jdxi_editor.midi.track.classification
Track classification utilities for MIDI files.
This module provides functions to classify MIDI tracks into categories: - Bass: Low-pitched, monophonic or low polyphony tracks - Keys/Guitars: Wide range, polyphonic tracks (piano, guitar, etc.) - Strings: Sustained, legato tracks with ensemble-like patterns
Attributes
Classes
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
True when track name contains 'string' or 'strings' (case-insensitive). |
|
|
|
|
|
|
|
Calculate standard deviation of a list of values. |
|
Classify tracks in a MIDI file into Bass, Keys/Guitars, and Strings. |
Module Contents
- jdxi_editor.midi.track.classification.has_pitch_bend(s: jdxi_editor.midi.track.stats.TrackStats)[source]
- class jdxi_editor.midi.track.classification.ScoreRule[source]
-
- condition: Callable[[jdxi_editor.midi.track.stats.TrackStats], bool][source]
- evaluate(stats: jdxi_editor.midi.track.stats.TrackStats) float[source]
- jdxi_editor.midi.track.classification.name_contains_string(stats: jdxi_editor.midi.track.stats.TrackStats) bool[source]
True when track name contains ‘string’ or ‘strings’ (case-insensitive).
- jdxi_editor.midi.track.classification.analyze_track_for_classification(track: mido.MidiTrack, track_index: int) jdxi_editor.midi.track.stats.TrackStats[source]
- jdxi_editor.midi.track.classification.score_rules(stats: jdxi_editor.midi.track.stats.TrackStats, rules: list[ScoreRule]) float[source]
- jdxi_editor.midi.track.classification.calculate_scores(stats: jdxi_editor.midi.track.stats.TrackStats) None[source]
- jdxi_editor.midi.track.classification.explain_score(stats: jdxi_editor.midi.track.stats.TrackStats, rules: list[ScoreRule])[source]
- jdxi_editor.midi.track.classification._calculate_std_dev(values: List[float]) float[source]
Calculate standard deviation of a list of values.
- jdxi_editor.midi.track.classification.classify_tracks(midi_file: mido.MidiFile, exclude_drum_tracks: List[int] | None = None, min_score: float = 30.0) dict[source]
Classify tracks in a MIDI file into Bass, Keys/Guitars, and Strings.
- Parameters:
midi_file – The MIDI file to analyze
exclude_drum_tracks – List of track indices to exclude from classification
min_score – Minimum score threshold for a track to be classified
- Returns:
“bass”: List of (track_index, “TrackStats”) tuples
”keys_guitars”: List of (track_index, TrackStats) tuples
”strings”: List of (track_index, TrackStats) tuples
”unclassified”: List of (track_index, TrackStats) tuples
- Return type:
Dictionary with keys