Copying some stuff from web

Again, agree to disagree. It’s documented, but, “I have no idea what that’s referring to.” I guess the solution to that is an RFC to change the synth control style throughout the help system.

I did this with my live coding system loaded (actually missing one file, but close enough):

(
a = (control: 0, arrayed: 0, audio: 0, scalar: 0, total: 0);

SynthDescLib.global.synthDescs.do { |desc|
	if(desc.name.asString.beginsWith("system_").not) {
		desc.controls.do { |ctl|
			var rate = ctl.rate;
			if(ctl.name != '?') {
				a[rate] = (a[rate] ?? { 0 }) + 1;
				if(ctl.defaultValue.size > 1) {
					a[\arrayed] = a[\arrayed] + 1;
				};
				a[\total] = a[\total] + 1;
			};
		};
	};
};

a
)

-> ( 'scalar': 22, 'arrayed': 12, 'control': 1443, 'audio': 0,
  'total': 1465 )

Arrayed controls clock in at 12/1465 < 1%, and scalar rate at 22/1465 ~= 1.5% scalar. It’s hard to count tr controls this way but I don’t use them frequently. Perhaps that’s why I don’t mind to write out NamedControl in the 0.8% cases of arrayed controls (where there’s really no good other way) or the couple percent other cases.

For the majority of cases, it’s a nice optimization that function args collapse into one Control unit.

(
SynthDef(\oneControl, {
	var ctl = Control.names(Array.fill(250, { |i| ("ctl" ++ i).asSymbol }))
	.kr((1..500));
	Out.kr(0, ctl[0]);
}).add;

SynthDef(\namedControls, {
	var ctl = Array.fill(250, { |i|
		NamedControl.kr(("ctl" ++ i).asSymbol, i+1)
	});
	Out.kr(0, ctl[0]);
}).add;
)

// 10-11% after setting CPU performance mode
a = (instrument: \oneControl, ctl0: (0..100), type: \on).play;

a.put(\type, \off).play;

// 18-19%
a = (instrument: \namedControls, ctl0: (0..100), type: \on).play;

a.put(\type, \off).play;

hjh