I am trying to route a signal inside an Ndef with Out.ar(~monitorBus, sig). In the end of the Ndef, SplayAZ spreads the array to 8 channels and is played with .reshaping_(\expanding).play.
The monitorBus is somehow routed to the speakers although it has a higher index. If the Out.ar is the last expression in the Ndef, no sound comes from the speakers. If Out.ar is not the last expression in the Ndef, something weird is happening. Any clues?
May I ask, does this “somehow” use In.ar, or InFeedback.ar?
Or, are you controlling node order of execution in some other way?
hjh
I use the bus ~monitorBus = Bus(\audio, 16, 1, s);
and then I am defining some synths that use In.ar(~monitorBus, 1);
. I get the weird routing before I activate the synths with Synth.tail(1, synthName)
.
This is actually working as expected - e.g. try out
{Out.ar(bus: 4, SinOsc.ar)}.plot;
which returns a silent signal - so Out
does not return the signal it received but returns an empty signal.
In order to send the signal to a bus and also use it as output of a NodeProxy you would need to do something along
~bus = Bus.audio(server: s, numChannels: 1);
~bus.scope;
(
Ndef(\x, {
var sig = SinOsc.ar();
Out.ar(~bus, sig);
sig;
});
)
On the other hand I’d try to stay out of Bus
territiory and instead rely on the bus abstraction provided by NodeProxy - so e.g. do this.
Ndef(\x, {SinOsc.ar});
Ndef(\bus, {
// obtain the signal of x within another NodeProxy
var xSig = Ndef.ar(key: \x, numChannels: 1);
// collect more signals here and e.g. combine them
xSig;
});
// or access the bus used by x
Ndef(\x).bus;
// returns e.g. -> Bus(audio, 5, 1, localhost)
BTW - NodeProxys are using InFeedback
under the hood which allows you to ignore the signal order on the server, but you obtain a block size delay which is problematic for e.g. Karplus Strong or sample accurate playback/sequencing.
edit: the NodeProxy way of playing on a bus would be
~bus = Bus.audio(server: s, numChannels: 1);
Ndef(\x, {SinOsc.ar}).play(~bus);