libmidi.types.messages.channel

MIDI channel message.

Functions

channel_message_from_bytes(data)

Get a channel message from bytes.

Classes

BaseMessageChannel(channel)

Base class for channel messages.

ChannelMessageType(value)

Enum of message types.

MessageAftertouch(channel, note, value)

MessageChannelAftertouch(channel, value)

MessageControlChange(channel, control, value)

MessageNoteOff(channel, note, velocity)

MessageNoteOn(channel, note, velocity)

MessagePitchBend(channel, value_lsb, value_msb)

MessageProgramChange(channel, program)

class libmidi.types.messages.channel.BaseMessageChannel(channel: int)

Base class for channel messages.

Since all channel messages have the same structure (at least a channel data + 8 bit data bytes), we can commonize a lot of methods.

__init__(channel: int)

Initialize a channel message.

__str__() str

Return a string representation of the message.

channel_message_type: ChannelMessageType
copy(**kwargs) BaseMessageChannel
classmethod from_bytes(data: bytes)

Read a message from bytes.

get_length() int
get_status_byte()

Return the status byte of the message.

message_type: MessageType = 0
to_bytes()

Return message as bytes.

class libmidi.types.messages.channel.ChannelMessageType(value)

Enum of message types.

AFTERTOUCH = 10
CHANNEL_AFTERTOUCH = 13
CONTROL_CHANGE = 11
NOTE_OFF = 8
NOTE_ON = 9
PITCH_BEND = 14
PROGRAM_CHANGE = 12
class libmidi.types.messages.channel.MessageAftertouch(channel: int, note: int, value: int)
__init__(channel: int, note: int, value: int)

Initialize an aftertouch message.

attributes: List[str] = ['note', 'value']
channel_message_type: ChannelMessageType = 10
class libmidi.types.messages.channel.MessageChannelAftertouch(channel: int, value: int)
__init__(channel: int, value: int)

Initialize a channel aftertouch message.

attributes: List[str] = ['value']
channel_message_type: ChannelMessageType = 13
class libmidi.types.messages.channel.MessageControlChange(channel: int, control: int, value: int)
__init__(channel: int, control: int, value: int)

Initialize a control change message.

attributes: List[str] = ['control', 'value']
channel_message_type: ChannelMessageType = 11
class libmidi.types.messages.channel.MessageNoteOff(channel: int, note: int, velocity: int)
__init__(channel: int, note: int, velocity: int)

Initialize a note off message.

attributes: List[str] = ['note', 'velocity']
channel_message_type: ChannelMessageType = 8
class libmidi.types.messages.channel.MessageNoteOn(channel: int, note: int, velocity: int)
__init__(channel: int, note: int, velocity: int)

Initialize a note on message.

attributes: List[str] = ['note', 'velocity']
channel_message_type: ChannelMessageType = 9
class libmidi.types.messages.channel.MessagePitchBend(channel: int, value_lsb: int, value_msb: int)
__init__(channel: int, value_lsb: int, value_msb: int)

Initialize a pitch bend message.

attributes: List[str] = ['value_lsb', 'value_msb']
channel_message_type: ChannelMessageType = 14
class libmidi.types.messages.channel.MessageProgramChange(channel: int, program: int)
__init__(channel: int, program: int)

Initialize a program change message.

attributes: List[str] = ['program']
channel_message_type: ChannelMessageType = 12
libmidi.types.messages.channel.channel_message_from_bytes(data: bytes) Tuple[BaseMessageChannel, bytes]

Get a channel message from bytes.