it can be done, here’s something i made a while ago with a really, really stupid trick to generate samples with arbitrary iterated function (single-sample buffer, arbitrary impulse, and Duty.ar! the impulse can run at the samplerate (i think? certainly at nyquist) i think just Dfsm and Duty.ar would work nicely together)
SynthDef.new(\cubicMapVoice, {
arg buf, out=0, level=1.0,
atk=0.001, rel=0.1, gate=1,
hz=110, oct=1, a=3.4,
lpf_hz_mul=2, lpf_hz_add=0;
var x, y, duty, env, output;
duty = 1.0 / (hz * oct);
x = Dbufrd(buf);
x = (a*x*x*x) + ((1.0-a)*x); // cubic oscillator.
y = Dbufwr(x, buf);
output = Duty.ar(duty, 0, y);
output = LPF.ar(output, hz * lpf_hz_mul + lpf_hz_add);
env = EnvGen.ar(Env.asr(atk, 1.0, rel), gate:gate, doneAction:2);
Out.ar(out, (env * output * level).dup);
}).send(s);
this is, of course, super inefficient.
actually probably a little funky because of sclang’s virtual terminal wonkiness (?) jack-stdin definitely the way to go i think