667 lines
21 KiB
JSON
667 lines
21 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "https://example.com/schemas/composition-config.json",
|
|
"title": "Generate electronic music without AI",
|
|
"description": "JSON schema for configuring musicgen",
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"type": "object",
|
|
"description": "Metadata about the composition",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Composition title",
|
|
"default": ""
|
|
},
|
|
"artist": {
|
|
"type": "string",
|
|
"description": "Artist or composer name",
|
|
"default": ""
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Description of the composition",
|
|
"default": ""
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"description": "Tags or genres",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": []
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"composition": {
|
|
"type": "object",
|
|
"description": "Global composition settings",
|
|
"required": ["key", "scale", "tempo", "measures"],
|
|
"properties": {
|
|
"key": {
|
|
"description": "Musical key",
|
|
"oneOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 127,
|
|
"description": "MIDI note number (60 = C4)"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-G][#b♯♭]?[0-9]$",
|
|
"description": "Note name (e.g., 'C4', 'F#3', 'Bb5')"
|
|
}
|
|
]
|
|
},
|
|
"scale": {
|
|
"type": "string",
|
|
"description": "Scale type",
|
|
"enum": [
|
|
"major",
|
|
"minor",
|
|
"dorian",
|
|
"phrygian",
|
|
"lydian",
|
|
"mixolydian",
|
|
"aeolian",
|
|
"locrian",
|
|
"pentatonic",
|
|
"blues",
|
|
"chromatic"
|
|
]
|
|
},
|
|
"tempo": {
|
|
"type": "number",
|
|
"description": "Tempo in beats per minute (BPM)",
|
|
"minimum": 40,
|
|
"maximum": 300
|
|
},
|
|
"time_signature": {
|
|
"type": "object",
|
|
"properties": {
|
|
"numerator": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 16,
|
|
"description": "Number of beats per measure"
|
|
},
|
|
"denominator": {
|
|
"type": "integer",
|
|
"enum": [2, 4, 8, 16],
|
|
"description": "Note value that gets one beat"
|
|
}
|
|
},
|
|
"required": ["numerator", "denominator"],
|
|
"additionalProperties": false,
|
|
"default": {
|
|
"numerator": 4,
|
|
"denominator": 4
|
|
}
|
|
},
|
|
"measures": {
|
|
"type": "integer",
|
|
"description": "Number of measures in the composition",
|
|
"minimum": 1,
|
|
"maximum": 1000
|
|
},
|
|
"complexity": {
|
|
"type": "number",
|
|
"description": "Musical complexity level (0.0 = simple, 1.0 = complex)",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.6
|
|
},
|
|
"harmony_density": {
|
|
"type": "number",
|
|
"description": "Harmonic density (0.0 = sparse, 1.0 = dense)",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.7
|
|
},
|
|
"rhythmic_density": {
|
|
"type": "number",
|
|
"description": "Rhythmic density (0.0 = sparse, 1.0 = dense)",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.8
|
|
},
|
|
"seed": {
|
|
"type": "integer",
|
|
"description": "Random seed for reproducible generation",
|
|
"minimum": 0,
|
|
"maximum": 18446744073709551615
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"tracks": {
|
|
"type": "array",
|
|
"description": "Individual track definitions",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["name", "instrument", "pattern"],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Track name (e.g., 'bass', 'kick', 'hihat', 'pad')"
|
|
},
|
|
"instrument": {
|
|
"type": "string",
|
|
"description": "Instrument/waveform type",
|
|
"enum": ["sine", "square", "sawtooth", "triangle", "noise"]
|
|
},
|
|
"volume": {
|
|
"type": "number",
|
|
"description": "Track volume level (0.0 = silent, 1.0 = full)",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 1.0
|
|
},
|
|
"pattern": {
|
|
"type": "object",
|
|
"description": "Pattern definition for this track",
|
|
"required": ["type"],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"description": "Pattern type",
|
|
"enum": ["custom", "chord", "arpeggio", "sequence"]
|
|
},
|
|
"loop_length": {
|
|
"type": "number",
|
|
"description": "Pattern loop length in beats",
|
|
"minimum": 0.1,
|
|
"maximum": 64.0,
|
|
"default": 4.0
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "custom"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"steps": {
|
|
"type": "array",
|
|
"description": "Individual pattern steps",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["time", "note", "duration", "velocity"],
|
|
"properties": {
|
|
"time": {
|
|
"type": "number",
|
|
"description": "Time in beats when note starts",
|
|
"minimum": 0.0
|
|
},
|
|
"note": {
|
|
"description": "Note to play",
|
|
"oneOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 127,
|
|
"description": "MIDI note number"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-G][#b♯♭]?[0-9]$",
|
|
"description": "Note name (e.g., 'C4', 'F#3')"
|
|
}
|
|
]
|
|
},
|
|
"duration": {
|
|
"type": "number",
|
|
"description": "Note duration in beats",
|
|
"minimum": 0.01,
|
|
"maximum": 16.0
|
|
},
|
|
"velocity": {
|
|
"type": "number",
|
|
"description": "Note velocity/volume (0.0 to 1.0)",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"required": ["steps"]
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "chord"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"chord_progression": {
|
|
"type": "array",
|
|
"description": "Chord progression steps",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["time", "chord", "duration"],
|
|
"properties": {
|
|
"time": {
|
|
"type": "number",
|
|
"description": "Time in beats when chord starts",
|
|
"minimum": 0.0
|
|
},
|
|
"chord": {
|
|
"type": "string",
|
|
"description": "Chord name (e.g., 'Cm7', 'F', 'G#maj7')"
|
|
},
|
|
"duration": {
|
|
"type": "number",
|
|
"description": "Chord duration in beats",
|
|
"minimum": 0.1,
|
|
"maximum": 16.0
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"voicing": {
|
|
"type": "string",
|
|
"description": "Chord voicing style",
|
|
"enum": ["close", "spread", "drop2", "drop3"],
|
|
"default": "close"
|
|
},
|
|
"octave": {
|
|
"type": "integer",
|
|
"description": "Base octave for chord",
|
|
"minimum": 0,
|
|
"maximum": 8,
|
|
"default": 4
|
|
}
|
|
},
|
|
"required": ["chord_progression"]
|
|
}
|
|
}
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"effects": {
|
|
"type": "array",
|
|
"description": "Audio effects to apply to this track",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["type"],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"description": "Effect type",
|
|
"enum": [
|
|
"lowpass",
|
|
"highpass",
|
|
"bandpass",
|
|
"delay",
|
|
"reverb",
|
|
"chorus",
|
|
"distortion",
|
|
"compressor"
|
|
]
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "lowpass"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"cutoff": {
|
|
"type": "number",
|
|
"description": "Cutoff frequency in Hz",
|
|
"minimum": 20,
|
|
"maximum": 20000,
|
|
"default": 1000
|
|
},
|
|
"resonance": {
|
|
"type": "number",
|
|
"description": "Resonance factor",
|
|
"minimum": 0.1,
|
|
"maximum": 10.0,
|
|
"default": 1.0
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "highpass"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"cutoff": {
|
|
"type": "number",
|
|
"description": "Cutoff frequency in Hz",
|
|
"minimum": 20,
|
|
"maximum": 20000,
|
|
"default": 100
|
|
},
|
|
"resonance": {
|
|
"type": "number",
|
|
"description": "Resonance factor",
|
|
"minimum": 0.1,
|
|
"maximum": 10.0,
|
|
"default": 1.0
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "delay"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"time": {
|
|
"type": "number",
|
|
"description": "Delay time in seconds",
|
|
"minimum": 0.001,
|
|
"maximum": 2.0,
|
|
"default": 0.25
|
|
},
|
|
"feedback": {
|
|
"type": "number",
|
|
"description": "Feedback amount",
|
|
"minimum": 0.0,
|
|
"maximum": 0.95,
|
|
"default": 0.3
|
|
},
|
|
"mix": {
|
|
"type": "number",
|
|
"description": "Wet/dry mix",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.3
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "reverb"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"room_size": {
|
|
"type": "number",
|
|
"description": "Room size",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.5
|
|
},
|
|
"damping": {
|
|
"type": "number",
|
|
"description": "High frequency damping",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.5
|
|
},
|
|
"mix": {
|
|
"type": "number",
|
|
"description": "Wet/dry mix",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.3
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "chorus"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"rate": {
|
|
"type": "number",
|
|
"description": "LFO rate in Hz",
|
|
"minimum": 0.1,
|
|
"maximum": 10.0,
|
|
"default": 1.0
|
|
},
|
|
"depth": {
|
|
"type": "number",
|
|
"description": "Modulation depth",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.5
|
|
},
|
|
"layers": {
|
|
"type": "integer",
|
|
"description": "Number of chorus layers",
|
|
"minimum": 1,
|
|
"maximum": 4,
|
|
"default": 2
|
|
},
|
|
"mix": {
|
|
"type": "number",
|
|
"description": "Wet/dry mix",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.5
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "distortion"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"drive": {
|
|
"type": "number",
|
|
"description": "Distortion amount",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.5
|
|
},
|
|
"tone": {
|
|
"type": "number",
|
|
"description": "Tone control (0.0 = dark, 1.0 = bright)",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"default": 0.5
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"sections": {
|
|
"type": "array",
|
|
"description": "Section definitions for structured compositions",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["name", "measures"],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Section name (e.g., 'intro', 'verse', 'chorus', 'bridge', 'outro')"
|
|
},
|
|
"measures": {
|
|
"type": "integer",
|
|
"description": "Number of measures in this section",
|
|
"minimum": 1,
|
|
"maximum": 1000
|
|
},
|
|
"tempo": {
|
|
"type": "number",
|
|
"description": "Tempo override for this section",
|
|
"minimum": 40,
|
|
"maximum": 300
|
|
},
|
|
"key": {
|
|
"description": "Key change for this section",
|
|
"oneOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 127
|
|
},
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-G][#b♯♭]?[0-9]$"
|
|
}
|
|
]
|
|
},
|
|
"scale": {
|
|
"type": "string",
|
|
"description": "Scale override for this section",
|
|
"enum": [
|
|
"major",
|
|
"minor",
|
|
"dorian",
|
|
"phrygian",
|
|
"lydian",
|
|
"mixolydian",
|
|
"aeolian",
|
|
"locrian",
|
|
"pentatonic",
|
|
"blues",
|
|
"chromatic"
|
|
]
|
|
},
|
|
"complexity": {
|
|
"type": "number",
|
|
"description": "Complexity override for this section",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0
|
|
},
|
|
"repeat": {
|
|
"type": "integer",
|
|
"description": "Number of times to repeat this section",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"default": 1
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"export": {
|
|
"type": "object",
|
|
"description": "Export settings",
|
|
"properties": {
|
|
"filename": {
|
|
"type": "string",
|
|
"description": "Output filename (without extension)",
|
|
"default": "output"
|
|
},
|
|
"format": {
|
|
"type": "string",
|
|
"description": "Export format",
|
|
"enum": ["wav", "mp3", "flac"],
|
|
"default": "wav"
|
|
},
|
|
"sample_rate": {
|
|
"type": "integer",
|
|
"description": "Sample rate in Hz",
|
|
"enum": [22050, 44100, 48000, 88200, 96000],
|
|
"default": 44100
|
|
},
|
|
"bit_depth": {
|
|
"type": "integer",
|
|
"description": "Bit depth",
|
|
"enum": [16, 24, 32],
|
|
"default": 16
|
|
},
|
|
"stereo": {
|
|
"type": "boolean",
|
|
"description": "Export in stereo (true) or mono (false)",
|
|
"default": false
|
|
},
|
|
"max_duration": {
|
|
"type": "number",
|
|
"description": "Maximum duration in seconds (null for full composition)",
|
|
"minimum": 1.0,
|
|
"maximum": 3600.0
|
|
},
|
|
"variations": {
|
|
"type": "object",
|
|
"description": "Variation generation settings",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer",
|
|
"description": "Number of variations to generate",
|
|
"minimum": 1,
|
|
"maximum": 100
|
|
},
|
|
"vary_complexity": {
|
|
"type": "boolean",
|
|
"description": "Vary complexity between variations",
|
|
"default": false
|
|
},
|
|
"vary_rhythm": {
|
|
"type": "boolean",
|
|
"description": "Vary rhythm between variations",
|
|
"default": false
|
|
},
|
|
"vary_harmony": {
|
|
"type": "boolean",
|
|
"description": "Vary harmony between variations",
|
|
"default": false
|
|
},
|
|
"vary_tempo": {
|
|
"type": "boolean",
|
|
"description": "Vary tempo between variations",
|
|
"default": false
|
|
}
|
|
},
|
|
"required": ["count"],
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"required": ["composition"],
|
|
"additionalProperties": false
|
|
}
|