- EVALUATING MIDI EVENTS
- TRANSFORMING MIDI EVENTS
- SEE ALSO
- COPYRIGHT AND LICENSE
MIDI::Tools - Various functions dealing with MIDI Events
use MIDI::Tools qw(...); # too much stuff, see below
MIDI::Tools - Various functions dealing with MIDI events
This is a collection of functions evaluating or transforming lists of MIDI events, probably most useful for algorithmic composition. It is designed to be compatible with Sean M. Burke MIDI-Perl suite of modules.
This module is in an early alpha stage of development. Interfaces are not written in stone yet, and stuff needs to be added. Near-future plans include: Dealing with intervals. Dealing with scales (transpose in scale, measure outsideness). Swingifying. Dealing with Chords.
EVALUATING MIDI EVENTS
All functions take a reference to a list of MIDI events as parameter and return a scalar or list of results.
$count = note_count($events);
Returns number of note_on events (excluding those with a velocity of 0).
($lowest, $highest) = note_range($events);
Returns lowest and highest pitch ocurring in note_on events, or undef if no note_on events occur in $events.
($mean, $stddev) = note_mean($events);
Returns mean and standard deviation of pitches in MIDI note_on events.
TRANSFORMING MIDI EVENTS
All functions take a reference to a list of MIDI events as parameter and modify the events directly.
note_limit($events, $lowest, $highest);
Remove all note_on and note_off events whose pitches lie outside ($lowest .. $highest).
Transpose events by a (positive or negative) number of semitones. Notes will not be transposed below 0 or above 127.
Christian Renz, <firstname.lastname@example.org>
COPYRIGHT AND LICENSE
Copyright 2003 by Christian Renz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.