|
|
6 years ago | |
|---|---|---|
| examples | 6 years ago | |
| res | 6 years ago | |
| src | 6 years ago | |
| .gitignore | 6 years ago | |
| LICENSE-dist.txt | 6 years ago | |
| LICENSE.txt | 6 years ago | |
| Makefile | 6 years ago | |
| README.md | 6 years ago | |
| plugin.json | 6 years ago | |
Scripting language host for VCV Rack containing:
This is a reference API for the DuktapeEngine (JavaScript).
Other script engines may vary in their syntax (e.g. block.inputs[i][j] vs block.getInput(i, j) vs input(i, j)).
// Display message on LED display.
display(message)
// Skip this many sample frames before running process().
// For sequencers, 32 is reasonable since process() will be called every 0.7ms with a 44100kHz sample rate.
// For audio generators and processors, 1 is recommended. If this is too slow for your purposes, write a C++ plugin.
config.frameDivider = 1
// Number of samples to store each block passed to process().
// Latency introduced by buffers is `bufferSize * frameDivider * sampleTime`.
config.bufferSize = 1
// Called when the next block is ready to be processed.
function process(block) {
// Engine sample rate in Hz. Read-only.
block.sampleRate
// Equal to `1 / sampleRate`. Read-only.
block.sampleTime
// The actual buffer size, requested by `config.bufferSize`. Read-only.
block.bufferSize
// Voltage of the input port of row `i` and buffer index `j`. Read-only.
block.inputs[i][j]
// Voltage of the output port of row `i` and buffer index `j`. Writable.
block.outputs[i][j]
// Value of the knob of row `i`. Between 0 and 1. Read-only.
block.knobs[i]
// Pressed state of the switch of row `i`. Read-only.
block.switches[i]
// Brightness of the RGB LED of row `i` and color index `c`. Writable.
// `c=0` for red, `c=1` for green, `c=2` for blue.
block.lights[i][c]
// Brightness of the switch RGB LED of row `i` and color index `c`. Writable.
block.switchLights[i][c]
}
make dep, following the Duktape example in the Makefile.MyEngine.cpp file in src/ with a ScriptEngine subclass defining the virtual methods, following src/DuktapeEngine.cpp as an example.src/ScriptEngine.cpp.examples/. These will be included in the plugin package for the user.DuktapeEngine (JavaScript)