The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Music::Intervals::Numeric - Breakdown of numeric musical intervals

VERSION

version 0.0905

SYNOPSIS

  use Music::Intervals::Numeric;

  my $m = Music::Intervals::Numeric->new(
    notes => [qw( 1/1 6/5 3/2 15/8 )],
  );

  print Dumper(
    $m->frequencies,
    $m->intervals,
    $m->cent_vals,
    $m->prime_factor,
  );

  my $interval = $m->ratios->{'5/4'};

DESCRIPTION

A Music::Intervals object shows the mathematical break-down of musical intervals given as integer ratios.

ATTRIBUTES

notes

The actual notes to use in the computation

Default: [ 1/1 5/4 3/2 ] (C E G)

The list of notes may be any of the keys in the Music::Intervals::Ratio ratio hashref. This is very very long and contains useful intervals such as those of the common scale and even the Pythagorean intervals, too.

ratios

Musical ratios keyed by interval fractions. Computed attribute if not given.

METHODS

new

  $x = Music::Intervals->new(%arguments);

Create a new Music::Intervals object.

cent_vals

Show cents.

frequencies

Show frequencies.

intervals

Show intervals.

prime_factor

Show the prime factorization.

dyads

Return pairs of the given combinations with fractional and pitch ratio parts.

ratio_factorize

Return the dyadic fraction as a prime factored expression.

SEE ALSO

Music::Intervals

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2022 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.