Skip to content

Instantly share code, notes, and snippets.

@iani
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save iani/9447425 to your computer and use it in GitHub Desktop.

Select an option

Save iani/9447425 to your computer and use it in GitHub Desktop.
Very simple way to limit amplitude of a feedback synth, in SuperCollider
// Pass the signal only when its amplitude is below a given threshold.
(
a = {
var source, clamp;
source = In.ar(Server.default.options.numInputBusChannels);
source = CombN.ar(source); // token effect: edit to add more fancy stuff
clamp = Amplitude.kr(source) < \threshold.kr(0.1);
Out.ar(0, source * clamp);
}.play;
)
//:
a.set(\threshold, 0.01);
//:
a.set(\threshold, 0.05);
//:
a.set(\threshold, 0.001);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment