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

Open in TuneToys

Data to MIDI as the Patch draws it, at default values: inlets on the left, outlets on the right.

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#

PortDirectionSignalLanes
notesInputData (json)1
triggerInputData (trigger)1
midiOutputMIDI16 MIDI channels

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
channelChannel1 to 161linearMIDI channel of the generated notes.
transposeTranspose-48 to 480stlinearSemitones added to every note.
quantizeQuantize0 to 30linearSnap 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.

Patch: 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.
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.
Frame preview: Play a JSON melodyFrame “Play a JSON melody” with 2 elements: text heading, text hint.PLAY A JSON MELODYPress Play: the four-note figure starts on every bar. Notes are in beats, so te…
Frame preview (static). Controls show their default values.

Open in TuneToys

  • 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.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close