Skip to main content
Requires built torq._audio (PyPI binary wheel, or TORQ_NATIVE=1 pip install 'torqpy[native]').

AudioEngine

AudioEngine(sample_rate=48000, channels=1|2)

UGen conventions

  • Connect: a >> b >> engine.dac or a.to(b); fan-out a.send(b, c); bind a @ engine / a.on(clock)
  • Audio sugar: node * g inserts Gain(g) (AudioNode × number only; Dur * n unchanged)
  • dac << src / blackhole << src reverse-patch into an AudioSink
  • Oscillators / filters / STK: .freq
  • SqrOsc.width; Gain.gain; Pan.pan
  • ADSR.keyOn / keyOff (and snake_case aliases)
  • Delay.delay, .mix, .feedback
  • STK instruments: noteOn(amp=0.5) / noteOff(amp=0.5); controlChange(number, value) / control_change (value in [0, 128])
  • NRev.t60, .mix; JCRev.t60, .mix; PRCRev.t60, .mix; Chorus.depth, .frequency, .mix
Sources (oscs, Noise, STK instruments) do not accept audio inputs. STK effects (NRev, JCRev, PRCRev, Chorus) do. AudioNode is an alias of UGen. Torque owns the audio clock: STK is embedded in the native graph. Do not use scsynth/pyo as an audio server.

Helpers

Example

Headless VMs often have no output device — check has_output_device() before play_while / live start.