{
  "id": "http://schema.midi.org/property-exchange/M2-105-S_v1-0_ChannelList.json#",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Channel List",
  "description": "MIDI-CI Property Exchange ChannelList schema.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "title": {
        "title": "Title",
        "description": "The name of the Channel being described.",
        "type": "string",
        "minLength": 1
      },
      "channel": {
        "title": "MIDI Channel",
        "description": "This is the Channel being described by this entry in the list of Channels.",
        "type": "integer",
        "minimum": 1,
        "maximum": 16
      },
      "channelClusterId": {
        "title": "Channel Cluster Id",
        "type": "integer",
        "description": "If the Channel is a member of a Channel Cluster then this is the id of the Channel Cluster."
      },
      "clusterBasicChannel": {
        "title": "Channel Cluster Basic Channel",
        "description": "This declares if this is the Basic Channel for the Channel Cluster. If the Device is operating on multiple Channels which belong to the Channel Cluster, then MIDI messages sent to this channel set some parameters across multiple channels of the Channel Cluster which belong to the same.",
        "type": "boolean"
      },
      "deviceBasicChannel": {
        "title": "Device Basic Channel",
        "type": "boolean",
        "description": "This declares if this is the Basic Channel for the Device."
      },
      "programTitle": {
        "title": "Program Title",
        "description": "The name of the Program currently active on this Channel.",
        "type": "string"
      },
      "bankPC": {
        "title": "Bank MSB, LSB and Program Change",
        "description": "This is a 3 item array containing the Bank MSB, Bank LSB and Program Change [MSB, LSB, PC] for the current Program.",
        "type": "array",
        "minItems": 3,
        "maxItems": 3,
        "items": {
          "type": "integer",
          "minimum": 0,
          "maximum": 127
        }
      },
      "mpeZone": {
        "title": "MPE Zone",
        "description": "If the Device is using MPE, then this Property declares if the Channel is art of the Upper Zone or Lower Zone.",
        "type": "string",
        "enum": [
          "upper",
          "lower"
        ]
      },
      "links": {
        "type": "array",
        "description": "Resources that return an object or an array of objects may provide links to other related Resources.",
        "items": {
          "type": "object",
          "properties": {
            "resource": {
              "type": "string",
              "description": "The Resource to be linked.",
              "minLength": 3,
              "maxLength": 36
            },
            "resId": {
              "type": "string",
              "description": "Resource Id, the identifier used to select the desired Payload Data entry.",
              "maxLength": 36
            },
            "title": {
              "type": "string",
              "description": "This is the human-readable title for this link. Fall back to using the \"title\" Property in ResourceList if not supplied."
            },
            "role": {
              "type": "string",
              "description": "This is the role for this linked resource.",
              "minLength": 1,
              "maxLength": 32
            }
          },
          "required": [
            "resource"
          ]
        }
      }
    },
    "required": [
      "title",
      "channel"
    ],
    "additionalProperties": false,
    "patternProperties": {
      "^x-": {
        "description": "Any property starting with x- is valid."
      }
    }
  }
}
