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

Re: [sc-users] Freeing Previously Allocated Busses



This is a new feature wslib: Synth:freeAction_

cheers,
Wouter

Op 6 mei 2009, om 15:30 heeft Sciss het volgende geschreven:

you can register for n_end notification about crucial nodes using the bus. with a simplifying extension like

+ Node {
	onEnd_ { arg func;
		var upd;
		upd = Updater( this.register, { arg node, what;
			if( what === \n_end, {
				upd.remove;
				func.value( this );
			});
		});
	}
}

it becomes something like

s.boot;

SynthDef( \test1, { arg inBus, outBus, freq = 440; Out.ar( outBus, Resonz.ar( In.ar( inBus ), freq, 0.05, mul: EnvGen.kr( Env.perc, doneAction: 2 )))}).send( s ); SynthDef( \test2, { arg outBus, density = 100, amp = 1; Out.ar( outBus, Dust.ar( density ) * amp )}).send( s );

(
r = fork {
	inf.do({
		var bus, synth1, synth2;
		bus = Bus.audio( s );
synth2 = Synth( \test2, [ \outBus, bus.index, \density, exprand( 10, 1000 ), \amp, 0.5 ]); synth1 = Synth.after( synth2, \test1, [ \inBus, bus.index, \outBus, 2.rand, \freq, exprand( 100, 10000 )]);
		[ "n_go", synth1.nodeID, bus.index ].postln;
synth1.onEnd = { arg node; [ "n_end", node.nodeID, bus.index ].postln; bus.free; synth2.free };
		exprand( 0.05, 1.0 ).wait;
	});
};
)

ciao, -sciss-

Am 06.05.2009 um 15:08 schrieb koonce@xxxxxxxxxxxxx:


What is the simplest way of freeing all allocated busses from a previous, terminated process? Sudden termination leaves no record of the allocated
bus objects, so I can't see how to free them.

Similarly, is there a way to list the currently assigned/allocated busses
so  that I may then free them?

PAUL



_______________________________________________
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/


_______________________________________________
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/


_______________________________________________
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/