Jeremy Mates > Music-Tension > Music::Tension

Download:
Music-Tension-0.68.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.68   Source  

NAME ^

Music::Tension - music tension analysis

SYNOPSIS ^

Beta interface! May change without notice!

  my $t = Music::Tension ();
  $t->pitch2freq(60);
  $t->freq2pitch(440);


  my $ct = Music::Tension::Cope ();
  $ct->... # see that module for details

  my $plt = Music::Tension::PlompLevelt ();
  $plt->... # see that module for details

DESCRIPTION ^

Music tension (dissonance) analysis. This module merely provides pitch and frequency conversion routines. The other modules under this distribution provide various algorithms that produce a number for how consonant or dissonant a chord or other musical events are, presumably for use in musical analysis or composition.

The numbers produced by one module can only be used in comparison with other musical events calculated by the same module; no attempt has been made to correlate the output of any overlapping methods between the different modules. (Though comparisons may be interesting.)

SUB-MODULES

If you have ideas for a new tension analysis module, please let me know, so it can be included in this distribution, or locate it outside of the Music::Tension::* space.

METHODS ^

Any method may croak if something is awry with the input. These methods are inherited by the sub-modules.

new optional params

Constructor. Accepts an optional parameter to change the reference frequency use by the frequency/pitch conversion calls (440 by default).

  my $t = Music::Tension->new(reference_frequency => 442);
freq2pitch frequency

Given a frequency (Hz), returns the integer pitch number (which might also be a MIDI number, unless that range is execeeded somehow). Fractional pitch results are rounded to the nearest pitch number. (I'm not sure if the standard practice is to round or truncate the conversion, so I guessed to round.)

pitch2freq pitch

Given a pitch number (a positive integer, perhaps from the MIDI numbers range), returns the frequency (Hz).

SEE ALSO ^

AUTHOR ^

Jeremy Mates, <jmates@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2012-2013 by Jeremy Mates

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: