how to use an envelope to continually control a cycle~ (or anything related)

GLDLZ's icon

hello all!

what i would like to be able to do (and what i can't seem to figure out) is take an object which outputs values between 0 and 1 (like, say the cycle~) which is normally cycling between these two values at whatever rate is defined as its frequency, and instead, cause it to cycle between the values every time it receives a bang, at a rate defined by the envelope.

so, for example, i'd like to be able to create an envelope and if the cycle left off at say 0.23 i'd like to cause it to climb an additional 0.20 to 0.43, and then keep climbing every time i bang the envelope, and rise and fall as it usually does, so that when it's at 0.83, if i bang the envelope it comes back to 0.97 and so on.

is such a thing possible? how would i go about doing this? it's alright if the solution doesn't involve a cycle~ at all, that's just the only object i could think of to explain what i'm looking for

double_UG's icon

[bline]

Max Patch
Copy patch and select New From Clipboard in Max.