#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

#197 in Audio

44 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.4–1MB
~22K SLoC