Skip to content

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.

Idle
Click Run to execute
VM State
Run a script to see VM state
Web MIDIUnavailable
Quick Reference
Filterkeep notedrop clock, realtimekeep cc where cc == 1
Transformevent(vel=clamp(vel, 35, 110))transpose(12)12 -> vel
Conditionwhen type == note : sendwhen vel > 100 : drop
Emitemit.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

  1. Write or load a script — Use the editor or select an example from the dropdown
  2. Configure a test event — Set the event type, channel, note/CC number, and velocity
  3. Click Run — Execute the script and see the transformed output
  4. 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, realtime

Normalize 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

StatementDescription
keep notePass only note events
drop clock, realtimeRemove clock and realtime events
keep cc where cc == 1Keep only modwheel CC
drop all where ch == 10Drop all events on channel 10

Transforms

StatementDescription
event(vel=100)Set velocity to 100
event(note=note + 12)Transpose up an octave
12 -> velAlternative assignment syntax
1 -> chRoute to channel 1

Conditionals

StatementDescription
when type == note : sendPass notes through
when vel > 100 : dropDrop loud notes
when note in C2..B4 : { ... }Execute block for notes in range

Emit & Send

StatementDescription
sendOutput current event (consumes it)
send throughOutput 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

FunctionDescription
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:

  1. Create a route with Virtual Keyboard as the source
  2. Add a Script transform to your route
  3. Open MIDI Monitor to see output
  4. Play notes on the Virtual Keyboard
  5. Iterate on your script

Next Steps

Built with ❤️ for musicians