From 66b902a55d0b269786b1a7ea315158eb6915525a Mon Sep 17 00:00:00 2001 From: bordun Date: Sun, 25 Oct 2020 19:13:40 +0100 Subject: [PATCH] docs: improve midi --- .../docs/docs/midi/midi-configuration.md | 20 +++++++++++-- resources/docs/docs/midi/midi-messages.md | 30 +++++++++---------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/resources/docs/docs/midi/midi-configuration.md b/resources/docs/docs/midi/midi-configuration.md index 31bd3646..defe9d3a 100644 --- a/resources/docs/docs/midi/midi-configuration.md +++ b/resources/docs/docs/midi/midi-configuration.md @@ -44,7 +44,7 @@ Enabling MIDI support in Open Stage Control requires additional softwares to be ## Configuration -When running the app, the `-m / --midi` switch must be set and accepts the following options, separated by spaces. +The server's `midi` option accepts the following parameters, separated by spaces. !!! warning "" If an option contains space characters, it must be enquoted. @@ -57,7 +57,7 @@ Print the available MIDI ports to the console when the server starts. This actio Create a virtual MIDI device that will translate OSC messsages to MIDI messages -- `device_name` is an arbitrary identifier that can be used as a target by widgets (see [Widget setup](#widget-setup)) +- `device_name` is an arbitrary identifier that can be used as a target by widgets (see [Widget setup](#widget-setup)). It doesn't have to match any device's real name. - `input` / `output` can be port numbers or strings (as reported by the `list` action). If a string is specified, the first port whose name contains the string will be used (comparison is case-insensitive). **`sysex`** @@ -90,9 +90,25 @@ In order to send MIDI messages, a widget must have at least one `target` formatt `midi:device_name` (where `device_name` is one of the declared midi devices) +Its `address` and `preArgs` properties must be set according to Open Stage Control's [midi messages](../midi-messages) specification. + !!! warning Messages received from a MIDI port only affect widgets that send to this port. ## Debug Enabling the server's `debug` options will print some extra informations (sent/received midi messages, midi setup informations, etc) + +## Example configuration + +Setting the server's `midi` option as follows: + +``` +sysex synth:1,2 daw:3,3 +``` + +- enables sysex support (sysex messages will not be ignored) +- creates a midi device "synth" connected with input 1 and output 2 +- creates a midi device "daw" connected with input 3 and output 3 + +If a widget has its `target` set to `midi:synth`, it will receive MIDI from port 1 and send MIDI to port 2. diff --git a/resources/docs/docs/midi/midi-messages.md b/resources/docs/docs/midi/midi-messages.md index 11ce6265..a79cee7e 100644 --- a/resources/docs/docs/midi/midi-messages.md +++ b/resources/docs/docs/midi/midi-messages.md @@ -1,5 +1,5 @@ !!! info "" - Define static argument values using the [`preArgs`](/docs/widgets-reference/#preArgs) option in order to complete the respective MIDI message. + Define static argument values using the [`preArgs`](/docs/widgets/properties-reference/#preArgs) option in order to complete the respective MIDI message. ---- @@ -11,15 +11,15 @@ NoteOn event or noteOff if velocity equals `0`. - `note`: integer between 0 and 127 - `velocity`: integer between 0 and 127 -Example: +!!! example "Example" -A push button might be configured as follows in order to send a MIDI note whose velocity is defined by the button's on/off value: + A push button might be configured as follows in order to send a MIDI note whose velocity is defined by the button's on/off value: -- `address`: /note -- `preArgs`: [1, 60] (for MIDI channel 1, and note 60 / C4) -- `on`: 100 (for noteOn velocity of 100 on button push) -- `off`: 0 (to send a noteOff on button release) -- `target`: ["midi:device_name"] (where device_name is one of the declared midi devices defined during [setup](#setup)) + - `address`: `/note` + - `preArgs`: `[1, 60]` (for MIDI channel 1, and note 60 / C4) + - `on`: `100` (for noteOn velocity of 100 on button push) + - `off`: `0` (to send a noteOff on button release) + - `target`: `midi:device_name` (where device_name is one of the declared midi devices defined during [setup](../midi-configuration)) ---- @@ -31,14 +31,14 @@ Control change event. - `cc`: integer between 0 and 127 - `value`: integer between 0 and 127 -Example: +!!! example "Example" -A fader might be configured as follows in order to send a MIDI control message (a volume control in this example): + A fader might be configured as follows in order to send a MIDI control message (a volume control in this example): -- `address`: /control -- `pre-args`: [1, 7] (MIDI channel 1, control number 7 generally used as volume control) -- `range`: {"min": 0, "max": 127} (MIDI values are encoded in this range) -- `target`: ["midi:device_name"] + - `address`: `/control` + - `pre-args`: `[1, 7]` (MIDI channel 1, control number 7 generally used as volume control) + - `range`: `{"min": 0, "max": 127}` (MIDI values are encoded in this range) + - `target`: `midi:device_name` ---- @@ -50,7 +50,7 @@ Program change event. - `program`: integer between 0 and 127* !!! info - \* Some devices / softwares display the `program` value between 1 and 128, thus interpreting `program change 0` as `program change 1` and so on. Enable the `pc_offset` option to make Open Stage Control behave this way. + \* Some devices / softwares display the `program` value between 1 and 128, thus interpreting `program change 0` as `program change 1` and so on. Add the `pc_offset` parameter to the server's `midi` option to make Open Stage Control behave this way. ----