MIDI::Drummer::Tiny::Syncopate - Syncopation logic
version 0.3000
use MIDI::Drummer::Tiny::Syncopate; my $d = MIDI::Drummer::Tiny::Syncopate->new( file => 'syncopate.mid', reverb => 15, ); $d->combinatorial( $d->snare, { repeat => 2, patterns => [qw(0101 1001)], }); # Play parts simultaneously $d->sync( \&snare, \&kick, \&hhat ); sub snare { $d->combinatorial( $d->snare, { count => 1 } ) } sub kick { $d->combinatorial( $d->kick, { negate => 1 } ) } sub hhat { $d->steady( $d->closed_hh ) } $d->write;
MIDI::Drummer::Tiny::Syncopate provides methods to use in the eg/syncopation/* lessons.
MIDI::Drummer::Tiny::Syncopate
$duration = $d->duration;
Default: quarter
quarter
$repeat = $d->repeat;
Default: 4
4
$d = MIDI::Drummer::Tiny::Syncopate->new(%arguments);
Return a new MIDI::Drummer::Tiny::Syncopate object.
$d->steady; $d->steady( $d->kick ); $d->steady( $d->kick, { duration => $d->eighth } );
Play a steady beat with the given instrument and optional duration, for the number of beats accumulated in the object's counter attribute.
Defaults:
instrument: closed_hh Options: duration: given by constructor
$d->combinatorial; $d->combinatorial( $d->kick ); $d->combinatorial( $d->kick, \%options );
Play a beat pattern with the given instrument, given by "variations_with_repetition" in Algorithm::Combinatorics.
This method accumulates beats in the object's counter attribute if the count option is set.
The vary option is a hashref of coderefs, keyed by single character tokens, like the digits, 0-9. The coderef durations should add up to the duration option.
instrument: snare Options: duration: given by constructor count: 0 negate: 0 beats: given by constructor repeat: given by constructor vary: 0 => sub { $self->rest( $options->{duration} ) }, 1 => sub { $self->note( $options->{duration}, $instrument ) }, patterns: undef
The eg/syncopation/* lessons.
MIDI::Util
Moo
https://www.amazon.com/dp/0882847953 - "Progressive Steps to Syncopation for the Modern Drummer"
Gene Boggs <gene@cpan.org>
This software is copyright (c) 2022 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.
To install MIDI::Drummer::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MIDI::Drummer::Tiny
CPAN shell
perl -MCPAN -e shell install MIDI::Drummer::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.