Skip to content

Commit 9ff4669

Browse files
authored
Update reincore_MegaGrit.jsfx to v2.0 (#418)
- Fixed a critical bug where the mid-band signal was always silent. - Added 'Envelope Smoothness' slider for direct control over the modulation's character. - Replaced the high-band clipper with a smoother soft-clip distortion. - Added input clamping for improved stability at high gain. - Lowered the default 'Input Drive' for a better experience. * Special thanks to ashcat_lt for the feedback!
1 parent ae42cc1 commit 9ff4669

1 file changed

Lines changed: 47 additions & 36 deletions

File tree

Distortion/reincore_MegaGrit.jsfx

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
desc: MegaGrit
1+
desc: MegaGrit – 3-Band + Feedback Distortion
22
author: reincore
3-
version: 1.0
3+
version: 2.0
44
link: MegaGrit GitHub Repo https://github.com/reincore/megagrit-jsfx
55
about: Multiband JSFX distortion for REAPER – splits audio into low/mid/high, adds unique dirt per band, then a feedback “breather” that bends with your playing.
6+
changelog:
7+
- Fixed a critical bug where the mid-band signal was always silent.
8+
- Added 'Envelope Smoothness' slider for direct control over the modulation's character.
9+
- Replaced the high-band clipper with a smoother soft-clip distortion.
10+
- Added input clamping for improved stability at high gain.
11+
- Lowered the default 'Input Drive' for a better experience.
12+
* Special thanks to ashcat_lt for the feedback!
613

714
// MegaGrit – 3-Band + Feedback Distortion
815
// License: MIT – do whatever you want, credit optional.
@@ -12,43 +19,47 @@ about: Multiband JSFX distortion for REAPER – splits audio into low/mid/high,
1219
//
1320
// ------------------------------------------------------------
1421

15-
desc:MegaGrit – 3-Band + Feedback Distortion
16-
17-
slider1:pregain=15<1,40,0.1>Input Drive
18-
slider2:lowgain=1<0.1,4,0.01>Low‑Band Gain
19-
slider3:midgain=1<0.1,4,0.01>Mid‑Band Gain
20-
slider4:highgain=1<0.1,4,0.01>High‑Band Gain
21-
slider5:feedback=0.8<0,2,0.01>Feedback Amount (0‑2)
22-
slider6:depth=1<0,2,0.01>Envelope Depth (0‑2)
23-
slider7:mix=1<0,1,0.01>Distortion Mix (0=Dry,1=Wet)
24-
slider8:postgain=0.5<0.1,1,0.01>Output Volume
22+
slider1:pregain=6<1,40,0.1>Input Drive
23+
slider2:lowgain=1<0.1,4,0.01>Low-Band Gain
24+
slider3:midgain=1<0.1,4,0.01>Mid-Band Gain
25+
slider4:highgain=1<0.1,4,0.01>High-Band Gain
26+
slider5:feedback=0.8<0,2,0.01>Feedback Amount
27+
slider6:env_smooth=0.01<0.001,0.2,0.001>Envelope Smoothness
28+
slider7:depth=1<0,2,0.01>Envelope Depth
29+
slider8:mix=1<0,1,0.01>Distortion Mix (Dry/Wet)
30+
slider9:postgain=0.5<0.1,1,0.01>Output Volume
2531

2632
@init
27-
low = mid = high = 0;
33+
low_lpf = mid_lpf = 0;
2834
env = 0;
29-
function softclip(v) ( v/(1+abs(v)); );
35+
36+
function softclip(val) ( val / (1 + abs(val)) );
3037

3138
@sample
32-
// Multibreak stage with gains per band
33-
in = spl0 * pregain;
34-
low = low + 0.1 * (in - low);
35-
high = in - low;
36-
mid = in - low - high;
37-
low_d = softclip(low * lowgain);
38-
mid_d = sin(mid * 3 * midgain);
39-
high_d = max(-0.3, min(0.3, high * highgain));
40-
multibreak_out = low_d + mid_d + high_d;
41-
42-
// NeuroGrit feedback stage with boosted modulation depth
43-
pre = softclip(multibreak_out);
44-
absin = abs(pre);
45-
env = 0.97 * env + 0.03 * absin;
46-
boost = 2;
47-
mod = 1 + feedback * sin(env * depth * $pi) * boost;
48-
ng_out = softclip(pre * mod);
49-
50-
// Dry/Wet mix & output
51-
final = mix * ng_out + (1 - mix) * in;
52-
53-
spl0 = spl1 = final * postgain;
39+
in = spl0 * pregain;
40+
41+
low_lpf = low_lpf + 0.1 * (in - low_lpf);
42+
mid_lpf = mid_lpf + 0.2 * (in - mid_lpf);
43+
44+
low = low_lpf;
45+
mid = mid_lpf - low_lpf;
46+
high = in - mid_lpf;
47+
48+
low_d = softclip(low * lowgain);
49+
mid_input_clamped = min(100, max(-100, mid * 3 * midgain));
50+
mid_d = sin(mid_input_clamped);
51+
high_d = 0.9 * softclip(high * highgain * 1.5);
52+
53+
multiband_out = low_d + mid_d + high_d;
54+
55+
pre_feedback = softclip(multiband_out);
56+
abs_in = abs(pre_feedback);
57+
58+
env = (1 - env_smooth) * env + env_smooth * abs_in;
59+
60+
boost = 1.5;
61+
mod_signal = 1 + feedback * sin(env * depth * $pi) * boost;
62+
feedback_out = softclip(pre_feedback * mod_signal);
5463

64+
final_out = mix * feedback_out + (1 - mix) * spl0;
65+
spl0 = spl1 = final_out * postgain;

0 commit comments

Comments
 (0)