Created
February 1, 2025 18:41
-
-
Save Zizazar/06a6668514a8e40791bb84a86975e726 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Small script that converts one track of midi to Scrap Computers HDD array. | |
| import mido | |
| import json | |
| mid = mido.MidiFile('bad_apple.mid') | |
| converted = [] | |
| for msg in mid.tracks[0]: | |
| if not msg.is_meta and msg.type in ('note_on', 'note_off'): | |
| converted.append([1 if msg.type == 'note_on' else 0, msg.note, msg.velocity, msg.time]) | |
| with open("./bad_apple.json", "w") as f: | |
| json.dump(converted, f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment