jdxi_editor.midi.track.gm_map

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

JDXI_BANK_MSB

GM_TO_DIGITAL

_DIGITAL_LOW_LEAD

_ANALOG_LOW_LEAD

LOW_REGISTER

_GM_TO_ANALOG

_GM_TO_KIT

DEFAULT_KIT

Functions

digital_for_gm(program[, average_note]) → int

The JD-Xi Digital preset (1-256) closest to GM program.

analog_for_gm(program[, average_note]) → int

The JD-Xi Analog preset (1-64) closest to GM program (a mono part: basses and leads).

kit_for_gm(program) → int

The JD-Xi drum kit (1-33) closest to GM drum kit program.

note_channel(track) → Optional[int]

The channel (0-based) of the track's first note.

gm_program(track) → Optional[int]

The General MIDI program the track's notes start with: the first program

average_note(track) → Optional[float]

gm_name(program) → str

preset_for_part(channel, track) → Optional[int]

The JD-Xi preset (1-based, of the part's own list) for track played by

strip_program_changes(track, channel) → mido.MidiTrack

track without its program changes and bank selects on channel (0-based), timing kept.

with_sound(track, channel, msb, lsb, program) → mido.MidiTrack

track starting with Bank Select + Program Change (0-based channel and program).

Module Contents

jdxi_editor.midi.track.gm_map.JDXI_BANK_MSB[source]
jdxi_editor.midi.track.gm_map.GM_TO_DIGITAL: tuple[int, ...] = (162, 162, 163, 162, 164, 165, 168, 169, 173, 174, 175, 176, 176, 176, 173, 178, 170, 171, 170,...[source]
jdxi_editor.midi.track.gm_map._DIGITAL_LOW_LEAD[source]
jdxi_editor.midi.track.gm_map._ANALOG_LOW_LEAD[source]
jdxi_editor.midi.track.gm_map.LOW_REGISTER = 52[source]
jdxi_editor.midi.track.gm_map._GM_TO_ANALOG: dict[int, int][source]
jdxi_editor.midi.track.gm_map._GM_TO_KIT[source]
jdxi_editor.midi.track.gm_map.DEFAULT_KIT = 29[source]
jdxi_editor.midi.track.gm_map.digital_for_gm(program: int, average_note: float | None = None) → int[source]

The JD-Xi Digital preset (1-256) closest to GM program.

jdxi_editor.midi.track.gm_map.analog_for_gm(program: int, average_note: float | None = None) → int[source]

The JD-Xi Analog preset (1-64) closest to GM program (a mono part: basses and leads).

jdxi_editor.midi.track.gm_map.kit_for_gm(program: int | None) → int[source]

The JD-Xi drum kit (1-33) closest to GM drum kit program.

jdxi_editor.midi.track.gm_map.note_channel(track: mido.MidiTrack) → int | None[source]

The channel (0-based) of the track’s first note.

jdxi_editor.midi.track.gm_map.gm_program(track: mido.MidiTrack) → int | None[source]

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).

jdxi_editor.midi.track.gm_map.average_note(track: mido.MidiTrack) → float | None[source]
jdxi_editor.midi.track.gm_map.gm_name(program: int) → str[source]
jdxi_editor.midi.track.gm_map.preset_for_part(channel: int, track: mido.MidiTrack) → int | None[source]

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.

jdxi_editor.midi.track.gm_map.strip_program_changes(track: mido.MidiTrack, channel: int) → mido.MidiTrack[source]

track without its program changes and bank selects on channel (0-based), timing kept.

jdxi_editor.midi.track.gm_map.with_sound(track: mido.MidiTrack, channel: int, msb: int, lsb: int, program: int) → mido.MidiTrack[source]

track starting with Bank Select + Program Change (0-based channel and program).