scamp_extensions.pitch.utilities

Module containing pitch-related utility functions, such as those that convert between midi and hertz.

Functions

bark_to_freq(b)

Converts a Bark number to its corresponding frequency in hertz.

cents_to_ratio(cents)

Given a number of cents, convert it to a corresponding frequency ratio.

freq_to_bark(f)

Converts a frequency in hertz to a (floating point) Bark number according to the psychoacoustic Bark scale (https://en.wikipedia.org/wiki/Bark_scale).

hertz_to_midi(hertz_value[, A])

Given a frequency in hertz, returns the corresponding (floating point) MIDI pitch.

map_keyboard_to_microtonal_pitches(...[, ...])

Given a list of microtonal (floating-point) MIDI pitches, finds an efficient map from keyboard-friendly (integer) pitches to the original microtonal pitches.

midi_to_hertz(midi_value[, A])

Given a MIDI pitch, returns the corresponding frequency in hertz.

note_name_to_number(note_name)

Converts a note name (e.g.

ratio_to_cents(ratio)

Given a frequency ratio, convert it to a corresponding number of cents.