jdxi_editor.midi.channel.channel
This module defines an enumeration for MIDI channels used in a synthesizer, specifically for a Roland JD-Xi-style instrument editor.
The MidiChannel class extends IntEnum and provides symbolic names for the common MIDI channels, including: - DIGITAL1 (channel 1) - DIGITAL2 (channel 2) - ANALOG (channel 3) - DRUM (channel 10) - PROGRAM (channel 16)
The class also provides utility methods for handling MIDI channels, including: - __str__: Returns a string representation of the channel. - midi_channel_number: A property that returns the actual MIDI channel number (1-based). - from_midi_channel: A class method that retrieves a MidiChannel from a given MIDI channel number.
- Usage example:
channel = MidiChannel.DIGITAL1 print(str(channel)) # Output: “Digital 1 (Ch.1)” print(channel.midi_channel_number) # Output: 1 print(MidiChannel.from_midi_channel(9)) # Output: MidiChannel.DRUM_KIT
Classes
MIDI Channel Enum |
Module Contents
- class jdxi_editor.midi.channel.channel.MidiChannel[source]
Bases:
enum.IntEnumMIDI Channel Enum
- classmethod from_midi_channel(channel: int) MidiChannel | None[source]