« Return to Thread: [approve] Dionysos's Env:test bug

Re: [approve] Dionysos's Env:test bug

by Josh Parmenter :: Rate this Message:

Reply to Author | View in Thread

Is there any reason not to wait for the 3.3.1 post-bug fix? 

Best,

Josh

On Apr 25, 2009, at 3:42 PM, James Harkins wrote:

The problem is in the use of s.bind instead of fork to handle the server sync. Bind collects all the messages into one bundle, but for sustaining envelopes, the release message must be sent separately.

Even though we are post-RC, is it uncontroversial enough to correct this? It would avoid some new user confusion.

I also prefer cleaning up temporary synthdefs when they're not needed. OSCpathResponder added to do this (but only if server notifications are on).

test { arg releaseTime = 3.0;
var id, def, s;
s = Server.default;
if(s.serverRunning.not) { "Server not running.".warn; ^this };
id = s.nextNodeID;
fork {
def = { arg gate=1;
Out.ar(0,
SinOsc.ar(800, pi/2, 0.3) * EnvGen.ar(this, gate, doneAction:2)
)
}.asSynthDef;
def.send(s);
s.sync;
s.sendBundle(s.latency, [9, def.name, id]);
if(s.notified) {
OSCpathResponder(s.addr, ['/n_end', id], { |time, responder, message|
s.sendMsg(\d_free, def.name);
responder.remove;
}).add;
};
if(this.isSustained) { s.sendBundle(s.latency + releaseTime, [15, id, \gate, 0]) };
};
}


hjh


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

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


******************************************

/* Joshua D. Parmenter

http://www.realizedsound.net/josh/


“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono

*/

 « Return to Thread: [approve] Dionysos's Env:test bug