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

Re: [sc-users] AudioIn triggering a Routine



OSCpathResponder and SendTrig are also a really nice match. OSCpathResponder can respond to multiple triggers with individual trigger IDs. Which is neat, because SendTrig lets you send precisely such individual trigger IDs. So for instance, if you have more than one AudioIn and you want to control different client side events, routines or whatever, check out the OSCpathResponder help file.

Den 14/05/2006 kl. 19.00 skrev Sciss:

hallo,

in SuperCollider 3 you have to distinguish between things that are on the Server side, for example Synths (connected UGens) and stuff on the Client side, for example a Routine. To communicate back from Server to Client, e.g. to control a Routine through a UGen such as AudioIn, you need to use the special UGen SendTrig which sends trigger messages back to the Client :

(
SynthDef( \pling, { arg freq = 440, mul = 0.1;
	var line;
	
	line = Line.ar( mul, 0, 0.1, doneAction: 2 );
	Out.ar( 0, Pan2.ar( SinOsc.ar( freq, mul: line )));
}).send( s );
)

(
r = Routine({
	rrand( 1, 4 ).do({ arg i;
		Synth( \pling, [ \freq,  rrand( 60, 80 ).midicps ]);
		0.1.wait;
	});
});
)

(
  {
  	var inp, trig;
  	
  	inp = AudioIn.ar( 1 );
//  	trig = Compander.ar( inp, inp, -6.dbamp, inf, 1, 0.01, 0.1 );
  	trig = Amplitude.kr( inp ) > -12.dbamp;
  	SendTrig.kr( trig );
  }.play;
 )

(
n = OSCresponderNode( s.addr, '/tr', { arg time, resp, msg;
	if( r.isPlaying, {
		"stop!".inform;
		r.stop;
	}, {
		"play!".inform;
		r.reset;
		r.play;
	});
}).add;
)

n.remove;

check the help file for SendTrig.

ciao , -sciss-


Am 14.05.2006 um 18:02 schrieb Johannes Quint:

with the 'gate'-parameter, i can control an EnvGen by an AudioIn- signal.
but can i start (and stop) a routine by an AudioIn-signal too?
thanks for help,
johannes quint


_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users