Schemas / Music

rig.music.note

v0.31.0 · draft 6 fields 3 required

Fields

FieldTypeMeaning
pitch integer0 – 127 required 0-127
velocity integer0 – 127 optional Optional. 0-127; absent = 100
channel integer0 – 15 optional Optional. 0-15; absent = 0
start float required Beats
duration float required Beats; 0 = instantaneous
clip entity optional Optional. Parent clip entity; none = unbound

Free-time piano-roll / clip note (beats). Format when present.

Grid cells are rig.music.step inside a pattern - not this schema.

Raw MIDI bytes stay in the host behind rig.music.midi_output.

Beats vs host ticks

start / duration are beats, not host clock ticks. That matches industry sync (Ableton Link speaks beat + phase) and keeps notes portable across hosts with different ticksPerQuarter.

Hosts that store notes in ticks convert at the document boundary using the scene rig.music.clock (ticksPerQuarter). A per-component codec that cannot see the clock cannot convert honestly - that is a host IO smell, not a reason to change this schema. Tick grids stay host-local; do not serialize tick positions as if they were beats.

JSON Schema

Resolves at https://rig.works/schemas/rig.music.note.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.music.note.schema.json",
  "title": "rig.music.note",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "pitch": {
      "type": "integer",
      "minimum": 0,
      "maximum": 127
    },
    "velocity": {
      "type": "integer",
      "minimum": 0,
      "maximum": 127
    },
    "channel": {
      "type": "integer",
      "minimum": 0,
      "maximum": 15
    },
    "start": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "duration": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "clip": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    }
  },
  "required": [
    "pitch",
    "start",
    "duration"
  ]
}