Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
EffectCompressor Class Referencefinal

An Effect derived from EffectTwoPassSimpleMono. More...

#include <Compressor.h>

Inheritance diagram for EffectCompressor:
[legend]
Collaboration diagram for EffectCompressor:
[legend]

Public Member Functions

 EffectCompressor ()
 
virtual ~EffectCompressor ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
ManualPageID ManualPage () const override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
std::unique_ptr< EffectEditorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
 Add controls to effect panel; always succeeds. More...
 
bool DoTransferDataFromWindow ()
 
bool TransferDataToWindow (const EffectSettings &settings) override
 
bool TransferDataFromWindow (EffectSettings &settings) override
 
- Public Member Functions inherited from EffectTwoPassSimpleMono
 ~EffectTwoPassSimpleMono () override
 
bool Process (EffectInstance &instance, EffectSettings &settings) override
 
- Public Member Functions inherited from StatefulEffect
 ~StatefulEffect () override
 
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from StatefulEffectBase
virtual bool Init ()
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (MessagePackage &package)
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
virtual size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
 
virtual bool RealtimeProcessEnd (EffectSettings &settings) noexcept
 settings can be updated to let a dialog change appearance at idle More...
 
virtual bool RealtimeFinalize (EffectSettings &settings) noexcept
 
virtual size_t SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 
virtual unsigned GetAudioInCount () const
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const
 How many output buffers to allocate at once. More...
 
virtual sampleCount GetLatency () const
 
virtual bool NeedsDither () const
 
virtual bool ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr)
 
virtual bool ProcessFinalize () noexcept
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () const override
 
bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings) override
 
bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
RealtimeSince RealtimeSupport () const override
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
OptionalMessage LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
OptionalMessage LoadFactoryPreset (int id, EffectSettings &settings) const override
 
OptionalMessage LoadFactoryDefaults (EffectSettings &settings) const override
 
virtual const EffectParameterMethodsParameters () const
 
bool CanExportPresets () const override
 Whether the effect supports export of presets to files, and importing too. More...
 
bool HasOptions () const override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatID GetSelectionFormat ()
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings, InstanceFinder finder={})
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
bool IsLinearEffect () const
 
bool PreviewsFullSelection () const
 
void SetTracks (TrackList *pTracks)
 
virtual std::any BeginPreview (const EffectSettings &settings)
 Called when Preview() starts, to allow temporary effect state changes. More...
 
bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess) override
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void CountWaveTracks ()
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual bool HasOptions () const =0
 
virtual bool CanExportPresets () const =0
 Whether the effect supports export of presets to files, and importing too. More...
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
virtual std::unique_ptr< EffectOutputsMakeOutputs () const
 Produce an object to hold values to send to effect output meters. More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual RealtimeSince RealtimeSupport () const =0
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsRealtime () const
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 
- Public Member Functions inherited from StatefulEffectUIServices
 ~StatefulEffectUIServices () override
 
std::unique_ptr< EffectEditorPopulateUI (const EffectPlugin &plugin, ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const override
 Allows PopulateOrExchange to return null. More...
 
virtual std::unique_ptr< EffectEditorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs)
 Add controls to effect panel; always succeeds. More...
 
virtual bool TransferDataToWindow (const EffectSettings &settings)
 
virtual bool TransferDataFromWindow (EffectSettings &settings)
 
- Public Member Functions inherited from BasicEffectUIServices
int ShowClientInterface (const EffectPlugin &plugin, wxWindow &parent, wxDialog &dialog, EffectEditor *pEditor, bool forceModal) const override
 
void ExportPresets (const EffectPlugin &plugin, const EffectSettings &settings) const override
 
OptionalMessage ImportPresets (const EffectPlugin &plugin, EffectSettings &settings) const override
 
void ShowOptions (const EffectPlugin &plugin) const override
 
bool ValidateUI (const EffectPlugin &context, EffectSettings &) const override
 
bool CloseUI () const override
 
- Public Member Functions inherited from EffectUIServices
virtual ~EffectUIServices ()
 
virtual int ShowHostInterface (EffectBase &plugin, wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)
 
virtual int ShowClientInterface (const EffectPlugin &plugin, wxWindow &parent, wxDialog &dialog, EffectEditor *pEditor, bool forceModal=false) const =0
 
virtual std::unique_ptr< EffectEditorPopulateUI (const EffectPlugin &plugin, ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const =0
 Adds controls to a panel that is given as the parent window of S More...
 
virtual void ExportPresets (const EffectPlugin &plugin, const EffectSettings &settings) const =0
 
virtual OptionalMessage ImportPresets (const EffectPlugin &plugin, EffectSettings &settings) const =0
 
virtual void ShowOptions (const EffectPlugin &plugin) const =0
 
virtual bool ValidateUI (const EffectPlugin &context, EffectSettings &settings) const =0
 
virtual bool CloseUI () const =0
 

Static Public Member Functions

static EffectCompressorFetchParameters (EffectCompressor &e, EffectSettings &)
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
- Static Public Member Functions inherited from EffectBase
static std::optional< InstancePointerFindInstance (EffectPlugin &plugin)
 
static InstanceFinder DefaultInstanceFinder (EffectPlugin &plugin)
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Static Public Member Functions inherited from EffectUIServices
static int DoMessageBox (const EffectPlugin &plugin, const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Compressor") }
 
- Static Public Attributes inherited from EffectPlugin
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Protected Member Functions

bool InitPass1 () override
 
bool InitPass2 () override
 
bool NewTrackPass1 () override
 
bool ProcessPass2 (float *buffer, size_t len) override
 
bool TwoBufferProcessPass1 (float *buffer1, size_t len1, float *buffer2, size_t len2) override
 
- Protected Member Functions inherited from EffectTwoPassSimpleMono
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual bool NewTrackPass1 ()
 
virtual bool NewTrackPass2 ()
 
virtual bool ProcessPass1 (float *WXUNUSED(buffer), size_t WXUNUSED(len))
 Override this method to actually process audio. More...
 
virtual bool ProcessPass2 (float *WXUNUSED(buffer), size_t WXUNUSED(len))
 
virtual bool TwoBufferProcessPass1 (float *buffer1, size_t len1, float *buffer2, size_t len2)
 
virtual bool TwoBufferProcessPass2 (float *buffer1, size_t len1, float *buffer2, size_t len2)
 
void DisableSecondPass ()
 Call this if you know in advance that no second pass will be needed. More...
 
- Protected Member Functions inherited from Effect
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 Default implementation returns previewLength More...
 
bool TotalProgress (double frac, const TranslatableString &={}) const
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={}) const
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={}) const
 
int GetNumWaveTracks () const
 
int GetNumWaveGroups () const
 
void GetBounds (const WaveTrack &track, sampleCount *start, sampleCount *len)
 
- Protected Member Functions inherited from EffectBase
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 

Private Member Functions

void FreshenCircle ()
 
float AvgCircle (float x)
 
void Follow (float *buffer, float *env, size_t len, float *previous, size_t previous_len)
 
float DoCompression (float x, double env)
 
void OnSlider (wxCommandEvent &evt)
 
void UpdateUI ()
 
const EffectParameterMethodsParameters () const override
 

Private Attributes

wxWeakRef< wxWindow > mUIParent {}
 
double mRMSSum
 
size_t mCircleSize
 
size_t mCirclePos
 
Doubles mCircle
 
double mAttackTime
 
double mThresholdDB
 
double mNoiseFloorDB
 
double mRatio
 
bool mNormalize
 
bool mUsePeak
 
double mDecayTime
 
double mAttackFactor
 
double mAttackInverseFactor
 
double mDecayFactor
 
double mThreshold
 
double mCompression
 
double mNoiseFloor
 
int mNoiseCounter
 
double mGain
 
double mLastLevel
 
Floats mFollow1
 
Floats mFollow2
 
size_t mFollowLen
 
double mMax
 
EffectCompressorPanelmPanel
 
wxStaticText * mThresholdLabel
 
wxSlider * mThresholdSlider
 
wxStaticText * mThresholdText
 
wxStaticText * mNoiseFloorLabel
 
wxSlider * mNoiseFloorSlider
 
wxStaticText * mNoiseFloorText
 
wxStaticText * mRatioLabel
 
wxSlider * mRatioSlider
 
wxStaticText * mRatioText
 
wxStaticText * mAttackLabel
 
wxSlider * mAttackSlider
 
wxStaticText * mAttackText
 
wxStaticText * mDecayLabel
 
wxSlider * mDecaySlider
 
wxStaticText * mDecayText
 
wxCheckBox * mGainCheckBox
 
wxCheckBox * mPeakCheckBox
 

Static Private Attributes

static constexpr EffectParameter Threshold
 
static constexpr EffectParameter NoiseFloor
 
static constexpr EffectParameter Ratio
 
static constexpr EffectParameter AttackTime
 
static constexpr EffectParameter ReleaseTime
 
static constexpr EffectParameter Normalize
 
static constexpr EffectParameter UsePeak
 

Additional Inherited Members

- Public Types inherited from StatefulEffectBase
using MessagePackage = EffectInstance::MessagePackage
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
using InstancePointer = std::shared_ptr< EffectInstanceEx >
 
using InstanceFinder = std::function< std::optional< InstancePointer >(EffectSettings &settings) >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , After_3_1 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Public Types inherited from EffectUIServices
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Public Attributes inherited from EffectBase
std::shared_ptr< TrackListmTracks {}
 
int mNumTracks {}
 
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
double mT0 {}
 
double mT1 {}
 
bool mIsPreview { false }
 
- Protected Attributes inherited from EffectTwoPassSimpleMono
int mCurTrackNum
 
double mCurRate
 
double mCurT0
 
double mCurT1
 
int mPass
 
bool mSecondPassDisabled
 
std::shared_ptr< TrackListmWorkTracks
 
TrackListmTrackLists [2]
 
- Protected Attributes inherited from EffectBase
double mF0 {}
 
double mF1 {}
 
wxArrayString mPresetNames
 
unsigned mUIFlags { 0 }
 

Detailed Description

An Effect derived from EffectTwoPassSimpleMono.

Definition at line 28 of file Compressor.h.

Constructor & Destructor Documentation

◆ EffectCompressor()

EffectCompressor::EffectCompressor ( )

Definition at line 84 of file Compressor.cpp.

85{
86 Parameters().Reset(*this);
87
88 mThreshold = 0.25;
89 mNoiseFloor = 0.01;
90 mCompression = 0.5;
91 mFollowLen = 0;
92
94}
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: EffectBase.cpp:210
const EffectParameterMethods & Parameters() const override
Definition: Compressor.cpp:60
double mNoiseFloor
Definition: Compressor.h:100
double mCompression
Definition: Compressor.h:99
double mThreshold
Definition: Compressor.h:98
virtual void Reset(Effect &effect) const =0

Referenced by Parameters().

Here is the caller graph for this function:

◆ ~EffectCompressor()

EffectCompressor::~EffectCompressor ( )
virtual

Definition at line 96 of file Compressor.cpp.

97{
98}

Member Function Documentation

◆ AvgCircle()

float EffectCompressor::AvgCircle ( float  x)
private

Definition at line 441 of file Compressor.cpp.

442{
443 float level;
444
445 // Calculate current level from root-mean-squared of
446 // circular buffer ("RMS")
448 mCircle[mCirclePos] = value*value;
450 level = sqrt(mRMSSum/mCircleSize);
452
453 return level;
454}
Doubles mCircle
Definition: Compressor.h:85
size_t mCirclePos
Definition: Compressor.h:84
size_t mCircleSize
Definition: Compressor.h:83
__finl float_x4 __vecc sqrt(const float_x4 &a)

References mCircle, mCirclePos, mCircleSize, mRMSSum, and staffpad::audio::simd::sqrt().

Referenced by Follow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoCompression()

float EffectCompressor::DoCompression ( float  x,
double  env 
)
private

Definition at line 569 of file Compressor.cpp.

570{
571 float out;
572 if(mUsePeak) {
573 // Peak values map 1.0 to 1.0 - 'upward' compression
574 out = value * pow(1.0/env, mCompression);
575 } else {
576 // With RMS-based compression don't change values below mThreshold - 'downward' compression
577 out = value * pow(mThreshold/env, mCompression);
578 }
579
580 // Retain the maximum value for use in the normalization pass
581 if(mMax < fabs(out))
582 mMax = fabs(out);
583
584 return out;
585}

References mCompression, mMax, mThreshold, and mUsePeak.

Referenced by TwoBufferProcessPass1().

Here is the caller graph for this function:

◆ DoTransferDataFromWindow()

bool EffectCompressor::DoTransferDataFromWindow ( )

Definition at line 305 of file Compressor.cpp.

306{
307 // To do: eliminate this by using control validators instead
308 mThresholdDB = (double) mThresholdSlider->GetValue();
309 mNoiseFloorDB = (double) mNoiseFloorSlider->GetValue() / NoiseFloor.scale;
310 mRatio = (double) mRatioSlider->GetValue() / Ratio.scale;
311 mAttackTime = (double) mAttackSlider->GetValue() / 100.0; //AttackTime.scale;
312 mDecayTime = (double) mDecaySlider->GetValue() / ReleaseTime.scale;
313 mNormalize = mGainCheckBox->GetValue();
314 mUsePeak = mPeakCheckBox->GetValue();
315
316 return true;
317}
wxCheckBox * mPeakCheckBox
Definition: Compressor.h:132
double mThresholdDB
Definition: Compressor.h:88
static constexpr EffectParameter Ratio
Definition: Compressor.h:141
wxSlider * mDecaySlider
Definition: Compressor.h:128
double mAttackTime
Definition: Compressor.h:87
wxSlider * mAttackSlider
Definition: Compressor.h:124
wxSlider * mNoiseFloorSlider
Definition: Compressor.h:116
wxSlider * mThresholdSlider
Definition: Compressor.h:112
double mDecayTime
Definition: Compressor.h:94
static constexpr EffectParameter NoiseFloor
Definition: Compressor.h:139
static constexpr EffectParameter ReleaseTime
Definition: Compressor.h:145
double mNoiseFloorDB
Definition: Compressor.h:89
wxSlider * mRatioSlider
Definition: Compressor.h:120
wxCheckBox * mGainCheckBox
Definition: Compressor.h:131
const Type scale
Scaling factor, for slider control.

References mAttackSlider, mAttackTime, mDecaySlider, mDecayTime, mGainCheckBox, mNoiseFloorDB, mNoiseFloorSlider, mNormalize, mPeakCheckBox, mRatio, mRatioSlider, mThresholdDB, mThresholdSlider, mUsePeak, NoiseFloor, Ratio, ReleaseTime, and EffectParameter< Structure, Member, Type, Value >::scale.

Referenced by OnSlider(), and TransferDataFromWindow().

Here is the caller graph for this function:

◆ FetchParameters()

static EffectCompressor * EffectCompressor::FetchParameters ( EffectCompressor e,
EffectSettings  
)
inlinestatic

Definition at line 32 of file Compressor.h.

32{ return &e; }

◆ Follow()

void EffectCompressor::Follow ( float *  buffer,
float *  env,
size_t  len,
float *  previous,
size_t  previous_len 
)
private

Definition at line 456 of file Compressor.cpp.

457{
458 /*
459
460 "Follow"ing algorithm by Roger B. Dannenberg, taken from
461 Nyquist. His description follows. -DMM
462
463 Description: this is a sophisticated envelope follower.
464 The input is an envelope, e.g. something produced with
465 the AVG function. The purpose of this function is to
466 generate a smooth envelope that is generally not less
467 than the input signal. In other words, we want to "ride"
468 the peaks of the signal with a smooth function. The
469 algorithm is as follows: keep a current output value
470 (called the "value"). The value is allowed to increase
471 by at most rise_factor and decrease by at most fall_factor.
472 Therefore, the next value should be between
473 value * rise_factor and value * fall_factor. If the input
474 is in this range, then the next value is simply the input.
475 If the input is less than value * fall_factor, then the
476 next value is just value * fall_factor, which will be greater
477 than the input signal. If the input is greater than value *
478 rise_factor, then we compute a rising envelope that meets
479 the input value by working bacwards in time, changing the
480 previous values to input / rise_factor, input / rise_factor^2,
481 input / rise_factor^3, etc. until this NEW envelope intersects
482 the previously computed values. There is only a limited buffer
483 in which we can work backwards, so if the NEW envelope does not
484 intersect the old one, then make yet another pass, this time
485 from the oldest buffered value forward, increasing on each
486 sample by rise_factor to produce a maximal envelope. This will
487 still be less than the input.
488
489 The value has a lower limit of floor to make sure value has a
490 reasonable positive value from which to begin an attack.
491 */
492 double level,last;
493
494 if(!mUsePeak) {
495 // Update RMS sum directly from the circle buffer
496 // to avoid accumulation of rounding errors
498 }
499 // First apply a peak detect with the requested decay rate
500 last = mLastLevel;
501 for(size_t i=0; i<len; i++) {
502 if(mUsePeak)
503 level = fabs(buffer[i]);
504 else // use RMS
505 level = AvgCircle(buffer[i]);
506 // Don't increase gain when signal is continuously below the noise floor
507 if(level < mNoiseFloor) {
509 } else {
510 mNoiseCounter = 0;
511 }
512 if(mNoiseCounter < 100) {
513 last *= mDecayFactor;
514 if(last < mThreshold)
515 last = mThreshold;
516 if(level > last)
517 last = level;
518 }
519 env[i] = last;
520 }
521 mLastLevel = last;
522
523 // Next do the same process in reverse direction to get the requested attack rate
524 last = mLastLevel;
525 for(size_t i = len; i--;) {
526 last *= mAttackInverseFactor;
527 if(last < mThreshold)
528 last = mThreshold;
529 if(env[i] < last)
530 env[i] = last;
531 else
532 last = env[i];
533 }
534
535 if((previous != NULL) && (previous_len > 0)) {
536 // If the previous envelope was passed, propagate the rise back until we intersect
537 for(size_t i = previous_len; i--;) {
538 last *= mAttackInverseFactor;
539 if(last < mThreshold)
540 last = mThreshold;
541 if(previous[i] < last)
542 previous[i] = last;
543 else // Intersected the previous envelope buffer, so we are finished
544 return;
545 }
546 // If we can't back up far enough, project the starting level forward
547 // until we intersect the desired envelope
548 last = previous[0];
549 for(size_t i=1; i<previous_len; i++) {
550 last *= mAttackFactor;
551 if(previous[i] > last)
552 previous[i] = last;
553 else // Intersected the desired envelope, so we are finished
554 return;
555 }
556 // If we still didn't intersect, then continue ramp up into current buffer
557 for(size_t i=0; i<len; i++) {
558 last *= mAttackFactor;
559 if(buffer[i] > last)
560 buffer[i] = last;
561 else // Finally got an intersect
562 return;
563 }
564 // If we still didn't intersect, then reset mLastLevel
565 mLastLevel = last;
566 }
567}
float AvgCircle(float x)
Definition: Compressor.cpp:441
double mAttackFactor
Definition: Compressor.h:95
double mDecayFactor
Definition: Compressor.h:97
double mAttackInverseFactor
Definition: Compressor.h:96

References AvgCircle(), FreshenCircle(), mAttackFactor, mAttackInverseFactor, mDecayFactor, mLastLevel, mNoiseCounter, mNoiseFloor, mThreshold, and mUsePeak.

Referenced by TwoBufferProcessPass1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreshenCircle()

void EffectCompressor::FreshenCircle ( )
private

Definition at line 432 of file Compressor.cpp.

433{
434 // Recompute the RMS sum periodically to prevent accumulation of rounding errors
435 // during long waveforms
436 mRMSSum = 0;
437 for(size_t i=0; i<mCircleSize; i++)
438 mRMSSum += mCircle[i];
439}

References mCircle, mCircleSize, and mRMSSum.

Referenced by Follow().

Here is the caller graph for this function:

◆ GetDescription()

TranslatableString EffectCompressor::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 107 of file Compressor.cpp.

108{
109 return XO("Compresses the dynamic range of audio");
110}
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol EffectCompressor::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 102 of file Compressor.cpp.

103{
104 return Symbol;
105}
static const ComponentInterfaceSymbol Symbol
Definition: Compressor.h:34

References Symbol.

◆ GetType()

EffectType EffectCompressor::GetType ( ) const
overridevirtual

Type determines how it behaves.

Implements EffectDefinitionInterface.

Definition at line 119 of file Compressor.cpp.

120{
121 return EffectTypeProcess;
122}
@ EffectTypeProcess

References EffectTypeProcess.

◆ InitPass1()

bool EffectCompressor::InitPass1 ( )
overrideprotectedvirtual

Override these methods if you need to initialize something before each pass. Return false if processing should stop.

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 346 of file Compressor.cpp.

347{
348 mMax=0.0;
349 if (!mNormalize)
351
352 // Find the maximum block length required for any track
353 size_t maxlen = inputTracks()->Selected<const WaveTrack>().max(
355 );
356 mFollow1.reset();
357 mFollow2.reset();
358 // Allocate buffers for the envelope
359 if(maxlen > 0) {
360 mFollow1.reinit(maxlen);
361 mFollow2.reinit(maxlen);
362 }
363 mFollowLen = maxlen;
364
365 return true;
366}
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:58
const TrackList * inputTracks() const
Definition: EffectBase.h:91
void DisableSecondPass()
Call this if you know in advance that no second pass will be needed.
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:967
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
size_t GetMaxBlockSize() const
Definition: WaveTrack.cpp:2258

References EffectTwoPassSimpleMono::DisableSecondPass(), WaveTrack::GetMaxBlockSize(), EffectBase::inputTracks(), mFollow1, mFollow2, mFollowLen, mMax, mNormalize, ArrayOf< X >::reinit(), and TrackList::Selected().

Here is the call graph for this function:

◆ InitPass2()

bool EffectCompressor::InitPass2 ( )
overrideprotectedvirtual

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 368 of file Compressor.cpp.

369{
370 // Actually, this should not even be called, because we call
371 // DisableSecondPass() before, if mNormalize is false.
372 return mNormalize;
373}

References mNormalize.

◆ ManualPage()

ManualPageID EffectCompressor::ManualPage ( ) const
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 112 of file Compressor.cpp.

113{
114 return L"Compressor";
115}

◆ NewTrackPass1()

bool EffectCompressor::NewTrackPass1 ( )
overrideprotectedvirtual

Override these methods if you need to do things before every track (including the first one)

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 321 of file Compressor.cpp.

322{
325 mNoiseCounter = 100;
326
327 mAttackInverseFactor = exp(log(mThreshold) / (mCurRate * mAttackTime + 0.5));
329 mDecayFactor = exp(log(mThreshold) / (mCurRate * mDecayTime + 0.5));
330
331 if(mRatio > 1)
332 mCompression = 1.0-1.0/mRatio;
333 else
334 mCompression = 0.0;
335
337
338 mCircleSize = 100;
339 mCircle.reinit( mCircleSize, true );
340 mCirclePos = 0;
341 mRMSSum = 0.0;
342
343 return true;
344}
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:337

References DB_TO_LINEAR, mAttackFactor, mAttackInverseFactor, mAttackTime, mCircle, mCirclePos, mCircleSize, mCompression, EffectTwoPassSimpleMono::mCurRate, mDecayFactor, mDecayTime, mLastLevel, mNoiseCounter, mNoiseFloor, mNoiseFloorDB, mRatio, mRMSSum, mThreshold, mThresholdDB, and ArrayOf< X >::reinit().

Here is the call graph for this function:

◆ OnSlider()

void EffectCompressor::OnSlider ( wxCommandEvent &  evt)
private

Definition at line 587 of file Compressor.cpp.

588{
590 UpdateUI();
591}
bool DoTransferDataFromWindow()
Definition: Compressor.cpp:305

References DoTransferDataFromWindow(), and UpdateUI().

Here is the call graph for this function:

◆ Parameters()

const EffectParameterMethods & EffectCompressor::Parameters ( ) const
overrideprivatevirtual

Reimplemented from Effect.

Definition at line 60 of file Compressor.cpp.

61{
63 Threshold, NoiseFloor, Ratio, // positive number > 1.0
64 AttackTime, // seconds
65 ReleaseTime, // seconds
67 > parameters;
68 return parameters;
69}
Generates EffectParameterMethods overrides from variadic template arguments.
static constexpr EffectParameter Threshold
Definition: Compressor.h:137
static constexpr EffectParameter UsePeak
Definition: Compressor.h:149
static constexpr EffectParameter AttackTime
Definition: Compressor.h:143
static constexpr EffectParameter Normalize
Definition: Compressor.h:147

References AttackTime, EffectCompressor(), NoiseFloor, Normalize, Ratio, ReleaseTime, Threshold, and UsePeak.

Here is the call graph for this function:

◆ PopulateOrExchange()

std::unique_ptr< EffectEditor > EffectCompressor::PopulateOrExchange ( ShuttleGui S,
EffectInstance instance,
EffectSettingsAccess access,
const EffectOutputs pOutputs 
)
overridevirtual

Add controls to effect panel; always succeeds.

Returns
if not null, then return it from PopulateUI instead of a DefaultEffectEditor; default implementation returns null

Reimplemented from StatefulEffectUIServices.

Definition at line 160 of file Compressor.cpp.

163{
164 mUIParent = S.GetParent();
165 S.SetBorder(5);
166
167 S.StartHorizontalLay(wxEXPAND, true);
168 {
169 S.SetBorder(10);
170 mPanel = safenew EffectCompressorPanel(S.GetParent(), wxID_ANY,
173 mRatio);
174 S.Prop(true)
175 .Position(wxEXPAND | wxALL)
176 .MinSize( { 400, 200 } )
177 .AddWindow(mPanel);
178 S.SetBorder(5);
179 }
180 S.EndHorizontalLay();
181
182 S.StartStatic( {} );
183 {
184 S.StartMultiColumn(3, wxEXPAND);
185 {
186 S.SetStretchyCol(1);
187 mThresholdLabel = S.AddVariableText(XO("&Threshold:"), true,
188 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
190 .Name(XO("Threshold"))
191 .Style(wxSL_HORIZONTAL)
192 .AddSlider( {},
196 mThresholdText = S.AddVariableText(ThresholdFormat(999), true,
197 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
198
199 mNoiseFloorLabel = S.AddVariableText(XO("&Noise Floor:"), true,
200 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
202 .Name(XO("Noise Floor"))
203 .Style(wxSL_HORIZONTAL)
204 .AddSlider( {},
208 mNoiseFloorText = S.AddVariableText(ThresholdFormat(999),
209 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
210
211 mRatioLabel = S.AddVariableText(XO("&Ratio:"), true,
212 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
214 .Name(XO("Ratio"))
215 .Style(wxSL_HORIZONTAL)
216 .AddSlider( {},
219 Ratio.min * Ratio.scale);
220 mRatioSlider->SetPageSize(5);
221 mRatioText = S.AddVariableText(RatioTextFormat( 1, 99.9 ), true,
222 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
223
224 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
225 * an 'attack' phase where the sound builds up and a 'decay' where the
226 * sound dies away. So this means 'onset duration'. */
227 mAttackLabel = S.AddVariableText(XO("&Attack Time:"), true,
228 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
230 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
231 * an 'attack' phase where the sound builds up and a 'decay' where the
232 * sound dies away. So this means 'onset duration'. */
233 .Name(XO("Attack Time"))
234 .Style(wxSL_HORIZONTAL)
235 .AddSlider( {},
239 mAttackText = S.AddVariableText(
240 AttackTimeFormat(9.99),
241 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
242
243 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
244 * an 'attack' phase where the sound builds up and a 'decay' or 'release' where the
245 * sound dies away. */
246 mDecayLabel = S.AddVariableText(XO("R&elease Time:"), true,
247 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
249 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
250 * an 'attack' phase where the sound builds up and a 'decay' or 'release' where the
251 * sound dies away. */
252 .Name(XO("Release Time"))
253 .Style(wxSL_HORIZONTAL)
254 .AddSlider( {},
258
259 mDecayText = S.AddVariableText(
260 DecayTimeFormat(99.9),
261 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
262 }
263 S.EndMultiColumn();
264 }
265 S.EndStatic();
266
267 S.StartHorizontalLay(wxCENTER, false);
268 {
269 /* i18n-hint: Make-up, i.e. correct for any reduction, rather than fabricate it.*/
270 mGainCheckBox = S.AddCheckBox(XXO("Ma&ke-up gain for 0 dB after compressing"),
271 Normalize.def);
272 /* i18n-hint: "Compress" here means reduce variations of sound volume,
273 NOT related to file-size compression; Peaks means extremes in volume */
274 mPeakCheckBox = S.AddCheckBox(XXO("C&ompress based on Peaks"),
275 UsePeak.def);
276 }
277 S.EndHorizontalLay();
278 return nullptr;
279}
@ ID_Ratio
Definition: Compressor.cpp:55
@ ID_Threshold
Definition: Compressor.cpp:53
@ ID_Attack
Definition: Compressor.cpp:56
@ ID_NoiseFloor
Definition: Compressor.cpp:54
@ ID_Decay
Definition: Compressor.cpp:57
XXO("&Cut/Copy/Paste Toolbar")
#define safenew
Definition: MemoryX.h:9
#define S(N)
Definition: ToChars.cpp:64
wxStaticText * mRatioText
Definition: Compressor.h:121
wxStaticText * mRatioLabel
Definition: Compressor.h:119
wxStaticText * mAttackLabel
Definition: Compressor.h:123
wxWeakRef< wxWindow > mUIParent
Definition: Compressor.h:80
wxStaticText * mDecayText
Definition: Compressor.h:129
wxStaticText * mDecayLabel
Definition: Compressor.h:127
EffectCompressorPanel * mPanel
Definition: Compressor.h:109
wxStaticText * mNoiseFloorText
Definition: Compressor.h:117
wxStaticText * mAttackText
Definition: Compressor.h:125
wxStaticText * mThresholdText
Definition: Compressor.h:113
wxStaticText * mNoiseFloorLabel
Definition: Compressor.h:115
wxStaticText * mThresholdLabel
Definition: Compressor.h:111
TranslatableString DecayTimeFormat(double value)
Definition: Compressor.cpp:135
TranslatableString RatioTextFormat(int sliderValue, double value)
Definition: Compressor.cpp:138
TranslatableString ThresholdFormat(int value)
Definition: Compressor.cpp:128
TranslatableString AttackTimeFormat(double value)
Definition: Compressor.cpp:132
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.

References AttackTime, anonymous_namespace{Compressor.cpp}::AttackTimeFormat(), anonymous_namespace{Compressor.cpp}::DecayTimeFormat(), EffectParameter< Structure, Member, Type, Value >::def, ID_Attack, ID_Decay, ID_NoiseFloor, ID_Ratio, ID_Threshold, mAttackLabel, mAttackSlider, mAttackText, EffectParameter< Structure, Member, Type, Value >::max, mDecayLabel, mDecaySlider, mDecayText, mGainCheckBox, EffectParameter< Structure, Member, Type, Value >::min, mNoiseFloorDB, mNoiseFloorLabel, mNoiseFloorSlider, mNoiseFloorText, mPanel, mPeakCheckBox, mRatio, mRatioLabel, mRatioSlider, mRatioText, mThresholdDB, mThresholdLabel, mThresholdSlider, mThresholdText, mUIParent, NoiseFloor, Normalize, Ratio, anonymous_namespace{Compressor.cpp}::RatioTextFormat(), ReleaseTime, S, safenew, EffectParameter< Structure, Member, Type, Value >::scale, Threshold, anonymous_namespace{Compressor.cpp}::ThresholdFormat(), UsePeak, XO(), and XXO().

Here is the call graph for this function:

◆ ProcessPass2()

bool EffectCompressor::ProcessPass2 ( float *  buffer,
size_t  len 
)
overrideprotected

Definition at line 421 of file Compressor.cpp.

422{
423 if (mMax != 0)
424 {
425 for (size_t i = 0; i < len; i++)
426 buffer[i] /= mMax;
427 }
428
429 return true;
430}

References mMax.

◆ TransferDataFromWindow()

bool EffectCompressor::TransferDataFromWindow ( EffectSettings settings)
overridevirtual

Update the given settings from controls; default does nothing, returns true

Reimplemented from StatefulEffectUIServices.

Definition at line 296 of file Compressor.cpp.

297{
298 if (!mUIParent->Validate())
299 {
300 return false;
301 }
303}

References DoTransferDataFromWindow(), and mUIParent.

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectCompressor::TransferDataToWindow ( const EffectSettings settings)
overridevirtual

Update controls for the settings; default does nothing, returns true

Reimplemented from StatefulEffectUIServices.

Definition at line 281 of file Compressor.cpp.

282{
285 mRatioSlider->SetValue(lrint(mRatio * Ratio.scale));
288 mGainCheckBox->SetValue(mNormalize);
289 mPeakCheckBox->SetValue(mUsePeak);
290
291 UpdateUI();
292
293 return true;
294}
#define lrint(dbl)
Definition: float_cast.h:169

References AttackTime, lrint, mAttackSlider, mAttackTime, mDecaySlider, mDecayTime, mGainCheckBox, mNoiseFloorDB, mNoiseFloorSlider, mNormalize, mPeakCheckBox, mRatio, mRatioSlider, mThresholdDB, mThresholdSlider, mUsePeak, NoiseFloor, Ratio, ReleaseTime, EffectParameter< Structure, Member, Type, Value >::scale, and UpdateUI().

Here is the call graph for this function:

◆ TwoBufferProcessPass1()

bool EffectCompressor::TwoBufferProcessPass1 ( float *  buffer1,
size_t  len1,
float *  buffer2,
size_t  len2 
)
overrideprotectedvirtual

Override this method to actually process audio with access to 2 sequential buffers at a time

Either buffer1 or buffer2 may be modified as needed This allows implementation of processing with delays The default just calls the one-buffer-at-a-time method

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 378 of file Compressor.cpp.

380{
381 // If buffers are bigger than allocated, then abort
382 // (this should never happen, but if it does, we don't want to crash)
383 if((len1 > mFollowLen) || (len2 > mFollowLen))
384 return false;
385
386 // This makes sure that the initial value is well-chosen
387 // buffer1 == NULL on the first and only the first call
388 if (buffer1 == NULL) {
389 // Initialize the mLastLevel to the peak level in the first buffer
390 // This avoids problems with large spike events near the beginning of the track
392 for(size_t i=0; i<len2; i++) {
393 if(mLastLevel < fabs(buffer2[i]))
394 mLastLevel = fabs(buffer2[i]);
395 }
396 }
397
398 // buffer2 is NULL on the last and only the last call
399 if(buffer2 != NULL) {
400 Follow(buffer2, mFollow2.get(), len2, mFollow1.get(), len1);
401 }
402
403 if(buffer1 != NULL) {
404 for (size_t i = 0; i < len1; i++) {
405 buffer1[i] = DoCompression(buffer1[i], mFollow1[i]);
406 }
407 }
408
409
410#if 0
411 // Copy the envelope over the track data (for debug purposes)
412 memcpy(buffer1, mFollow1, len1*sizeof(float));
413#endif
414
415 // Rotate the buffer pointers
416 mFollow1.swap(mFollow2);
417
418 return true;
419}
void Follow(float *buffer, float *env, size_t len, float *previous, size_t previous_len)
Definition: Compressor.cpp:456
float DoCompression(float x, double env)
Definition: Compressor.cpp:569

References DoCompression(), Follow(), mFollow1, mFollow2, mFollowLen, mLastLevel, and mThreshold.

Here is the call graph for this function:

◆ UpdateUI()

void EffectCompressor::UpdateUI ( )
private

Definition at line 593 of file Compressor.cpp.

594{
595 mThresholdLabel->SetName(wxString::Format(_("Threshold %d dB"), (int) mThresholdDB));
596 mThresholdText->SetLabel(ThresholdFormat((int) mThresholdDB).Translation());
597 mThresholdText->SetName(mThresholdText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
598
599 mNoiseFloorLabel->SetName(wxString::Format(_("Noise Floor %d dB"), (int) mNoiseFloorDB));
600 mNoiseFloorText->SetLabel(ThresholdFormat((int) mNoiseFloorDB).Translation());
601 mNoiseFloorText->SetName(mNoiseFloorText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
602
603 mRatioLabel->SetName(
605 mRatioText->SetLabel(
607 mRatioText->SetName(mRatioText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
608
609 mAttackLabel->SetName(wxString::Format(_("Attack Time %.2f secs"), mAttackTime));
610 mAttackText->SetLabel(AttackTimeFormat(mAttackTime).Translation());
611 mAttackText->SetName(mAttackText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
612
613 mDecayLabel->SetName(wxString::Format(_("Release Time %.1f secs"), mDecayTime));
614 mDecayText->SetLabel(DecayTimeFormat(mDecayTime).Translation());
615 mDecayText->SetName(mDecayText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
616
617 mPanel->Refresh(false);
618
619 return;
620}
#define _(s)
Definition: Internat.h:73
wxString Translation() const
TranslatableString RatioLabelFormat(int sliderValue, double value)
Definition: Compressor.cpp:150

References _, anonymous_namespace{Compressor.cpp}::AttackTimeFormat(), anonymous_namespace{Compressor.cpp}::DecayTimeFormat(), mAttackLabel, mAttackText, mAttackTime, mDecayLabel, mDecayText, mDecayTime, mNoiseFloorDB, mNoiseFloorLabel, mNoiseFloorText, mPanel, mRatio, mRatioLabel, mRatioSlider, mRatioText, mThresholdDB, mThresholdLabel, mThresholdText, anonymous_namespace{Compressor.cpp}::RatioLabelFormat(), anonymous_namespace{Compressor.cpp}::RatioTextFormat(), anonymous_namespace{Compressor.cpp}::ThresholdFormat(), and TranslatableString::Translation().

Referenced by OnSlider(), and TransferDataToWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ AttackTime

constexpr EffectParameter EffectCompressor::AttackTime
staticconstexprprivate
Initial value:
L"AttackTime", 0.2, 0.1, 5.0, 100 }

Definition at line 143 of file Compressor.h.

Referenced by Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ mAttackFactor

double EffectCompressor::mAttackFactor
private

Definition at line 95 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mAttackInverseFactor

double EffectCompressor::mAttackInverseFactor
private

Definition at line 96 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mAttackLabel

wxStaticText* EffectCompressor::mAttackLabel
private

Definition at line 123 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mAttackSlider

wxSlider* EffectCompressor::mAttackSlider
private

◆ mAttackText

wxStaticText* EffectCompressor::mAttackText
private

Definition at line 125 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mAttackTime

double EffectCompressor::mAttackTime
private

◆ mCircle

Doubles EffectCompressor::mCircle
private

Definition at line 85 of file Compressor.h.

Referenced by AvgCircle(), FreshenCircle(), and NewTrackPass1().

◆ mCirclePos

size_t EffectCompressor::mCirclePos
private

Definition at line 84 of file Compressor.h.

Referenced by AvgCircle(), and NewTrackPass1().

◆ mCircleSize

size_t EffectCompressor::mCircleSize
private

Definition at line 83 of file Compressor.h.

Referenced by AvgCircle(), FreshenCircle(), and NewTrackPass1().

◆ mCompression

double EffectCompressor::mCompression
private

Definition at line 99 of file Compressor.h.

Referenced by DoCompression(), and NewTrackPass1().

◆ mDecayFactor

double EffectCompressor::mDecayFactor
private

Definition at line 97 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mDecayLabel

wxStaticText* EffectCompressor::mDecayLabel
private

Definition at line 127 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mDecaySlider

wxSlider* EffectCompressor::mDecaySlider
private

◆ mDecayText

wxStaticText* EffectCompressor::mDecayText
private

Definition at line 129 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mDecayTime

double EffectCompressor::mDecayTime
private

◆ mFollow1

Floats EffectCompressor::mFollow1
private

Definition at line 104 of file Compressor.h.

Referenced by InitPass1(), and TwoBufferProcessPass1().

◆ mFollow2

Floats EffectCompressor::mFollow2
private

Definition at line 104 of file Compressor.h.

Referenced by InitPass1(), and TwoBufferProcessPass1().

◆ mFollowLen

size_t EffectCompressor::mFollowLen
private

Definition at line 105 of file Compressor.h.

Referenced by InitPass1(), and TwoBufferProcessPass1().

◆ mGain

double EffectCompressor::mGain
private

Definition at line 102 of file Compressor.h.

◆ mGainCheckBox

wxCheckBox* EffectCompressor::mGainCheckBox
private

◆ mLastLevel

double EffectCompressor::mLastLevel
private

Definition at line 103 of file Compressor.h.

Referenced by Follow(), NewTrackPass1(), and TwoBufferProcessPass1().

◆ mMax

double EffectCompressor::mMax
private

Definition at line 107 of file Compressor.h.

Referenced by DoCompression(), InitPass1(), and ProcessPass2().

◆ mNoiseCounter

int EffectCompressor::mNoiseCounter
private

Definition at line 101 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mNoiseFloor

double EffectCompressor::mNoiseFloor
private

Definition at line 100 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mNoiseFloorDB

double EffectCompressor::mNoiseFloorDB
private

◆ mNoiseFloorLabel

wxStaticText* EffectCompressor::mNoiseFloorLabel
private

Definition at line 115 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mNoiseFloorSlider

wxSlider* EffectCompressor::mNoiseFloorSlider
private

◆ mNoiseFloorText

wxStaticText* EffectCompressor::mNoiseFloorText
private

Definition at line 117 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mNormalize

bool EffectCompressor::mNormalize
private

Definition at line 91 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), InitPass1(), InitPass2(), and TransferDataToWindow().

◆ mPanel

EffectCompressorPanel* EffectCompressor::mPanel
private

Definition at line 109 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mPeakCheckBox

wxCheckBox* EffectCompressor::mPeakCheckBox
private

◆ mRatio

double EffectCompressor::mRatio
private

◆ mRatioLabel

wxStaticText* EffectCompressor::mRatioLabel
private

Definition at line 119 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mRatioSlider

wxSlider* EffectCompressor::mRatioSlider
private

◆ mRatioText

wxStaticText* EffectCompressor::mRatioText
private

Definition at line 121 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mRMSSum

double EffectCompressor::mRMSSum
private

Definition at line 82 of file Compressor.h.

Referenced by AvgCircle(), FreshenCircle(), and NewTrackPass1().

◆ mThreshold

double EffectCompressor::mThreshold
private

Definition at line 98 of file Compressor.h.

Referenced by DoCompression(), Follow(), NewTrackPass1(), and TwoBufferProcessPass1().

◆ mThresholdDB

double EffectCompressor::mThresholdDB
private

◆ mThresholdLabel

wxStaticText* EffectCompressor::mThresholdLabel
private

Definition at line 111 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mThresholdSlider

wxSlider* EffectCompressor::mThresholdSlider
private

◆ mThresholdText

wxStaticText* EffectCompressor::mThresholdText
private

Definition at line 113 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mUIParent

wxWeakRef<wxWindow> EffectCompressor::mUIParent {}
private

Definition at line 80 of file Compressor.h.

Referenced by PopulateOrExchange(), and TransferDataFromWindow().

◆ mUsePeak

bool EffectCompressor::mUsePeak
private

Definition at line 92 of file Compressor.h.

Referenced by DoCompression(), DoTransferDataFromWindow(), Follow(), and TransferDataToWindow().

◆ NoiseFloor

constexpr EffectParameter EffectCompressor::NoiseFloor
staticconstexprprivate
Initial value:
L"NoiseFloor", -40.0, -80.0, -20.0, 0.2 }

Definition at line 139 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ Normalize

constexpr EffectParameter EffectCompressor::Normalize
staticconstexprprivate
Initial value:
L"Normalize", true, false, true, 1 }

Definition at line 147 of file Compressor.h.

Referenced by Parameters(), and PopulateOrExchange().

◆ Ratio

constexpr EffectParameter EffectCompressor::Ratio
staticconstexprprivate
Initial value:
L"Ratio", 2.0, 1.1, 10.0, 10 }

Definition at line 141 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ ReleaseTime

constexpr EffectParameter EffectCompressor::ReleaseTime
staticconstexprprivate
Initial value:
L"ReleaseTime", 1.0, 1.0, 30.0, 10 }

Definition at line 145 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ Symbol

const ComponentInterfaceSymbol EffectCompressor::Symbol { XO("Compressor") }
static

Definition at line 34 of file Compressor.h.

Referenced by GetSymbol().

◆ Threshold

constexpr EffectParameter EffectCompressor::Threshold
staticconstexprprivate
Initial value:
L"Threshold", -12.0, -60.0, -1.0, 1 }

Definition at line 137 of file Compressor.h.

Referenced by Parameters(), and PopulateOrExchange().

◆ UsePeak

constexpr EffectParameter EffectCompressor::UsePeak
staticconstexprprivate
Initial value:
L"UsePeak", false, false, true, 1 }

Definition at line 149 of file Compressor.h.

Referenced by Parameters(), and PopulateOrExchange().


The documentation for this class was generated from the following files: