Commit 01bc487
c_dsp_demo: heavy distortion effect
Third example kind: a stateless overdrive — drive gain into a +/-1.0
clamp, cubic soft clip (y = x - x^3/3) to round the corners, 3/2
renormalize for the 2/3 knee. Integer-only, so it compiles on all
three backends; `drive` is the knob to edit live. The demo now plays
the CZ notes clean, bitcrushed, then distorted.
Verified in the browser on the web build: enabled on bus 0 it runs in
the AMY worklet and lifts a quiet sine's output peak 5.8x into the
saturator, no worklet errors.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 14ce229 commit 01bc487
1 file changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
41 | 61 | | |
42 | 62 | | |
43 | 63 | | |
| |||
65 | 85 | | |
66 | 86 | | |
67 | 87 | | |
| 88 | + | |
68 | 89 | | |
69 | 90 | | |
70 | 91 | | |
| |||
86 | 107 | | |
87 | 108 | | |
88 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
89 | 118 | | |
90 | | - | |
| 119 | + | |
91 | 120 | | |
92 | 121 | | |
0 commit comments