-
Notifications
You must be signed in to change notification settings - Fork 66
Output control
This section explains how outputs are controlled on OpenDeck boards. Outputs are often LEDs, but the same control block can also be used for other output hardware supported by the board. Outputs can be controlled using received MIDI messages, via locally generated events from connected components on the board, or via OSC.
See this page for details.
PWM-capable OpenDeck outputs use a 1 ms period by default. That is a 1 kHz
PWM frequency. The output level controls duty cycle inside that period: 0% is
always off, 50% is on for half of each period, and 100% is always on.
There are several modes which can be used to control outputs on OpenDeck boards. Control modes can be split into local, where an output is controlled by internal MIDI messages generated by switches, encoders, analog inputs, or touchscreen-linked components, and MIDI in, where an output is controlled by incoming MIDI messages received on any enabled transport.
- MIDI In: Note (Single value) - In this mode, notes are used to control output state. Level and pulse control are not possible in this mode. Output is turned on in this mode if the following is true:
- Incoming MIDI channel equals to output channel
- Incoming MIDI Note equals to output activation ID
- Incoming MIDI velocity equals to output activation value
- Local control: Note (Single value) - In this mode, locally generated Note messages are used to control output state. Level and pulse control are not possible in this mode. Output is turned on in this mode if the following is true:
- Local MIDI channel equals to output channel
- Local MIDI Note equals to output activation ID
- Local MIDI velocity equals to output activation value
- MIDI In: CC (Single value) - In this mode, CC messages are used to control output state. Level and pulse control are not possible in this mode. Output is turned on in this mode if the following is true:
- Incoming MIDI channel equals to output channel
- Incoming MIDI CC index equals to output activation ID
- Incoming MIDI CC value equals to output activation value
- Local control: CC (Single value) - In this mode, locally generated CC messages are used to control output state. Level and pulse control are not possible in this mode. Output is turned on in this mode if the following is true:
- Local MIDI channel equals to output channel
- Local MIDI CC index equals to output activation ID
- Local MIDI CC value equals to output activation value
- Program change (Single value) - In this mode, Program Change messages are used to control output state. Output activation value is ignored in this mode. Level and pulse control are not possible in this mode. In this mode, both MIDI in and locally generated Program Change messages are used so that the output state stays in sync. If the global Use MIDI Program Change Offset option is enabled, the configured activation ID is offset before matching. Output is turned on in this mode if the following is true:
- MIDI channel equals to output channel
- MIDI program value equals to output activation ID
- MIDI In: Note (Multi value) - In this mode, notes are used to control output level and pulse speed. Output is controlled in this mode if the following is true:
- Incoming MIDI channel equals to output channel
- Incoming MIDI Note equals to output activation ID
- Incoming MIDI velocity is converted to output level (see Control values)
- Local control: Note (Multi value) - In this mode, locally generated Note messages are used to control output level and pulse speed. Output is controlled in this mode if the following is true:
- Local MIDI channel equals to output channel
- Local MIDI Note equals to output activation ID
- Local MIDI velocity is converted to output level (see Control values)
- MIDI In: CC (Multi value) - In this mode, CC messages are used to control output level and pulse speed. Output is controlled in this mode if the following is true:
- Incoming MIDI channel equals to output channel
- Incoming MIDI CC index equals to output activation ID
- Incoming MIDI CC value is converted to output level (see Control values)
- Local control: CC (Multi value) - In this mode, locally generated CC messages are used to control output level and pulse speed. Output is controlled in this mode if the following is true:
- Local MIDI channel equals to output channel
- Local MIDI CC index equals to output activation ID
- Local MIDI CC value is converted to output level (see Control values)
- Preset (Single value) - In this mode, the output is turned on if the current preset matches the output activation ID. Activation value is ignored. If the global Use MIDI Program Change Offset option is enabled, the configured activation ID is offset before matching.
- Static / constantly on - In this mode the output is constantly on from the moment the board is powered on and doesn't react to local or remote events.
This section is valid for all Multi value control modes.
The received MIDI value is always scaled from 0-127 into an output level from 0% to 100%.
Pulse speed is selected separately from the same MIDI value:
| MIDI values | Pulse speed / timer | Pulse speed / MIDI clock |
|---|---|---|
0-15
|
None | None |
16-19, 32-35, 48-51, 64-67, 80-83, 96-99, 112-115
|
1000 ms | Whole note (48 pulses) |
20-23, 36-39, 52-55, 68-71, 84-87, 100-103, 116-119
|
500 ms | 1/2 note (24 pulses) |
24-27, 40-43, 56-59, 72-75, 88-91, 104-107, 120-123
|
250 ms | 1/4 note (12 pulses) |
28-31, 44-47, 60-63, 76-79, 92-95, 108-111, 124-127
|
None | None |
Examples: MIDI value 20 sets the output level from value 20 and selects the 500 ms pulse speed. MIDI value 31 sets the output level from value 31 and does not pulse.
On hardware not supporting PWM, any level above 0% is usually treated as on. On PWM-capable output hardware, the level can be used as a duty percentage.
OSC output control uses the same 0% to 100% level range:
/opendeck/output/<index> <level>
Values below 0 are clamped to 0; values above 100 are clamped to 100.
Hardware
- Supported microcontrollers
- Supported components
-
Supported boards
- Adafruit
- Arduino
- Generic
- LILYGO
- Nordic Semiconductor
- Olimex
- PJRC
- Raspberry Pi
- Shantea Controls
- Silicognition
- STMicroelectronics
- Waveshare
- WIZnet
- Recommended components and where to get them
- LED indicators
Configuration and usage
- Configurable features
- Output control
- OSC
- Presets
- Timing and latency
- Configuring touchscreens
- Firmware update via bootloader
Advanced