shithub: leaf

Download patch

ref: cd53a580c42b38c1be12e07b5e6fefee6cb89c95
parent: f0a1204dfb90feef80d99c1fbb0458d3748ef9ec
author: Jeff Snyder <jeff@snyderphonics.com>
date: Wed Dec 19 18:33:37 EST 2018

added Q control of hihat bandpass

--- a/LEAF/Inc/leaf-808.h
+++ b/LEAF/Inc/leaf-808.h
@@ -73,7 +73,9 @@
 void        t808Hihat_setOscNoiseMix     (t808Hihat* const, float oscNoiseMix);
 void        t808Hihat_setDecay           (t808Hihat* const, float decay);
 void        t808Hihat_setHighpassFreq    (t808Hihat* const, float freq);
-void        t808Hihat_etOscBandpassFreq  (t808Hihat* const, float freq);
+void        t808Hihat_setOscBandpassFreq  (t808Hihat* const, float freq);
+void 		t808Hihat_setOscBandpassQ		(t808Hihat* const hihat, float Q);
+void        t808Hihat_setStickBandPassFreq  (t808Hihat* const, float freq);
 void        t808Hihat_setOscFreq         (t808Hihat* const, float freq);
 
 
--- a/LEAF/Src/leaf-808.c
+++ b/LEAF/Src/leaf-808.c
@@ -157,6 +157,11 @@
     tSVF_setFreq(&hihat->bandpassOsc,freq);
 }
 
+void t808Hihat_setOscBandpassQ(t808Hihat* const hihat, float Q)
+{
+    tSVF_setQ(&hihat->bandpassOsc,Q);
+}
+
 void t808Hihat_setStickBandPassFreq(t808Hihat* const hihat, float freq)
 {
     tSVF_setFreq(&hihat->bandpassStick,freq);
@@ -165,8 +170,6 @@
 
 void t808Hihat_setOscFreq(t808Hihat* const hihat, float freq)
 {
-	//if (freq < 5600.0f) //to avoid aliasing (for some reason high frequency settings here cause hard faults)
-	{
 		tSquare_setFreq(&hihat->p[0], 2.0f * freq);
 		tSquare_setFreq(&hihat->p[1], 3.00f * freq);
 		tSquare_setFreq(&hihat->p[2], 4.16f * freq);
@@ -173,7 +176,6 @@
 		tSquare_setFreq(&hihat->p[3], 5.43f * freq);
 		tSquare_setFreq(&hihat->p[4], 6.79f * freq);
 		tSquare_setFreq(&hihat->p[5], 8.21f * freq);
-	}
 }
 
 void t808Hihat_init(t808Hihat* const hihat)