Created
October 12, 2021 10:29
-
-
Save Pixelsuft/ce96e75610f5b9bbe2abfe9bb9e42ed2 to your computer and use it in GitHub Desktop.
MIDI Backward
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 | |
fn = input('Enter file name: ').replace('"', '') | |
ext = fn.split('.')[-1].strip() | |
no_ext = '.'.join(fn.split('.')[:-1]) | |
cv1 = MidiFile(fn, clip=True) | |
all_tracks = [] | |
for track in cv1.tracks: | |
all_tracks.append(track) | |
for track in all_tracks: | |
cv1.tracks.remove(track) | |
for track in all_tracks: | |
cv1.tracks.append(track[::-1]) | |
cv1.save(f'{no_ext}_out.{ext}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment