File: wavefold.scd

package info (click to toggle)
python-renardo-lib 0.9.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,220 kB
  • sloc: python: 10,999; sh: 34; makefile: 7
file content (11 lines) | stat: -rw-r--r-- 507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
SynthDef.new(\wavefold, {
	|bus, fold, symetry, smooth|
	var osc,gain,compensationGain,envFollower,ampgain;
	osc = In.ar(bus, 2);
	compensationGain = max(LinLin.kr(fold, 0, 1, 1, 20) * 0.75, 1).reciprocal;
	envFollower = EnvFollow.ar((osc * 2).softclip, 0.9999);
	ampgain = (compensationGain * (1 - 0.4)) + (envFollower * 0.4);
	osc = SmoothFoldS.ar((osc + LinLin.kr(symetry, 0, 1, 1, 0)) * LinLin.kr(fold, 0, 1, 1, 20), smoothAmount: smooth);
	osc = LeakDC.ar(osc*ampgain);
	ReplaceOut.ar(bus, osc)
}).add;