[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] how to tell when n_set messages have been executed



~synth = {arg frequ=440; SinOsc.ar(freq:frequ)}.play;

(
~bndlTime = 0.2;
Routine({
  ~wait = true;
  100.do{
	~new_freq = rrand(400, 600);
	s.makeBundle( ~bndlTime, { ~synth.set("frequ", ~new_freq) });
	("waiting for freq "++~new_freq).postln;
	while({~wait}, {
	  (s.options.blockSize*2/s.sampleRate).wait;
s.makeBundle( ~bndlTime, { ~synth.get(\frequ, { arg value; ("freq is "++value).postln;
		// has the synth been updated?
if (value == ~new_freq, {~wait = false;"Synth control updated!".postln}, {"waiting... ".postln});
	  })});
//	  0.0001.wait;
	});
	~wait = true;
  };
}).play( SystemClock );
)

Am 29.07.2009 um 20:20 schrieb James Harkins:

Since you're not timestamping your OSC messages, probably the actual execution time of the n_get is wrong.
hjh


On Wed, Jul 29, 2009 at 1:23 PM, Sciss <contact@xxxxxxxx> wrote:
totally strange. even if you initially wait _two_ control blocks, the reported value might still not have been updated:


~synth = {arg freq=440; SinOsc.ar(freq:freq)}.play;

(
Routine({

 ~wait = true;
 100.do{
       ~new_freq = rrand(400, 600);
       ~synth.set("freq", ~new_freq);
       ("waiting for freq "++~new_freq).postln;
       while({~wait}, {
         (s.options.blockSize*2/s.sampleRate).wait;

         ~synth.get(\freq, { arg value; ("freq is "++value).postln;
               // has the synth been updated?
if (value == ~new_freq, {~wait = false;"Synth control updated!".postln}, {"waiting... ".postln});
         });
//        0.0001.wait;
       });
       ~wait = true;
 };
}).play( SystemClock );
)

i.e. i still get "waiting..." here a lot. something with the server scheduling must be definitely be broken, i assume?

ciao, -sciss-



--
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/