jdxi_editor.midi.track.gm_map ============================= .. py:module:: jdxi_editor.midi.track.gm_map .. autoapi-nested-parse:: The JD-Xi sound closest to a General MIDI instrument. A file made for a General MIDI instrument chooses each channel's instrument with a program change (0-127, no JD-Xi bank). On the JD-Xi those numbers pick a sound of whatever bank the part is in: here each GM instrument has the JD-Xi preset that comes closest — a Digital tone for Digital 1 and 2, an Analog tone for the Analog part (it plays one note at a time: basses and leads), a drum kit for the Drums. Close, not the same: a starting point the user can change. Preset numbers are the JD-Xi's, 1-based, as in its preset lists. Attributes ---------- .. autoapisummary:: jdxi_editor.midi.track.gm_map.JDXI_BANK_MSB jdxi_editor.midi.track.gm_map.GM_TO_DIGITAL jdxi_editor.midi.track.gm_map._DIGITAL_LOW_LEAD jdxi_editor.midi.track.gm_map._ANALOG_LOW_LEAD jdxi_editor.midi.track.gm_map.LOW_REGISTER jdxi_editor.midi.track.gm_map._GM_TO_ANALOG jdxi_editor.midi.track.gm_map._GM_TO_KIT jdxi_editor.midi.track.gm_map.DEFAULT_KIT Functions --------- .. autoapisummary:: jdxi_editor.midi.track.gm_map.digital_for_gm jdxi_editor.midi.track.gm_map.analog_for_gm jdxi_editor.midi.track.gm_map.kit_for_gm jdxi_editor.midi.track.gm_map.note_channel jdxi_editor.midi.track.gm_map.gm_program jdxi_editor.midi.track.gm_map.average_note jdxi_editor.midi.track.gm_map.gm_name jdxi_editor.midi.track.gm_map.preset_for_part jdxi_editor.midi.track.gm_map.strip_program_changes jdxi_editor.midi.track.gm_map.with_sound Module Contents --------------- .. py:data:: JDXI_BANK_MSB .. py:data:: GM_TO_DIGITAL :type: tuple[int, ...] :value: (162, 162, 163, 162, 164, 165, 168, 169, 173, 174, 175, 176, 176, 176, 173, 178, 170, 171, 170,... .. py:data:: _DIGITAL_LOW_LEAD .. py:data:: _ANALOG_LOW_LEAD .. py:data:: LOW_REGISTER :value: 52 .. py:data:: _GM_TO_ANALOG :type: dict[int, int] .. py:data:: _GM_TO_KIT .. py:data:: DEFAULT_KIT :value: 29 .. py:function:: digital_for_gm(program: int, average_note: Optional[float] = None) -> int The JD-Xi Digital preset (1-256) closest to GM *program*. .. py:function:: analog_for_gm(program: int, average_note: Optional[float] = None) -> int The JD-Xi Analog preset (1-64) closest to GM *program* (a mono part: basses and leads). .. py:function:: kit_for_gm(program: Optional[int]) -> int The JD-Xi drum kit (1-33) closest to GM drum kit *program*. .. py:function:: note_channel(track: mido.MidiTrack) -> Optional[int] The channel (0-based) of the track's first note. .. py:function:: gm_program(track: mido.MidiTrack) -> Optional[int] The General MIDI program the track's notes start with: the first program change on their channel, unless a JD-Xi Bank Select comes with it (then it is a JD-Xi sound already). .. py:function:: average_note(track: mido.MidiTrack) -> Optional[float] .. py:function:: gm_name(program: int) -> str .. py:function:: preset_for_part(channel: int, track: mido.MidiTrack) -> Optional[int] The JD-Xi preset (1-based, of the part's own list) for *track* played by the part on *channel* (1, 2, 3, 10); None: the file chooses no GM sound. .. py:function:: strip_program_changes(track: mido.MidiTrack, channel: int) -> mido.MidiTrack *track* without its program changes and bank selects on *channel* (0-based), timing kept. .. py:function:: with_sound(track: mido.MidiTrack, channel: int, msb: int, lsb: int, program: int) -> mido.MidiTrack *track* starting with Bank Select + Program Change (0-based channel and program).