Could someone explain the timebase and phase offset variables in beatsin8():

Could someone explain the timebase and phase offset variables in beatsin8(): LIB8STATIC uint8_t beatsin8( accum88 beats_per_minute, uint8_t lowest = 0, uint8_t highest = 255,
uint32_t timebase = 0, uint8_t phase_offset = 0)

I am trying to trigger a light at a specific point, but I want it to start at lowest brightness. I was hoping that resetting the timer through:

#define USE_GET_MILLISECOND_TIMER 1

and

uint32_t get_millisecond_timer()
{
return millis() - resetTime;
}

would do the trick but it seems to reset to the top of the sine curve (full brightness), not the bottom (low brightness) which is what I’m looking for.

Setting the time base to millis() should zero out the beat.
uint8_t wave = beatsin8(60, 0, 255, millis());

Then try adding 64, 128, or 192 and see if that gives what you want.
uint8_t wave = beatsin8(60, 0, 255, millis(), 128);

feeding millis() inside beatsin8 seems to just freeze (or keep resetting) the beat, but using “USE_GET_MILLISECOND_TIMER 1” and 192 as phase shift seems to give me what I was seeking.

Thanks for the help!

i’m using uint8_t beat1 = beatsin8( BPM, DIMMEST, BRIGHTEST,0,192);

so 0 for timebase