Music::Chord::Progression::Transform - Generate transformed chord progressions
version 0.0303
use Music::Chord::Progression::Transform (); my $prog = Music::Chord::Progression::Transform->new; $prog = Music::Chord::Progression::Transform->new( transforms => [qw(L R P T6 R S T-6)], ); my ($generated, $transforms, $chords) = $prog->generate; ($generated, $transforms, $chords) = $prog->circular; # midi use MIDI::Util qw(setup_score); my $score = setup_score(); $score->n('wn', @$_) for @$generated; $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 (but may be immediately transformed by the first operation).
isobase
Default: C (but may be C#, Db, etc.)
C
C#
Db
$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.
This is computed and not a constructor attribute.
$format = $prog->format;
The format of the returned results, as either named ISO notes or midinum integers.
ISO
midinum
Default: midinum
$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 following "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 => '7b5', format => 'ISO', max => 12, allowed => ['T'], transforms => [qw(O T1 T2 T3)], );
Create a new Music::Chord::Progression::Transform object.
($generated, $transforms, $chords) = $prog->generate;
Generate a linear series of transformed chords.
($generated, $transforms, $chords) = $prog->circular;
Generate a circular series of transformed chords.
This method defines movement around a circular list ("necklace") of chord transformations. 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.