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.dacora.to(b); fan-outa.send(b, c); binda @ engine/a.on(clock) - Audio sugar:
node * ginsertsGain(g)(AudioNode × number only;Dur * nunchanged) dac << src/blackhole << srcreverse-patch into anAudioSink- Oscillators / filters / STK:
.freq SqrOsc.width;Gain.gain;Pan.panADSR.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(valuein[0, 128]) NRev.t60,.mix;JCRev.t60,.mix;PRCRev.t60,.mix;Chorus.depth,.frequency,.mix
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.