Schemas / Music
rig.music.pattern
v0.31.0 · draft 7 fields 1 required
Fields
| Field | Type | Meaning | |
|---|---|---|---|
steps |
array<rig.music.step> | required | Ordered rig.music.step cells; length = pattern length |
rootNote |
integer0 – 127 | optional | Optional. MIDI pitch 0-127 (scale root); absent = 60 |
scale |
enumchromatic · major · minor · dorian · pentatonic | optional | Optional. chromatic, major, minor, dorian, pentatonic; absent = chromatic |
lane |
int | optional | Optional. Voice index when several patterns play together |
stepsPerBeat |
number> 0 | optional | Optional. Steps advanced per transport beat; absent = 4 (16th notes) |
loopStartStep |
int | optional | Optional. First step of the loop region; absent = 0 |
loopEndStep |
int | optional | Optional. Step after the last looped step; absent = steps.length (loop the whole pattern) |
Ordered steps. Format when present.
Compose rig.meta.named for the label. Tempo comes from transport - no bpm here.
A rig.music.sequencer has a pattern. A pattern has steps.
No parallel numSteps - use steps.length.
stepsPerBeat is musical time: the wall-clock rate comes from transport bpm. A tracker that used an absolute per-pattern speed converts through the transport - pick bpm and stepsPerBeat so the step rate matches the original (default stepsPerBeat 4 is sixteenth notes at the transport tempo).
steps is a single row. A drum grid is several pattern entities sharing one rig.music.sequencer, each with its own lane - not one pattern holding a matrix. Lanes advance together, so patterns in one stack should be the same length; a host running unequal lengths is polymetric, which the Contract does not describe.
Omit lane for a single-voice pattern. Two patterns in one stack sharing a lane number is a document error, not a layering instruction.
JSON Schema
Resolves at https://rig.works/schemas/rig.music.pattern.schema.json —
raw file.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://rig.works/schemas/rig.music.pattern.schema.json",
"title": "rig.music.pattern",
"type": "object",
"additionalProperties": false,
"properties": {
"steps": {
"type": "array",
"items": {
"$ref": "./rig.music.step.schema.json"
}
},
"rootNote": {
"type": "integer",
"minimum": 0,
"maximum": 127
},
"scale": {
"type": "string",
"enum": [
"chromatic",
"major",
"minor",
"dorian",
"pentatonic"
]
},
"lane": {
"$ref": "./_defs.schema.json#/$defs/int"
},
"stepsPerBeat": {
"type": "number",
"exclusiveMinimum": 0
},
"loopStartStep": {
"$ref": "./_defs.schema.json#/$defs/int"
},
"loopEndStep": {
"$ref": "./_defs.schema.json#/$defs/int"
}
},
"required": [
"steps"
]
}