MIDI::Chord::Guitar - MIDI pitches for guitar chord voicings
version 0.0607
use MIDI::Chord::Guitar; my $mcg = MIDI::Chord::Guitar->new; my $chords = $mcg->transform('D3', 'dim7'); my $chord = $mcg->transform('D3', 'dim7', 0); # MIDI: #$score->n('wn', @$chord); my $fingerings = $mcg->fingering('D3', 'dim7'); my $fingering = $mcg->fingering('D3', 'dim7', 0); my $voicings = $mcg->voicings('dim7'); $voicings = $mcg->voicings('dim7', 'ISO');
MIDI::Chord::Guitar provides MIDI pitch numbers for common chord voicings of an E A D G B E tuned guitar.
MIDI::Chord::Guitar
E A D G B E
Here is a handy diagram of ISO MIDI pitches laid out on a guitar neck:
And here is a companion diagram of MIDI pitch numbers laid out on a guitar neck:
In order to craft a MIDI-Perl program with appropriate transformations, cross-reference the voicing CSV included in this distribution, with the diagrams above. Check out the fingering column, and choose the best voicing to use.
Alternatively, inspect the results of the fingering method for each chord, and select those that are appropriate.
fingering
For guitar, "appropriate" means to consider bass movement and melodic phrasing, etc.
$file = $mcg->voicing_file;
The CSV file with which to find the MIDI numbered chord voicings.
If not given, the installed File::ShareDir CSV file is used.
$chords = $mcg->chords;
Computed attribute, containing the fingerings and voicings for all known chords, available after construction.
$chord = $mcg->transform($target, $chord_name, $variation); $chords = $mcg->transform($target, $chord_name);
Find the chord given the target, chord_name and an optional variation.
The target must be in the format of an ISO note (e.g. on the guitar, a C note is represented by C3, C4, C5, etc).
ISO
C3
C4
C5
If no chord_name is given, major is used.
major
If no variation is given, all transformed voicings are returned.
For example, here are the open major chord specs for each note in the key of C:
'C3', '', 0 'D3', '', 4 'E2', '', 3 'F2', '', 3 'G2', '', 2 'A2', '', 1 'B2', '', 1
$mcg->voicings($chord_name); $mcg->voicings($chord_name, $format);
Return all the voicings of a given chord_name in the key of C.
The default format is midinum but can be given as ISO or midi to return named notes with octaves.
midinum
midi
The order of the voicing variations of a chord is by fret position. So, the first variations are at lower frets.
Here is an example of the voicing CSV file which can be found with the voicing_file attribute:
C,x32010-1,48,52,55,60,, C,x13331-3,48,55,60,64,67, C,431114-5,48,52,55,60,64,72 C,133211-8,48,55,60,64,67,72 C,xx1343-10,60,67,72,76,, C7,x32310-1,48,52,58,60,64, C7,x13131-3,48,55,58,64,67, C7,431112-5,48,52,55,60,64,70 C7,131211-8,48,55,58,64,70,72 C7,xx1323-10,60,67,70,76,, ...
Check out the links in the "SEE ALSO" section for the chord shapes used to create this.
$fingering = $mcg->fingering($target, $chord_name, $variation); $fingerings = $mcg->fingering($target, $chord_name);
As with the transform method, but for neck position, finger placement.
transform
The t/01-methods.t and eg/* files in this distribution
The CSV of chords used by this module (with the voicing_file attribute)
voicing_file
File::ShareDir
List::Util
Moo
Music::Note
Text::CSV_XS
https://www.guitartricks.com/chords/C-chord shapes
https://www.oolimo.com/guitarchords/C shapes
Gene Boggs <gene@cpan.org>
This software is copyright (c) 2021 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 MIDI::Chord::Guitar, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MIDI::Chord::Guitar
CPAN shell
perl -MCPAN -e shell install MIDI::Chord::Guitar
For more information on module installation, please visit the detailed CPAN module installation guide.