Musical note duration for tempo-synchronized timing.
NoteDuration represents musical time durations (whole notes, quarter notes, etc.) and provides conversion to seconds based on tempo from AudioPlayHead. This is useful for tempo-synced delays, LFOs, arpeggiators, and other time-based effects that need to follow the host DAW's tempo.
Key Features:
- Standard musical note durations (whole, half, quarter, etc.)
- Dotted and triplet variations
- Tempo-synchronized conversion to seconds
- Pre-defined list of common durations
- Support for bars and beats
The class stores duration as bars and beats (quarter notes), then converts to seconds using the current tempo from the host's transport.
Usage:
float seconds = quarterNote.toSeconds(audioPlayhead);
static const std::vector< NoteDuration > & getNoteDurations()
static float toSeconds(juce::AudioPlayHead *playhead, float value)
NoteDuration(const char *name="", float bars=0.0f, float note=0.0f)
- See also
- Parameter, StepLFO