I had to apply an old programmer adage
to your blocks:
If in doubt
rip it out
(not so good advice for my dentist)
The whole approach of tracking the radius to decide where you
are in a cycle is fragile, because you can easily miss
a particular radius value (the clock isn't fast enough)
and it doesn't distinguish between upward and downward slopes
It's much simpler to just use the elapsed amount of time
and the seconds per rep (repetition).
The floor() function (or round) or ceiling() function
applied to elapsed seconds / seconds per rep
gives you a clean current count for comparison purposes.
(I see you switched from beats per minute to seconds,
so I assume this is for slower exercises like bar bells,
where it takes multiple seconds to complete each repetition.)
Regarding the different canvas sizes,
I removed a block where I presumptuously
assume Portrait mode, setting Canvas Height to Width,
and instead used the minimum of Height and Width to determine
Regarding starting the radius at 0,
I achieved this by introducing a constant
phase_offset, initially -90 degrees, to shift the sine wave
to make it start at a trough, instead of in the middle of its
I also reset the constant 30 to 60 where you turn
seconds to minutes. I am holding to
the full sine wave cycle in my presentation,
not just an ascending phase. Any other interpretation
opens up a can of worms.
I am unsure about the purpose of your hold spinner.
I assume it is meant to limit how many seconds the exercise
is allowed to run?
I saw no point to the Clock for the Hold function, so
I ripped it out.