jdxi_editor.ui.editors.midi_player.fit_jdxi

Fit to the JD-Xi: what of a MIDI file the JD-Xi plays, and a proposal that puts its tracks on the JD-Xi’s four parts.

The JD-Xi plays four parts, each on its own channel: Digital 1 (1), Digital 2 (2), Analog (3), Drums (10). Notes on any other channel are not heard. A file made for the JD-Xi has nothing to fit; a general file (an orchestra on 16 channels) does.

Attributes

JDXI_PARTS

NOT_PLAYED

OFF_CHANNEL

PART_COLORS

NOT_PLAYED_COLOR

Classes

TrackInfo

FitDialog

One row per track with notes: where it is, and the part proposed for it;

Functions

part_presets(channel) → list[dict]

The JD-Xi presets a part can take: Digital tones (1, 2), Analog tones (3), drum kits (10).

preset_wire(preset) → tuple[int, int, int]

(bank MSB, bank LSB, program 0-127) to send for preset.

part_name(channel) → str

«Digital 1», …; a channel the JD-Xi does not play: «channel 5».

note_tracks(midi_file) → list[TrackInfo]

The tracks that play notes (tempo and marker tracks have nothing to fit).

summary(midi_file) → tuple[str, bool]

One line on what the JD-Xi plays of midi_file, and whether it is ready

propose(tracks, drum_indices, classifications) → dict[int, int]

Track index -> proposed 1-based channel (NOT_PLAYED: leave it off).

current(tracks) → dict[int, int]

Track index -> the part it is on now (1-based channel; NOT_PLAYED: on no part).

Module Contents

jdxi_editor.ui.editors.midi_player.fit_jdxi.JDXI_PARTS: dict[int, str][source]
jdxi_editor.ui.editors.midi_player.fit_jdxi.NOT_PLAYED = 0[source]
jdxi_editor.ui.editors.midi_player.fit_jdxi.OFF_CHANNEL = 4[source]
jdxi_editor.ui.editors.midi_player.fit_jdxi.PART_COLORS: dict[int, str][source]
jdxi_editor.ui.editors.midi_player.fit_jdxi.NOT_PLAYED_COLOR = '#6b6e75'[source]
jdxi_editor.ui.editors.midi_player.fit_jdxi.part_presets(channel: int) → list[dict][source]

The JD-Xi presets a part can take: Digital tones (1, 2), Analog tones (3), drum kits (10).

jdxi_editor.ui.editors.midi_player.fit_jdxi.preset_wire(preset: dict) → tuple[int, int, int][source]

(bank MSB, bank LSB, program 0-127) to send for preset.

jdxi_editor.ui.editors.midi_player.fit_jdxi.part_name(channel: int) → str[source]

«Digital 1», …; a channel the JD-Xi does not play: «channel 5».

class jdxi_editor.ui.editors.midi_player.fit_jdxi.TrackInfo[source]
index: int[source]
name: str[source]
channel: int[source]
notes: int[source]
jdxi_editor.ui.editors.midi_player.fit_jdxi.note_tracks(midi_file: mido.MidiFile) → list[TrackInfo][source]

The tracks that play notes (tempo and marker tracks have nothing to fit).

jdxi_editor.ui.editors.midi_player.fit_jdxi.summary(midi_file: mido.MidiFile | None) → tuple[str, bool][source]

One line on what the JD-Xi plays of midi_file, and whether it is ready (every track that plays notes is on a JD-Xi part).

jdxi_editor.ui.editors.midi_player.fit_jdxi.propose(tracks: list[TrackInfo], drum_indices: list[int], classifications: dict) → dict[int, int][source]

Track index -> proposed 1-based channel (NOT_PLAYED: leave it off).

The drum tracks to Drums (10). Each melodic part takes ONE track, the one recognised best for it: the bass to Digital 1, keys or guitars to Digital 2, strings to Analog (the Analog part plays one note at a time; many tracks on one part would only be a jumble). Every other track is not played. A part nothing was recognised for keeps the track already on its channel, if any.

jdxi_editor.ui.editors.midi_player.fit_jdxi.current(tracks: list[TrackInfo]) → dict[int, int][source]

Track index -> the part it is on now (1-based channel; NOT_PLAYED: on no part).

class jdxi_editor.ui.editors.midi_player.fit_jdxi.FitDialog(tracks: list[TrackInfo], proposal: dict[int, int], parent: PySide6.QtWidgets.QWidget | None = None, start_as_now: bool = False, midi_file: mido.MidiFile | None = None)[source]

Bases: PySide6.QtWidgets.QDialog

One row per track with notes: where it is, and the part proposed for it; under the table, the sound of each part (with a file: the JD-Xi preset closest to the General MIDI instrument of the part’s main track).

CHOICES = [(1, 'Digital 1 (channel 1)'), (2, 'Digital 2 (channel 2)'), (3, 'Analog (channel 3)'), (10,...[source]
proposal[source]
midi_file = None[source]
tracks[source]
table[source]
combos: dict[int, PySide6.QtWidgets.QComboBox][source]
sound_combos: dict[int, PySide6.QtWidgets.QComboBox][source]
sound_sources: dict[int, PySide6.QtWidgets.QLabel][source]
_sound_touched: set[int][source]
_setting_sounds = False[source]
as_now_button[source]
proposal_button[source]
none_button[source]
select(parts: dict[int, int]) → None[source]

Choose parts (track index -> 1-based channel or NOT_PLAYED) in the Part column.

_on_part_changed(combo: PySide6.QtWidgets.QComboBox) → None[source]
static _colour(combo: PySide6.QtWidgets.QComboBox) → None[source]

The part’s colour; grey when not played.

parts() → dict[int, int][source]

Track index -> chosen part (1-based channel or NOT_PLAYED).

_build_sounds() → PySide6.QtWidgets.QWidget[source]
_on_sound_touched(channel: int) → None[source]
main_track(channel: int) → TrackInfo | None[source]

The track with the most notes among those chosen for the part on channel.

_propose_sounds() → None[source]

Each part’s sound from its main track’s GM instrument (not the ones chosen by hand).

sounds() → dict[int, tuple[int, int]][source]

Part channel (1-based) -> (preset number, main track index), for the parts to set.

_item(row: int, column: int, text: str, align=None) → PySide6.QtWidgets.QTableWidgetItem[source]
changes() → dict[int, int][source]

Track index -> new 1-based channel, only for the tracks that move.