Skip to content

Struct Ase::TickSignature

ClassList > Ase > TickSignature

Musical time signature and tick conversions.

  • #include <transport.hh>

Classes

Type Name
struct Beat
struct Time

Public Functions

Type Name
TickSignature ()
TickSignature (double bpm, uint8 beats_per_bar, uint8 beat_unit)
TickSignature (const TickSignature & other)
int32 bar_from_tick (int64 tick) const
Calculate bar from tick, requires set_signature() .
int32 bar_ticks () const
int64 bar_to_tick (int32 bar) const
Calculate tick from bar, requires set_signature() .
Beat beat_from_tick (int64 tick) const
Calculate beat from tick, requires set_signature() .
int32 beat_ticks () const
int64 beat_to_tick (const Beat & beat) const
Calculate tick from beat, requires set_signature() .
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)
Assign tempo in beats per minute.
void set_samplerate (uint samplerate)
Assign sample rate.
bool set_signature (uint8 beats_per_bar, uint8 beat_unit)
Assign time signature and offset for the signature to take effect.
int64 start_offset () const
double ticks_per_sample () const
Time time_from_tick (int64 tick) const
Calculate time from tick, requires set_bpm() .
int64 time_to_tick (const Time & time) const
Calculate tick from time, requires set_bpm() .

Protected Attributes

Type Name
int32 bar_ticks_ = = 0
int32 beat_ticks_ = = 0
uint8 beat_unit_ = = 4
Lower numeral (denominator in [1 2 4 8 16]), note value that represents one beat.
uint8 beats_per_bar_ = = 4
Upper numeral (numerator), how many beats constitute a bar.
double bpm_ = = 0
Current tempo in beats per minute.
double inv_samplerate_
Precalculated 1.0 / samplerate .
double inv_ticks_per_second_ = = 0
double sample_per_ticks_ = = 0
int32 samplerate_ = = 0
Sample rate (mixing frequency) in Hz.
int64 ticks_per_minute_ = = 0
double ticks_per_sample_ = = 0
double ticks_per_second_ = = 0

Protected Static Attributes

Type Name
constexpr const int64 offset_ = = 0

Public Functions Documentation

function TickSignature [1/3]

Ase::TickSignature::TickSignature () 

function TickSignature [2/3]

Ase::TickSignature::TickSignature (
    double bpm,
    uint8 beats_per_bar,
    uint8 beat_unit
) 

function TickSignature [3/3]

Ase::TickSignature::TickSignature (
    const TickSignature & other
) 

function bar_from_tick

int32 Ase::TickSignature::bar_from_tick (
    int64 tick
) const

function bar_ticks

inline int32 Ase::TickSignature::bar_ticks () const

function bar_to_tick

int64 Ase::TickSignature::bar_to_tick (
    int32 bar
) const

function beat_from_tick

Beat Ase::TickSignature::beat_from_tick (
    int64 tick
) const

function beat_ticks

inline int32 Ase::TickSignature::beat_ticks () const

function beat_to_tick

int64 Ase::TickSignature::beat_to_tick (
    const Beat & beat
) const

function beat_unit

inline const uint8 & Ase::TickSignature::beat_unit () const

function beats_per_bar

inline const uint8 & Ase::TickSignature::beats_per_bar () const

function bpm

inline double Ase::TickSignature::bpm () const

function inv_samplerate

inline double Ase::TickSignature::inv_samplerate () const

function operator=

TickSignature & Ase::TickSignature::operator= (
    const TickSignature & src
) 

function sample_from_tick

inline int64 Ase::TickSignature::sample_from_tick (
    int64 tick
) const

function sample_to_tick

inline int64 Ase::TickSignature::sample_to_tick (
    int64 sample
) const

function samplerate

inline double Ase::TickSignature::samplerate () const

function set_bpm

void Ase::TickSignature::set_bpm (
    double bpm
) 

function set_samplerate

void Ase::TickSignature::set_samplerate (
    uint samplerate
) 

function set_signature

bool Ase::TickSignature::set_signature (
    uint8 beats_per_bar,
    uint8 beat_unit
) 

function start_offset

inline int64 Ase::TickSignature::start_offset () const

function ticks_per_sample

inline double Ase::TickSignature::ticks_per_sample () const

function time_from_tick

Time Ase::TickSignature::time_from_tick (
    int64 tick
) const

function time_to_tick

int64 Ase::TickSignature::time_to_tick (
    const Time & time
) const

Protected Attributes Documentation

variable bar_ticks_

int32 Ase::TickSignature::bar_ticks_;

variable beat_ticks_

int32 Ase::TickSignature::beat_ticks_;

variable beat_unit_

uint8 Ase::TickSignature::beat_unit_;

variable beats_per_bar_

uint8 Ase::TickSignature::beats_per_bar_;

variable bpm_

double Ase::TickSignature::bpm_;

variable inv_samplerate_

double Ase::TickSignature::inv_samplerate_;

variable inv_ticks_per_second_

double Ase::TickSignature::inv_ticks_per_second_;

variable sample_per_ticks_

double Ase::TickSignature::sample_per_ticks_;

variable samplerate_

int32 Ase::TickSignature::samplerate_;

variable ticks_per_minute_

int64 Ase::TickSignature::ticks_per_minute_;

variable ticks_per_sample_

double Ase::TickSignature::ticks_per_sample_;

variable ticks_per_second_

double Ase::TickSignature::ticks_per_second_;

Protected Static Attributes Documentation

variable offset_

constexpr const int64 Ase::TickSignature::offset_;


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/transport.hh