I have experimented with MIDI, but the results aren't a complete solution:
But this is sooooo lousy compared to what a MIDI software package offers (of course, I really shouldn't knock free software either). I think the best use of Perl for MIDI is to create patterns of notes that can be derived from a mathematical sense - like generating scales of notes based from trigonometric functions or other such methods.use MIDI; use Data::Dumper; use strict; my $file = 'chimes.mid'; my $opus = MIDI::Opus->new({from_file=>$file}); # dump the contents of the events $opus->dump({flat=>1}); # example output (minus the header added by me) EVENT dtime channel note velocity ----------------------------------------------------------- text_event 0 (coded at Thu May 31 13:44:10 2001 ) patch_change 0 1 8 note_on 0 1 25 96 note_off 96 1 25 0 note_on 0 1 29 96 note_off 96 1 29 0 note_on 0 1 27 96 note_off 96 1 27 0 # print the notes as png file: 'experimental' according to docs # draw() returns a reference to a GD object my $im = $opus->draw; open(OUT, ">mid.png"); binmode(OUT); print OUT $im->png; close(OUT); # this produces an image like this +------------------------------------+ | | | ------------ | | ------------| |------------ | | | +------------------------------------+
I am also anticipating that XML will help revolutionize the ease of displaying MIDI event information.
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
In reply to (jeffa) Re: Dealing with MIDI
by jeffa
in thread Dealing with MIDI
by asiufy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |