{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pointcast.xyz/sunday/instrument.schema.json",
  "title": "Rainy Sunday instrument v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "version",
    "engine",
    "id",
    "slug",
    "title",
    "collection",
    "status",
    "canonical",
    "palette",
    "primaryGesture",
    "pointers",
    "synthesis",
    "mapping",
    "limits",
    "access",
    "resources",
    "determinism"
  ],
  "properties": {
    "schema": {
      "const": "tone-bloom.instrument.v1"
    },
    "version": {
      "const": "1.0.0"
    },
    "engine": {
      "const": "sunday-audio.v1"
    },
    "id": {
      "enum": [
        "RS-01",
        "RS-11",
        "RS-21",
        "RS-31"
      ]
    },
    "slug": {
      "enum": [
        "window",
        "seam",
        "cup",
        "clock"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "collection": {
      "const": "Rainy Sunday"
    },
    "status": {
      "const": "playable"
    },
    "canonical": {
      "type": "string",
      "format": "uri"
    },
    "palette": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^#[0-9a-f]{6}$"
      }
    },
    "primaryGesture": {
      "enum": [
        "tap",
        "sweep",
        "hold",
        "turn"
      ]
    },
    "pointers": {
      "const": 1
    },
    "synthesis": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "method",
        "rule"
      ],
      "properties": {
        "method": {
          "type": "string"
        },
        "rule": {
          "type": "string"
        }
      }
    },
    "mapping": {
      "type": "object"
    },
    "limits": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "maxSourceVoices",
        "masterGain",
        "perVoiceGain",
        "maxHoldMs",
        "cancelReleaseMs"
      ],
      "properties": {
        "maxSourceVoices": {
          "const": 12
        },
        "masterGain": {
          "const": 0.2
        },
        "perVoiceGain": {
          "const": 0.075
        },
        "maxHoldMs": {
          "const": 30000
        },
        "cancelReleaseMs": {
          "const": 40
        }
      }
    },
    "access": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "keyboard",
        "simplePointerEquivalent",
        "reducedMotion",
        "accountRequired",
        "microphone",
        "recording",
        "liveInference"
      ],
      "properties": {
        "keyboard": {
          "type": "string"
        },
        "simplePointerEquivalent": {
          "const": true
        },
        "reducedMotion": {
          "const": true
        },
        "accountRequired": {
          "const": false
        },
        "microphone": {
          "const": false
        },
        "recording": {
          "const": false
        },
        "liveInference": {
          "const": false
        }
      }
    },
    "resources": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "art",
        "score",
        "scoreSchema",
        "instrumentSchema"
      ],
      "properties": {
        "art": {
          "type": "string",
          "pattern": "^/sunday/"
        },
        "score": {
          "type": "string",
          "pattern": "^/sunday/"
        },
        "scoreSchema": {
          "type": "string",
          "pattern": "^/sunday/"
        },
        "instrumentSchema": {
          "type": "string",
          "pattern": "^/sunday/"
        }
      }
    },
    "determinism": {
      "type": "string"
    }
  }
}
