I have a question about beatsin* family of functions.

I have a question about beatsin* family of functions.
The very last parameter is “phase_offset” (default value is 0).
What is format here, what units?
I would like to generate two sins the same beat rate but opposite phases, phase shift is 180 degrees, what should I use as phase_offset?

sin1 = beatsin16(60, 0, 255, 0, 0); //first sin
sin2 = beatsin16(60, 0, 255, 0, 0/?/); //second sin

I believe I’ve got it…

Both parameters, “timebase” and “phase_offset”, are for shifting the phase, but units are different. Real shift of the phase is affected by all two of them.

“timebase” parameter specifies in mS. So, for 60 Beats Per Minute (1Hz) counter-phase (half-circle) value is 500. For 30 BPM counter-phase value is 1000.

“phase_offset” is mapped to max 8 or 16 bit value, so counter-phase value is 128 for 8-bit function and 32768 for 16-bit function.

Both parameters are applying together, so for beatsin8 with 60 BPM setting both as half-circle (timebase=500 and phase_offset=128) will give you no phase shift.

Good info, thank you @Serge_Skorodinsky