NAME
Music::Cadence - Provide musical cadence chords
VERSION
version 0.0300
SYNOPSIS
use Music::Cadence;
my $mc = Music::Cadence->new;
my $chords = $mc->cadence(
key => 'C',
scale => 'major',
type => 'perfect',
octave => 4,
); # [['G4','B4','D4'], ['C4','E4','G4']]
$chords = $mc->cadence(
key => 'C',
scale => 'major',
type => 'half',
leading => 2,
octave => 0,
); # [['D','F','A'], ['G','B','D']]
DESCRIPTION
Music::Cadence
provides musical cadence chords.
* This module is a very naive implementation of the actual theory. YMMV.
ATTRIBUTES
None.
METHODS
new
$mc = Music::Cadence->new;
Create a new Music::Cadence
object.
cadence
$chords = $mc->cadence; # Use defaults
$chords = $mc->cadence(
key => $key, # Default: C
scale => $scale, # Default: major
type => $type, # Default: perfect
leading => $leading, # Default: 1
octave => $octave, # Default: 0
variation => $variation, # Default: 1
);
Return an array reference of the chords of the cadence type (and leading chord when type is half
) based on the given key and scale name.
The octave is optional and if given, should be a number greater than or equal to zero.
The variation applies to the deceptive
cadence and determines the final chord. If given as 1
, the vi
chord is used. If given as 2
, the IV
chord is used.
Supported cadences are:
perfect
half
plagal
deceptive
Supported scales are:
ionian / major
dorian
phrygian
lydian
mixolydian
aeolian / minor
locrian
The leading chord is a number for each diatonic scale chord to use for the first half
cadence chord. So for the key of C major
this is:
CM: 1
Dm: 2
Em: 3
FM: 4
GM: 5
Am: 6
Bo: 7
SEE ALSO
The eg/cadence and t/01-methods.t files in this distribution.
https://en.wikipedia.org/wiki/Cadence
https://www.musictheoryacademy.com/how-to-read-sheet-music/cadences/
TO DO
Evaded cadence
Imperfect cadence
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2019 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.