Link Search Menu Expand Document

JSFX and EEL2

JSFX effects are text programs for processing or generating audio and MIDI, optionally with a custom graphical interface. Their code is written in EEL2, not JavaScript. score hosts them through YSFX, which compiles and runs the scripts.

Use the official JSFX programming reference for the file format and API, and the EEL2 reference for the underlying language. The links below lead to those existing references rather than duplicating their function tables here.

Language and API references

Topic Reference
Variables, expressions, operators, branching, loops and mathematics EEL2 language reference and JSFX basic code reference
File headers, sliders, audio pins, imports and code sections JSFX file structure
User-defined functions, local variables and namespaces Functions and namespace pseudo-objects
Audio samples, sample rate, block size, sliders and transport variables Special variables
Receiving and sending MIDI, including event offsets MIDI functions
Data files and saving/restoring script state File I/O and serialization
Memory operations, FFT and MDCT Advanced functions
Strings and string operations String reference
Drawing, images, mouse and keyboard interaction Graphics reference
Slider notifications and other host calls Host interaction functions

For orientation, the code sections separate initialization (@init), parameter updates (@slider), block processing (@block), sample processing (@sample), persistent state (@serialize) and drawing (@gfx). Consult their individual descriptions before deciding where code belongs; drawing and audio processing are not the same callback.

EEL2’s C-like appearance can be misleading: variable names are case-insensitive, parentheses group statements, and conditional expressions use ? and ?:. Its memory indexing and operator precedence also differ from JavaScript and C. Use the basic code and operator reference, not the JavaScript reference, when adapting a script.

Using JSFX in score

  • Loading, routing and opening the UI: follow Audio plug-in support.
  • Installing scripts and their dependencies: see Adding JSFX plug-ins. This covers the .jsfx extension, user-library discovery, the Effects / Data folder layout and existing effect collections.
  • Editing and saving: the same JSFX hosting section explains score’s script editor, saved script text and controls, presets, and keeping companion data/import files with the package. Saving the script in a document does not remove its external dependencies.
  • Playback position and tempo: see Transport and reverse playback. score supplies JSFX with time, tempo and signature information; reversing the timeline does not reverse an effect’s internal DSP history.

Host compatibility

The Cockos manual describes JSFX in REAPER. It is the language/API reference, not a guarantee that every REAPER-specific feature or recently added extension is available in score. Likewise, EEL2 is used in several applications: sharing the language does not make ReaScript or other host-specific APIs available to a JSFX effect.

Compatibility depends on the YSFX version included in the score build and on score’s host integration. Use the YSFX project and usage notes for the runtime, the score hosting documentation for integration behavior, and the score YSFX integration source when checking a particular host feature. YSFX’s standalone plug-in instructions are not score’s installation instructions.

Before relying on an imported effect, check its audio/MIDI routing, controls, custom graphics, required files and save/reload behavior in the target score build. A script compiling successfully does not establish that all of its host-dependent behavior works.