jdxi_editor.midi.message package

Subpackages

Submodules

jdxi_editor.midi.message.channel module

MIDI Channel Message Module

This module defines the ChannelMessage class, which represents a MIDI Channel Voice Message. It extends the Message base class and provides a structured way to handle MIDI messages that operate on specific channels, such as Note On, Note Off, and Control Change.

Classes:
  • ChannelMessage: Represents a MIDI channel message with status, data bytes, and channel information.

Features:
  • Validates MIDI channel range (0-15).

  • Constructs MIDI messages with status and data bytes.

  • Converts messages to byte lists for transmission.

Usage Example:
>>> msg = ChannelMessage(status=0x90, data1=60, data2=127, channel=1)  # Note On for Middle C
>>> msg.to_message_list()
[145, 60, 127]  # (0x91 in hex: Note On for channel 1)
class jdxi_editor.midi.message.channel.ChannelMessage(channel: int = 0, status: int = 0, data1: int | None = None, data2: int | None = None)[source]

Bases: MidiMessage

MIDI Channel Message

channel: int = 0[source]
status: int = 0[source]
data1: int | None = None[source]
data2: int | None = None[source]
to_message_list() List[int][source]

Convert to list of bytes for sending

__init__(channel: int = 0, status: int = 0, data1: int | None = None, data2: int | None = None) None

jdxi_editor.midi.message.control_change module

jdxi_editor.midi.message.identity_request module

jdxi_editor.midi.message.jdxi module

jdxi_editor.midi.message.midi module

MIDI Message Module

This module provides a base class for handling MIDI messages in a structured manner. It defines the Message class, which serves as the foundation for various types of MIDI messages, ensuring proper formatting and conversion to MIDI-compliant byte sequences.

Classes:
  • Message: Base class for MIDI messages, enforcing structure and conversion methods.

Features:
  • Provides constants for MIDI message handling (status mask, channel mask, max value).

  • Ensures subclass implementation of the to_list method for MIDI byte conversion.

  • Offers utility methods for converting messages to bytes and hexadecimal string format.

Usage Example:
>>> class NoteOnMessage(MidiMessage):
...     def to_list(self):
...         return [0x90, 60, 127]  # Note On for Middle C with velocity 127
...
>>> msg = NoteOnMessage()
>>> msg.to_bytes()
b'<'
import jdxi_editor.midi.sysex.utils >>> jdxi_editor.midi.sysex.utils.to_hex_string()

‘90 3C 7F’

class jdxi_editor.midi.message.midi.MidiMessage[source]

Bases: object

MIDI message base class

MIDI_MAX_VALUE = 127[source]
MIDI_STATUS_MASK = 240[source]
MIDI_CHANNEL_MASK = 15[source]
to_message_list() List[int][source]

Convert to list of bytes for sending, must be implemented in subclass

to_bytes() bytes[source]

Convert to bytes for sending

to_hex_string() str[source]

Convert message to a formatted hexadecimal string.

__init__() None

jdxi_editor.midi.message.program_change module

jdxi_editor.midi.message.roland module

jdxi_editor.midi.message.sysex module

Module contents