notated_pitch
- pitchtools.notated_pitch(pitch, semitone_divisions=4)[source]
Convert a note or a (fractional) midinote to a NotatedPitch
- Parameters:
pitch (
Union
[float
,str
]) – a midinote as float (60=4C), or a notenamesemitone_divisions – number of divisions per semitone (only relevant when passing a midinote as pitch
- Return type:
- Returns:
the corresponding pitch as NotatedPitch
See also
Example
>>> notated_pitch("4C#+15") NotatedPitch(octave=4, diatonic_index=0, diatonic_name='C', chromatic_index=1, chromatic_name='C#', diatonic_alteration=1.15, chromatic_alteration=0.15, accidental_name='sharp-up') >>> notated_pitch("4Db+15") NotatedPitch(octave=4, diatonic_index=1, diatonic_name='D', chromatic_index=1, chromatic_name='Db', diatonic_alteration=-0.85, chromatic_alteration=0.15, accidental_name='flat-up')