Audacity 3.2.0
BassTreble.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4 Audacity(R) is copyright (c) 1999-2016 Audacity Team.
5 License: GPL v2 or later. See License.txt.
6
7 BassTreble.cpp
8 Steve Daulton
9
10******************************************************************//*******************************************************************/
16#include "BassTreble.h"
17#include "EffectEditor.h"
18#include "LoadEffects.h"
19
20#include <math.h>
21#include <algorithm>
22
23#include <wx/checkbox.h>
24#include <wx/panel.h>
25#include <wx/slider.h>
26#include <wx/weakref.h>
27
28#include "Prefs.h"
29#include "ShuttleGui.h"
30#include "WaveTrack.h"
31#include "../widgets/valnum.h"
32
34{
37 > parameters;
38 return parameters;
39}
40
41// Used to communicate the type of the filter.
43{
46};
47
49{ XO("Bass and Treble") };
50
52
53
54
57{
58 Editor(const EffectUIServices& services,
60 ) : EffectEditor{ services, access }
62 {}
63 virtual ~Editor() = default;
64
65 bool ValidateUI() override;
66 bool UpdateUI() override;
67
69
70 wxWeakRef<wxWindow> mUIParent{};
72
73 wxSlider* mBassS;
74 wxSlider* mTrebleS;
75 wxSlider* mGainS;
76
77 wxTextCtrl* mBassT;
78 wxTextCtrl* mTrebleT;
79 wxTextCtrl* mGainT;
80
81 wxCheckBox* mLinkCheckBox;
82
83 void OnBassText(wxCommandEvent& evt);
84 void OnTrebleText(wxCommandEvent& evt);
85 void OnGainText(wxCommandEvent& evt);
86 void OnBassSlider(wxCommandEvent& evt);
87 void OnTrebleSlider(wxCommandEvent& evt);
88 void OnGainSlider(wxCommandEvent& evt);
89 void OnLinkCheckbox(wxCommandEvent& evt);
90
91 // Auto-adjust gain to reduce variation in peak level
92 void UpdateGain(double oldVal, int control);
93
95 {
96 EnableApply(mUIParent, mUIParent->Validate());
97 }
98
100 {
101 return EnableApply(
102 mUIParent, mUIParent->TransferDataFromWindow());
103 }
104};
105
106
110{
111 explicit Instance(const PerTrackEffect& effect)
112 : PerTrackEffect::Instance{ effect }
113 {}
114
116 double sampleRate,
117 ChannelNames chanMap) override;
118
120 const float* const* inBlock, float* const* outBlock, size_t blockLen) override;
121
122 bool RealtimeInitialize(EffectSettings& settings, double) override;
123
125 unsigned numChannels, float sampleRate) override;
126
127 bool RealtimeFinalize(EffectSettings& settings) noexcept override;
128
129 size_t RealtimeProcess(size_t group, EffectSettings& settings,
130 const float* const* inbuf, float* const* outbuf, size_t numSamples)
131 override;
132
133 unsigned GetAudioInCount() const override;
134 unsigned GetAudioOutCount() const override;
135
137
140 const float* const* inBlock,
141 float* const* outBlock,
142 size_t blockLen);
143
144 static void Coefficients(double hz, double slope, double gain, double samplerate, int type,
145 double& a0, double& a1, double& a2, double& b0, double& b1, double& b2);
146
147 static float DoFilter(EffectBassTrebleState& data, float in);
148
150 std::vector<EffectBassTreble::Instance> mSlaves;
151};
152
153
154std::shared_ptr<EffectInstance>
156{
157 return std::make_shared<Instance>(*this);
158}
159
160
162{
164}
165
167{
168}
169
170// ComponentInterface implementation
171
173{
174 return Symbol;
175}
176
178{
179 return XO("Simple tone control effect");
180}
181
183{
184 return L"Bass_and_Treble";
185}
186
187// EffectDefinitionInterface implementation
188
190{
191 return EffectTypeProcess;
192}
193
195{
197}
198
200{
201 return 1;
202}
203
205{
206 return 1;
207}
208
211{
212 InstanceInit(settings, mState, sampleRate);
213 return true;
214}
215
216
218 const float* const* inBlock, float* const* outBlock, size_t blockLen)
219{
220 return InstanceProcess(settings, mState, inBlock, outBlock, blockLen);
221}
222
224{
225 SetBlockSize(512);
226 mSlaves.clear();
227 return true;
228}
229
232 unsigned numChannels, float sampleRate)
233{
234 EffectBassTreble::Instance slave(mProcessor);
235
236 InstanceInit(settings, slave.mState, sampleRate);
237
238 mSlaves.push_back(slave);
239
240 return true;
241}
242
244{
245 mSlaves.clear();
246
247 return true;
248}
249
251 const float *const *inbuf, float *const *outbuf, size_t numSamples)
252{
253 if (group >= mSlaves.size())
254 return 0;
255 return InstanceProcess(settings, mSlaves[group].mState, inbuf, outbuf, numSamples);
256}
257
259{
260 auto& ms = GetSettings(settings);
261
262 return (ms.mBass == 0.0 && ms.mTreble == 0.0 && ms.mGain == 0.0);
263}
264
265
266// Effect implementation
267
268std::unique_ptr<EffectEditor> EffectBassTreble::MakeEditor(
270 const EffectOutputs *) const
271{
272 auto& settings = access.Get();
273 auto& myEffSettings = GetSettings(settings);
274
275 auto result = std::make_unique<Editor>(*this, access, myEffSettings);
276 result->PopulateOrExchange(S);
277 return result;
278 }
279
281{
282 mUIParent = S.GetParent();
283 auto& ms = mSettings;
284
285 S.SetBorder(5);
286 S.AddSpace(0, 5);
287
288 S.StartStatic(XO("Tone controls"));
289 {
290 S.StartMultiColumn(3, wxEXPAND);
291 {
292 S.SetStretchyCol(2);
293
294 // Bass control
295 mBassT = S
296 .Name(XO("Bass (dB):"))
297 .Validator<FloatingPointValidator<double>>(
298 1, &ms.mBass, NumValidatorStyle::DEFAULT, Bass.min, Bass.max)
299 .AddTextBox(XXO("Ba&ss (dB):"), L"", 10);
300 BindTo(*mBassT, wxEVT_TEXT, &Editor::OnBassText);
301
302 mBassS = S
303 .Name(XO("Bass"))
304 .Style(wxSL_HORIZONTAL)
305 .AddSlider( {}, 0, Bass.max * Bass.scale, Bass.min * Bass.scale);
306 BindTo(*mBassS, wxEVT_SLIDER, &Editor::OnBassSlider);
307
308 // Treble control
309 mTrebleT = S
310 .Validator<FloatingPointValidator<double>>(
311 1, &ms.mTreble, NumValidatorStyle::DEFAULT, Treble.min, Treble.max)
312 .AddTextBox(XXO("&Treble (dB):"), L"", 10);
313 BindTo(*mTrebleT, wxEVT_TEXT, &Editor::OnTrebleText);
314
315 mTrebleS = S
316 .Name(XO("Treble"))
317 .Style(wxSL_HORIZONTAL)
318 .AddSlider( {}, 0, Treble.max * Treble.scale, Treble.min * Treble.scale);
319 BindTo(*mTrebleS, wxEVT_SLIDER, &Editor::OnTrebleSlider);
320 }
321 S.EndMultiColumn();
322 }
323 S.EndStatic();
324
325 S.StartStatic(XO("Output"));
326 {
327 S.StartMultiColumn(3, wxEXPAND);
328 {
329 S.SetStretchyCol(2);
330
331 // Gain control
332 mGainT = S
333 .Validator<FloatingPointValidator<double>>(
334 1, &ms.mGain, NumValidatorStyle::DEFAULT, Gain.min, Gain.max)
335 .AddTextBox(XXO("&Volume (dB):"), L"", 10);
336 BindTo(*mGainT, wxEVT_TEXT, &Editor::OnGainText);
337
338 mGainS = S
339 .Name(XO("Level"))
340 .Style(wxSL_HORIZONTAL)
341 .AddSlider( {}, 0, Gain.max * Gain.scale, Gain.min * Gain.scale);
342 BindTo(*mGainS, wxEVT_SLIDER, &Editor::OnGainSlider);
343 }
344 S.EndMultiColumn();
345
346 S.StartMultiColumn(2, wxCENTER);
347 {
348 // Link checkbox
349 mLinkCheckBox =
350 S
351 .AddCheckBox(XXO("&Link Volume control to Tone controls"),
352 Link.def);
353 BindTo(*mLinkCheckBox, wxEVT_CHECKBOX, &Editor::OnLinkCheckbox);
354 }
355 S.EndMultiColumn();
356 }
357 S.EndStatic();
358}
359
361{
362 // get the settings from the MessageBuffer and write them to our local copy
363 const auto& settings = mAccess.Get();
364
365 mSettings = GetSettings(settings);
366
367 if (! mUIParent->TransferDataToWindow())
368 {
369 return false;
370 }
371
372 mBassS-> SetValue((int)(mSettings.mBass * Bass.scale));
373 mTrebleS-> SetValue((int)(mSettings.mTreble *Treble.scale));
374 mGainS-> SetValue((int)(mSettings.mGain * Gain.scale));
375 mLinkCheckBox->SetValue(mSettings.mLink);
376
377 return true;
378}
379
380
381
382// EffectBassTreble implementation
383
385{
386 auto& ms = GetSettings(settings);
387
388 data.samplerate = sampleRate;
389 data.slope = 0.4f; // same slope for both filters
390 data.hzBass = 250.0f; // could be tunable in a more advanced version
391 data.hzTreble = 4000.0f; // could be tunable in a more advanced version
392
393 data.a0Bass = 1;
394 data.a1Bass = 0;
395 data.a2Bass = 0;
396 data.b0Bass = 0;
397 data.b1Bass = 0;
398 data.b2Bass = 0;
399
400 data.a0Treble = 1;
401 data.a1Treble = 0;
402 data.a2Treble = 0;
403 data.b0Treble = 0;
404 data.b1Treble = 0;
405 data.b2Treble = 0;
406
407 data.xn1Bass = 0;
408 data.xn2Bass = 0;
409 data.yn1Bass = 0;
410 data.yn2Bass = 0;
411
412 data.xn1Treble = 0;
413 data.xn2Treble = 0;
414 data.yn1Treble = 0;
415 data.yn2Treble = 0;
416
417 data.bass = -1;
418 data.treble = -1;
419 data.gain = DB_TO_LINEAR(ms.mGain);
420
421}
422
425 const float *const *inBlock, float *const *outBlock, size_t blockLen)
426{
427 auto& ms = GetSettings(settings);
428
429 const float *ibuf = inBlock[0];
430 float *obuf = outBlock[0];
431
432 // Set value to ensure correct rounding
433 double oldBass = DB_TO_LINEAR(ms.mBass);
434 double oldTreble = DB_TO_LINEAR(ms.mTreble);
435
436 data.gain = DB_TO_LINEAR(ms.mGain);
437
438 // Compute coefficients of the low shelf biquand IIR filter
439 if (data.bass != oldBass)
440 Coefficients(data.hzBass, data.slope, ms.mBass, data.samplerate, kBass,
441 data.a0Bass, data.a1Bass, data.a2Bass,
442 data.b0Bass, data.b1Bass, data.b2Bass);
443
444 // Compute coefficients of the high shelf biquand IIR filter
445 if (data.treble != oldTreble)
446 Coefficients(data.hzTreble, data.slope, ms.mTreble, data.samplerate, kTreble,
447 data.a0Treble, data.a1Treble, data.a2Treble,
448 data.b0Treble, data.b1Treble, data.b2Treble);
449
450 for (decltype(blockLen) i = 0; i < blockLen; i++) {
451 obuf[i] = DoFilter(data, ibuf[i]) * data.gain;
452 }
453
454 return blockLen;
455}
456
457
458
459// Effect implementation
460
461
462void EffectBassTreble::Instance::Coefficients(double hz, double slope, double gain, double samplerate, int type,
463 double& a0, double& a1, double& a2,
464 double& b0, double& b1, double& b2)
465{
466 double w = 2 * M_PI * hz / samplerate;
467 double a = exp(log(10.0) * gain / 40);
468 double b = sqrt((a * a + 1) / slope - (pow((a - 1), 2)));
469
470 if (type == kBass)
471 {
472 b0 = a * ((a + 1) - (a - 1) * cos(w) + b * sin(w));
473 b1 = 2 * a * ((a - 1) - (a + 1) * cos(w));
474 b2 = a * ((a + 1) - (a - 1) * cos(w) - b * sin(w));
475 a0 = ((a + 1) + (a - 1) * cos(w) + b * sin(w));
476 a1 = -2 * ((a - 1) + (a + 1) * cos(w));
477 a2 = (a + 1) + (a - 1) * cos(w) - b * sin(w);
478 }
479 else //assumed kTreble
480 {
481 b0 = a * ((a + 1) + (a - 1) * cos(w) + b * sin(w));
482 b1 = -2 * a * ((a - 1) + (a + 1) * cos(w));
483 b2 = a * ((a + 1) + (a - 1) * cos(w) - b * sin(w));
484 a0 = ((a + 1) - (a - 1) * cos(w) + b * sin(w));
485 a1 = 2 * ((a - 1) - (a + 1) * cos(w));
486 a2 = (a + 1) - (a - 1) * cos(w) - b * sin(w);
487 }
488}
489
491{
492 // Bass filter
493 float out = (data.b0Bass * in + data.b1Bass * data.xn1Bass + data.b2Bass * data.xn2Bass -
494 data.a1Bass * data.yn1Bass - data.a2Bass * data.yn2Bass) / data.a0Bass;
495 data.xn2Bass = data.xn1Bass;
496 data.xn1Bass = in;
497 data.yn2Bass = data.yn1Bass;
498 data.yn1Bass = out;
499
500 // Treble filter
501 in = out;
502 out = (data.b0Treble * in + data.b1Treble * data.xn1Treble + data.b2Treble * data.xn2Treble -
503 data.a1Treble * data.yn1Treble - data.a2Treble * data.yn2Treble) / data.a0Treble;
504 data.xn2Treble = data.xn1Treble;
505 data.xn1Treble = in;
506 data.yn2Treble = data.yn1Treble;
507 data.yn1Treble = out;
508
509 return out;
510}
511
512
513void EffectBassTreble::Editor::OnBassText(wxCommandEvent & WXUNUSED(evt))
514{
515 auto& ms = mSettings;
516
517 double oldBass = ms.mBass;
518
519 if (!EnableApplyFromTransferDataFromWindow())
520 {
521 return;
522 }
523
524 if (ms.mLink)
525 UpdateGain(oldBass, kBass);
526
527 mBassS->SetValue((int) (ms.mBass * Bass.scale));
528
529 ValidateUI();
530 Publish(EffectSettingChanged{});
531}
532
533void EffectBassTreble::Editor::OnTrebleText(wxCommandEvent & WXUNUSED(evt))
534{
535 auto& ms = mSettings;
536
537 double oldTreble = ms.mTreble;
538
539 if (!EnableApplyFromTransferDataFromWindow())
540 {
541 return;
542 }
543
544 if (ms.mLink)
545 UpdateGain(oldTreble, kTreble);
546
547 mTrebleS->SetValue((int) (ms.mTreble * Treble.scale));
548
549 ValidateUI();
550 Publish(EffectSettingChanged{});
551}
552
553void EffectBassTreble::Editor::OnGainText(wxCommandEvent & WXUNUSED(evt))
554{
555 auto& ms = mSettings;
556
557 if (!EnableApplyFromTransferDataFromWindow())
558 {
559 return;
560 }
561
562 mGainS->SetValue((int) (ms.mGain * Gain.scale));
563
564 ValidateUI();
565 Publish(EffectSettingChanged{});
566}
567
569{
570 auto& ms = mSettings;
571
572 double oldBass = ms.mBass;
573 ms.mBass = (double) evt.GetInt() / Bass.scale;
574 mBassT->GetValidator()->TransferToWindow();
575
576 if (ms.mLink)
577 UpdateGain(oldBass, kBass);
578
579 EnableApplyFromValidate();
580
581 ValidateUI();
582 Publish(EffectSettingChanged{});
583}
584
586{
587 auto& ms = mSettings;
588
589 double oldTreble = ms.mTreble;
590 ms.mTreble = (double) evt.GetInt() / Treble.scale;
591 mTrebleT->GetValidator()->TransferToWindow();
592
593 if (ms.mLink)
594 UpdateGain(oldTreble, kTreble);
595
596 EnableApplyFromValidate();
597
598 ValidateUI();
599 Publish(EffectSettingChanged{});
600}
601
603{
604 auto& ms = mSettings;
605
606 ms.mGain = (double) evt.GetInt() / Gain.scale;
607 mGainT->GetValidator()->TransferToWindow();
608
609 EnableApplyFromValidate();
610
611 ValidateUI();
612 Publish(EffectSettingChanged{});
613}
614
615void EffectBassTreble::Editor::OnLinkCheckbox(wxCommandEvent& /*evt*/)
616{
617 auto& ms = mSettings;
618
619 ms.mLink = mLinkCheckBox->GetValue();
620
621 ValidateUI();
622 Publish(EffectSettingChanged{});
623}
624
625void EffectBassTreble::Editor::UpdateGain(double oldVal, int control)
626{
627 auto& ms = mSettings;
628
629 double newVal;
630 oldVal = (oldVal > 0)? oldVal / 2.0 : oldVal / 4.0;
631
632 if (control == kBass)
633 newVal = (ms.mBass > 0)? ms.mBass / 2.0 : ms.mBass / 4.0;
634 else
635 newVal = (ms.mTreble > 0)? ms.mTreble / 2.0 : ms.mTreble / 4.0;
636
637 ms.mGain -= newVal - oldVal;
638 ms.mGain = std::min(Gain.max, std::max(Gain.min, ms.mGain));
639
640 mGainS->SetValue(ms.mGain);
641 mGainT->GetValidator()->TransferToWindow();
642
643}
644
645
646
647
649{
650 // This bit was copied from the original override of the effect's TransferDataFromWindow
651 if (! mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
652 {
653 return false;
654 }
655
656
657 mAccess.ModifySettings
658 (
659 [this](EffectSettings& settings)
660 {
661 // pass back the modified settings to the MessageBuffer
662 //
664
665 return nullptr;
666 }
667 );
668
669 return true;
670}
671
kShelfType
Definition: BassTreble.cpp:43
@ kBass
Definition: BassTreble.cpp:44
@ kTreble
Definition: BassTreble.cpp:45
int min(int a, int b)
#define M_PI
Definition: Distortion.cpp:30
struct State mState
EffectType
@ EffectTypeProcess
ChannelName
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:337
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:69
bool ValidateUI(const EffectPlugin &context, EffectSettings &) const override
Generates EffectParameterMethods overrides from variadic template arguments.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: EffectBase.cpp:210
const EffectParameterMethods & Parameters() const override
Definition: BassTreble.cpp:33
static constexpr EffectParameter Treble
Definition: BassTreble.h:95
std::unique_ptr< EffectEditor > MakeEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const override
Called only from PopulateUI, to add controls to effect panel.
Definition: BassTreble.cpp:268
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
Definition: BassTreble.cpp:155
static constexpr EffectParameter Gain
Definition: BassTreble.h:98
bool CheckWhetherSkipEffect(const EffectSettings &settings) const override
After Init(), tell whether Process() should be skipped.
Definition: BassTreble.cpp:258
RealtimeSince RealtimeSupport() const override
Since which version of Audacity has the effect supported realtime?
Definition: BassTreble.cpp:194
static constexpr EffectParameter Bass
Definition: BassTreble.h:92
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Definition: BassTreble.cpp:182
ComponentInterfaceSymbol GetSymbol() const override
Definition: BassTreble.cpp:172
virtual ~EffectBassTreble()
Definition: BassTreble.cpp:166
TranslatableString GetDescription() const override
Definition: BassTreble.cpp:177
static const ComponentInterfaceSymbol Symbol
Definition: BassTreble.h:55
EffectType GetType() const override
Type determines how it behaves.
Definition: BassTreble.cpp:189
static constexpr EffectParameter Link
Definition: BassTreble.h:101
RealtimeSince
In which versions of Audacity was an effect realtime capable?
static bool EnableApply(wxWindow *parent, bool enable=true)
Enable or disable the Apply button of the dialog that contains parent.
Performs effect computation.
Inherit to add a state variable to an EffectInstance subclass.
Hold values to send to effect output meters.
Interface for manipulations of an Effect's settings.
virtual const EffectSettings & Get()=0
static EffectBassTrebleSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:166
Base class for many of the effects in Audacity.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.
BuiltinEffectsModule::Registration< EffectBassTreble > reg
Definition: BassTreble.cpp:51
__finl float_x4 __vecc sqrt(const float_x4 &a)
EffectBassTrebleSettings mSettings
Definition: BassTreble.cpp:71
void OnTrebleText(wxCommandEvent &evt)
Definition: BassTreble.cpp:533
Editor(const EffectUIServices &services, EffectSettingsAccess &access, const EffectBassTrebleSettings &settings)
Definition: BassTreble.cpp:58
void PopulateOrExchange(ShuttleGui &S)
Definition: BassTreble.cpp:280
void OnLinkCheckbox(wxCommandEvent &evt)
Definition: BassTreble.cpp:615
wxWeakRef< wxWindow > mUIParent
Definition: BassTreble.cpp:70
void OnGainText(wxCommandEvent &evt)
Definition: BassTreble.cpp:553
void OnBassSlider(wxCommandEvent &evt)
Definition: BassTreble.cpp:568
wxCheckBox * mLinkCheckBox
Definition: BassTreble.cpp:81
bool EnableApplyFromTransferDataFromWindow()
Definition: BassTreble.cpp:99
void UpdateGain(double oldVal, int control)
Definition: BassTreble.cpp:625
void OnBassText(wxCommandEvent &evt)
Definition: BassTreble.cpp:513
bool ValidateUI() override
Get settings data from the panel; may make error dialogs and return false.
Definition: BassTreble.cpp:648
void OnTrebleSlider(wxCommandEvent &evt)
Definition: BassTreble.cpp:585
bool UpdateUI() override
Update appearance of the panel for changes in settings.
Definition: BassTreble.cpp:360
void OnGainSlider(wxCommandEvent &evt)
Definition: BassTreble.cpp:602
virtual ~Editor()=default
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
Definition: BassTreble.cpp:217
static float DoFilter(EffectBassTrebleState &data, float in)
Definition: BassTreble.cpp:490
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap) override
Definition: BassTreble.cpp:209
bool RealtimeAddProcessor(EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) override
Definition: BassTreble.cpp:230
static void InstanceInit(EffectSettings &settings, EffectBassTrebleState &data, float sampleRate)
Definition: BassTreble.cpp:384
bool RealtimeInitialize(EffectSettings &settings, double) override
Definition: BassTreble.cpp:223
static size_t InstanceProcess(EffectSettings &settings, EffectBassTrebleState &data, const float *const *inBlock, float *const *outBlock, size_t blockLen)
Definition: BassTreble.cpp:423
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
Definition: BassTreble.cpp:204
EffectBassTrebleState mState
Definition: BassTreble.cpp:149
size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inbuf, float *const *outbuf, size_t numSamples) override
Definition: BassTreble.cpp:250
static void Coefficients(double hz, double slope, double gain, double samplerate, int type, double &a0, double &a1, double &a2, double &b0, double &b1, double &b2)
Definition: BassTreble.cpp:462
bool RealtimeFinalize(EffectSettings &settings) noexcept override
Definition: BassTreble.cpp:243
Instance(const PerTrackEffect &effect)
Definition: BassTreble.cpp:111
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
Definition: BassTreble.cpp:199
std::vector< EffectBassTreble::Instance > mSlaves
Definition: BassTreble.cpp:150
const Type scale
Scaling factor, for slider control.
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.
Message sent by EffectEditor when a setting is changed by the user.
Definition: EffectEditor.h:26
Externalized state of a plug-in.