Description
Music::Duration::Partition is a Perl module that partitions a musical duration into randomized rhythmic phrases.
Features of the Module
Durations
MIDI-Perl length pool aliases, 'hn' = half-note, 'qn' = quarter-note, 'ten' = triplet eighth-note, etc.
Fine-grained duration control with 'd' and a number of "ticks" (e.g. 'd48'). And there are 96 ticks per quarter-note.
Motif Generation
Create single or multiple, randomized rhythmic phrases ("motifs").
Score Interaction
Add motifs and corresponding voices to a MIDI score.
Quick Example
Basic Usage
use MIDI::Util qw(setup_score);
use Music::Duration::Partition ();
use Music::Scales qw(get_scale_MIDI);
my $score = setup_score();
my $mdp = Music::Duration::Partition->new(
pool => [qw(hn dqn qn en)],
);
my $motif = $mdp->motif;
my @scale = get_scale_MIDI('C', 4, 'major');
my @voices = map { $scale[ int rand @scale ] } @$motif;
$mdp->add_to_score($score, $motif, \@voices);
$score->write_score('duration-partition.mid');
Music-Duration-Partition is available for Mac, Windows, Linux, and BSD distributions through the CPAN.
Powered by Perl
What is Perl?
Perl is a high-level, general-purpose, interpreted, dynamic programming language and was developed by Larry Wall in 1987 as a Unix scripting language to make report processing easier. Since then, Perl has undergone many changes, revisions and is still in active development!
Built with Web::PerlDistSite