"""
SystemControllerMessage
=======================
# Example usage:
# Enable program change transmission
>>> msg = SystemControllerMessage(
>>> param=SystemController.TX_PROGRAM_CHANGE.STATUS, value=1 # ON
>>> )
# Set keyboard velocity to REAL
>>> msg = SystemControllerMessage(
>>> param=SystemController.KEYBOARD_VELOCITY.STATUS, value=0 # REAL
>>> )
# Set velocity curve to MEDIUM
>>> msg = SystemControllerMessage(
>>> param=SystemController.VELOCITY_CURVE.STATUS, value=1 # MEDIUM
>>> )
# Set velocity offset to +5
>>> msg = SystemControllerMessage(
>>> param=SystemController.VELOCITY_OFFSET.STATUS, value=69 # Convert +5 to 69 (64+5)
>>> )
"""
from dataclasses import dataclass
from jdxi_editor.midi.data.address.address import (
AddressOffsetSystemLMB,
AddressOffsetTemporaryToneUMB,
AddressStartMSB,
CommandID,
)
from jdxi_editor.midi.data.address.sysex import ZERO_BYTE
from jdxi_editor.midi.message.roland import RolandSysEx
@dataclass
[docs]
class SystemControllerMessage(RolandSysEx):
"""System Controller parameter message"""
[docs]
command: int = CommandID.DT1
[docs]
msb: int = AddressStartMSB.SETUP # 0x02: Setup area
[docs]
umb: int = AddressOffsetTemporaryToneUMB.COMMON # 0x03: Controller section
[docs]
lmb: int = AddressOffsetSystemLMB.CONTROLLER # Always 0x00
[docs]
lsb: int = ZERO_BYTE # Parameter number
[docs]
value: int = ZERO_BYTE # Parameter value
[docs]
def __post_init__(self):
super().__post_init__() # Set address and data from RolandSysEx