Is AudioControl redundant when you can pass in an audio bus number (e.g. as kr) and read from that bus (at audio rate, obviously)?

Am I missing some subtle point about AudioControl, meaning a_ variables usefulness?

It seems to me that in most examples one just passes in an audio bus number and then reads from that bus with In.ar etc. I can see that maybe you want to change between busses at audio rate speed. But that seems like a pretty obscure feature.

Is there a “killer app” use for AudioControl that cannot easily be done otherwise?

AudioControl isn’t strictly for changing between buses at audio-rate (though you can do this…) - rather, an AudioControl represents a control input that’s an ar-rate audio bus and not a kr-rate value.

There is one big functional difference between using an AudioControl and passing a bus number - AudioControl's can be flexibly set to:

  • fixed values
  • kr bus inputs
  • ar bus inputs

When using bus-passing, e.g. In.ar(\bus.kr), you are effectively requiring that you have a bus allocated in order to set this value at all - it would be impossible e.g. to set this to a fixed value (e.g. 0 for silence). However, when using AudioControl you have the option of setting the control to a fixed value OR mapping it to an audio-rate or control-rate bus for modulation.

For example:

(
Ndef(\test, {
	SinOsc.ar(\modFreq.ar(200).poll)
}).play;
)

// Fixed value
Ndef(\test).set(\modFreq, 300);

// kr rate value
Ndef(\test).set(\modFreq, Ndef(\krMod, {
	SinOsc.kr(1/16).range(200, 400)
}));

// ar rate value
Ndef(\test).set(\modFreq, Ndef(\arMod, {
	SinOsc.ar(32).range(200, 400)
}));

Note that when setting this AudioControl to a bus, you have to use asMap, e.g. synth.set(\modFreq, bus.asMap). Ndef is doing this automatically, but if you were setting it to a bus you allocated yourself you’d need the asMap.

I use AudioControl's for any control that I may want to modulate from the outside, as well as for audio inputs. Since it behaves identically to kr controls for normal fixed-value cases, it works transparently for e.g. patterns, but if I want to modulate it later I can without having to touch my original SynthDef. This also allows me to set the default value to 0 (effectively: silence) for audio inputs that I want to be optional.

This is also a matter of consistency - I don’t want to have to check my SynthDef to see whether an input expects a bus number or can be mapped, so I lean heavily on using AudioControl so I don’t have to think about it too much.

1 Like

I can see that maybe you want to change between busses at audio rate speed. But that seems like a pretty obscure feature.

That’s not really possible. All Ugens that I’ve seen aquire the bus once per control cycle, even if the bus number is an audio rate control.

1 Like