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

[sc-dev] In and Out



should instruments in sc3 make use of an Out ugen?
if i want to patch instruments, this
is not very handy, although:
	- we could give each a bus, asign an In.ar
	to the input and patch them on the server
	- Out.ar could accept -1 as bus number to stay disabled.
	then Out should have an output.

a = Instrument(\a, { ... });
b = Instrument(\b, { a.ar * oscx });

there is no other way of patching Instruments when building the definition like
this when using Out in this way, because Out has no
output. This limits the use of Instruments to representation
of SynthDefs only.

	nevertheless,

	Instrument(\name, { arg gate=1, out=0;
			var snd;
			snd = SinOsc.ar * gate;
			Out.ar(out, snd);
			out
	})

would be the way to write it so it can be used both ways going with the way Out.ar works now.


there is a similar issue when using an input:

 	a = Instrument(\name, { arg gate=1, zin=0, out=0;
			var snd;
			snd = In.ar(zin) * gate;
			Out.ar(out, snd);
			out
	})
	a.ar(1, SinOsc.ar, 0);//this will not work.


so In could use either a bus number or a UGen input

In : MultiOutUGen {
	*ar { arg bus = 0, numChannels = 1;
		^if(bus.isKindOf(Integer), {
			this.multiNew('audio', numChannels, bus)
		}, {
			bus
		})
	}
	*kr { arg bus = 0, numChannels = 1;
		^if(bus.isKindOf(Integer), {
			this.multiNew('control', numChannels, bus)
		}, {
			bus
		})
	}


maybe this mix of concepts is confusing, anyway it would allow
to define Instruments in a more general way.