Skip to content

Commit 14a29dd

Browse files
authored
Merge pull request #27 from Sinuslabs/1.6.5
1.6.5
2 parents b381069 + 2c3627e commit 14a29dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3556
-595
lines changed

AdditionalSourceCode/nodes/Degrade.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ using pma_t = control::pma<NV,
185185
parameter::plain<cable_table_t<NV>, 0>>;
186186
template <int NV>
187187
using envelope_follower_t = wrap::mod<parameter::plain<pma_t<NV>, 0>,
188-
wrap::no_data<dynamics::envelope_follower>>;
188+
wrap::no_data<dynamics::envelope_follower<NV>>>;
189189

190190
template <int NV>
191191
using chain_t = container::chain<parameter::empty,

AdditionalSourceCode/nodes/Delay.h

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This just references the real file
2+
3+
#include "../../DspNetworks/ThirdParty/Delay.h"

AdditionalSourceCode/nodes/Reverb.h

+56-115
Large diffs are not rendered by default.

AdditionalSourceCode/nodes/factory.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
/** Autogenerated Main.cpp. */
22

3-
// ================================| Include only the DSP files |================================
3+
// =================================| Include only the DSP files |=================================
44

55
#include <AppConfig.h>
66
#include <hi_dsp_library/hi_dsp_library.h>
77
#include <hi_faust/hi_faust.h>
88
#include "includes.h"
9-
// ==========================| Now we can add the rest of the codebase |==========================
9+
// ===========================| Now we can add the rest of the codebase |===========================
1010

1111
#include <JuceHeader.h>
1212

13+
#if !JUCE_WINDOWS
1314
#pragma clang diagnostic push
1415
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
16+
#endif
1517

16-
// ======================================| Project Factory |======================================
18+
// =======================================| Project Factory |=======================================
1719

1820
namespace project
1921
{
@@ -23,12 +25,13 @@ struct Factory: public scriptnode::dll::StaticLibraryHostFactory
2325
Factory()
2426
{
2527
TempoSyncer::initTempoData();
26-
// Node registrations -------------------------------------------------------------------
28+
// Node registrations ----------------------------------------------------------------------
2729

28-
registerPolyNode<project::Flanger<1>, project::Flanger<NUM_POLYPHONIC_VOICES>>();
29-
registerPolyNode<project::FaustReverb<1>, project::FaustReverb<NUM_POLYPHONIC_VOICES>>();
30-
registerPolyNode<project::Distortion<1>, project::Distortion<NUM_POLYPHONIC_VOICES>>();
31-
registerPolyNode<project::Delay2<1>, project::Delay2<NUM_POLYPHONIC_VOICES>>();
30+
registerPolyNode<project::Flanger<1>, scriptnode::wrap::illegal_poly<project::Flanger<1>>>();
31+
registerPolyNode<project::FaustReverb<1>, scriptnode::wrap::illegal_poly<project::FaustReverb<1>>>();
32+
registerPolyNode<project::Distortion<1>, scriptnode::wrap::illegal_poly<project::Distortion<1>>>();
33+
registerPolyNode<project::Delay2<1>, scriptnode::wrap::illegal_poly<project::Delay2<1>>>();
34+
registerPolyNode<project::Delay<1>, scriptnode::wrap::illegal_poly<project::Delay<1>>>();
3235
registerPolyNode<project::Chorus2<1>, wrap::illegal_poly<project::Chorus2<1>>>();
3336
registerPolyNode<project::Degrade<1>, wrap::illegal_poly<project::Degrade<1>>>();
3437
registerPolyNode<project::Flair<1>, wrap::illegal_poly<project::Flair<1>>>();
@@ -45,6 +48,8 @@ scriptnode::dll::FactoryBase* scriptnode::DspNetwork::createStaticFactory()
4548
return new project::Factory();
4649
}
4750

51+
#if !JUCE_WINDOWS
4852
#pragma clang diagnostic pop
53+
#endif
4954

5055

AdditionalSourceCode/nodes/includes.h

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
// Include third party header files ----------------
1111

12+
#include "Delay.h"
1213
#include "Delay2.h"
1314
#include "Distortion.h"
1415
#include "FaustReverb.h"

DspNetworks/Networks/Reverb.xml

+44-102
Large diffs are not rendered by default.

DspNetworks/ThirdParty/Delay.h

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#pragma once
2+
#include "hi_faust/hi_faust.h"
3+
using Meta = ::faust::Meta;
4+
using UI = ::faust::UI;
5+
#define FAUST_UIMACROS
6+
// define dummy macros
7+
#define FAUST_ADDCHECKBOX(...)
8+
#define FAUST_ADDNUMENTRY(...)
9+
#define FAUST_ADDBUTTON(...)
10+
#define FAUST_ADDHORIZONTALSLIDER(...)
11+
#define FAUST_ADDVERTICALSLIDER(...)
12+
#define FAUST_ADDVERTICALBARGRAPH(...)
13+
#define FAUST_ADDHORIZONTALBARGRAPH(...)
14+
#define FAUST_ADDSOUNDFILE(...)
15+
#include "src/Delay.cpp"
16+
#if (FAUST_INPUTS - FAUST_OUTPUTS) > 0
17+
#error Number of inputs and outputs in faust code must match!
18+
#endif
19+
namespace project {
20+
struct DelayMetaData {
21+
SN_NODE_ID("Delay");
22+
};
23+
template <int NV, class ModParameterClass=scriptnode::parameter::empty_list>
24+
using Delay = scriptnode::faust::faust_static_wrapper<NV, ModParameterClass, _Delay, DelayMetaData, FAUST_OUTPUTS>;
25+
} // namespace project
26+
// undef dummy macros
27+
#undef FAUST_UIMACROS
28+
#undef FAUST_ADDCHECKBOX
29+
#undef FAUST_ADDNUMENTRY
30+
#undef FAUST_ADDBUTTON
31+
#undef FAUST_ADDHORIZONTALSLIDER
32+
#undef FAUST_ADDVERTICALSLIDER
33+
#undef FAUST_ADDVERTICALBARGRAPH
34+
#undef FAUST_ADDHORIZONTALBARGRAPH
35+
#undef FAUST_ADDSOUNDFILE
36+
// undef faust ui macros
37+
#undef FAUST_FILE_NAME
38+
#undef FAUST_CLASS_NAME
39+
#undef FAUST_COMPILATION_OPIONS
40+
#undef FAUST_INPUTS
41+
#undef FAUST_OUTPUTS
42+
#undef FAUST_ACTIVES
43+
#undef FAUST_PASSIVES
44+
#undef FAUST_LIST_ACTIVES
45+
#undef FAUST_LIST_PASSIVES

DspNetworks/ThirdParty/src/Delay.cpp

+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
/* ------------------------------------------------------------
2+
author: "Yann Orlarey"
3+
copyright: "Grame"
4+
license: "STK-4.3"
5+
name: "smoothDelay"
6+
version: "1.0"
7+
Code generated with Faust 2.79.2 (https://faust.grame.fr)
8+
Compilation options: -lang cpp -rui -nvi -ct 1 -cn _Delay -scn ::faust::dsp -es 1 -mcd 16 -mdd 1024 -mdy 33 -uim -single -ftz 0
9+
------------------------------------------------------------ */
10+
11+
#ifndef ___Delay_H__
12+
#define ___Delay_H__
13+
14+
#ifndef FAUSTFLOAT
15+
#define FAUSTFLOAT float
16+
#endif
17+
18+
#include <algorithm>
19+
#include <cmath>
20+
#include <cstdint>
21+
#include <math.h>
22+
23+
#ifndef FAUSTCLASS
24+
#define FAUSTCLASS _Delay
25+
#endif
26+
27+
#ifdef __APPLE__
28+
#define exp10f __exp10f
29+
#define exp10 __exp10
30+
#endif
31+
32+
#if defined(_WIN32)
33+
#define RESTRICT __restrict
34+
#else
35+
#define RESTRICT __restrict__
36+
#endif
37+
38+
39+
struct _Delay final : public ::faust::dsp {
40+
41+
FAUSTFLOAT fHslider0;
42+
int IOTA0;
43+
float fVec0[1048576];
44+
int fSampleRate;
45+
float fConst0;
46+
float fConst1;
47+
FAUSTFLOAT fHslider1;
48+
float fConst2;
49+
FAUSTFLOAT fHslider2;
50+
float fRec1[2];
51+
float fRec2[2];
52+
float fRec3[2];
53+
float fRec4[2];
54+
float fRec0[2];
55+
float fVec1[1048576];
56+
float fRec5[2];
57+
58+
_Delay() {
59+
}
60+
61+
void metadata(Meta* m) {
62+
m->declare("author", "Yann Orlarey");
63+
m->declare("basics.lib/name", "Faust Basic Element Library");
64+
m->declare("basics.lib/version", "1.21.0");
65+
m->declare("compile_options", "-lang cpp -rui -nvi -ct 1 -cn _Delay -scn ::faust::dsp -es 1 -mcd 16 -mdd 1024 -mdy 33 -uim -single -ftz 0");
66+
m->declare("copyright", "Grame");
67+
m->declare("delays.lib/name", "Faust Delay Library");
68+
m->declare("delays.lib/version", "1.1.0");
69+
m->declare("filename", "Delay.dsp");
70+
m->declare("license", "STK-4.3");
71+
m->declare("maths.lib/author", "GRAME");
72+
m->declare("maths.lib/copyright", "GRAME");
73+
m->declare("maths.lib/license", "LGPL with exception");
74+
m->declare("maths.lib/name", "Faust Math Library");
75+
m->declare("maths.lib/version", "2.8.1");
76+
m->declare("name", "smoothDelay");
77+
m->declare("platform.lib/name", "Generic Platform Library");
78+
m->declare("platform.lib/version", "1.3.0");
79+
m->declare("signals.lib/name", "Faust Signal Routing Library");
80+
m->declare("signals.lib/version", "1.6.0");
81+
m->declare("version", "1.0");
82+
}
83+
84+
static constexpr int getStaticNumInputs() {
85+
return 2;
86+
}
87+
static constexpr int getStaticNumOutputs() {
88+
return 2;
89+
}
90+
int getNumInputs() {
91+
return 2;
92+
}
93+
int getNumOutputs() {
94+
return 2;
95+
}
96+
97+
static void classInit(int sample_rate) {
98+
}
99+
100+
void instanceConstants(int sample_rate) {
101+
fSampleRate = sample_rate;
102+
fConst0 = std::min<float>(1.92e+05f, std::max<float>(1.0f, float(fSampleRate)));
103+
fConst1 = 0.001f * fConst0;
104+
fConst2 = 1e+03f / fConst0;
105+
}
106+
107+
void instanceResetUserInterface() {
108+
fHslider0 = FAUSTFLOAT(0.0f);
109+
fHslider1 = FAUSTFLOAT(0.0f);
110+
fHslider2 = FAUSTFLOAT(1e+01f);
111+
}
112+
113+
void instanceClear() {
114+
IOTA0 = 0;
115+
for (int l0 = 0; l0 < 1048576; l0 = l0 + 1) {
116+
fVec0[l0] = 0.0f;
117+
}
118+
for (int l1 = 0; l1 < 2; l1 = l1 + 1) {
119+
fRec1[l1] = 0.0f;
120+
}
121+
for (int l2 = 0; l2 < 2; l2 = l2 + 1) {
122+
fRec2[l2] = 0.0f;
123+
}
124+
for (int l3 = 0; l3 < 2; l3 = l3 + 1) {
125+
fRec3[l3] = 0.0f;
126+
}
127+
for (int l4 = 0; l4 < 2; l4 = l4 + 1) {
128+
fRec4[l4] = 0.0f;
129+
}
130+
for (int l5 = 0; l5 < 2; l5 = l5 + 1) {
131+
fRec0[l5] = 0.0f;
132+
}
133+
for (int l6 = 0; l6 < 1048576; l6 = l6 + 1) {
134+
fVec1[l6] = 0.0f;
135+
}
136+
for (int l7 = 0; l7 < 2; l7 = l7 + 1) {
137+
fRec5[l7] = 0.0f;
138+
}
139+
}
140+
141+
void init(int sample_rate) {
142+
classInit(sample_rate);
143+
instanceInit(sample_rate);
144+
}
145+
146+
void instanceInit(int sample_rate) {
147+
instanceConstants(sample_rate);
148+
instanceResetUserInterface();
149+
instanceClear();
150+
}
151+
152+
_Delay* clone() {
153+
return new _Delay();
154+
}
155+
156+
int getSampleRate() {
157+
return fSampleRate;
158+
}
159+
160+
void buildUserInterface(UI* ui_interface) {
161+
ui_interface->openVerticalBox("smoothDelay");
162+
ui_interface->declare(&fHslider1, "style", "knob");
163+
ui_interface->declare(&fHslider1, "unit", "ms");
164+
ui_interface->addHorizontalSlider("delay", &fHslider1, FAUSTFLOAT(0.0f), FAUSTFLOAT(0.0f), FAUSTFLOAT(5e+03f), FAUSTFLOAT(0.1f));
165+
ui_interface->declare(&fHslider0, "style", "knob");
166+
ui_interface->addHorizontalSlider("feedback", &fHslider0, FAUSTFLOAT(0.0f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1e+02f), FAUSTFLOAT(0.1f));
167+
ui_interface->declare(&fHslider2, "style", "knob");
168+
ui_interface->declare(&fHslider2, "unit", "ms");
169+
ui_interface->addHorizontalSlider("interpolation", &fHslider2, FAUSTFLOAT(1e+01f), FAUSTFLOAT(1.0f), FAUSTFLOAT(1e+02f), FAUSTFLOAT(0.1f));
170+
ui_interface->closeBox();
171+
}
172+
173+
void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) {
174+
FAUSTFLOAT* input0 = inputs[0];
175+
FAUSTFLOAT* input1 = inputs[1];
176+
FAUSTFLOAT* output0 = outputs[0];
177+
FAUSTFLOAT* output1 = outputs[1];
178+
float fSlow0 = 0.01f * std::max<float>(0.0f, std::min<float>(1e+02f, float(fHslider0)));
179+
float fSlow1 = fConst1 * std::max<float>(0.0f, std::min<float>(5e+03f, float(fHslider1)));
180+
float fSlow2 = fConst2 / std::max<float>(1.0f, std::min<float>(1e+02f, float(fHslider2)));
181+
for (int i0 = 0; i0 < count; i0 = i0 + 1) {
182+
float fTemp0 = float(input0[i0]) + fSlow0 * fRec0[1];
183+
fVec0[IOTA0 & 1048575] = fTemp0;
184+
float fTemp1 = ((fRec1[1] != 0.0f) ? (((fRec2[1] > 0.0f) & (fRec2[1] < 1.0f)) ? fRec1[1] : 0.0f) : (((fRec2[1] == 0.0f) & (fSlow1 != fRec3[1])) ? fSlow2 : (((fRec2[1] == 1.0f) & (fSlow1 != fRec4[1])) ? -fSlow2 : 0.0f)));
185+
fRec1[0] = fTemp1;
186+
fRec2[0] = std::max<float>(0.0f, std::min<float>(1.0f, fRec2[1] + fTemp1));
187+
fRec3[0] = (((fRec2[1] >= 1.0f) & (fRec4[1] != fSlow1)) ? fSlow1 : fRec3[1]);
188+
fRec4[0] = (((fRec2[1] <= 0.0f) & (fRec3[1] != fSlow1)) ? fSlow1 : fRec4[1]);
189+
int iTemp2 = int(std::min<float>(524288.0f, std::max<float>(0.0f, fRec3[0])));
190+
float fTemp3 = fVec0[(IOTA0 - iTemp2) & 1048575];
191+
int iTemp4 = int(std::min<float>(524288.0f, std::max<float>(0.0f, fRec4[0])));
192+
fRec0[0] = fTemp3 + fRec2[0] * (fVec0[(IOTA0 - iTemp4) & 1048575] - fTemp3);
193+
output0[i0] = FAUSTFLOAT(fRec0[0]);
194+
float fTemp5 = float(input1[i0]) + fSlow0 * fRec5[1];
195+
fVec1[IOTA0 & 1048575] = fTemp5;
196+
float fTemp6 = fVec1[(IOTA0 - iTemp2) & 1048575];
197+
fRec5[0] = fTemp6 + fRec2[0] * (fVec1[(IOTA0 - iTemp4) & 1048575] - fTemp6);
198+
output1[i0] = FAUSTFLOAT(fRec5[0]);
199+
IOTA0 = IOTA0 + 1;
200+
fRec1[1] = fRec1[0];
201+
fRec2[1] = fRec2[0];
202+
fRec3[1] = fRec3[0];
203+
fRec4[1] = fRec4[0];
204+
fRec0[1] = fRec0[0];
205+
fRec5[1] = fRec5[0];
206+
}
207+
}
208+
209+
};
210+
211+
#ifdef FAUST_UIMACROS
212+
213+
#define FAUST_FILE_NAME "Delay.dsp"
214+
#define FAUST_CLASS_NAME "_Delay"
215+
#define FAUST_COMPILATION_OPIONS "-lang cpp -rui -nvi -ct 1 -cn _Delay -scn ::faust::dsp -es 1 -mcd 16 -mdd 1024 -mdy 33 -uim -single -ftz 0"
216+
#define FAUST_INPUTS 2
217+
#define FAUST_OUTPUTS 2
218+
#define FAUST_ACTIVES 3
219+
#define FAUST_PASSIVES 0
220+
221+
FAUST_ADDHORIZONTALSLIDER("delay", fHslider1, 0.0f, 0.0f, 5e+03f, 0.1f);
222+
FAUST_ADDHORIZONTALSLIDER("feedback", fHslider0, 0.0f, 0.0f, 1e+02f, 0.1f);
223+
FAUST_ADDHORIZONTALSLIDER("interpolation", fHslider2, 1e+01f, 1.0f, 1e+02f, 0.1f);
224+
225+
#define FAUST_LIST_ACTIVES(p) \
226+
p(HORIZONTALSLIDER, delay, "delay", fHslider1, 0.0f, 0.0f, 5e+03f, 0.1f) \
227+
p(HORIZONTALSLIDER, feedback, "feedback", fHslider0, 0.0f, 0.0f, 1e+02f, 0.1f) \
228+
p(HORIZONTALSLIDER, interpolation, "interpolation", fHslider2, 1e+01f, 1.0f, 1e+02f, 0.1f) \
229+
230+
#define FAUST_LIST_PASSIVES(p) \
231+
232+
#endif
233+
234+
#endif

0 commit comments

Comments
 (0)