Data to MIDI
Play a JSON list of notes in beats as MIDI on each trigger, scheduled on the transport.
- Bridge
- Since 0.2.0
- midi
- notes
- melody
- json
- sequence
- bridge
- data
Data to MIDI plays a list of notes written as JSON through any MIDI input, such as the Polyphonic instrument.
What it does#
notes takes a JSON list such as [{ "note": 60, "velocity": 0.8, "start": 0, "duration": 0.5 }]: MIDI note numbers, velocity 0–1 (0.8 when missing), and start and duration in beats. Up to 1 024 notes per list. With trigger cabled, each trigger plays the whole list from the next grid point; without it, every new list plays as it arrives. Playing again cancels notes still scheduled from the previous list.
The notes become note-on and note-off messages on the node's midi output, stamped with audio frames from the transport's tempo, and enter the engine's MIDI input through the bridge. In the browser the scheduling runs on the main thread, so timing is as tight as its timers allow, not sample-exact. Hosts without the data domain (the Player, exports) play nothing from this node.
When to use it#
Use it to play generated melodies, from an LLM chat answer, a Dataset or a Value, every bar of a Cron in Beat mode.
Ports#
| Port | Direction | Signal | Lanes |
|---|---|---|---|
notes | Input | Data (json) | 1 |
trigger | Input | Data (trigger) | 1 |
midi | Output | MIDI | 16 MIDI channels |
Parameters#
| Parameter | Label | Range | Default | Unit | Scale | Notes |
|---|---|---|---|---|---|---|
channel | Channel | 1 to 16 | 1 | linear | MIDI channel of the generated notes. | |
transpose | Transpose | -48 to 48 | 0 | st | linear | Semitones added to every note. |
quantize | Quantize | 0 to 3 | 0 | linear | Snap note starts to this grid before scheduling. Choices: 0 Off, 1 Quarter, 2 Eighth, 3 Sixteenth. |
Channel (channel)#
The MIDI channel, 1 to 16, of the generated notes.
Transpose (transpose)#
Semitones added to every note, -48 to 48. Notes pushed outside 0–127 are skipped.
Quantize (quantize)#
Off starts the list at the current beat. Quarter, Eighth or Sixteenth waits for the next grid point and snaps each note's start to that grid.
Tips#
- An invalid list (a missing
start, a negative duration) is reported in the inspector and nothing plays. - Keep durations shorter than the gap to the next note for clean retriggers.
See also#
Polyphonic instrument, LLM chat, Cron, MIDI cables, Data cables.
Help patches
Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.
1. Play a JSON melody
beginner Teaches: channel, transpose, quantize
A JSON list of notes in beats plays through an eight-voice synth each bar.
Connections as text
- Polyphonic instrument audio output connected to Patch outputs audio input
- Cron tick output connected to Data to MIDI trigger input
- Value value output connected to Convert value input
- Convert value output connected to Data to MIDI notes input
- Data to MIDI midi output connected to Polyphonic instrument midi input
- Each bar tick plays the whole list from the next quarter note (Quantize Quarter).
- Transpose shifts every note in semitones; Channel sets the MIDI channel.
Related nodes
- LLM chat Ask Anthropic, OpenAI or Gemini with your own vault key through the completion endpoint; text or JSON out.
- Polyphonic instrument Eight owned, velocity-sensitive oscillator voices with ADSR, sustain and MPE, played from a MIDI cable in the Toy's tuning.
- Cron Fire a trigger on an interval, a cron expression or musical beats, with the time as JSON.