NAME

Music::Duration - Add 32nd, 64th and tuple durations to MIDI-Perl

VERSION

version 0.0602

SYNOPSIS

# Compare:
# perl -MMIDI::Simple -MData::Dumper -e'$Data::Dumper::Sortkeys=1; print Dumper \%MIDI::Simple::Length'
# perl -MMusic::Duration -MData::Dumper -e'$Data::Dumper::Sortkeys=1; print Dumper \%MIDI::Simple::Length'

# In a program:
use MIDI::Simple;
use Music::Duration;

Music::Duration::tuple( 'ten', 'z', 5 );

my $black_page = MIDI::Simple->new_score();
# ...
n( 'zten', 'n38' ) for 1 .. 5; # 5 snares in place of an eighth note triplet

DESCRIPTION

This module adds thirty-second and sixty-fourth note divisions to MIDI::Simple. It also adds fractional note divisions with the tuple() function.

32nd durations added:

yn dyn ddyn tyn

64th durations added:

xn dxn ddxn txn

FUNCTION

tuple()

Music::Duration::tuple( 'qn', 'z', 5 );
# $score->n( 'zqn', ... );
Music::Duration::tuple( 'wn', 'z', 5 );
# $score->n( 'zwn', ... );

Add a fractional division to the MIDI::Simple Length hash for a given name and duration.

Musically, this creates a "cluster" of notes in place of the given duration.

A triplet is a 3-tuple.

So in the first example, instead of a quarter note, we instead play 5 beats - a 5-tuple. In the second, instead of a whole note (of four beats), we instead play 5 beats.

SEE ALSO

The Length hash in MIDI::Simple

The code in the t/ directory

https://www.scribd.com/doc/26974069/Frank-Zappa-The-Black-Page-1-Melody-Score

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Gene Boggs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.