struct
TickSignatureMusical time signature and tick conversions.
Public functions
- auto bar_from_tick(int64 tick) const → int32
- Calculate bar from tick, requires set_
signature(). - auto bar_to_tick(int32 bar) const → int64
- Calculate tick from bar, requires set_
signature(). - auto beat_from_tick(int64 tick) const → Beat
- Calculate beat from tick, requires set_
signature(). - auto beat_to_tick(const Beat& beat) const → int64
- Calculate tick from beat, requires set_
signature(). - void set_bpm(double bpm)
- Assign tempo in beats per minute.
- void set_samplerate(uint samplerate)
- Assign sample rate.
- auto set_signature(uint8 beats_per_bar, uint8 beat_unit) → bool
- Assign time signature and offset for the signature to take effect.
- auto time_from_tick(int64 tick) const → Time
- Calculate time from tick, requires set_
bpm(). - auto time_to_tick(const Time& time) const → int64
- Calculate tick from time, requires set_
bpm().
Protected variables
- uint8 beats_per_bar_
- Upper numeral (numerator), how many beats constitute a bar.
- uint8 beat_unit_
- Lower numeral (denominator in [1 2 4 8 16]), note value that represents one beat.
- int32 samplerate_
- Sample rate (mixing frequency) in Hz.
- double bpm_
- Current tempo in beats per minute.
- double inv_samplerate_
- Precalculated
1.0 / samplerate
.