Hi everyone!
It’s possible to control Routines with OSC? Or only Patterns; I mean normally SC clients control only Patterns or more characteristics of SC? Especially Routines.
j
Not sure exactly what you mean by “control” - but, the only thing you can really do with a Routine is pull values from it… This you can do via OSC.
~routine = Routine({
[50, 55, 56, 54].do {
|midinote|
midinote.yield
}
});
OSCdef(\foo, {
Synth(\someSynth, args:[\freq, ~routine.next.midifreq])
}, "/next/note");
If you’re thinking of e.g. controlling Event patterns / things in the pattern system with OSC (like Pbind
), you can definitely do this with OSC as well. It’s often useful to use Pdef
to do this, since it gives you a permanent and easily accessible handle to refer to and modify a pattern while it’s playing.
This might help to clarify things too:
- A
Stream
is an object that can provide a sequence of values by callingnext
on it. There are many different kinds ofStream
s. - A
Routine
is type ofStream
that is based on aFunction
- it’snext
method returns the values that are yielded in theFunction
by calling e.g.value.yield
. - A
Pattern
is a description of a Stream - if you callasStream
on it, it returns a newStream
based on that description. It’s a bit of a shortcut to talk aboutPattern
’s as if they’re doing something (e.g. “playing a Pattern”) - they’re really just a blueprint to produceStream
s that do something.