You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
653 B
29 lines
653 B
3 years ago
|
#ifndef _AUDIO_TIMER_H_
|
||
|
#define _AUDIO_TIMER_H_
|
||
3 years ago
|
|
||
3 years ago
|
class AudioTimer : public AudioStream
|
||
3 years ago
|
{
|
||
|
public:
|
||
3 years ago
|
AudioTimer(void):
|
||
3 years ago
|
AudioStream(1, inputQueueArray)
|
||
|
{
|
||
|
tick = 0;
|
||
|
bpm = 60;
|
||
|
sequencer_step_function = NULL;
|
||
|
}
|
||
|
|
||
|
virtual uint32_t get_tick(void);
|
||
|
virtual void set_bpm(uint8_t b);
|
||
3 years ago
|
virtual void function(uint8_t steps, void(*func)());
|
||
3 years ago
|
virtual void update(void);
|
||
|
|
||
|
private:
|
||
|
audio_block_t *inputQueueArray[1];
|
||
|
uint8_t bpm;
|
||
3 years ago
|
uint16_t steps;
|
||
3 years ago
|
void (*sequencer_step_function)();
|
||
|
volatile uint32_t tick;
|
||
|
const float beat = AUDIO_SAMPLE_RATE_EXACT / float(AUDIO_BLOCK_SAMPLES) / 60.0;
|
||
|
};
|
||
|
#endif
|