Using Tidal to control modular synths with CV

I'm not totally sure how to map a tidal cycle against a super collider envelope...

Env.adsr(0.001, 0.2, 0.25, 1) will output a new ADSR envelope

Screen Shot 2020-05-17 at 2.27.31 pm

I tried looking at various existing synths and issues, but i end up a bit more confused than I started... I think I need to get current position of envelope related to cycle length, and then turn that position into a 0/1 value...

(
  SynthDef(\adsr, { | out, channel, attack = 0.1, decay = 0.5, sustain = 0.5, release = 0.5 |
    var env = Env.adsr(attack, decay, sustain, release);
    var gen = IEnvGen.kr(env, index???));
    OffsetOut.ar(channel, DC.ar(gen));
  }).add
);

Thats more or less my work in progress...

Similar issue: defining new synths with different envelope behavior · Issue #89 · musikinformatik/SuperDirt · GitHub

I think this needs to be used somewhere: IEnvGen | SuperCollider 3.12.2 Help