[sc-users] Density problems again ( Server-Lang frustration)

Dionysis Athinaios adroid28 at yahoo.gr
Mon Oct 29 08:31:39 PST 2007



Joshua Parmenter-4 wrote:
> 
> Can you post a simple example of what you are trying to do? It is a  
> little difficult to help with simply an abstraction.
> 
> Thanks,
> 
> Josh
> 
> 

yup...

Check the expressivenes of the control with the second method and the
deterioration of the (not that high)
 high frequencies. Then check the opposite in the first method. I need the
good sides of both methods
 at the same time.

-----------------------------------------

Code:


//A synth to use

(
SynthDef("Siny_saw", { Out.ar(0, Saw.ar([400, 401], 0.2) 
	* Line.kr(1, 0, 0.1, doneAction: 2)); }).send(s);
)

//////////////////

(
//first way

a = { 
arg dur,density = 0.01;
var frq = exprand(90, 4000), osc, rout, waitfunc = 0.1, waitfunc2 =
rrand(0.05,0.12), runtime,  commandpath, response, aSynth, nodeID,
triggerID, pan, panI, panspread, panspreadI,minrate, minrateI,maxrate,
maxrateI, amp, ampI; 

// the amount of time for this to run
runtime = dur; 
// Osc responder ///////////////////////////// DENSITY

triggerID = 1;

aSynth = SynthDef( "SIny", { arg freq = 0.06, triggerID = 1; 

           var modu;

modu = density.value; // the modulation signal

SendTrig.kr(Impulse.kr(freq.reciprocal), triggerID, modu); }).play;

nodeID = aSynth.nodeID;

commandpath = ['/tr', nodeID, triggerID];

response =  {arg time, responder, msg; waitfunc = msg[3]};

osc = OSCpathResponder(s.addr, commandpath, response).add;

/////////////////////////////////////////////////////

// schedule the stop

SystemClock.sched(runtime, {rout.stop;});

SystemClock.sched(runtime + 3, {osc.remove; aSynth.free;});

     // DEFINE A ROUTINE
// "Texture_simple"
 rout = Routine.new({ 

	inf.do({ 	s.makeBundle(0.05, {Synth("Siny_saw") }
	                                 );
			(waitfunc).wait;   //Density control
	})
}).reset.play;

};

//second way

b= { 
arg dur,density = 0.01;
var frq = exprand(90, 4000), osc, rout, waitfunc = 0.1, waitfunc2 =
rrand(0.05,0.12), runtime,  commandpath, response, aSynth, nodeID,
triggerID, pan, panI, panspread, panspreadI,minrate, minrateI,maxrate,
maxrateI, amp, ampI; 

// the amount of time for this to run
runtime = dur; 
// Osc responder ///////////////////////////// DENSITY

triggerID = 1;

aSynth = SynthDef( "SIny", { arg freq = 0.06, triggerID = 1; 

           var modu;

modu = density.value; // the modulation signal

SendTrig.kr(Impulse.kr(density), triggerID); }).play;

nodeID = aSynth.nodeID;

commandpath = ['/tr', nodeID, triggerID];

response =  {Synth("Siny_saw") };

osc = OSCpathResponder(s.addr, commandpath, response).add;

/////////////////////////////////////////////////////

// schedule the stop

SystemClock.sched(runtime + 3, {osc.remove; aSynth.free;});

};

     
)

//////////////

a.value(60, {MouseX.kr(2.0, 0.005)}); //MouseX sends values for the wait
time
b.value(60, {MouseX.kr(0.5, 200)}); //Now MouseX sends freq values for the
impulse


-- 
View this message in context: http://www.nabble.com/Density-problems-again-%28-Server-Lang-frustration%29-tf4708422.html#a13469804
Sent from the Supercollider - User mailing list archive at Nabble.com.



More information about the sc-users mailing list