shithub: neindaw

Download patch

ref: d654397d87dff31fa573754dba4911b5e8f71231
parent: f37c2187b2619e615d49f9830be7cd922290d07e
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed May 13 06:31:12 EDT 2020

dsp: update for new faust

--- a/dsp/kick_drum.c
+++ b/dsp/kick_drum.c
@@ -1,6 +1,6 @@
 /* ------------------------------------------------------------
 name: "Kick Drum"
-Code generated with Faust 2.23.2 (https://faust.grame.fr)
+Code generated with Faust 2.23.10 (https://faust.grame.fr)
 Compilation options: -lang c -scal -ftz 0
 ------------------------------------------------------------ */
 
@@ -148,10 +148,10 @@
 	m->declare(m->metaInterface, "maths.lib/copyright", "GRAME");
 	m->declare(m->metaInterface, "maths.lib/license", "LGPL with exception");
 	m->declare(m->metaInterface, "maths.lib/name", "Faust Math Library");
-	m->declare(m->metaInterface, "maths.lib/version", "2.2");
+	m->declare(m->metaInterface, "maths.lib/version", "2.3");
 	m->declare(m->metaInterface, "name", "Kick Drum");
 	m->declare(m->metaInterface, "oscillators.lib/name", "Faust Oscillator Library");
-	m->declare(m->metaInterface, "oscillators.lib/version", "0.0");
+	m->declare(m->metaInterface, "oscillators.lib/version", "0.1");
 	m->declare(m->metaInterface, "platform.lib/name", "Generic Platform Library");
 	m->declare(m->metaInterface, "platform.lib/version", "0.1");
 }
@@ -246,7 +246,7 @@
 	USED(sample_rate);
 	USED(dsp);
 	dsp->fSampleRate = sample_rate;
-	dsp->fConst0 = min(192000.0f, max(1.0f, (float)dsp->fSampleRate));
+	dsp->fConst0 = fminf(192000.0f, fmaxf(1.0f, (float)dsp->fSampleRate));
 	dsp->fConst1 = (1.0f / dsp->fConst0);
 }
 
@@ -310,25 +310,25 @@
 	float fSlow0 = (float)dsp->fHslider0;
 	float fSlow1 = (float)dsp->fHslider1;
 	float fSlow2 = ((float)dsp->fCheckbox0 * (float)dsp->fHslider2);
-	float fSlow3 = max(1.0f, (dsp->fConst0 * (float)dsp->fHslider3));
+	float fSlow3 = fmaxf(1.0f, (dsp->fConst0 * (float)dsp->fHslider3));
 	float fSlow4 = (1.0f / fSlow3);
 	float fSlow5 = (float)dsp->fButton0;
-	float fSlow6 = (1.0f / max(1.0f, (dsp->fConst0 * (float)dsp->fHslider4)));
-	float fSlow7 = max(1.0f, (dsp->fConst0 * (float)dsp->fHslider5));
+	float fSlow6 = (1.0f / fmaxf(1.0f, (dsp->fConst0 * (float)dsp->fHslider4)));
+	float fSlow7 = fmaxf(1.0f, (dsp->fConst0 * (float)dsp->fHslider5));
 	float fSlow8 = (1.0f / fSlow7);
-	float fSlow9 = (1.0f / max(1.0f, (dsp->fConst0 * (float)dsp->fHslider6)));
+	float fSlow9 = (1.0f / fmaxf(1.0f, (dsp->fConst0 * (float)dsp->fHslider6)));
 	/* C99 loop */
 	{
 		int i;
 		for (i = 0; (i < count); i = (i + 1)) {
 			dsp->fVec0[0] = fSlow5;
-			int iTemp0 = (fSlow5 > dsp->fVec0[1]);
-			dsp->iRec2[0] = (iTemp0 + ((fSlow5 <= dsp->fVec0[1]) * (dsp->iRec2[1] + (dsp->iRec2[1] > 0))));
-			float fTemp1 = (float)dsp->iRec2[0];
-			float fTemp2 = (dsp->fConst1 * (fSlow1 + (fSlow2 * max(0.0f, min((fSlow4 * fTemp1), (1.0f - (fSlow6 * (fTemp1 - fSlow3))))))));
-			float fTemp3 = (dsp->fRec1[1] * ((float)(iTemp0 > 0) + -1.0f));
-			dsp->fRec1[0] = (fTemp2 - (fTemp3 + floorf((fTemp2 - fTemp3))));
-			output0[i] = (FAUSTFLOAT)(fSlow0 * (ftbl0KickDrumSIG0[(int)(65536.0f * dsp->fRec1[0])] * max(0.0f, min((fSlow8 * fTemp1), ((fSlow9 * (fSlow7 - fTemp1)) + 1.0f)))));
+			dsp->iRec2[0] = ((fSlow5 > dsp->fVec0[1]) + ((fSlow5 <= dsp->fVec0[1]) * (dsp->iRec2[1] + (dsp->iRec2[1] > 0))));
+			float fTemp0 = (float)dsp->iRec2[0];
+			float fTemp1 = (dsp->fConst1 * (fSlow1 + (fSlow2 * fmaxf(0.0f, fminf((fSlow4 * fTemp0), (1.0f - (fSlow6 * (fTemp0 - fSlow3))))))));
+			float fTemp2 = (fSlow5 - dsp->fVec0[1]);
+			float fTemp3 = (dsp->fRec1[1] * ((float)((fTemp2 * (float)(fTemp2 > 0.0f)) > 0.0f) + -1.0f));
+			dsp->fRec1[0] = (fTemp1 - (fTemp3 + floorf((fTemp1 - fTemp3))));
+			output0[i] = (FAUSTFLOAT)(fSlow0 * (ftbl0KickDrumSIG0[(int)(65536.0f * dsp->fRec1[0])] * fmaxf(0.0f, fminf((fSlow8 * fTemp0), ((fSlow9 * (fSlow7 - fTemp0)) + 1.0f)))));
 			dsp->fVec0[1] = dsp->fVec0[0];
 			dsp->iRec2[1] = dsp->iRec2[0];
 			dsp->fRec1[1] = dsp->fRec1[0];
--- a/dsp/math.h
+++ b/dsp/math.h
@@ -7,3 +7,5 @@
 #define sinf sin
 #define sqrtf sqrt
 #define tanf tan
+#define fmaxf max
+#define fminf min