Music::ToRoman - Convert notes and chords to Roman numeral notation
version 0.0701
use Music::ToRoman; my $mtr = Music::ToRoman->new( scale_note => 'A', scale_name => 'minor', ); my $roman = $mtr->parse('Am'); # i (minor) $roman = $mtr->parse('Bo'); # iio (diminished) $roman = $mtr->parse('CM'); # III (major) $roman = $mtr->parse('C'); # III (major) $roman = $mtr->parse('Em7'); # v7 (minor seventh) $roman = $mtr->parse('A+'); # I+ (augmented) $roman = $mtr->parse('BbM'); # bII (flat-two major) $roman = $mtr->parse('Cm9/G'); # iii9/VII # Also: $mtr = Music::ToRoman->new( scale_note => 'A', scale_name => 'dorian', chords => 0, ); $roman = $mtr->parse('A'); # i $roman = $mtr->parse('B'); # ii $roman = $mtr->parse('C'); # III $roman = $mtr->parse('D'); # IV $roman = $mtr->parse('E7'); # v7 $roman = $mtr->parse('F#'); # vi $roman = $mtr->parse('G'); # VII
Music::ToRoman converts chords to Roman numeral notation. Also individual "chordless" notes may be converted given a diatonic mode scale_name.
Music::ToRoman
For example usage, check out the tests for this distribution and the files eg/roman and eg/basslines in Music::BachChoralHarmony.
Note on which the scale is based. This can be one of C, Cb, C#, D, Db, D# ...
Default: C
Name of the scale. The diatonic mode names supported are:
ionian / major dorian phrygian lydian mixolydian aeolian / minor locrian
Default: major
Are we given chords to parse with major ("M") and minor ("m") designations?
Default: 1
If this is set to 0, single notes may be used to return the major/minor Roman numeral for the given diatonic mode scale_name.
$mtr = Music::ToRoman->new(%arguments);
Create a new Music::ToRoman object.
$roman = $mtr->parse($chord);
Parse a note or chord name into a Roman numeral representation.
For instance, the Roman numeral representation for the aeolian (or minor) mode is: i ii III iv v VI VII - where the case indicates the major/minor status of the given chord.
aeolian
This can be overridden by parsing say, BM7 (B major seven), thus producing II7 in the key of A minor.
BM7
II7
As expected, if a major/minor chord designation is not provided, "M" major is assumed.
If the chords attribute is off and a single note is given, the diatonic mode of the scale_name is used to find the correct Roman numeral representation.
Moo
List::MoreUtils
Music::Scales
https://en.wikipedia.org/wiki/Roman_numeral_analysis
Gene Boggs <gene@cpan.org>
This software is copyright (c) 2018 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.
To install Music::ToRoman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Music::ToRoman
CPAN shell
perl -MCPAN -e shell install Music::ToRoman
For more information on module installation, please visit the detailed CPAN module installation guide.