Howdy.
I am not great at making synthdefs, just so you know.
Problem:
I am trying to delay, or offset in time, when a glissando begins.
Below is what I have made, but it is broken, so I am including it here not really knowing if it is of any use to you.
(
SynthDef("sin", {|out = 0, sustain = 1, bnd = 0, bnt = 0.2, bno = 0, freq = 440,
iph = 0, amp = 1.0, pan = 0, att = 0.0, rel = 1.0, crv = -8.0|
var env, accel, sig, freqclipped;
env = Env.perc(att, rel, amp, crv).kr(doneAction: 2);
accel = TDelay.ar(Line.ar(1, 1 + bnd.clip(-1.0, 1.0), bnt * sustain), bno);
freqclipped = freq.clip(20, 20000) * accel;
sig = FSinOsc.ar(freqclipped.clip(20, 20000), iph, 0.75);
sig = sig * env;
sig = Pan2.ar(sig, pan);
Out.ar(out, sig);
}).store;
)
(
Pdef(0,
Pbind(*[
instrument: \sin,
amp: 1,
dur: 1/8,
bnd: Pwhite(-1.0, 1.0),
bnt: Phprand(0.0, 1.0),
bno: Pwhite(0.0, 1.0),
freq: Plprand(100, 1000).round(100),
])
).play
)
I would like to keep communication centered on this general setup of a synthdef and Pdef Pbind
combo as I can’t work with Pmonoartic
and similar because I always have this other stuff happening around the above slimmed down / vanillified example otherwise.
A friend said to try Tdelay
and so that is why that is in there. I got an error when I previously used Line.kr
so I changed that to .ar
and at that point my code could run and made a sound, but it was not what I expected. I am guessing my thing that I made is not good and proly you can tell.
Maybe this should be an Env
based thing instead? That way the glissando could have a curvature as well? I don’t know. I’m rambling here because I’m nervous about asking questions.
Any help would be very much appreciated.