the feeling I am getting from this thread is that patterns represent a powerful way to organise and sequence audio events.
my main problem with patterns is synchronisation - I want to be able to synchronise with a cv clock at a hardware input.
at the moment, I can collect the interval between clock ticks using a synth with Timer.ar
that sends back a OSC message using SendTrig.ar
:
(
SynthDef (\interval_getter) {
arg bus = 0, thresh = 0.5;
var sig, val;
sig = SoundIn.ar (bus);
sig = Compander.ar (1, sig, thresh, 10, 1, 0.01, 0.01);
sig = Trig1.ar (sig, 0.01);
val = Timer.ar (sig);
sig = (val > 0.05) * sig;
val = Timer.ar (sig);
SendTrig.ar (sig, 0, val);
}.add;
~osc_listener = OSCFunc ({
arg interval;
Synth (\triDing);
interval.postln;
}, '/tr', s.addr);
)
it’s not super pretty, but it works.
but, the OSC message is super late and together with sclang latency, it is not tenable to trigger either patterns or individual synths from inside the listener.
I could clock directly from a bus, but that would limit me to server side sequencing.
is there a way to use the powerful laziness of patterns with CV clock?
I’m not sure what it would be that I would be building - potentially a Clock
subclass that listens to an input channel and, when triggered, synchronously evaluates events that land on that beat, while scheduling those events that land between this beat and the next using the interval time between the last beat and this one?
such a clock would work similarly to an analog sequencer module, always waiting for the next CV impulse to push forward a step, but would retain all of the potential complexity and power of patterns.
is this possible?