Skip to content

Instantly share code, notes, and snippets.

@nfreear
Last active November 17, 2019 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfreear/29c2553babe71aa294f013e240f82e18 to your computer and use it in GitHub Desktop.
Save nfreear/29c2553babe71aa294f013e240f82e18 to your computer and use it in GitHub Desktop.
A JSON/ YAML schema for Scribbletune data.
{
"$schema": "http://json-schema.org/schema#",
"$id": "http://yourdomain.com/schemas/scribbletune-json.json",
"title": "Scribbletune-YAML",
"description": "Expose a subset of Scribbletune functionality via declarative YAML."
"#": [
"https://gist.github.com/nfreear/3af427127b75e63f4be842011b3ed7f8",
"https://scribbletune.com/documentation/core/clip",
"https://github.com/scribbletune/scribbletune/blob/master/src/typings.d.ts"
],
"type": "object",
"additionalProperties": false,
"properties": {
"clips": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/ClipParams"
}
},
"metadata": {
"type": "object",
"additionalProperties": true,
"properties": {
"title": { "type": "string" },
"author": { "type": "string" }
}
}
},
"definitions": {
"ClipParams": {
"description": "A clip is a container for a musical idea. ... It can be a single bar or two bars or how many ever bars you need.",
"type": "object",
"additionalProperties": true,
"required": [ "pattern" ],
"properties": {
"pattern": {
"type": "string",
"regex": "^[x\\[\\]_-R]+$",
"default": "x",
"examples": [ "x__-x__-x__-x__-" ]
},
"notes": {
"type": "string",
"regex": "^[a-gA-G0-8mM #-]+$",
"default": "C4",
"examples": [ "C4 D4 C4 D#4 C4 D4 C4 Bb3" ]
},
"sizzle": {
"type": [ "boolean", "string" ],
"enum": [ "sin", "cos", "rampUp", "rampDown" ],
"default": false
},
"accent": {
"type": "string"
},
"dur": {
"description": "Duration? What format ...?",
"type": "string"
},
"volume": {
"description": "What range ...?",
"type": "number"
},
"synth": {
"description": "One of the list at :~ https://github.com/Tonejs/Tone.js/tree/dev/Tone/instrument",
"type": "string",
"regex": "^[a-zA-Z]+$",
"examples": [ "Synth", "PolySynth" ]
},
"sample": {
"description": "For example, a sound file listed at :~ https://github.com/scribbletune/scribbletune.com/tree/master/sounds",
"type": "string",
"format": "uri",
"regex": "^https:\/.+\.(wav|mp3|mid)$",
"examples": [ "https://scribbletune.com/sounds/kick.wav" ]
},
"sequence": { "$ref": "#/definitions/ToneSequence" }
}
},
"ToneSequence": {
"description": "A Tone.js Sequence.",
"type": "object",
"properties": {
"start": { "type": "string", "default": null },
"stop": { "type": "string", "default": null }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment