OpenWareLaboratory
TapTempo Class Reference
Inheritance diagram for TapTempo:

Public Member Functions

void clock ()
 
void clock (size_t steps)
 
float getBeatsPerMinute ()
 Get tap tempo in BPM. More...
 
float getFrequency ()
 Get tap tempo frequency. More...
 
size_t getPeriodInSamples ()
 Get tap tempo period in samples. More...
 
bool isOn ()
 
void setBeatsPerMinute (float bpm)
 Set tap tempo in BPM. More...
 
void setFrequency (float freq)
 Set tap tempo frequency. More...
 
void setPeriodInSamples (size_t value)
 Set tap tempo period in samples. More...
 
 TapTempo (float sr, size_t limit)
 
 TapTempo (float sr, size_t min, size_t max)
 
void trigger (bool on)
 
void trigger (bool on, int delay)
 

Static Public Member Functions

static float bpmToFrequency (float bpm)
 
static float bpmToSamplePeriod (float bpm, float sr)
 
static TapTempocreate (float sr, size_t max_limit)
 
static TapTempocreate (float sr, size_t min, size_t max)
 
static void destroy (TapTempo *obj)
 
static float frequencyToBpm (float freq)
 
static float frequencyToSamplePeriod (float hz, float sr)
 
static float samplePeriodToBpm (float samples, float sr)
 

Protected Attributes

bool ison
 
const size_t max_limit
 
const size_t min_limit
 
size_t samples
 
const float sr
 
size_t trig
 

Detailed Description

Definition at line 4 of file TapTempo.h.

Constructor & Destructor Documentation

◆ TapTempo() [1/2]

TapTempo::TapTempo ( float  sr,
size_t  limit 
)
inline

Definition at line 13 of file TapTempo.h.

Referenced by create().

◆ TapTempo() [2/2]

TapTempo::TapTempo ( float  sr,
size_t  min,
size_t  max 
)
inline

Definition at line 16 of file TapTempo.h.

Member Function Documentation

◆ bpmToFrequency()

static float TapTempo::bpmToFrequency ( float  bpm)
inlinestatic

Definition at line 79 of file TapTempo.h.

Referenced by bpmToSamplePeriod().

◆ bpmToSamplePeriod()

static float TapTempo::bpmToSamplePeriod ( float  bpm,
float  sr 
)
inlinestatic

Definition at line 88 of file TapTempo.h.

References bpmToFrequency(), and sr.

Referenced by setBeatsPerMinute().

◆ clock() [1/2]

void TapTempo::clock ( )
inline

Definition at line 34 of file TapTempo.h.

References min_limit, and trig.

◆ clock() [2/2]

void TapTempo::clock ( size_t  steps)
inline

Definition at line 38 of file TapTempo.h.

References max_limit, and trig.

◆ create() [1/2]

static TapTempo* TapTempo::create ( float  sr,
size_t  max_limit 
)
inlinestatic

Definition at line 94 of file TapTempo.h.

References max_limit, sr, and TapTempo().

◆ create() [2/2]

static TapTempo* TapTempo::create ( float  sr,
size_t  min,
size_t  max 
)
inlinestatic

Definition at line 97 of file TapTempo.h.

References max, min, sr, and TapTempo().

◆ destroy()

static void TapTempo::destroy ( TapTempo obj)
inlinestatic

Definition at line 100 of file TapTempo.h.

◆ frequencyToBpm()

static float TapTempo::frequencyToBpm ( float  freq)
inlinestatic

Definition at line 82 of file TapTempo.h.

Referenced by samplePeriodToBpm().

◆ frequencyToSamplePeriod()

static float TapTempo::frequencyToSamplePeriod ( float  hz,
float  sr 
)
inlinestatic

Definition at line 85 of file TapTempo.h.

References sr.

◆ getBeatsPerMinute()

float TapTempo::getBeatsPerMinute ( )
inline

Get tap tempo in BPM.

Definition at line 46 of file TapTempo.h.

References samplePeriodToBpm(), samples, and sr.

◆ getFrequency()

float TapTempo::getFrequency ( )
inline

Get tap tempo frequency.

Definition at line 58 of file TapTempo.h.

References samples, and sr.

◆ getPeriodInSamples()

size_t TapTempo::getPeriodInSamples ( )
inline

Get tap tempo period in samples.

Definition at line 70 of file TapTempo.h.

References samples.

◆ isOn()

bool TapTempo::isOn ( )
inline

Definition at line 19 of file TapTempo.h.

References ison.

◆ samplePeriodToBpm()

static float TapTempo::samplePeriodToBpm ( float  samples,
float  sr 
)
inlinestatic

Definition at line 91 of file TapTempo.h.

References frequencyToBpm(), samples, and sr.

Referenced by getBeatsPerMinute().

◆ setBeatsPerMinute()

void TapTempo::setBeatsPerMinute ( float  bpm)
inline

Set tap tempo in BPM.

Definition at line 52 of file TapTempo.h.

References bpmToSamplePeriod(), samples, and sr.

◆ setFrequency()

void TapTempo::setFrequency ( float  freq)
inline

Set tap tempo frequency.

Definition at line 64 of file TapTempo.h.

References samples, and sr.

◆ setPeriodInSamples()

void TapTempo::setPeriodInSamples ( size_t  value)
inline

Set tap tempo period in samples.

Definition at line 76 of file TapTempo.h.

References samples.

◆ trigger() [1/2]

void TapTempo::trigger ( bool  on)
inline

Definition at line 22 of file TapTempo.h.

◆ trigger() [2/2]

void TapTempo::trigger ( bool  on,
int  delay 
)
inline

Definition at line 25 of file TapTempo.h.

References ison, max_limit, min_limit, samples, and trig.

Field Documentation

◆ ison

bool TapTempo::ison
protected

Definition at line 11 of file TapTempo.h.

Referenced by isOn(), and trigger().

◆ max_limit

const size_t TapTempo::max_limit
protected

Definition at line 8 of file TapTempo.h.

Referenced by AdjustableTapTempo::adjustSpeed(), clock(), create(), and trigger().

◆ min_limit

const size_t TapTempo::min_limit
protected

Definition at line 7 of file TapTempo.h.

Referenced by AdjustableTapTempo::adjustSpeed(), clock(), and trigger().

◆ samples

◆ sr

◆ trig

size_t TapTempo::trig
protected

Definition at line 10 of file TapTempo.h.

Referenced by clock(), and trigger().


The documentation for this class was generated from the following file: