#include "transport.hh"
Classes | |
struct | Beat |
struct | Time |
Public Member Functions | |
int32 | bar_from_tick (int64 tick) const |
int32 | bar_ticks () const |
int64 | bar_to_tick (int32 bar) const |
Beat | beat_from_tick (int64 tick) const |
int32 | beat_ticks () const |
int64 | beat_to_tick (const Beat &beat) const |
const uint8 & | beat_unit () const |
const uint8 & | beats_per_bar () const |
double | bpm () const |
double | inv_samplerate () const |
TickSignature & | operator= (const TickSignature &src) |
int64 | sample_from_tick (int64 tick) const |
int64 | sample_to_tick (int64 sample) const |
double | samplerate () const |
void | set_bpm (double bpm) |
void | set_samplerate (uint samplerate) |
bool | set_signature (uint8 beats_per_bar, uint8 beat_unit) |
int64 | start_offset () const |
double | ticks_per_sample () const |
TickSignature () | |
TickSignature (const TickSignature &other) | |
TickSignature (double bpm, uint8 beats_per_bar, uint8 beat_unit) | |
Time | time_from_tick (int64 tick) const |
int64 | time_to_tick (const Time &time) const |
Protected Attributes | |
int32 | bar_ticks_ |
int32 | beat_ticks_ |
uint8 | beat_unit_ |
uint8 | beats_per_bar_ |
double | bpm_ |
double | inv_samplerate_ |
double | inv_ticks_per_second_ |
double | sample_per_ticks_ |
int32 | samplerate_ |
int64 | ticks_per_minute_ |
double | ticks_per_sample_ |
double | ticks_per_second_ |
Static Protected Attributes | |
static constexpr const int64 | offset_ |
Musical time signature and tick conversions.
TickSignature | ( | ) |
TickSignature | ( | double | bpm, |
uint8 | beats_per_bar, | ||
uint8 | beat_unit | ||
) |
TickSignature | ( | const TickSignature & | other | ) |
double samplerate | ( | ) | const |
double inv_samplerate | ( | ) | const |
double ticks_per_sample | ( | ) | const |
double bpm | ( | ) | const |
int32 bar_ticks | ( | ) | const |
int32 beat_ticks | ( | ) | const |
int64 start_offset | ( | ) | const |
void set_samplerate | ( | uint | samplerate | ) |
Assign sample rate.
void set_bpm | ( | double | bpm | ) |
Assign tempo in beats per minute.
TickSignature::Time time_from_tick | ( | int64 | tick | ) | const |
Calculate time from tick, requires set_bpm().
Assign time signature and offset for the signature to take effect.
const uint8 & beats_per_bar | ( | ) | const |
const uint8 & beat_unit | ( | ) | const |
Calculate bar from tick, requires set_signature().
Calculate tick from bar, requires set_signature().
TickSignature::Beat beat_from_tick | ( | int64 | tick | ) | const |
Calculate beat from tick, requires set_signature().
Calculate tick from beat, requires set_signature().
TickSignature & operator= | ( | const TickSignature & | src | ) |
|
staticconstexprprotected |
|
protected |
Upper numeral (numerator), how many beats constitute a bar.
|
protected |
Lower numeral (denominator in [1 2 4 8 16]), note value that represents one beat.
|
protected |
|
protected |
|
protected |
Sample rate (mixing frequency) in Hz.
|
protected |
Current tempo in beats per minute.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Precalculated `1.0 / samplerate`.