Created
November 24, 2021 22:10
-
-
Save Echooff3/8089edae3c104bf292d2a9de2591f527 to your computer and use it in GitHub Desktop.
Python - Change midi channel 1 to 10 (converting midi drum samples)
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
from mido import MidiFile | |
from pathlib import Path | |
for name in Path('./ConvertThis').rglob('*.mid'): | |
print(name) | |
mid = MidiFile(name, clip=True) | |
for message in mid.tracks[0]: | |
if message.type in ('note_on','note_off'): | |
message.copy(channel=9) | |
mid.save(name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment