musicaiz.structure.NoteTiming¶
- class musicaiz.structure.NoteTiming(pitch: Union[str, int], start: Union[int, float], end: Union[int, float], bpm: int = 120, resolution: int = 96)[source]¶
- __init__(pitch: Union[str, int], start: Union[int, float], end: Union[int, float], bpm: int = 120, resolution: int = 96)[source]¶
- Attributes
- pitch: int
- start: Union[str, int]
the note on. If the input argument is an int we consider that the value correspond to ticks unit, and if the argument is a float we assume the value corresponds to seconds.
- end: Union[int, float]
the note off. If the input argument is an int we consider that the value correspond to ticks unit, and if the argument is a float we assume the value corresponds to seconds.
- delta_time: int
the note duration in 16th notes.
- bpm: int
- the tempo or bpms.
- resolution: int
the pulses o ticks per quarter note (PPQ or TPQN).
- Raises:
ValueError: [description] ValueError: [description]
Methods
__init__
(pitch, start, end[, bpm, resolution])- Attributes
pitch_value_in_range
(pitch_value)split_note_name
(note_name)Splits a note name (C# or Cb...) into a note name (C) and the accidental (# or b ...)
split_pitch_name
(pitch_name)Splits a note name (C#1 or Cb-1...) into a note name (C or Cb ...) and the octave (1 or 1 ...)