{
  "id": "MagicQ",
  "meta": {
    "name": "MagicQ",
    "version": "1.2",
    "author": "Nils Klaus",
    "port_default": 8000,
    "description": "OSC Library for Chamsys MagicQ Systems, updated with param-based dynamic nesting.",
    "readonly": true
  },
  "tree": {
    "label": "Root",
    "children": [
      {
        "label": "Playbacks",
        "children": [
          {
            "label": "Playback {p}",
            "param": {
              "name": "p",
              "type": "integer",
              "default": 1,
              "min": 1
            },
            "children": [
              {
                "label": "Level",
                "command": {
                  "path": "/pb/{p}",
                  "args": [
                    {
                      "type": "float",
                      "range": [0.0, 1.0],
                      "default": 1.0
                    }
                  ],
                  "description": "Set playback fader level"
                }
              },
              {
                "label": "Go",
                "command": {
                  "path": "/pb/{p}/go",
                  "args": [
                    {
                      "type": "float",
                      "range": [0.0, 1.0],
                      "default": 1.0
                    }
                  ],
                  "description": "Go on playback"
                }
              },
              {
                "label": "Flash",
                "command": {
                  "path": "/pb/{p}/flash",
                  "args": [
                    {
                      "type": "float",
                      "range": [0.0, 1.0],
                      "default": 1.0
                    }
                  ],
                  "description": "Set playback level to 100% (0 sets to 0%, non-zero sets to 100%)"
                }
              },
              {
                "label": "Pause",
                "command": {
                  "path": "/pb/{p}/pause",
                  "args": [
                    {
                      "type": "float",
                      "range": [0.0, 1.0],
                      "default": 1.0
                    }
                  ],
                  "description": "Pause playback"
                }
              },
              {
                "label": "Release",
                "command": {
                  "path": "/pb/{p}/release",
                  "args": [
                    {
                      "type": "float",
                      "range": [0.0, 1.0],
                      "default": 1.0
                    }
                  ],
                  "description": "Release playback"
                }
              },
              {
                "label": "Cue {c}",
                "param": {
                  "name": "c",
                  "type": "integer",
                  "default": 1,
                  "min": 1
                },
                "children": [
                  {
                    "label": "Jump to Cue",
                    "command": {
                      "path": "/pb/{p}/{c}",
                      "args": [
                        {
                          "type": "float",
                          "range": [0.0, 1.0],
                          "default": 1.0
                        }
                      ],
                      "description": "Jump to specific cue"
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "label": "Execute Window",
        "children": [
          {
            "label": "Item {i}",
            "param": {
              "name": "i",
              "type": "integer",
              "default": 1,
              "min": 1
            },
            "children": [
              {
                "label": "Trigger Item",
                "command": {
                  "path": "/exec/{i}",
                  "args": [
                    {
                      "type": "float",
                      "range": [0.0, 1.0],
                      "default": 1.0
                    }
                  ],
                  "description": "Control button, fader or encoder directly by item number"
                }
              }
            ]
          },
          {
            "label": "Page {pg}",
            "param": {
              "name": "pg",
              "type": "integer",
              "default": 1,
              "min": 1
            },
            "children": [
              {
                "label": "Item {i}",
                "param": {
                  "name": "i",
                  "type": "integer",
                  "default": 1,
                  "min": 1
                },
                "children": [
                  {
                    "label": "Trigger Page Item",
                    "command": {
                      "path": "/exec/{pg}/{i}",
                      "args": [
                        {
                          "type": "float",
                          "range": [0.0, 1.0],
                          "default": 1.0
                        }
                      ],
                      "description": "Control button, fader or encoder in execute window by page"
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "label": "10Scene",
        "children": [
          {
            "label": "Item {i}",
            "param": {
              "name": "i",
              "type": "integer",
              "default": 1,
              "min": 1
            },
            "children": [
              {
                "label": "Trigger",
                "command": {
                  "path": "/10Scene/{i}",
                  "args": [
                    {
                      "type": "integer",
                      "range": [0, 1],
                      "default": 1
                    }
                  ],
                  "description": "Control 10Scene buttons"
                }
              },
              {
                "label": "Toggle",
                "command": {
                  "path": "/10Scene/{i}/toggle",
                  "args": [],
                  "description": "Toggle 10Scene button"
                }
              },
              {
                "label": "Zone {z}",
                "param": {
                  "name": "z",
                  "type": "integer",
                  "default": 1,
                  "min": 1
                },
                "children": [
                  {
                    "label": "Trigger",
                    "command": {
                      "path": "/10Scene/{i}/{z}",
                      "args": [
                        {
                          "type": "integer",
                          "range": [0, 1],
                          "default": 1
                        }
                      ],
                      "description": "Control 10Scene buttons within a zone"
                    }
                  },
                  {
                    "label": "Toggle",
                    "command": {
                      "path": "/10Scene/{i}/{z}/toggle",
                      "args": [],
                      "description": "Toggle 10Scene button within a zone"
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "label": "Global Controls",
        "children": [
          {
            "label": "Blackout (DBO)",
            "command": {
              "path": "/dbo",
              "args": [
                {
                  "type": "integer",
                  "range": [0, 1],
                  "default": 1
                }
              ],
              "description": "Blackout (0 turns on, non-zero turns off)"
            }
          },
          {
            "label": "Swap Mode",
            "command": {
              "path": "/swap",
              "args": [
                {
                  "type": "integer",
                  "range": [0, 1],
                  "default": 1
                }
              ],
              "description": "Set swap mode (0 = add, non-zero = swap)"
            }
          }
        ]
      },
      {
        "label": "System & Remote",
        "children": [
          {
            "label": "RPC Command String",
            "command": {
              "path": "/rpc",
              "args": [
                {
                  "type": "string",
                  "default": ""
                }
              ],
              "description": "Send remote Ethernet command via argument"
            }
          },
          {
            "label": "RPC Command Path {cmd}",
            "param": {
              "name": "cmd",
              "type": "string",
              "default": "macro1"
            },
            "children": [
              {
                "label": "Trigger Path",
                "command": {
                  "path": "/rpc/{cmd}",
                  "args": [],
                  "description": "Send remote Ethernet command via dynamic path"
                }
              }
            ]
          },
          {
            "label": "MIDI Message",
            "command": {
              "path": "/midi",
              "args": [
                {
                  "type": "string",
                  "default": ""
                }
              ],
              "description": "Send MIDI bytes"
            }
          }
        ]
      },
      {
        "label": "OSC Feedback",
        "children": [
          {
            "label": "Feedback Off",
            "command": {
              "path": "/feedback/off",
              "args": [],
              "description": "Turns feedback off"
            }
          },
          {
            "label": "Feedback Playbacks",
            "command": {
              "path": "/feedback/pb",
              "args": [],
              "description": "Turns feedback on for playbacks"
            }
          },
          {
            "label": "Feedback Execute",
            "command": {
              "path": "/feedback/exec",
              "args": [],
              "description": "Turns feedback on for executes"
            }
          },
          {
            "label": "Feedback PB & Exec",
            "command": {
              "path": "/feedback/pb+exec",
              "args": [],
              "description": "Turns feedback on for playbacks and executes"
            }
          }
        ]
      }
    ]
  }
}