jdxi_editor.devel.analyze_drum_track

Analyze a MIDI file to identify the drum track.

This script uses multiple heuristics to determine which track is the drum track: 1. MIDI Channel 9 (standard GM drum channel) 2. Track name containing drum-related keywords 3. Note patterns (drum range, note density, polyphony) 4. Lack of pitch bend/control changes

Attributes

DRUM_NOTE_MIN

DRUM_NOTE_MAX

DRUM_KEYWORDS

midi_file_path

Functions

analyze_track_for_drums(→ dict)

Analyze a MIDI track to determine if it's likely a drum track.

find_drum_track(→ Optional[Tuple[int, dict]])

Analyze a MIDI file and return the most likely drum track.

Module Contents

jdxi_editor.devel.analyze_drum_track.DRUM_NOTE_MIN = 35[source]
jdxi_editor.devel.analyze_drum_track.DRUM_NOTE_MAX = 81[source]
jdxi_editor.devel.analyze_drum_track.DRUM_KEYWORDS = ['drum', 'percussion', 'perc', 'kit', 'beat', 'rhythm', 'snare', 'kick', 'hihat', 'hi-hat',...[source]
jdxi_editor.devel.analyze_drum_track.analyze_track_for_drums(track: mido.MidiTrack, track_index: int) dict[source]

Analyze a MIDI track to determine if it’s likely a drum track.

Returns a dictionary with analysis results and a score.

jdxi_editor.devel.analyze_drum_track.find_drum_track(midi_file_path: str) Tuple[int, dict] | None[source]

Analyze a MIDI file and return the most likely drum track.

Returns: (track_index, analysis_dict) or None if file can’t be analyzed

jdxi_editor.devel.analyze_drum_track.midi_file_path[source]