The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Music::Cadence - Provides musical cadence chords

VERSION

version 0.0100

SYNOPSIS

  use Music::Cadence;

  my $mc = Music::Cadence->new;

  my $notes = $mc->cadence(
    key    => 'C',
    scale  => 'major',
    type   => 'perfect',
    octave => 4,
  ); # [['G4','B4','D4'], ['C4','E4','G4']]

  $notes = $mc->cadence(
    key       => 'C',
    scale     => 'major',
    type      => 'imperfect',
    variation => 2,
    octave    => 0,
  ); # [['D','F','A'], ['G','B','D']]

DESCRIPTION

Music::Cadence provides musical cadence chords.

ATTRIBUTES

None.

METHODS

new

  $mc = Music::Cadence->new;

Create a new Music::Cadence object.

cadence

  $notes = $mc->cadence;        # Use defaults

  $notes = $mc->cadence(
    key       => $key,          # Default: C
    scale     => $scale,        # Default: major
    type      => $type,         # Default: perfect
    variation => $variation,    # Default: 0
    octave    => $octave,       # Default: 0
  );

Return an array reference of the notes of the cadence type (and variation when type is imperfect) 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.

Supported cadences are:

  perfect
  imperfect
  plagal
  deceptive

Supported scales are:

  ionian / major
  dorian
  phrygian
  lydian
  mixolydian
  aeolian / minor
  locrian

The variation is a number for each diatonic scale chord to use for the first imperfect 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

Moo

Music::Chord::Note

Music::Scales

Music::ToRoman

https://en.wikipedia.org/wiki/Cadence

https://www.musictheoryacademy.com/how-to-read-sheet-music/cadences/

TO DO

Evaded cadence

Half cadences

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.