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

Re: [sc-dev] b_gen synchronous?



On Dec 13, 2005, at 3:53 AM, James McCartney wrote:

It shouldn't be blocking other incoming messages. It may be holding up other async commands. All async messages and tasks are done on one thread.

In this example, I'm not clear on what's doing the blocking then. When you run the Buffer.allocConsecutive, the s_new messages (which should be synchronous, correct?) do get blocked, as evidenced by the stream of late messages in the post window.

<x-tad-smaller>s.boot;

(
</x-tad-smaller><x-tad-smaller>\singrain</x-tad-smaller><x-tad-smaller>, { </x-tad-smaller><x-tad-smaller>|freq, time|</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>Out</x-tad-smaller><x-tad-smaller>.ar(0, </x-tad-smaller><x-tad-smaller>SinOsc</x-tad-smaller><x-tad-smaller>.ar(freq, 0, 0.3 * </x-tad-smaller><x-tad-smaller>Env</x-tad-smaller><x-tad-smaller>.perc(0.01, time), doneAction:2)) ! 2);
}).send(s);

r = fork {
loop {
s.sendBundle(0.2, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\singrain</x-tad-smaller><x-tad-smaller>, -1, 0, 1, </x-tad-smaller><x-tad-smaller>\freq</x-tad-smaller><x-tad-smaller>, rrand(200, 800), </x-tad-smaller><x-tad-smaller>\time</x-tad-smaller><x-tad-smaller>, 0.1]);
0.125.wait;
}
};
)

(
b = </x-tad-smaller><x-tad-smaller>Buffer</x-tad-smaller><x-tad-smaller>.allocConsecutive(8, s, 32768, 1, { </x-tad-smaller><x-tad-smaller>|buf, i|</x-tad-smaller><x-tad-smaller>
buf.sine1Msg(1 ! (i+1 * 10));
});
)

[ Buffer(0, 32768, 1, 44100, nil), Buffer(1, 32768, 1, 44100, nil), Buffer(2, 32768, 1, 44100, nil), Buffer(3, 32768, 1, 44100, nil), Buffer(4, 32768, 1, 44100, nil), Buffer(5, 32768, 1, 44100, nil), Buffer(6, 32768, 1, 44100, nil), Buffer(7, 32768, 1, 44100, nil) ]
late 2.216027015
late 2.091027015
late 1.966027015
late 1.841027015
late 1.716027015
late 1.591027015
late 1.466027015
late 1.341027015
late 1.216027015
late 1.091027015
late 0.966027015
late 0.841027015
late 0.716027015
late 0.591027015
late 0.466027015
late 0.341027015
late 0.216027015
late 0.091027015
</x-tad-smaller>


: H. James Harkins
: 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