Gen~ (Daisy Oopsy) Tempo Flash an LED - with constant "on time"

dlwhite's icon

The goal is to flash an LED to a tempo (range 30-200 bpm). And that LED should always be "on" for the same amount of time regardless of tempo.

Lets assume I want the LED to flash on time for a constant of 75ms. So the "off" time will change length depending on the tempo.

I've looked at cycle, train, triangle, and others, and I can't figure how -in Gen~- to create a constant pulse where the period changes with rate, but the "on" pulse width is constant.

Using cycle, train, or triangle with a >= .7 doesn't work because "on" time changes length... it gets way to long for slower tempos.

Outside of Gen, I'd probably use an edge detector on the tempo signal to trigger a gate that lets through a constant 1 and the gate control would be an inverted, delay bang set to a fixed time to set the gate output to a zero. And the gate output would be the LED input. But none of those operators are in Gen.

Ideas?

Do I have to figure this out in codebox?

👽!t W∆s ∆lienz!👽's icon

you were close with the triangle idea, just need to track the beginning of the clock signal(phasor) to reset an accumulator, match that with your desired length in samples to set the 'off' portion of the cycle starting there:


dlwhite's icon

thanks. That's super helpful. That got me there and 150ms is about the right "on" time for tempos between 30 and 200bpm. I would not have thought about using Delta and a compare to catch the edge of the phasor.