Schemas / Music

rig.music.note

v1.0.0 · stable maturity: draft 7 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
intervals array<integer> optional Optional. Semitone offsets from pitch. Absent = pitch alone. Omit 0. A major triad is [4, 7]; a minor triad is [3, 7]

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

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

The note sounds pitch and each pitch + interval. Same chord shape as rig.music.step.

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.json — raw 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"
    },
    "intervals": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": -127,
        "maximum": 127
      },
      "uniqueItems": true
    }
  },
  "required": [
    "pitch",
    "start",
    "duration"
  ],
  "x-rig-maturity": "draft"
}

Seen in

music-chord.json