Looking at
CPAN,
MIDI::Perl seems to the most comprehensive package, at least as far as MIDI is concerned. As for other media, Audio::DSP, Audio::Tools, and Audio::CoolEdit may prove interesting. I'm not sure what other help to offer besides STFW (search the 'friendly' web). Experimentation is the best way to learn new things.
Good luck composing!