NAME
Music::MelodicDevice::Inversion - Apply melodic inversion to a series of notes
VERSION
version 0.0100
SYNOPSIS
use Music::MelodicDevice::Inversion;
my @notes = qw(C4 E4 D4 G4 C5);
my $md = Music::MelodicDevice::Inversion->new(scale_name => 'major');
my $intervals = $md->intervals(\@notes); # [2, -1, 3, 3]
my $inv = $md->invert('C4', \@notes); # [C4, A3, B3, F3, C3]
$md = Music::MelodicDevice::Inversion->new(scale_name => 'chromatic');
$intervals = $md->intervals(\@notes); # [4, -2, 5, 5]
$inv = $md->invert('C4', \@notes); # [C4, G#3, A#3, F3, C3]
DESCRIPTION
Music::MelodicDevice::Inversion
applies intervallic melodic inversions, both chromatic or diatonic, to a series of ISO formatted notes.
While there are a couple modules on CPAN that do various versions of melodic inversion, none appear to apply to an arbitrary series of notes. Hence this module.
ATTRIBUTES
scale_note
Default: C
scale_name
Default: chromatic
verbose
Default: 0
METHODS
new
$md = Music::MelodicDevice::Inversion->new(scale_name => $scale);
Create a new Music::MelodicDevice::Inversion
object.
intervals
$intervals = $md->intervals($notes);
invert
$inverted = $md->invert($note, $notes);
SEE ALSO
Music::AtonalUtil (contains an "invert" method)
MIDI::Praxis::Variation (contains an "inversion" function)
https://en.wikipedia.org/wiki/Inversion_(music)#Melodies
https://music.stackexchange.com/a/32508/6683
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2020 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.