jdxi_editor.midi.utils.drum_detection
Drum track detection utilities for MIDI files.
This module provides functions to analyze MIDI tracks and identify which tracks are likely drum tracks based on various heuristics.
Attributes
Functions
|
Analyze a MIDI track to determine if it's likely a drum track. |
|
Detect drum tracks in a MIDI file. |
Module Contents
- jdxi_editor.midi.utils.drum_detection.DRUM_KEYWORDS = ['drum', 'percussion', 'perc', 'kit', 'beat', 'rhythm', 'snare', 'kick', 'hihat', 'hi-hat',...[source]
- jdxi_editor.midi.utils.drum_detection.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.midi.utils.drum_detection.detect_drum_tracks(midi_file: mido.MidiFile, min_score: float = 70.0) List[Tuple[int, dict]][source]
Detect drum tracks in a MIDI file.
- Parameters:
midi_file – The MIDI file to analyze
min_score – Minimum score threshold for a track to be considered a drum track
- Returns:
List of tuples (track_index, analysis_dict) for tracks that meet the threshold, sorted by score (descending)