Music::Interval::Barycentric - Compute barycentric musical interval space
version 0.0400
use Music::Interval::Barycentric; my @chords = ([3,4,5], [0,4,7]); # Given in "pitch-class notation" my $dist = distance(@chords); $dist = orbit_distance(@chords); $dist = forte_distance(@chords); my $even = evenness_index($chords[0]); my @cycles = cyclic_permutation($chords[0]); # [3,4,5], [5,3,4], [4,5,3] my @center = barycenter(scalar @{ $chords[0] }); # [4,4,4]
Barycentric chord analysis
From the book (linked below):
"An intervallic representation of the chord leads naturally to a discrete barycentric condition. This condition itself leads to a convenient geometric representation of the chordal space as a simplicial grid.
Chords appear as points in this grid and musical inversions of the chord would generate beautiful polyhedra inscribed in concentric spheres centered at the barycenter. The radii of these spheres would effectively quantify the evenness and thus the consonance of the chord."
@point = barycenter; @point = barycenter($chord_size); @point = barycenter($chord_size, $scale_notes);
Return the barycenter (the "central coordinate") given an optional integer representing the number of notes in a chord, and an optional number of notes in the scale.
Defaults:
chord_size: 3 scale_notes: 12
$d = distance($chord1, $chord2);
Common Euclidean space distance metric between chords (vectors).
This function takes two array references representing chords.
$d = orbit_distance($chord1, $chord2);
Return the distance from chord1 to the minimum of the cyclic permutations for chord2.
chord1
chord2
$d = forte_distance($chord1, $chord2);
Return the distance from chord1 to the minimum of the cyclic permutations and reverse cyclic permutations for chord2.
@cycles = cyclic_permutation(@intervals);
Return the list of cyclic permutations of the given intervals.
This function takes a list of array references representing chords.
$e = evenness_index($chord);
Return a chord distance from the barycenter.
This function takes an array reference representing a chord.
my $inverted = inversion($chord);
"The inversion of a chord is formed by displaying the "retrograde" representation of the original chord."
The t/01-functions.t and eg/* programs in this distribution.
http://www.amazon.com/Geometry-Musical-Chords-Interval-Representation/dp/145022797X "A New Geometry of Musical Chords in Interval Representation: Dissonance, Enrichment, Degeneracy and Complementation"
Gene Boggs <gene@cpan.org>
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.
To install Music::Interval::Barycentric, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Music::Interval::Barycentric
CPAN shell
perl -MCPAN -e shell install Music::Interval::Barycentric
For more information on module installation, please visit the detailed CPAN module installation guide.