w00t! Got it!
Here’s the current version (with slide) of my tama-style “talking drum”:
(
SynthDef(\tama,
{|note = 52,
note_slide = 0, note_slide_shape = 1, note_slide_curve = 0, amp = 1, amp_slide = 0, amp_slide_shape = 1, amp_slide_curve = 0, pan = 0, pan_slide = 0, pan_slide_shape = 1, pan_slide_curve = 0, attack = 0, decay = 0, sustain = 0, release = 1, attack_level = 1, sustain_level = 1, env_curve = 1, out_bus = 0, gate=1, tension=0.05, loss=0.9, vel=1, dur=1 |
var signal, freq;
var lossexp=LinLin.ar(loss,0.0,1.0,0.9,1.0);
var env = Env([0, 1, 0.5, 1, 0], [0.01, 0.5, 0.02, 0.5]);
var excitation = EnvGen.kr(Env.perc, gate, timeScale: 1, doneAction: 0) * PinkNoise.ar(0.4);
note= VarLag.kr(note, note_slide, note_slide_curve, note_slide_shape);
amp= VarLag.kr(amp, amp_slide, amp_slide_curve, amp_slide_shape);
pan= VarLag.kr(pan, pan_slide, pan_slide_curve, pan_slide_shape);
freq=note.midicps;
signal = amp*MembraneCircle.ar(excitation, tension*(freq/60.midicps), lossexp);
DetectSilence.ar(signal,doneAction:2);
signal = signal * EnvGen.ar(Env.perc, gate, vel*0.5, 0, dur, 2);
signal=Pan2.ar(signal, pan);
Out.ar(out_bus,signal);
}
).writeDefFile("/Users/alex/Desktop/sc-synths");
)
And here’s a slide, with that synth, after loading the SynthDef (and making sure Sonic Pi is set to accept external synths):
use_synth "tama"
use_synth_defaults tension: 0.045, loss: 0.99999, dur: 3, note_slide: 0.5, note_slide_shape: 7
s=play 36
sleep 0.5
control s, note: 62
sleep 0.5
control s, note: 50
sleep 0.5
play 50
Can now investigate some of the other UGens to create more synths. Will surely go overboard with those, but they really can be a lot of fun.
Thanks again, @ethancrawford! The notion that VarLag.kr
was a UGen opened up this thing which has been nagging me since last November!