« Return to Thread: OSCresponderNode

Re: OSCresponderNode

by Joe Mariglio :: Rate this Message:

Reply to Author | View in Thread


Marije:
I have a suspicion that SendTrig cannot send sample accurate triggers. The
triggers are FIFO to a non-realtime thread, which I am guessing are harvested
only every controlcycle, for actual sending out.
 
ouch that's lame, but not so much an issue now.  i came up with an implementation that defines regions of spectral activity and sends only changes of state to the client for evaluation.  this need not be sample accurate.  from there, the client activates routines that send synchronous or quasi-synchronous timestamped oscBundles.  i assume those to be subsample accurate. 

//so 'a' is the gamut, with a different routine dedicated to each layer in the gamut:

a = Array.geom(400, 16, 2**(1/40));
~layers = a.collect({|x, i|
                                    Task({
                                        loop({
                                            s.sendBundle(0.1, [9, "sine_subsample", -1, 0, 0, \freq, x]);
                                            (1/x).wait;
                                            })
                                        })
                                    });
//the filterbank uses the same gamut, and triggers the client only when a boundary is crossed:

SynthDef("filter", {|freq = 128, in = 16, cyc = 4, thresh = 0.0125, rq = 0.025|
    var amp, rate, t0, t1;
    amp = Amplitude.kr(BPF.ar(InFeedback.ar(in), freq, rq));
    t0 = amp < thresh;
    t1 = thresh < amp;
    SendTrig.kr(Latch.kr(t0, Impulse.kr(freq/cyc)), 0, freq);
    SendTrig.kr(Latch.kr(t1, Impulse.kr(freq/cyc)), 1, freq);
}).send(s);

//right now there is only one 'bit' of amplitude data (on/off), but this will change.
//the responder just has to toggle the appropriate routine based on control rate data sent by the filters

~responder = OSCresponderNode(s.addr, '/tr',
                                                    {|time, responder, msg|
                                                        var frq, amp, laya;
                                                        frq = msg[3];
                                                        amp = msg[2];
                                                        laya = ~layers[a.indexIn(frq)];
                                                        amp.switch(
                                                            0, {laya.stop},
                                                            1, {laya.play}
                                                            );
                                                            });


Use Josh'es suggestion to make a server side only implementation of what you
want to do.
 
the problem with keeping everything server-side is that i want to implement this across a cluster of remote scsynth instances in a network, with my laptop as the 'head node', doing analysis and task management.  any suggestions for how to accomplish this while keeping everything server-side? 

at this point, the information about the spectrum is abstracted into explicitly written oscBundles.  if i wanted to, i could point those to a selection from an array of remote scsynths or other software.  also having client-side knowledge of that data allows me to do things like fill an array and create a score for NRT manipulation and resynthesis.  as far as i comprehend, i could not do most of these things if i kept the process server-side.  am i wrong in believing this?

jm

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

 « Return to Thread: OSCresponderNode