Hi guys,
a few days ago I stumbled upon a nice playlist of PureData tutorials by SoundSimulator and, in particular, I was impressed by the video regarding the glitch and wanted to bring the PureData code that is shown in the video, into SuperCollider.
The part of the PD code that I tried to translate is as follows:
and, at the moment, my current translation in SC language is following:
(
SynthDef(\bplay, {
|out=0, amp=1.0, buf, fb=1.0|
var glitch = MouseButton.kr(0, 1);
var localBuf = LocalBuf.new( SampleRate.ir(), 1);
var original = PlayBuf.ar(1, buf, BufRateScale.kr(buf), 1, loop:1.0) * (1-glitch);
var tapPhase = LocalIn.ar(1);
var delay = DelTapRd.ar(localBuf, tapPhase, MouseY.kr(0.01, 0.7), 2, mul:fb) * glitch;
var sig = original + delay;
LocalOut.ar( DelTapWr.ar(localBuf, sig) );
sig = sig * amp;
Out.ar(out, sig!2);
}).add;
)
In my synth it is the mouse button that activates or deactivates the “repeater” effect while the drag allows you to shorten or lengthen the “repeated” portion of the audio.
You can try yourself following the steps below:
// 1. boot the server
s.boot;
// 2. load your audiofile
~sample = Buffer.readChannel(s, "/path/to/my/sound/file.wav", channels:0);
// 3. instantiate the synth
x = Synth(\bplay, [\buf, ~sample]);
// 4. play with the mouse :)
// 5. eventually free the synth
x.free;
While the general sound behavior of the synthesizer in SC seems similar to that in Puredata, I noticed one important difference: when I change the delay duration - dragging with the mouse - the sound undergoes drifts in pitch. The pitch increases when the delay time is shortened and decreases instead when you allug the delay time. Just as if it were a tape delay.
While I have researched this effect in some cases in the past, in this particular context I would like it not to be there instead.
How do I modify my implementation to achieve the desired effect?
Thank you so much for your support