Skip to content

Commit 35c5346

Browse files
committed
add filter envelope and reverb section
1 parent a1e3ea2 commit 35c5346

14 files changed

+304
-71
lines changed

JuceLibraryCode/AppConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
#define JucePlugin_Name "sBMP4"
359359
#endif
360360
#ifndef JucePlugin_Desc
361-
#define JucePlugin_Desc "sBMP4"
361+
#define JucePlugin_Desc "Subtractive synth based on the Prophet REV2"
362362
#endif
363363
#ifndef JucePlugin_Manufacturer
364364
#define JucePlugin_Manufacturer "BMP4"
@@ -373,7 +373,7 @@
373373
#define JucePlugin_ManufacturerCode 0x424d5034 // 'BMP4'
374374
#endif
375375
#ifndef JucePlugin_PluginCode
376-
#define JucePlugin_PluginCode 0x73424d50 // 'sBMP'
376+
#define JucePlugin_PluginCode 0x53626d70 // 'Sbmp'
377377
#endif
378378
#ifndef JucePlugin_IsSynth
379379
#define JucePlugin_IsSynth 1

Source/ButtonGroupComponent.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
/*
22
==============================================================================
33
4-
ButtonGroupComponent.cpp
5-
Created: 23 Jan 2019 4:41:28pm
6-
Author: Haake
4+
Copyright (c) 2019 - Vincent Berthiaume
5+
6+
The code included in this file is provided under the terms of the ISC license
7+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
8+
To use, copy, modify, and/or distribute this software for any purpose with or
9+
without fee is hereby granted provided that the above copyright notice and
10+
this permission notice appear in all copies.
11+
12+
sBMP4 IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
13+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
14+
DISCLAIMED.
715
816
==============================================================================
917
*/

Source/ButtonGroupComponent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct LfoDest : public Selection
6464
{
6565
osc1Freq = 0,
6666
osc2Freq,
67-
filterCurOff,
67+
filterCutOff,
6868
filterResonance,
6969
total
7070
};
@@ -77,7 +77,7 @@ enum defaults
7777
{
7878
defaultOscShape = (int) OscShape::saw,
7979
defaultLfoShape = (int) LfoShape::triangle,
80-
defaultLfoDest = (int) LfoDest::filterCurOff
80+
defaultLfoDest = (int) LfoDest::filterCutOff
8181
};
8282

8383
class FilledDrawableButton : public DrawableButton

Source/Helpers.h

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
/*
22
==============================================================================
33
4-
Helpers.h
5-
Created: 21 Jan 2019 11:52:58am
6-
Author: Haake
4+
Copyright (c) 2019 - Vincent Berthiaume
5+
6+
The code included in this file is provided under the terms of the ISC license
7+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
8+
To use, copy, modify, and/or distribute this software for any purpose with or
9+
without fee is hereby granted provided that the above copyright notice and
10+
this permission notice appear in all copies.
11+
12+
sBMP4 IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
13+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
14+
DISCLAIMED.
715
816
==============================================================================
917
*/
@@ -51,14 +59,17 @@ namespace Constants
5159
static const float defaultLfoAmount = 0.f;
5260

5361
static const float defaultEffectParam1 = 0.f;
62+
static const float defaultEffectParam2 = 0.f;
5463

5564
static const NormalisableRange<float> dBRange = {-12.f, 12.f};
5665
static const NormalisableRange<float> sliderRange = {0.f, 1.f};
5766
static const NormalisableRange<float> centeredSliderRange = {-0.5f, .5f};
5867

5968
//envelope stuff
69+
static const auto minA = .001f;
6070
static const auto minAmp = .01f;
61-
static const auto defaultAmpA = minAmp;
71+
72+
static const auto defaultAmpA = minA;
6273
static const auto defaultAmpD = minAmp;
6374
static const auto defaultAmpS = 1.f;
6475
static const auto defaultAmpR = .25f;
@@ -67,7 +78,7 @@ namespace Constants
6778
static const auto ampSkewFactor = .5f;
6879
static const auto cutOffSkewFactor = .5f;
6980

70-
static const NormalisableRange<float> attackRange {minAmp, 25.f, 0.f, ampSkewFactor};
81+
static const NormalisableRange<float> attackRange {minA, 25.f, 0.f, ampSkewFactor};
7182
static const NormalisableRange<float> decayRange {minAmp, 25.f, 0.f, ampSkewFactor};
7283
static const NormalisableRange<float> sustainRange {minAmp, 1.f, 0.f, sustainSkewFactor};
7384
static const NormalisableRange<float> releaseRange {minAmp, 25.f, 0.f, ampSkewFactor};
@@ -103,6 +114,11 @@ namespace sBMP4AudioProcessorIDs
103114
const String ampSustainID = "ampSustainID";
104115
const String ampReleaseID = "ampReleaseID";
105116

117+
const String filterEnvAttackID = "filterEnvAttackID";
118+
const String filterEnvDecayID = "filterEnvDecayID";
119+
const String filterEnvSustainID = "filterEnvSustainID";
120+
const String filterEnvReleaseID = "filterEnvReleaseID";
121+
106122
const String lfoShapeID = "lfoShapeID";
107123
const String lfoDestID = "lfoDestID";
108124
const String lfoFreqID = "lfoFreqID";
@@ -142,9 +158,15 @@ namespace sBMP4AudioProcessorNames
142158
const String lfoFreqSliderDesc = "FREQUENCY";
143159
const String lfoAmountSliderDesc = "AMOUNT";
144160

161+
#if 0
145162
const String effectGroupDesc = "EFFECT";
146163
const String effectParam1Desc = "PARAM 1";
147164
const String effectParam2Desc = "PARAM 2";
165+
#else
166+
const String effectGroupDesc = "REVERB";
167+
const String effectParam1Desc = "ROOM";
168+
const String effectParam2Desc = "MIX";
169+
#endif
148170
}
149171

150172
namespace sBMP4AudioProcessorChoices
@@ -165,9 +187,6 @@ namespace sBMP4AudioProcessorChoices
165187
const String lfoDest1 = "Osc2 Freq";
166188
const String lfoDest2 = "Cutoff";
167189
const String lfoDest3 = "Resonance";
168-
169-
const String effectChoices0 = "Reverb";
170-
const String effectChoices1 = "None";
171190
}
172191

173192
inline bool getVarAsBool (const ValueTree& v, const Identifier& id) { return static_cast<bool> (v.getProperty (id)); }

Source/PluginEditor.cpp

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
==============================================================================
3+
4+
Copyright (c) 2019 - Vincent Berthiaume
5+
6+
The code included in this file is provided under the terms of the ISC license
7+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
8+
To use, copy, modify, and/or distribute this software for any purpose with or
9+
without fee is hereby granted provided that the above copyright notice and
10+
this permission notice appear in all copies.
11+
12+
sBMP4 IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
13+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
14+
DISCLAIMED.
15+
16+
==============================================================================
17+
*/
18+
119
#include "PluginProcessor.h"
220
#include "PluginEditor.h"
321

@@ -13,7 +31,7 @@ enum sizes
1331
lineCount = 4,
1432
lineH = 75,
1533

16-
columnCount = 6,
34+
columnCount = 8,
1735
columnW = 110,
1836

1937
height = 2 * overallGap + 4 * panelGap + lineCount * lineH,
@@ -44,6 +62,10 @@ sBMP4AudioProcessorEditor::sBMP4AudioProcessorEditor (sBMP4AudioProcessor& p) :
4462
filterGroup ({}, filterGroupDesc),
4563
filterCutoffAttachment (p.state, filterCutoffID, filterCutoffSlider),
4664
filterResonanceAttachment (p.state, filterResonanceID, filterResonanceSlider),
65+
filterEnvAttackAttachment (p.state, filterEnvAttackID, filterEnvAttackSlider),
66+
filterEnvDecayAttachment (p.state, filterEnvDecayID, filterEnvDecaySlider),
67+
filterEnvSustainAttachment (p.state, filterEnvSustainID, filterEnvSustainSlider),
68+
filterEnvReleaseAttachment (p.state, filterEnvReleaseID, filterEnvReleaseSlider),
4769

4870
//AMPLIFIER
4971
ampGroup ({}, ampGroupDesc),
@@ -106,9 +128,9 @@ sBMP4AudioProcessorEditor::sBMP4AudioProcessorEditor (sBMP4AudioProcessor& p) :
106128
{osc1FreqDesc, osc1TuningDesc, String(), oscSubOctDesc, osc2FreqDesc, osc2TuningDesc, String(), oscMixDesc},
107129
{&osc1FreqSlider, &osc1TuningSlider, &osc1ShapeButtons, &oscSubSlider, &osc2FreqSlider, &osc2TuningSlider, &osc2ShapeButtons, &oscMixSlider});
108130

109-
addGroup (filterGroup, {&filterCutoffLabel, &filterResonanceLabel},
110-
{filterCutoffSliderDesc, filterResonanceSliderDesc},
111-
{&filterCutoffSlider, &filterResonanceSlider});
131+
addGroup (filterGroup, {&filterCutoffLabel, &filterResonanceLabel, &filterEnvAttackLabel, &filterEnvDecayLabel, &filterEnvSustainLabel, &filterEnvReleaseLabel},
132+
{filterCutoffSliderDesc, filterResonanceSliderDesc, ampAttackSliderDesc, ampDecaySliderDesc, ampSustainSliderDesc, ampReleaseSliderDesc},
133+
{&filterCutoffSlider, &filterResonanceSlider, &filterEnvAttackSlider, &filterEnvDecaySlider, &filterEnvSustainSlider, &filterEnvReleaseSlider});
112134

113135
addGroup (ampGroup, {&ampAttackLabel, &ampDecayLabel, &ampSustainLabel, &ampReleaseLabel},
114136
{ampAttackSliderDesc, ampDecaySliderDesc, ampSustainSliderDesc, ampReleaseSliderDesc},
@@ -151,7 +173,7 @@ void sBMP4AudioProcessorEditor::resized()
151173
auto curComponentIndex = 0;
152174
for (int i = 0; i < numLines; ++i)
153175
{
154-
auto lineBounds = groupBounds.removeFromTop (lineH);
176+
auto lineBounds = groupBounds.removeFromTop (lineH);
155177

156178
for (int j = 0; j < numColumns; ++j)
157179
{
@@ -168,13 +190,15 @@ void sBMP4AudioProcessorEditor::resized()
168190
}
169191
};
170192

193+
//top section
171194
setupGroup (oscGroup, topSection.removeFromLeft (4 * columnW + 2 * panelGap), {&osc1FreqSlider, &osc1TuningSlider, &osc1ShapeButtons, &oscSubSlider,
172-
&osc2FreqSlider, &osc2TuningSlider, &osc2ShapeButtons, &oscMixSlider}, 2, 4);
173-
setupGroup (ampGroup, bottomSection.removeFromLeft (4 * columnW + 2 * panelGap), {&ampAttackSlider,&ampDecaySlider, &ampSustainSlider, &ampReleaseSlider}, 2, 4);
195+
&osc2FreqSlider, &osc2TuningSlider, &osc2ShapeButtons, &oscMixSlider}, 2, 4);
196+
setupGroup (filterGroup, topSection, {&filterCutoffSlider, &filterResonanceSlider, nullptr, nullptr, &filterEnvAttackSlider,&filterEnvDecaySlider, &filterEnvSustainSlider, &filterEnvReleaseSlider}, 2, 4);
174197

175-
setupGroup (filterGroup, topSection, {&filterCutoffSlider, &filterResonanceSlider}, 2, 2);
176-
setupGroup (lfoGroup, bottomSection, {&lfoShapeButtons, &lfoFreqSlider, &lfoDestButtons, &lfoAmountSlider}, 2, 2);
177-
//setupGroup (effectGroup, topSection, {&effectParam1Slider, &effectParam2Slider}, 1, 2);
198+
//bottom section
199+
setupGroup (lfoGroup, bottomSection.removeFromLeft (2 * columnW + panelGap), {&lfoShapeButtons, &lfoFreqSlider, &lfoDestButtons, &lfoAmountSlider}, 2, 2);
200+
setupGroup (effectGroup, bottomSection.removeFromLeft (2 * columnW + panelGap), {&effectParam1Slider, &effectParam2Slider}, 2, 2);
201+
setupGroup (ampGroup, bottomSection, {&ampAttackSlider,&ampDecaySlider, &ampSustainSlider, &ampReleaseSlider}, 2, 4);
178202

179203
#if CPU_USAGE
180204
auto cpuSectionH = 100;

Source/PluginEditor.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
==============================================================================
3+
4+
Copyright (c) 2019 - Vincent Berthiaume
5+
6+
The code included in this file is provided under the terms of the ISC license
7+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
8+
To use, copy, modify, and/or distribute this software for any purpose with or
9+
without fee is hereby granted provided that the above copyright notice and
10+
this permission notice appear in all copies.
11+
12+
sBMP4 IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
13+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
14+
DISCLAIMED.
15+
16+
==============================================================================
17+
*/
18+
119
#pragma once
220

321
#include "../JuceLibraryCode/JuceHeader.h"
@@ -15,7 +33,7 @@ class SnappingSlider : public Slider
1533
tolerance (snapTolerance)
1634
{
1735
setLookAndFeel (&lf);
18-
//setPopupDisplayEnabled (true, false, nullptr);
36+
setPopupDisplayEnabled (true, false, nullptr);
1937
}
2038

2139
~SnappingSlider()
@@ -92,9 +110,11 @@ class sBMP4AudioProcessorEditor : public AudioProcessorEditor
92110
ButtonGroupComponent osc1ShapeButtons, osc2ShapeButtons;
93111

94112
//FILTER
95-
sBMP4Label filterCutoffLabel, filterResonanceLabel;
113+
sBMP4Label filterCutoffLabel, filterResonanceLabel, filterEnvAttackLabel, filterEnvDecayLabel, filterEnvSustainLabel, filterEnvReleaseLabel;
96114
SnappingSlider filterCutoffSlider, filterResonanceSlider;
97115
AudioProcessorValueTreeState::SliderAttachment filterCutoffAttachment, filterResonanceAttachment;
116+
SnappingSlider filterEnvAttackSlider, filterEnvDecaySlider, filterEnvSustainSlider, filterEnvReleaseSlider;
117+
AudioProcessorValueTreeState::SliderAttachment filterEnvAttackAttachment, filterEnvDecayAttachment, filterEnvSustainAttachment, filterEnvReleaseAttachment;
98118

99119
//AMPLIFIER
100120
sBMP4Label ampAttackLabel, ampDecayLabel, ampSustainLabel, ampReleaseLabel;

Source/PluginProcessor.cpp

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
==============================================================================
3+
4+
Copyright (c) 2019 - Vincent Berthiaume
5+
6+
The code included in this file is provided under the terms of the ISC license
7+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
8+
To use, copy, modify, and/or distribute this software for any purpose with or
9+
without fee is hereby granted provided that the above copyright notice and
10+
this permission notice appear in all copies.
11+
12+
sBMP4 IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
13+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
14+
DISCLAIMED.
15+
16+
==============================================================================
17+
*/
118

219
#include "PluginProcessor.h"
320
#include "PluginEditor.h"
@@ -36,12 +53,18 @@ sBMP4AudioProcessor::sBMP4AudioProcessor() :
3653
std::make_unique<AudioParameterFloat> (ampSustainID, ampSustainSliderDesc, sustainRange, defaultAmpS),
3754
std::make_unique<AudioParameterFloat> (ampReleaseID, ampReleaseSliderDesc, releaseRange, defaultAmpR),
3855

56+
std::make_unique<AudioParameterFloat> (filterEnvAttackID, ampAttackSliderDesc, attackRange, defaultAmpA),
57+
std::make_unique<AudioParameterFloat> (filterEnvDecayID, ampDecaySliderDesc, decayRange, defaultAmpD),
58+
std::make_unique<AudioParameterFloat> (filterEnvSustainID, ampSustainSliderDesc, sustainRange, defaultAmpS),
59+
std::make_unique<AudioParameterFloat> (filterEnvReleaseID, ampReleaseSliderDesc, releaseRange, defaultAmpR),
60+
3961
std::make_unique<AudioParameterFloat> (lfoFreqID, lfoFreqSliderDesc, lfoRange, defaultLfoFreq),
4062
std::make_unique<AudioParameterChoice> (lfoShapeID, lfoShapeDesc, StringArray {lfoShape0, lfoShape1, /*lfoShape2,*/ lfoShape3, lfoShape4}, defaultLfoShape),
4163
std::make_unique<AudioParameterChoice> (lfoDestID, lfoDestDesc, StringArray {lfoDest0, lfoDest1, lfoDest2, lfoDest3}, defaultLfoDest),
4264
std::make_unique<AudioParameterFloat> (lfoAmountID, lfoAmountSliderDesc, sliderRange, defaultLfoAmount),
4365

44-
std::make_unique<AudioParameterFloat> (effectParam1ID, effectParam1Desc, sliderRange, defaultEffectParam1)
66+
std::make_unique<AudioParameterFloat> (effectParam1ID, effectParam1Desc, sliderRange, defaultEffectParam1),
67+
std::make_unique<AudioParameterFloat> (effectParam2ID, effectParam2Desc, sliderRange, defaultEffectParam2)
4568
})
4669

4770
#if CPU_USAGE
@@ -60,6 +83,13 @@ sBMP4AudioProcessor::sBMP4AudioProcessor() :
6083
state.addParameterListener (oscSubID, &synth);
6184
state.addParameterListener (oscMixID, &synth);
6285

86+
state.addParameterListener (filterCutoffID, &synth);
87+
state.addParameterListener (filterResonanceID, &synth);
88+
state.addParameterListener (filterEnvAttackID, &synth);
89+
state.addParameterListener (filterEnvDecayID, &synth);
90+
state.addParameterListener (filterEnvSustainID, &synth);
91+
state.addParameterListener (filterEnvReleaseID, &synth);
92+
6393
state.addParameterListener (ampAttackID, &synth);
6494
state.addParameterListener (ampDecayID, &synth);
6595
state.addParameterListener (ampSustainID, &synth);
@@ -70,8 +100,8 @@ sBMP4AudioProcessor::sBMP4AudioProcessor() :
70100
state.addParameterListener (lfoFreqID, &synth);
71101
state.addParameterListener (lfoAmountID, &synth);
72102

73-
state.addParameterListener (filterCutoffID, &synth);
74-
state.addParameterListener (filterResonanceID, &synth);
103+
state.addParameterListener (effectParam1ID, &synth);
104+
state.addParameterListener (effectParam2ID, &synth);
75105
}
76106

77107
sBMP4AudioProcessor::~sBMP4AudioProcessor()

Source/PluginProcessor.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
==============================================================================
3+
4+
Copyright (c) 2019 - Vincent Berthiaume
5+
6+
The code included in this file is provided under the terms of the ISC license
7+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
8+
To use, copy, modify, and/or distribute this software for any purpose with or
9+
without fee is hereby granted provided that the above copyright notice and
10+
this permission notice appear in all copies.
11+
12+
sBMP4 IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
13+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
14+
DISCLAIMED.
15+
16+
==============================================================================
17+
*/
18+
119
#pragma once
220

321
#include "../JuceLibraryCode/JuceHeader.h"

0 commit comments

Comments
 (0)