Last active
June 24, 2019 21:29
-
-
Save hadess/59cda27c83f3555966b8d1df85422c13 to your computer and use it in GitHub Desktop.
SMF (Standard Midi File) 1 format to SMF 0 format converter using ALSA's arecordmidi
This file contains 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
#!/bin/sh | |
# | |
# Adapted from https://music.stackexchange.com/questions/39040/how-can-i-convert-a-standard-midi-file-from-type-1-to-type-0 | |
if [ $# != 2 ] ; then | |
echo "Usage: $0 infile.mid outfile.mid" | |
exit 1 | |
fi | |
arecordmidi -p 14:0 "$2" & | |
PORT=`aplaymidi -l | grep arecordmidi | cut -d " " -f 1` # to identify 'arecordmidi port 0' device (e.g. 129:0) | |
aplaymidi -p $PORT "$1" | |
kill %% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment