Skip to content

Commit b20f153

Browse files
committed
Add more fx
1 parent 8a793ba commit b20f153

File tree

15 files changed

+5211
-22
lines changed

15 files changed

+5211
-22
lines changed

plugin/Resources/layout.json

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@
106106
},
107107
{ "id": "fx", "x": 0, "y": "prevB()+1", "w": "parW() - 169", "h": 137, "children":
108108
[
109-
{ "id": "gate", "x": "0", "y": 0, "w": 290, "h": 137, "children":
109+
{ "id": "gate", "x": "0", "y": 0, "w": 306, "h": 137, "children":
110110
[
111-
{ "id": "Beat", "x": 61, "y": 30, "w": 42, "h": 57 },
111+
{ "id": "Beat", "x": 69, "y": 30, "w": 42, "h": 57 },
112112
{ "id": "Length", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
113113
{ "id": "A", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
114114
{ "id": "R", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
@@ -124,9 +124,42 @@
124124
{ "id": "Width", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 }
125125
]
126126
},
127-
{ "id": "distort", "x": "prevR()+1", "y": "prevY()", "w": 100, "h": 137, "children":
127+
{ "id": "distort", "x": "prevR()+1", "y": "prevY()", "w": 84, "h": 137, "children":
128128
[
129-
{ "id": "Amount", "x": 22, "y": "23 + 22", "w": 56, "h": 70 }
129+
{ "id": "Distort", "children":
130+
[
131+
{ "id": "mode", "r": "parW() - 4", "y": 4, "w": 16, "h": 16 }
132+
]
133+
},
134+
{ "id": "page1", "bounds": "parent", "children":
135+
[
136+
{ "id": "Amount", "x": 14, "y": "23 + 22", "w": 56, "h": 70 }
137+
]
138+
},
139+
{ "id": "page2", "bounds": "parent", "children":
140+
[
141+
{ "id": "Rate", "x": 0, "y": 23, "w": 42, "h": 57 },
142+
{ "id": "Rez", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
143+
{ "id": "Hard", "x": 0, "y": "prevB()", "w": 42, "h": 57 },
144+
{ "id": "Mix", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 }
145+
]
146+
},
147+
{ "id": "page3", "bounds": "parent", "children":
148+
[
149+
{ "id": "Gain", "x": 0, "y": 23, "w": 42, "h": 57 },
150+
{ "id": "Tone", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
151+
{ "id": "Output", "x": 0, "y": "prevB()", "w": 42, "h": 57 },
152+
{ "id": "Mix", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 }
153+
]
154+
},
155+
{ "id": "page4", "bounds": "parent", "children":
156+
[
157+
{ "id": "Gain", "x": 0, "y": 23, "w": 42, "h": 57 },
158+
{ "id": "Tone", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
159+
{ "id": "Output", "x": 0, "y": "prevB()", "w": 42, "h": 57 },
160+
{ "id": "Mix", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 }
161+
]
162+
}
130163
]
131164
},
132165
{ "id": "delay", "x": "prevR()+1", "y": "prevY()", "w": 126, "h": 137, "children":

plugin/Source/FX/DeRez2.cpp

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
/* ========================================
2+
* DeRez2 - DeRez2.h
3+
* Copyright (c) 2016 airwindows, Airwindows uses the MIT license
4+
* ======================================== */
5+
6+
#ifndef __DeRez2_H
7+
#include "DeRez2.h"
8+
#endif
9+
10+
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wfloat-conversion", "-Wimplicit-float-conversion", "-Wunused-parameter")
11+
12+
DeRez2::DeRez2(audioMasterCallback audioMaster) :
13+
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
14+
{
15+
A = 1.0;
16+
B = 1.0;
17+
C = 1.0;
18+
D = 1.0;
19+
lastSampleL = 0.0;
20+
heldSampleL = 0.0;
21+
lastDrySampleL = 0.0;
22+
lastOutputSampleL = 0.0;
23+
24+
lastSampleR = 0.0;
25+
heldSampleR = 0.0;
26+
lastDrySampleR = 0.0;
27+
lastOutputSampleR = 0.0;
28+
29+
position = 0.0;
30+
incrementA = 0.0;
31+
incrementB = 0.0;
32+
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
33+
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
34+
//this is reset: values being initialized only once. Startup values, whatever they are.
35+
36+
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
37+
_canDo.insert("plugAsSend"); // plug-in can be used as a send effect.
38+
_canDo.insert("x2in2out");
39+
setNumInputs(kNumInputs);
40+
setNumOutputs(kNumOutputs);
41+
setUniqueID(kUniqueId);
42+
canProcessReplacing(); // supports output replacing
43+
canDoubleReplacing(); // supports double precision processing
44+
programsAreChunks(true);
45+
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
46+
}
47+
48+
DeRez2::~DeRez2() {}
49+
VstInt32 DeRez2::getVendorVersion () {return 1000;}
50+
void DeRez2::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
51+
void DeRez2::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);}
52+
//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than
53+
//trying to do versioning and preventing people from using older versions. Maybe they like the old one!
54+
55+
static float pinParameter(float data)
56+
{
57+
if (data < 0.0f) return 0.0f;
58+
if (data > 1.0f) return 1.0f;
59+
return data;
60+
}
61+
62+
VstInt32 DeRez2::getChunk (void** data, bool isPreset)
63+
{
64+
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
65+
chunkData[0] = A;
66+
chunkData[1] = B;
67+
chunkData[2] = C;
68+
chunkData[3] = D;
69+
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
70+
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
71+
started with. */
72+
73+
*data = chunkData;
74+
return kNumParameters * sizeof(float);
75+
}
76+
77+
VstInt32 DeRez2::setChunk (void* data, VstInt32 byteSize, bool isPreset)
78+
{
79+
float *chunkData = (float *)data;
80+
A = pinParameter(chunkData[0]);
81+
B = pinParameter(chunkData[1]);
82+
C = pinParameter(chunkData[2]);
83+
D = pinParameter(chunkData[3]);
84+
/* We're ignoring byteSize as we found it to be a filthy liar */
85+
86+
/* calculate any other fields you need here - you could copy in
87+
code from setParameter() here. */
88+
return 0;
89+
}
90+
91+
void DeRez2::setParameter(VstInt32 index, float value) {
92+
switch (index) {
93+
case kParamA: A = value; break;
94+
case kParamB: B = value; break;
95+
case kParamC: C = value; break;
96+
case kParamD: D = value; break;
97+
default: throw; // unknown parameter, shouldn't happen!
98+
}
99+
}
100+
101+
float DeRez2::getParameter(VstInt32 index) {
102+
switch (index) {
103+
case kParamA: return A; break;
104+
case kParamB: return B; break;
105+
case kParamC: return C; break;
106+
case kParamD: return D; break;
107+
default: break; // unknown parameter, shouldn't happen!
108+
} return 0.0; //we only need to update the relevant name, this is simple to manage
109+
}
110+
111+
void DeRez2::getParameterName(VstInt32 index, char *text) {
112+
switch (index) {
113+
case kParamA: vst_strncpy (text, "Rate", kVstMaxParamStrLen); break;
114+
case kParamB: vst_strncpy (text, "Rez", kVstMaxParamStrLen); break;
115+
case kParamC: vst_strncpy (text, "Hard", kVstMaxParamStrLen); break;
116+
case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
117+
default: break; // unknown parameter, shouldn't happen!
118+
} //this is our labels for displaying in the VST host
119+
}
120+
121+
void DeRez2::getParameterDisplay(VstInt32 index, char *text) {
122+
switch (index) {
123+
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
124+
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
125+
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
126+
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
127+
default: break; // unknown parameter, shouldn't happen!
128+
} //this displays the values and handles 'popups' where it's discrete choices
129+
}
130+
131+
void DeRez2::getParameterLabel(VstInt32 index, char *text) {
132+
switch (index) {
133+
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
134+
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
135+
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
136+
case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
137+
default: break; // unknown parameter, shouldn't happen!
138+
}
139+
}
140+
141+
VstInt32 DeRez2::canDo(char *text)
142+
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
143+
144+
bool DeRez2::getEffectName(char* name) {
145+
vst_strncpy(name, "DeRez2", kVstMaxProductStrLen); return true;
146+
}
147+
148+
VstPlugCategory DeRez2::getPlugCategory() {return kPlugCategEffect;}
149+
150+
bool DeRez2::getProductString(char* text) {
151+
vst_strncpy (text, "airwindows DeRez2", kVstMaxProductStrLen); return true;
152+
}
153+
154+
bool DeRez2::getVendorString(char* text) {
155+
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
156+
}

plugin/Source/FX/DeRez2.h

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* ========================================
2+
* DeRez2 - DeRez2.h
3+
* Created 8/12/11 by SPIAdmin
4+
* Copyright (c) 2011 __MyCompanyName__, Airwindows uses the MIT license
5+
* ======================================== */
6+
7+
#pragma once
8+
9+
#include "FXBase.h"
10+
11+
#include <set>
12+
#include <string>
13+
#include <math.h>
14+
15+
class DeRez2 :
16+
public AudioEffectX
17+
{
18+
public:
19+
enum {
20+
kParamA = 0,
21+
kParamB = 1,
22+
kParamC = 2,
23+
kParamD = 3,
24+
kNumParameters = 4
25+
}; //
26+
27+
static constexpr int kNumPrograms = 0;
28+
static constexpr int kNumInputs = 2;
29+
static constexpr int kNumOutputs = 2;
30+
static constexpr unsigned long kUniqueId = 'eerz'; //Change this to what the AU identity is!
31+
32+
DeRez2(audioMasterCallback audioMaster);
33+
~DeRez2();
34+
virtual bool getEffectName(char* name); // The plug-in name
35+
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
36+
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
37+
virtual bool getVendorString(char* text); // Vendor info
38+
virtual VstInt32 getVendorVersion(); // Version number
39+
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
40+
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
41+
virtual void getProgramName(char *name); // read the name from the host
42+
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
43+
virtual VstInt32 getChunk (void** data, bool isPreset);
44+
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
45+
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
46+
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
47+
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
48+
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
49+
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
50+
virtual VstInt32 canDo(char *text);
51+
private:
52+
char _programName[kVstMaxProgNameLen + 1];
53+
std::set< std::string > _canDo;
54+
55+
double lastSampleL;
56+
double heldSampleL;
57+
double lastDrySampleL;
58+
double lastOutputSampleL;
59+
60+
double lastSampleR;
61+
double heldSampleR;
62+
double lastDrySampleR;
63+
double lastOutputSampleR;
64+
65+
double position;
66+
double incrementA;
67+
double incrementB;
68+
69+
uint32_t fpdL;
70+
uint32_t fpdR;
71+
//default stuff
72+
73+
float A;
74+
float B;
75+
float C;
76+
float D;
77+
78+
};
79+

0 commit comments

Comments
 (0)