Glitch/repater synth - porting from PureData

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 =, 1);
	var localBuf =, 1);
	var original =, buf,, 1, loop:1.0) * (1-glitch);

	var tapPhase =;
	var delay =, tapPhase,, 0.7), 2, mul:fb) * glitch;

	var sig = original + delay;, sig) );

	sig = sig * amp;, sig!2);

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

// 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;

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

1 Like

Would Warp1 work here?

One thing is that the Pd patch isn’t ramping the delay time – it’s just instantaneously jumping. (delread~ can’t smooth out delay time changes because it’s a control input, not a signal input. delread4~ can.)

But MouseY has a built in lag.

So at minimum, you might try disabling the lag by setting it to 0, and see if the sound is closer to the original.



Thank you guys for your support,
@jamshark70 thank you for pointing out the delread~ object behaviour in PureData.
I was eventually able to get quite near to the same acoustic effect setting the lag to 0.0 for the MouseY object.

Just realized that this post can be related to one of my previous posts.
Placing the link here just for an additional reference.