home/ atoms/ sc-rate-mismatch-ar-kr

Mixing audio-rate and control-rate UGens in SuperCollider fails the SynthDef build with a 'not audio rate' post message

SuperCollider UGens operate at either audio rate (.ar) or control rate (.kr). Feeding an audio-rate signal where a control-rate input is expected (or vice versa) causes the SynthDef to fail to build and posts an error such as ‘input was not audio rate’ or ’… not a UGen or Number’. The fix is to keep modulators at .kr and the audible signal chain at .ar, using K2A or A2K to explicitly convert between rates when needed.

Examples

Using SinOsc.kr as a direct audio output fails. Using SinOsc.ar as the amplitude of another .ar UGen without rate conversion can also cause mismatch errors.

Assessment

Identify the error class produced by a rate mismatch in SuperCollider and describe the two conversion UGens that fix deliberate cross-rate connections.

“Make modulators `.kr`, the audible chain `.ar`. Wrap with `K2A`/`A2K` to convert rate deliberately. Re-check every UGen's rate.”
context/ · L5-debug/supercollider.md · chunk 1