Change Midi/Out/cc/any from trig ro gate?


#1

I'm trying to set up a midi LFO controller patch and am hoping for some help in modifying an object:

This is what I want, but I would like the trigger input to act like a gate so that when the input is high it passes the LFO and when it's low it doesn't. I played about in the code, but everything I did either didn't work or broke it. LOL

Any suggestions appreciated. Thanks!


#2

Just "passing" the LFO will not work, as the LFO produces new values at k-rate (3kHz), while DIN MIDI can only send CC messages at about 1kHz, so some rate limiting is needed anyway.
I would use an lfo/square to generate trigger pulses for the midi/out/cc and a logic/and_2 to gate the trigger pulses. Or if about 200 updates per second (the highest frequency of lfo/square) is not enough, use osc/square_cheap as a trigger source.
Of course you could also hack the midi/out/cc object to trigger itself each 10th k-cycle or so while the gate input is active, but I always get quicker results using a few of factory objects than messing with the source code.


#3

Great info and thoughts, thank you!