jdxi_editor.midi.sysex.names

Names of SysEx bytes from the JD-Xi address and parameter enums.

Example

>>> from jdxi_editor.midi.data.address.address import CommandID
>>> parse_sysex_byte(0x12, CommandID)
'DT1'

Attributes

T

Classes

SysExEnumProtocol

Base class for protocol classes.

EnumWithAddress

Base class for protocol classes.

Functions

parse_sysex_byte(byte_value, enum_cls) → str

Get the name of a SysEx byte value using a given enum class.

Module Contents

jdxi_editor.midi.sysex.names.T[source]
class jdxi_editor.midi.sysex.names.SysExEnumProtocol[source]

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
classmethod message_position() → int[source]
__call__(value: int)[source]
class jdxi_editor.midi.sysex.names.EnumWithAddress[source]

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
classmethod message_position() → int[source]

Get the position of the message in the SysEx message. :return: int - the position of the message

classmethod get_parameter_by_address(address: int) → T | None[source]

Get the enum member by address. :param address: int :return: Optional[T] - the enum member or None if not found

jdxi_editor.midi.sysex.names.parse_sysex_byte(byte_value: int, enum_cls: Type[SysExEnumProtocol]) → str[source]

Get the name of a SysEx byte value using a given enum class.

Supports both: - address-aware enums (get_parameter_by_address) - value-based enums (IntEnum / Enum)

Parameters:
  • byte_value – SysEx byte value

  • enum_cls – Enum class

Returns:

name or “COMMON (0x??)” if not found