A library for musical pitch conversions! Provides functions and methods for converting between frequency (hz), midi-step, letter-octave and mels.
Rust
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src
.gitignore
.travis.yml
Cargo.toml
README.md

README.md

pitch_calc Build Status

A library for musical pitch conversions!

pitch_calc provides functions and methods for converting between frequency, midi-step and letter-octave.

It looks like this.

assert!(Hz(440.0).letter_octave() == (A, 4))

Types

  • Hz ("times per second").
  • LetterOctave (musical letter notation).
  • Mel (a perceptual scale of pitches judged by listeners to be equal in distance from one another).
  • Perc (Percentage of the human hearing range (20hz - 20khz)).
  • ScaledPerc (Scaled percentage of the human hearing range).
  • Step (MIDI semitone steps).

Usage

Add the following to your Cargo.toml.

[dependencies.pitch_calc]
git = "https://github.com/RustAudio/pitch_calc"

or

[dependencies]
pitch_calc = "X.X.X"

where "X.X.X" is the version you want (find the latest version in the Cargo.toml).

See the example for a simple demonstration.