Skip to content

Commit

Permalink
Remove automatic MidiDict metadata attribution (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad authored Dec 4, 2024
1 parent 5d6a503 commit 178339f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
38 changes: 0 additions & 38 deletions ariautils/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,6 @@
"sfx": true
}
}
},
"metadata": {
"functions": {
"composer_filename": {
"run": false,
"args": {
"composer_names": ["bach", "beethoven", "mozart", "chopin", "rachmaninoff", "liszt", "debussy", "schubert", "brahms", "ravel", "satie", "scarlatti"]
}
},
"composer_metamsg": {
"run": false,
"args": {
"composer_names": ["bach", "beethoven", "mozart", "chopin", "rachmaninoff", "liszt", "debussy", "schubert", "brahms", "ravel", "satie", "scarlatti"]
}
},
"form_filename": {
"run": false,
"args": {
"form_names": ["sonata", "prelude", "nocturne", "etude", "waltz", "mazurka", "impromptu", "fugue"]
}
},
"maestro_json": {
"run": false,
"args": {
"composer_names": ["bach", "beethoven", "mozart", "chopin", "rachmaninoff", "liszt", "debussy", "schubert", "brahms", "ravel", "satie", "scarlatti"],
"form_names": ["sonata", "prelude", "nocturne", "étude", "waltz", "mazurka", "impromptu", "fugue"]
}
},
"abs_path": {
"run": true,
"args": {}
}
},
"manual": {
"genre": ["classical", "jazz"],
"form": ["sonata", "prelude", "nocturne", "étude", "waltz", "mazurka", "impromptu", "fugue"],
"composer": ["bach", "beethoven", "mozart", "chopin", "rachmaninoff", "liszt", "debussy", "schubert", "brahms", "ravel", "satie", "scarlatti"]
}
}
},
"tokenizer": {
Expand Down
15 changes: 0 additions & 15 deletions ariautils/midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ def midi_to_dict(mid: mido.MidiFile) -> MidiDictData:
time signatures, key signatures, and other musical events.
"""

metadata_config = load_config()["data"]["metadata"]
# Convert time in mid to absolute
for track in mid.tracks:
curr_tick = 0
Expand Down Expand Up @@ -686,20 +685,6 @@ def midi_to_dict(mid: mido.MidiFile) -> MidiDictData:
midi_dict_data["note_msgs"], key=lambda x: x["tick"]
)

for metadata_process_name, metadata_process_config in metadata_config[
"functions"
].items():
if metadata_process_config["run"] is True:
metadata_fn = get_metadata_fn(
metadata_process_name=metadata_process_name
)
fn_args: dict = metadata_process_config["args"]

collected_metadata = metadata_fn(mid, midi_dict_data, **fn_args)
if collected_metadata:
for k, v in collected_metadata.items():
midi_dict_data["metadata"][k] = v

return midi_dict_data


Expand Down

0 comments on commit 178339f

Please sign in to comment.