A Visual Studio Code extension providing syntax highlighting, snippets, and language support for genexpr - C74's DSP expression language used in Max/MSP.
- Full syntax highlighting for genexpr code
- Support for DSP-specific keywords and operators
- C-style syntax with genexpr-specific extensions
- Proper highlighting for constants, classes, and built-in functions
- Buffer operations:
buffer,peek,poke - Oscillators:
cycle,cyclePhase - Data structures:
data,delay,history - Control flow:
for,function,return - Parameters:
param - Utility functions:
wrap
- File extensions:
.gendsp,.genexpr - Auto-completion and IntelliSense
- Bracket matching and auto-closing pairs
- Code folding support
- Comment support (single-line
//and block/* */)
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "genexpr"
- Click Install
- Create a new file with
.gendspor.genexprextension - Start typing genexpr code - syntax highlighting will activate automatically
- Use snippets by typing the prefix and pressing Tab
| Snippet | Description |
|---|---|
buffer |
Create a Buffer object with dimension and channel info |
cycle |
Cycle operator with frequency input |
cyclePhase |
Cycle operator with phase input |
data |
Data object declaration |
delay |
Delay line object |
history |
History object for tracking previous values |
peek |
Read from buffer or data object |
poke |
Write to buffer or data object |
wrap |
Wrap a value between min/max bounds |
for |
For loop structure |
function |
Function definition |
param |
Parameter declaration |
return |
Return statement |
// Simple oscillator with buffer
Buffer myBuffer("myBuffer");
myBuffer_dim = dim(myBuffer);
myBuffer_chans = channels(myBuffer);
// Generate a sine wave
sample, sampleIndex = cycle(440.0, name="myBuffer");
// Wrap the output
wrappedOutput = wrap(sample, -1.0, 1.0);
// Output the result
out = wrappedOutput;
- Visual Studio Code 1.11.0 or higher
- No additional dependencies required
This extension does not currently provide any configurable settings.
- None currently reported
Initial release featuring:
- Basic syntax highlighting for genexpr
- Core DSP snippets (buffer, cycle, data, etc.)
- Language configuration for proper editing support
Contributions are welcome! Please feel free to submit issues and pull requests.
This extension is open source. Please check the repository for license details.
- Max/MSP - The main Max/MSP environment
- genexpr Documentation - Official genexpr reference