Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Mini howto: Midi files and Debian GNU/Linux

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
Rodolfo Medina
Posts: 35
Joined: 2006-05-06 10:39

Mini howto: Midi files and Debian GNU/Linux

#1 Post by Rodolfo Medina »

The present mini howto is to be improved and completed.
Happy linuxing!
Rodolfo


---------------------------------------------------------------------------------
Operating system: Debian GNU/Linux 3.1 ("Sarge") r2, kernel 2.4.

After the Debian base installation, I had chosen the manual
packages selection and installed the following packages:

make gcc less x-window-system gnome-core libc6-dev

. From:

http://www.fourmilab.ch/webtools/midicsv/

I downloaded midicsv-1.0.tar.gz and put it in ~/tmp. To install it,
the packages perl and libc6-dev are necessary. I did:

$ cd ~/tmp
$ tar xzvf midicsv-1.0.tar.gz
$ cd midicsv-1.0
$ make
$ make check
All tests passed.

$ make torture
perl torture.pl | ./csvmidi | tee /tmp/w.mid | ./midicsv | ./csvmidi >/tmp/w1.mid
Torture test passed.

# make install
install -d -m 755 /usr/local/bin
install -m 755 midicsv csvmidi /usr/local/bin
install -d -m 755 /usr/local/man/man1
install -m 644 midicsv.1 csvmidi.1 /usr/local/man/man1
install -d -m 755 /usr/local/man/man5
install -m 644 midicsv.5 /usr/local/man/man5

. So the package was successfully installed. Before removing the
~/tmp/midicsv-1.0 directory I saved apart all the .pl files included in it.
Besides, I created the file cancelchannel.pl and filled it with:




$which_channel = 3;

while ($a = <>) {
if (!($a =~ m/\s*[\#\;]/)) { # Ignore comment lines
if ($a =~ m/\s*\d+\s*,\s*\d+\s*,\s*\w+_c\s*,\s*(\d+)/) {
if ($1 != $which_channel){
print($a);
}
} else {
print($a);
}
}
}





. Look at:

http://www.fourmilab.ch/webtools/midicsv/

. To transpose key of song.mid, I did:

$ midicsv song.mid | perl transpose.pl | csvmidi > tsong.mid

; to cancel the sing channel from song.mid, I did:

$ midicsv song.mid | perl cancelchannel.pl | csvmidi > tsong.mid

; to change the speed of song.mid I did:

$ midicsv song.mid tsong.txt

, then edited the file tsong.txt with my desired tempo
(see `Tempo', section 'midicsv File Format' at:

http://www.fourmilab.ch/webtools/midicsv/

) and then:

$ csvmidi tsong.txt tsong.mid

; to change the speed and also cancel the sing channel, I did:

$ midicsv song.mid tsong.txt

, then edited the file tsong.txt with my desired tempo (see `Tempo',
section 'midicsv File Format' at

http://www.fourmilab.ch/webtools/midicsv/

) and then

$ perl cancelchannel.pl tsong.txt | csvmidi > tsong.mid

. Then,

# apt-get install timidity freepats

. To play mysong.mid, just say:

$ timidity mysong.mid

. To transpose the song one half tone up,

$ timidity -K 1 mysong.mid

. To transpose the song one half tone down,

$ timidity -K -1 mysong.mid

. This will play mysong.mid with 500% volume and trace 4 cancelled:

$ timidity -ia -A500 --trace --mute=4 mysong.mid

. To convert mysong.mid into mysong.wav,

$ timidity -Ow mysong.mid mysong.wav

. Then,

# apt-get install alsaplayer

. To play mysong.wav,

$ alsaplayer mysong.wav

Post Reply