Skip to content

pdmeyer/GenExpr_VSCode

Repository files navigation

GenExpr for VS Code

A Visual Studio Code extension providing syntax highlighting, snippets, and language support for genexpr - C74's DSP expression language used in Max/MSP.

Features

🎵 Syntax Highlighting

  • 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

📝 Code Snippets

  • Buffer operations: buffer, peek, poke
  • Oscillators: cycle, cyclePhase
  • Data structures: data, delay, history
  • Control flow: for, function, return
  • Parameters: param
  • Utility functions: wrap

🔧 Language Support

  • File extensions: .gendsp, .genexpr
  • Auto-completion and IntelliSense
  • Bracket matching and auto-closing pairs
  • Code folding support
  • Comment support (single-line // and block /* */)

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "genexpr"
  4. Click Install

Usage

Creating a genexpr file

  1. Create a new file with .gendsp or .genexpr extension
  2. Start typing genexpr code - syntax highlighting will activate automatically
  3. Use snippets by typing the prefix and pressing Tab

Available Snippets

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

Example Code

// 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;

Requirements

  • Visual Studio Code 1.11.0 or higher
  • No additional dependencies required

Extension Settings

This extension does not currently provide any configurable settings.

Known Issues

  • None currently reported

Release Notes

0.0.1

Initial release featuring:

  • Basic syntax highlighting for genexpr
  • Core DSP snippets (buffer, cycle, data, etc.)
  • Language configuration for proper editing support

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

This extension is open source. Please check the repository for license details.

Related

About

IDE Support for GenExpr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published