jvconnected.interfaces.midi.bcf_sysex
- exception jvconnected.interfaces.midi.bcf_sysex.ResponseError(error_code: int)[source]
Bases:
Exception
Raised on errors indicated by
BCLReply
messagesThe
error_code
is used to provide a description of the error, if possible- error_code: int
The
error number
from the device
- class jvconnected.interfaces.midi.bcf_sysex.BCLSyxBase(manufacturer: Sequence[ByteString] = (0, 32, 50), device_id: Sequence[ByteString] = (127,), model: Sequence[ByteString] = (20,), command: Sequence[ByteString] = (32,), message_index: int = 0)[source]
Bases:
object
Wrapper for a single BCL command as a Sysex message
- manufacturer: Sequence[ByteString] = (0, 32, 50)
The Sysex manufacturer id
This should always be
(0x00, 0x20, 0x32)
(Behringer)
- device_id: Sequence[ByteString] = (127,)
The device id from 0x00 to 0x15, or 0x7f for “any”
- model: Sequence[ByteString] = (20,)
0x14 for BCF2000, 0x15 for BCR2000, or 0x7f for “any”
- command: Sequence[ByteString] = (32,)
The command type. This is 0x20 for BCL messages
- classmethod from_sysex_message(msg: Message) BCLSysex [source]
Create an instance from the given
Message
- property index_msb: Sequence[ByteString]
Bits 7-13 of
message_index
- property index_lsb: Sequence[ByteString]
Bits 0-6 of
message_index
- build_sysex_data() Sequence[ByteString] [source]
Build the Sysex message as a sequence of int
- build_sysex_message() Message [source]
Build a Sysex message wrapped in a
mido.Message
- class jvconnected.interfaces.midi.bcf_sysex.BCLSysex(manufacturer: Sequence[ByteString] = (0, 32, 50), device_id: Sequence[ByteString] = (127,), model: Sequence[ByteString] = (20,), command: Sequence[ByteString] = (32,), message_index: int = 0, bcl_text: str = '')[source]
Bases:
BCLSyxBase
A BCL Text command
- class jvconnected.interfaces.midi.bcf_sysex.BCLReply(manufacturer: Sequence[ByteString] = (0, 32, 50), device_id: Sequence[ByteString] = (127,), model: Sequence[ByteString] = (20,), command: Sequence[ByteString] = (32,), message_index: int = 0, error_code: Sequence[ByteString] = (0,))[source]
Bases:
BCLSyxBase
A message sent from a BC device in response to a BCL command
- error_code: Sequence[ByteString] = (0,)
If non-zero, indicates an error occured
- raise_on_error()[source]
Check for errors and raise a
ResponseError
if necessary
- class jvconnected.interfaces.midi.bcf_sysex.BCLBlock(revision: str = 'F1', text_lines: ~typing.Sequence[str] = <factory>)[source]
Bases:
object
A sequence of BCL commands either received from or sent to a BC device
- revision: str = 'F1'
The device type and revision number for the device
This is typically “F1” for the BCF2000 and “R1” for the BCR2000
- text_lines: Sequence[str]
The BCL command lines within the block (not including the block start or end commands)
- classmethod from_midi_messages(messages: Sequence[Message]) Tuple[BCLBlock, Sequence[Message]] [source]
- build_sysex_items() Sequence[BCLSysex] [source]
Construct the
BCLSysex
items needed to send the block
- async send(inport: InputPort, outport: OutputPort)[source]
Send the block and wait for the device reply using the given Midi ports
- Parameters
inport (aioport.InputPort) – An open midi input port to receive BCL replies from
outport (aioport.OutputPort) – An open midi output port to send BCL messages to
- async send_to_port_name(name: str)[source]
Send the block and wait for the device reply using the given port name
Opens an
aioport.IOPort
matching the given name. The input/output ports are then used as described in thesend()
method
- class jvconnected.interfaces.midi.bcf_sysex.ControlBase(message_type: str = 'control_change', channel: int = 0, number: int = 0, mode: str = '', value_min: int = 0, value_max: int = 127, value_default: Optional[int] = None, show_value: bool = True)[source]
Bases:
object
Base class for control definitions
- message_type: str = 'control_change'
Midi message type for the control
Choices
['note', 'aftertouch', 'control_change', 'program_change', 'pitch_bend']
- class jvconnected.interfaces.midi.bcf_sysex.EncoderConf(message_type: str = 'control_change', channel: int = 0, number: int = 0, mode: str = '1dot', value_min: int = 0, value_max: int = 127, value_default: Optional[int] = None, show_value: bool = True, index: int = 1, encoder_mode: str = 'absolute', resolution: Sequence[int] = (96, 96, 96, 96))[source]
Bases:
ControlBase
A Push Encoder configuration
- mode: str = '1dot'
LED Display mode
Choices
[ 'off', '1dot', '1dot/off', '12dot', '12dot/off', 'bar', 'bar/off', 'spread', 'pan', 'qual', 'cut', 'damp', ]
- encoder_mode: str = 'absolute'
Control mode for the encoder
Choices
[ 'absolute', 'relative-1', 'relative-2', 'relative-3', 'inc/dec', 'absolute/14', 'relative-1/14', 'relative-2/14', 'relative-3/14', ]
- class jvconnected.interfaces.midi.bcf_sysex.FaderConf(message_type: str = 'control_change', channel: int = 0, number: int = 0, mode: str = 'absolute', value_min: int = 0, value_max: int = 127, value_default: Optional[int] = None, show_value: bool = True, index: int = 1, motor: bool = True, override: str = 'move', keyoverride: str = 'off')[source]
Bases:
ControlBase
A fader configuration
- override: str = 'move'
Behavior when
motor
isFalse
Choices
['move', 'pickup']
'move'
Immediately send output messages when the fader is moved
'pickup'
Wait for the fader to reach last known value before sending output messages
- class jvconnected.interfaces.midi.bcf_sysex.ButtonConf(message_type: str = 'control_change', channel: int = 0, number: int = 0, mode: str = '', value_min: int = 0, value_max: int = 127, value_default: Optional[int] = None, show_value: bool = True, index: int = 1, button_mode: str = 'toggleon', increment: int = 1)[source]
Bases:
ControlBase
A Button configuration
- increment: int = 1
Amount to increment/decrement if
button_mode
is'increment'
- class jvconnected.interfaces.midi.bcf_sysex.Preset(**kwargs)[source]
Bases:
object
Representation of a BCF preset containing
encoders
,faders
andbuttons
- encoders: Dict[int, EncoderConf]
Mapping of
EncoderConf
definitions using their index as keys
- buttons: Dict[int, ButtonConf]
Mapping of
ButtonConf
definitions using their index as keys
- add_encoder(**kwargs) EncoderConf [source]
Create an
EncoderConf
and add it toencoders
Keyword arguments from this method will be used to create the instance
- add_fader(**kwargs) FaderConf [source]
Create a
FaderConf
and add it tofaders
Keyword arguments from this method will be used to create the instance
- add_button(**kwargs) ButtonConf [source]
Create a
ButtonConf
and add it tobuttons
Keyword arguments from this method will be used to create the instance
- build_bcl_lines() Sequence[str] [source]
Build the BCL commands for the preset as a list of strings
- build_sysex_messages() Sequence[Message] [source]
Build the BCL commands for the preset as a sequence of Sysex messages
- build_store_block(preset_num: int) BCLBlock [source]
Build the BCL commands to store the preset to the given number, wrapped in a
BCLBlock
- build_store_sysex(preset_num: int) Sequence[Message] [source]
Build the BCL commands to store the preset to the given number, wrapped in a sequence of Sysex messages
- async send(inport: InputPort, outport: OutputPort, store: bool = False, preset_num: int = 1)[source]
Send the preset to the device and optionally store it using the given midi ports
- Parameters
inport (aioport.InputPort) – An open midi input port to receive BCL replies from
outport (aioport.OutputPort) – An open midi output port to send BCL messages to
store (bool) – If True, store the preset in the device memory using the given preset_num. Default is False
preset_num (int) – If store is True this is will be the preset number stored on the device. Default is 1