#frequency #pitch #tuner #encoding #cents #musical-temperament

temperaments

Calculate frequency tables of a wide variety of musical temperaments and calculate cent offsets

4 releases (stable)

1.0.2 Sep 2, 2024
0.1.0 Aug 24, 2024

#195 in Audio

Download history 160/week @ 2024-08-21 319/week @ 2024-08-28 90/week @ 2024-09-04 13/week @ 2024-09-11 8/week @ 2024-09-18 10/week @ 2024-09-25 13/week @ 2024-10-02

75 downloads per month

MIT license

94KB
2.5K SLoC

temperaments crate

Included Temperaments

This crate provides definitions of various historical and modern musical temperments. This crate includes:

  • Equal Temperament
  • Kirnberger II
  • Meantone
    • 1/4 Syntonic Comma
    • 1/5 Syntonic Comma
    • 1/6 Syntonic Comma
    • LucyTuning
  • Pythagorean (1/6 Pythagorean Comma)
  • Vallotti (1/6 Comma)
  • Temperament based on the cover of Bach's Well Tempered Clavier (1722)
  • Werckmeister III
  • Young's No. 2

By implementing your own structs that implement the Temperament trait, you can define your own temperaments!

We have plans to add additional temperaments. If you would like any specific temperament to be added, please file an issue.

Functionality

This crate also provides functionality such as:

  • A table of frequencies for all pitches for any given temperament
  • Adding cents to a frequency
  • Calculating the number of cents between two frequencies
  • Finding the closest note based on a given frequency

Please feel free to file issues for any new feature requests!

Credit

The temperaments in this module are based on research presented in the following resources:

Dependencies

~0.3–1MB
~21K SLoC