Neuroscript Simulator
Try out Neuroscript in this interactive simulator. Write code, test with sample MIDI events, and see the results instantly—all right here in your browser.
Input EventIdle
Script
Output
Click Run to execute
VM State
Run a script to see VM state
Web MIDIUnavailable
Quick Reference
Filter
keep notedrop clock, realtimekeep cc where cc == 1Transform
event(vel=clamp(vel, 35, 110))transpose(12)12 -> velCondition
when type == note : sendwhen vel > 100 : dropEmit
emit.cc(74, value)emit.noteOn(60, 100)Features
- Real WASM engine — Scripts compile and run using the same Neuroscript Rust engine as the desktop app
- Syntax highlighting — Keywords, builtins, note literals, and comments are highlighted in real-time
- Web MIDI bridge — Connect hardware controllers to audition scripts with live MIDI input
- Instant feedback — See compile errors immediately as you type
Building locally?
Run npm run prebuild (or make docs-wasm) inside docs/web to copy the WASM bundle into public/neuroscript-wasm/.
How to Use
- Write or load a script — Use the editor or select an example from the dropdown
- Configure a test event — Set the event type, channel, note/CC number, and velocity
- Click Run — Execute the script and see the transformed output
- Inspect results — View output events or see if the event was dropped/filtered
Example Scripts
Filter System Messages
neuroscript
# Remove timing noise from MIDI stream
drop clock, start, stop, continue, realtimeNormalize Velocity
neuroscript
# Keep only notes and clamp velocity to a usable range
keep note
event(vel=clamp(vel, 35, 110))Keyboard Split
neuroscript
# Route low notes to channel 2, high notes to channel 3
drop clock, start, stop, continue, realtime
when type == note and note in C-1..B3 : {
2 -> ch
send
}
when type == note and note in C4..G9 : {
3 -> ch
send
}CC Mapping
neuroscript
# Map modwheel (CC1) to filter cutoff (CC74)
when type == cc and cc == 1 : {
emit.cc(74, value)
send through
}Transpose with Velocity Shaping
neuroscript
# Transpose up an octave and shape dynamics
when type == note : {
event(note=clamp(note + 12, 0, 127))
event(vel=clamp(scale(vel, 1, 127, 40, 110), 35, 120))
}Language Quick Reference
Filtering
| Statement | Description |
|---|---|
keep note | Pass only note events |
drop clock, realtime | Remove clock and realtime events |
keep cc where cc == 1 | Keep only modwheel CC |
drop all where ch == 10 | Drop all events on channel 10 |
Transforms
| Statement | Description |
|---|---|
event(vel=100) | Set velocity to 100 |
event(note=note + 12) | Transpose up an octave |
12 -> vel | Alternative assignment syntax |
1 -> ch | Route to channel 1 |
Conditionals
| Statement | Description |
|---|---|
when type == note : send | Pass notes through |
when vel > 100 : drop | Drop loud notes |
when note in C2..B4 : { ... } | Execute block for notes in range |
Emit & Send
| Statement | Description |
|---|---|
send | Output current event (consumes it) |
send through | Output current event (continue processing) |
emit.cc(74, value) | Emit a new CC event |
emit.noteOn(note, vel) | Emit a new note on |
Built-in Functions
| Function | Description |
|---|---|
clamp(x, min, max) | Constrain value to range |
scale(x, inMin, inMax, outMin, outMax) | Linear interpolation |
wrap(x, min, max) | Wrap value into range |
min(a, b) | Minimum of two values |
max(a, b) | Maximum of two values |
abs(x) | Absolute value |
Desktop Testing
For more advanced testing, use the desktop app:
- Create a route with Virtual Keyboard as the source
- Add a Script transform to your route
- Open MIDI Monitor to see output
- Play notes on the Virtual Keyboard
- Iterate on your script
Next Steps
- Script Engine Overview — Learn scripting fundamentals
- Event Model — Understanding MIDI events in Neuroscript
