Tuning and Notation
audio_samples.notation holds tuning systems, the Functional Just System, svara, mela and thaat names, and note names with key, cents and octave options.
Tuning systems and musical notation: interval generators, Functional Just System, svara, mela and thaat names.
- audio_samples.notation.fifths_to_note(*, unison, fifths, unicode=True)
The note a number of perfect fifths from a unison.
- audio_samples.notation.hz_to_fjs(frequencies, *, fmin=None, unison=None, unicode=False)
The Functional Just System spelling of frequencies relative to a reference.
- Parameters:
frequencies (float |
array_like) – In Hz.fmin (Optional[float]) – The frequency of ratio 1. Default: the smallest input.
unison (Optional[str]) – The note of ratio 1. Default: nearest note to
fmin.unicode (bool) – As for
interval_to_fjs(). Default false.
- Returns:
The spelling, the shape of the input.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.hz_to_note(hz, *, octave=True, cents=False, key='C:maj', unicode=False)
The name of a frequency.
- Parameters:
hz (float |
array_like) – Frequencies in Hz.octave – As
midi_to_note.cents – As
midi_to_note.key – As
midi_to_note.unicode – As
midi_to_note.
- Returns:
The names.
- Return type:
- audio_samples.notation.hz_to_svara_c(frequencies, *, Sa, mela, abbr=True, octave=True, unicode=True)
The Carnatic svara of frequencies within a melakarta raga.
- Parameters:
frequencies (float |
array_like) – In Hz.Sa (float) – The frequency of Sa, in Hz.
abbr – As for
midi_to_svara_h().octave – As for
midi_to_svara_h().unicode – As for
midi_to_svara_h().
- Returns:
The svara, the shape of the input.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.hz_to_svara_h(frequencies, *, Sa, abbr=True, octave=True, unicode=True)
The Hindustani svara of frequencies.
- Parameters:
frequencies (float |
array_like) – In Hz.Sa (float) – The frequency of Sa, in Hz.
abbr – As for
midi_to_svara_h().octave – As for
midi_to_svara_h().unicode – As for
midi_to_svara_h().
- Returns:
The svara, the shape of the input.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.interval_frequencies(n_bins, *, fmin, intervals, bins_per_octave=12, tuning=0.0, sort=True)
Frequencies of a tuning system over several octaves.
- Parameters:
n_bins (int) – Number of frequencies.
fmin (float) – The lowest frequency, in Hz.
intervals (str |
array_like) –"equal","pythagorean","ji3","ji5","ji7", or the ratios of one octave.bins_per_octave (int) – Intervals per octave. Default 12.
tuning (float) – Offset of equal temperament in fractions of a bin.
sort (bool) – In increasing order. Default true.
- Returns:
The frequencies.
- Return type:
numpy.ndarray[float64]
- audio_samples.notation.interval_to_fjs(interval, *, unison='C', tolerance=1.0317460317460319, unicode=True)
The Functional Just System spelling of an interval.
Ratios built from the primes up to 23 are recognised, to six decimal places.
- Parameters:
- Returns:
The spelling, the shape of the input.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.list_mela()
The 72 melakarta ragas and their numbers.
- audio_samples.notation.list_thaat()
The ten thaats, by name.
- audio_samples.notation.mela_to_degrees(mela)
The scale degrees of a melakarta raga, in semitones above Sa.
- Parameters:
mela (int | str) – The raga’s number, from 1 to 72, or its name.
- Returns:
Seven degrees.
- Return type:
numpy.ndarray[int64]
- audio_samples.notation.mela_to_svara(mela, *, abbr=True, unicode=True)
The names of the twelve svaras of a melakarta raga, from Sa.
- audio_samples.notation.midi_to_note(midi, *, octave=True, cents=False, key='C:maj', unicode=False)
The name of a MIDI number.
- Parameters:
midi (float |
array_like) – MIDI numbers. A value that is not finite gives"".octave (bool) – Include the octave. Default True.
cents (bool) – Include the deviation in cents, such as
"A4+25". Needsoctave.key (str) – The key, such as
"F:maj", that decides the spelling. Default"C:maj".unicode (bool) – Unicode accidentals; otherwise ASCII
#andb. Default False.
- Returns:
The names.
- Return type:
- audio_samples.notation.midi_to_svara_c(midi, *, Sa, mela, abbr=True, octave=True, unicode=True)
The Carnatic svara of MIDI numbers within a melakarta raga.
- Parameters:
midi (float |
array_like) – MIDI numbers; a non-finite value gives"".Sa (float) – The MIDI number of Sa.
abbr – As for
midi_to_svara_h().octave – As for
midi_to_svara_h().unicode – As for
midi_to_svara_h().
- Returns:
The svara, the shape of the input.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.midi_to_svara_h(midi, *, Sa, abbr=True, octave=True, unicode=True)
The Hindustani svara of MIDI numbers.
- Parameters:
- Returns:
The svara, the shape of the input.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.note_to_hz(note, *, round_midi=False)
The frequency of a note name.
- Parameters:
- Returns:
The frequencies in Hz.
- Return type:
- audio_samples.notation.note_to_midi(note, *, round_midi=True)
The MIDI number of a note name.
- Parameters:
- Returns:
The numbers.
- Return type:
- audio_samples.notation.note_to_svara_c(notes, *, Sa, mela, abbr=True, octave=True, unicode=True)
The Carnatic svara of note names within a melakarta raga.
- Parameters:
Sa (str) – The note of Sa.
abbr – As for
midi_to_svara_h().octave – As for
midi_to_svara_h().unicode – As for
midi_to_svara_h().
- Returns:
The svara.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.note_to_svara_h(notes, *, Sa, abbr=True, octave=True, unicode=True)
The Hindustani svara of note names.
- Parameters:
Sa (str) – The note of Sa.
abbr – As for
midi_to_svara_h().octave – As for
midi_to_svara_h().unicode – As for
midi_to_svara_h().
- Returns:
The svara.
- Return type:
str | numpy.ndarray[str]
- audio_samples.notation.plimit_intervals(*, primes, bins_per_octave=12, sort=True, return_factors=False)
One octave of a just-intonation system over the given primes.
- Parameters:
- Returns:
Ratios in
[1, 2), or factors.- Return type:
numpy.ndarray[float64] | list[dict[int, int]]
- audio_samples.notation.pythagorean_intervals(*, bins_per_octave=12, sort=True, return_factors=False)
One octave of the Pythagorean tuning.
- Parameters:
- Returns:
Ratios in
[1, 2), or factors.- Return type:
numpy.ndarray[float64] | list[dict[int, int]]
- audio_samples.notation.thaat_to_degrees(thaat)
The scale degrees of a thaat, in semitones above Sa.
- Parameters:
thaat (str) – Its name, in any letter case.
- Returns:
Seven degrees.
- Return type:
numpy.ndarray[int64]