Music::Chord::Progression::Transform - Generate transformed chord progressions
version 0.0107
use MIDI::Util qw(setup_score midi_format); use Music::Chord::Progression::Transform (); my $prog = Music::Chord::Progression::Transform->new; my $chords = $prog->generate; $chords = $prog->circular; # render a midi file my $score = setup_score(); $score->n('wn', midi_format(@$_)) for @$chords; $score->write_score('transform.mid');
The Music::Chord::Progression::Transform module generates transposed and Neo-Riemann chord progressions.
Music::Chord::Progression::Transform
$base_note = $prog->base_note;
The initial isobase, capitalized note on which the progression starts.
isobase
Default: C
C
$base_octave = $prog->base_octave;
The initial note octave on which the progression starts.
Default: 4
4
$chord_quality = $prog->chord_quality;
The quality or "flavor" of the initial chord.
For Neo-Riemann operations on triads, the quality must be either major ('') or minor ('m'). For seventh chords, use a quality of 7. For transposition operations, anything goes.
''
'm'
7
Please see the Music::Chord::Note module for a list of the known chords, like m for "minor" or 7 for a seventh chord, etc.
m
Default: '' (major)
$base_chord = $prog->base_chord;
The initial chord given by the base_note, base_octave, and the chord_quality.
$format = $prog->format;
The format of the returned results, as either named ISO notes or midinum integers.
ISO
midinum
Default: ISO
$semitones = $transpose->semitones;
The number of positive and negative semitones for a transposition transformation. That is, this is a +/- bound on the T transformations.
T
Default: 7 (a perfect 5th)
$max = $prog->max;
The number of circular transformations to make.
$allowed = $prog->allowed;
The allowed transformations. Currently this is either T for transposition, N for Neo-Riemannian, or both.
N
Default: T N
T N
$transforms = $prog->transforms;
The array-reference of T# transposed and Neo-Riemann transformations that define the chord progression.
T#
The T# transformations are a series of transposition operations, where # is a positive or negative number between +/- semitones.
#
For Neo-Riemann transformations, please see the Music::NeoRiemannianTonnetz module for the allowed operations.
Additionally the "non-transformation" operations are included: O returns to the initial chord, and I is the identity that leaves the current chord untouched.
O
I
This can also be given as an integer, which defines the number of random transformations to perform.
$verbose = $prog->verbose;
Show progress.
Default: 0
0
$prog = Music::Chord::Progression::Transform->new; # use defaults $prog = Music::Chord::Progression::Transform->new( # override defaults base_note => 'Bb', base_octave => 5, chord_quality => '7', format => 'midinum', max => 12, allowed => ['T'], transforms => [qw(O T1 T2 T3)], );
Create a new Music::Chord::Progression::Transform object.
$chords = $prog->generate;
Generate a linear series of transformed chords.
$chords = $prog->circular;
Generate a series of transformed chords based on a circular list of transformations.
This method defines movement over a circular list ("necklace") of chord transformations, including O, which means "return to the original chord", and I which means to "make no transformation." Starting at position zero, move forward or backward along the necklace, transforming the current chord.
The t/01-methods.t and eg/* files
Carp
Data::Dumper::Compact
Moo
Music::MelodicDevice::Transposition
Music::NeoRiemannianTonnetz
Music::Chord::Note
Music::Chord::Namer
https://viva.pressbooks.pub/openmusictheory/chapter/neo-riemannian-triadic-progressions/
Gene Boggs <gene@cpan.org>
This software is Copyright (c) 2023 by Gene Boggs.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Music::Chord::Progression::Transform, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Music::Chord::Progression::Transform
CPAN shell
perl -MCPAN -e shell install Music::Chord::Progression::Transform
For more information on module installation, please visit the detailed CPAN module installation guide.