Audacity 3.2.0
Namespaces | Macros | Functions | Variables
Distortion.cpp File Reference
#include "Distortion.h"
#include "LoadEffects.h"
#include <cmath>
#include <algorithm>
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/valgen.h>
#include <wx/log.h>
#include <wx/slider.h>
#include <wx/stattext.h>
#include "Prefs.h"
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
Include dependency graph for Distortion.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{Distortion.cpp}
 

Macros

#define _USE_MATH_DEFINES
 
#define M_PI   3.1415926535897932384626433832795
 
#define M_PI_2   1.57079632679489661923132169163975
 
#define skipsamples   1000
 

Functions

TranslatableString defaultLabel (int index)
 

Variables

struct {
   const TranslatableString   name
 
   EffectDistortion::Params   params
 
FactoryPresets []
 
BuiltinEffectsModule::Registration< EffectDistortionanonymous_namespace{Distortion.cpp}::reg
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 25 of file Distortion.cpp.

◆ M_PI

#define M_PI   3.1415926535897932384626433832795

Definition at line 29 of file Distortion.cpp.

◆ M_PI_2

#define M_PI_2   1.57079632679489661923132169163975

Definition at line 32 of file Distortion.cpp.

◆ skipsamples

#define skipsamples   1000

Definition at line 78 of file Distortion.cpp.

Function Documentation

◆ defaultLabel()

TranslatableString defaultLabel ( int  index)

Definition at line 114 of file Distortion.cpp.

115{
116 static const TranslatableString names[] = {
117 XO("Upper Threshold"),
118 XO("Noise Floor"),
119 XO("Parameter 1"),
120 XO("Parameter 2"),
121 XO("Number of repeats"),
122 };
123
124 return names[ index ];
125}
#define XO(s)
Definition: Internat.h:31
static TranslatableStrings names
Definition: TagsEditor.cpp:151
Holds a msgid for the translation catalog; may also bind format arguments.

References names, and XO.

Referenced by EffectDistortion::PopulateOrExchange(), and EffectDistortion::UpdateUI().

Here is the caller graph for this function:

Variable Documentation

◆ 

const struct { ... } FactoryPresets[]
Initial value:
=
{
{ XO("Hard clip -12dB, 80% make-up gain"), { 0, 0, -12.0, -70.0, 0.0, 80.0, 0 } },
{ XO("Soft clip -12dB, 80% make-up gain"), { 1, 0, -12.0, -70.0, 50.0, 80.0, 0 } },
{ XO("Fuzz Box"), { 1, 0, -30.0, -70.0, 80.0, 80.0, 0 } },
{ XO("Walkie-talkie"), { 1, 0, -50.0, -70.0, 60.0, 80.0, 0 } },
{ XO("Blues drive sustain"), { 2, 0, -6.0, -70.0, 30.0, 80.0, 0 } },
{ XO("Light Crunch Overdrive"), { 3, 0, -6.0, -70.0, 20.0, 80.0, 0 } },
{ XO("Heavy Overdrive"), { 4, 0, -6.0, -70.0, 90.0, 80.0, 0 } },
{ XO("3rd Harmonic (Perfect Fifth)"), { 5, 0, -6.0, -70.0, 100.0, 60.0, 0 } },
{ XO("Valve Overdrive"), { 6, 1, -6.0, -70.0, 30.0, 40.0, 0 } },
{ XO("2nd Harmonic (Octave)"), { 6, 1, -6.0, -70.0, 50.0, 0.0, 0 } },
{ XO("Gated Expansion Distortion"), { 7, 0, -6.0, -70.0, 30.0, 80.0, 0 } },
{ XO("Leveller, Light, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 1 } },
{ XO("Leveller, Moderate, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 2 } },
{ XO("Leveller, Heavy, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 3 } },
{ XO("Leveller, Heavier, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 4 } },
{ XO("Leveller, Heaviest, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 5 } },
{ XO("Half-wave Rectifier"), { 9, 0, -6.0, -70.0, 50.0, 50.0, 0 } },
{ XO("Full-wave Rectifier"), { 9, 0, -6.0, -70.0, 100.0, 50.0, 0 } },
{ XO("Full-wave Rectifier (DC blocked)"), { 9, 1, -6.0, -70.0, 100.0, 50.0, 0 } },
{ XO("Percussion Limiter"), {10, 0, -12.0, -70.0, 100.0, 30.0, 0 } },
}

Referenced by EffectDistortion::DoLoadFactoryPreset(), and EffectDistortion::GetFactoryPresets().

◆ name

const TranslatableString name

Definition at line 82 of file Distortion.cpp.

Referenced by audacity::network_manager::MultipartData::Add(), Effect::AddAnalysisTrack(), CommandMessageTarget::AddBool(), CommandContext::AddBool(), LispyCommandMessageTarget::AddBool(), AboutDialog::AddCredit(), Effect::AddedAnalysisTrack::AddedAnalysisTrack(), anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItemGroup(), audacity::network_manager::MultipartData::AddFile(), CommandManager::AddGlobalCommand(), anonymous_namespace{PluginMenus.cpp}::AddGroupedEffectMenuItems(), CommandManager::AddItem(), CommandMessageTarget::AddItem(), CommandContext::AddItem(), LispyCommandMessageTarget::AddItem(), CommandManager::AddItemList(), MacroCommands::AddMacro(), CommandSignature::AddParameter(), anonymous_namespace{PluginMenus.cpp}::AddSortedEffectMenuItems(), ExportMP3::AddTags(), MacroCommands::ApplyMacro(), ApplyMacroDialog::ApplyMacroToProject(), ExportFFmpeg::AskResample(), ASlider::ASlider(), NyquistEffectsModule::AutoRegisterPlugins(), anonymous_namespace{Registry.cpp}::BadPath(), ProgressDialog::Beep(), PopupMenuTable::BeginSection(), ScreenshotCommand::CaptureToolbar(), DeviceToolBar::ChangeDevice(), AudioSetupToolBar::ChangeDevice(), CommandManager::Check(), DBConnection::CheckpointThread(), MenuTable::CommandGroup(), KeyConfigPrefs::Commit(), ConvertLegacyProjectFile(), ConvertLegacyTrack(), LabelTrack::Create(), FileDialogWrapper::Create(), FileDialog::Create(), wxDialogWrapper::Create(), anonymous_namespace{RealtimeEffectPanel.cpp}::ListNavigationPanel::Create(), anonymous_namespace{RealtimeEffectPanel.cpp}::MovableControl::Create(), anonymous_namespace{RealtimeEffectPanel.cpp}::HyperLinkCtrlWrapper::Create(), wxPanelWrapper::Create(), WaveTrack::CreateClip(), FFmpegFunctions::CreateEncoder(), ThemeBase::CreateOneImageCache(), AudacityApp::CreateSingleInstanceChecker(), MacroCommands::DeleteMacro(), FFmpegPresets::DeletePreset(), CommandManager::DescribeCommandsAndShortcuts(), AudioUnitEffectsModule::DiscoverPluginsAtPath(), Journal::Dispatch(), AudacityCommand::DoAudacityCommand(), EffectBase::DoEffect(), ExportMultipleDialog::DoExport(), ProjectAudioManager::DoRecord(), BuiltinCommandsModule::DoRegistration(), BuiltinEffectsModule::DoRegistration(), TrackUtilities::DoRemoveTrack(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteTrack(), anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), PluginManager::DropFile(), anonymous_namespace{ProjectSerializer.cpp}::XMLTagHandlerAdapter::EmitStartTag(), CommandManager::Enable(), XMLFileReader::endElement(), CommandManager::EndSubMenu(), XMLUtf8BufferWriter::EndTag(), anonymous_namespace{ProjectSerializer.cpp}::XMLTagHandlerAdapter::EndTag(), XMLWriter::EndTag(), ProjectSerializer::EndTag(), EQCurve::EQCurve(), ExportFFmpeg::ExportFFmpeg(), ExportMultipleDialog::ExportMultipleByLabel(), ExportMultipleDialog::ExportMultipleByTrack(), FileDialog::FileDialog(), FileIO::FileIO(), AudioSetupToolBar::FillInputChannels(), DeviceToolBar::FillInputChannels(), anonymous_namespace{Registry.cpp}::CollectedItems::Find(), find_widget(), anonymous_namespace{AudioUnitEffectsModule.cpp}::FindAudioUnit(), Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::FindByNameAmongPeers(), WaveTrack::FindClipByName(), FindDialog::FindDialog(), FindFFmpegLibs(), MP3Exporter::FindLibrary(), LV2EffectsModule::FindModulePaths(), VampEffectsModule::FindModulePaths(), BasicMenu::anonymous_namespace{BasicMenu.cpp}::FindPathName(), VampEffectsModule::FindPlugin(), FFmpegPresets::FindPreset(), ExportFFmpegOptions::FindSelectedCodec(), ExportFFmpegOptions::FindSelectedFormat(), VSTEffectWrapper::ForEachParameter(), GetAVVersion(), NumericConverter::GetBuiltinFormat(), CommandManager::GetCategories(), CommandManager::GetCategoryFromName(), EffectManager::GetCommandIdentifier(), audacity::network_manager::Request::getCookie(), audacity::network_manager::CookiesList::getCookie(), WaveTrack::GetDefaultAudioTrackNamePreference(), CommandManager::GetDefaultKeyFromName(), AudioIOBase::GetDeviceInfo(), VSTEffect::GetEffectIDs(), CommandManager::GetEnabled(), EffectDistortion::GetFactoryPresets(), VST3::Hosting::anonymous_namespace{module_linux.cpp}::LinuxModule::getFunctionPointer(), VST3::Hosting::anonymous_namespace{module_win32.cpp}::Win32Module::getFunctionPointer(), Tags::GetGenre(), audacity::network_manager::Request::getHeader(), audacity::network_manager::HeadersList::getHeader(), KeyView::GetIndexByName(), CommandManager::GetKeyFromName(), CommandManager::GetLabelFromName(), Languages::GetLanguages(), ExportCL::GetMetaChunk(), FFmpegImportFileHandle::GetMetadata(), GetMIDIDeviceInfo(), AudacityVst3HostApplication::getName(), DevicePrefs::GetNamesAndLabels(), CommandManager::GetPrefixedLabelFromName(), EffectDefinitionInterface::GetSquashedName(), PluginManager::GetSubgroups(), Module::GetSymbol(), GetSymbolFromProcess(), Tags::GetTag(), cloud::audiocom::anonymous_namespace{UploadService.cpp}::GetUploadRequestPayload(), AUPImportFileHandle::HandlePCMAliasBlockFile(), HandlePrint(), cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadPolicy(), CommandManager::HandleXMLTag(), Journal::WindowPaths::anonymous_namespace{JournalWindowPaths.cpp}::HasName(), audacity::network_manager::Header::hasSameName(), Tags::HasTag(), anonymous_namespace{RealtimeEffectPanel.cpp}::HyperLinkCtrlWrapper::HyperLinkCtrlWrapper(), FLACImportFileHandle::Import(), OggImportFileHandle::Import(), WavPackImportFileHandle::Import(), LWSlider::Init(), FFmpegImportFileHandle::InitCodecs(), NyquistEffectsModule::Initialize(), AudioUnitEffectSettings::Intern(), MacroCommands::IsFixed(), KeyConfigPrefsFactory(), anonymous_namespace{RealtimeEffectPanel.cpp}::ListNavigationPanel::ListNavigationPanel(), Tags::LoadDefaults(), MixerBoard::LoadMusicalInstruments(), ExportMP3Options::LoadNames(), ThemeBase::LoadOneThemeComponents(), AudioUnitEffectsModule::LoadPlugin(), FFmpegPresets::LoadPreset(), VST3Wrapper::LoadUserPreset(), AudioUnitEffect::LoadUserPreset(), Effect::LoadUserPreset(), LadspaEffect::LoadUserPreset(), LV2Effect::LoadUserPreset(), VSTEffect::LoadUserPreset(), VST3Effect::LoadUserPreset(), LV2Ports::LV2Ports(), LWSlider::LWSlider(), MacroCommands::MacroCommands(), anonymous_namespace{PluginMenus.cpp}::MakeAddGroupItems(), WaveTrack::MakeClipCopyName(), anonymous_namespace{PluginMenus.cpp}::MakeGroupsFilter(), WaveTrack::MakeNewClipName(), TrackList::MakeUniqueTrackName(), anonymous_namespace{Registry.cpp}::CollectedItems::MergeLater(), anonymous_namespace{Registry.cpp}::CollectedItems::MergeWithExistingItem(), KeyConfigPrefs::MergeWithExistingKeys(), MacroCommands::MigrateLegacyChains(), Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack(), CommandManager::Modify(), Effect::ModifyAnalysisTrack(), anonymous_namespace{RealtimeEffectPanel.cpp}::MovableControl::MovableControl(), ShuttleGui::Name(), DialogDefinition::Item::Name(), CommandManager::NewIdentifier(), CommandParameters::NormalizeName(), MacrosWindow::OnAdd(), ApplyMacroDialog::OnApplyToFiles(), DevicePrefs::OnDevice(), DevicePrefs::OnHost(), MacrosWindow::OnImport(), GStreamerImportFileHandle::OnPadAdded(), FileActions::Handler::OnPrint(), MacrosWindow::OnRemove(), EffectUIHost::OnSaveAs(), GStreamerImportFileHandle::OnTag(), AudacityApp::OnTimer(), DBConnection::OpenStepByStep(), anonymous_namespace{MIDIPlay.h}::Iterator::OutputEvent(), FFmpegPresets::OverwriteIsOk(), AudioUnitWrapper::ParameterInfo::ParameterInfo(), audacity::network_manager::Cookie::Parse(), NyquistEffect::Parse(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::PopulateInitialStatePanel(), ExportMultipleDialog::PopulateOrExchange(), VampEffect::PopulateOrExchange(), anonymous_namespace{PrefsPanel.cpp}::PrefsItem::PrefsItem(), EffectFindClipping::Process(), MacroCommands::ReadMacro(), KeyView::RefreshBindings(), KeyConfigPrefs::RefreshKeyInfo(), VSTEffect::RefreshParameters(), cloud::ShareAudioToolbar::RegenerateTooltips(), AudioSetupToolBar::RegenerateTooltips(), ControlToolBar::RegenerateTooltips(), Journal::RegisteredCommand::RegisteredCommand(), PrefsPanel::Registration::Registration(), RegistryKey::RegistryKey(), CommandManager::RemoveDuplicateShortcuts(), BasicMenu::anonymous_namespace{BasicMenu.cpp}::ReplayPopup(), anonymous_namespace{Registry.cpp}::ReportConflictingPlacements(), anonymous_namespace{Registry.cpp}::ReportGroupGroupCollision(), anonymous_namespace{Registry.cpp}::ReportItemItemCollision(), MacroCommands::RestoreMacro(), ProjectFileIO::SafetyFileName(), Internat::SanitiseFilename(), ExportFFmpegOptions::SavePreset(), FFmpegPresets::SavePreset(), VSTEffect::SaveSettings(), VST3Wrapper::SaveUserPreset(), AudioUnitEffect::SaveUserPreset(), Effect::SaveUserPreset(), LadspaEffect::SaveUserPreset(), LV2Effect::SaveUserPreset(), VSTEffect::SaveUserPreset(), VST3Effect::SaveUserPreset(), CommandManager::SetCommandFlags(), audacity::network_manager::Request::setCookie(), FileDialog::SetFilename(), audacity::network_manager::Request::setHeader(), KeyView::SetKeyByName(), KeyConfigPrefs::SetKeyForSelected(), CommandManager::SetKeyFromName(), ExportFFmpeg::SetMetadata(), NumericTextCtrl::SetName(), wxPanelWrapper::SetName(), wxDialogWrapper::SetName(), WaveClip::SetName(), AudacityProject::SetProjectName(), ProjectFileIO::SetProjectTitle(), Tags::SetTag(), SetToExtantDirectory(), NyqBench::SetWindowTitle(), LyricsWindow::SetWindowTitle(), MixerBoardFrame::SetWindowTitle(), sf_normalize_name(), MenuTable::Special(), XMLFileReader::startElement(), CommandOutputTargets::StartField(), CommandContext::StartField(), CommandMessageTarget::StartField(), LispyCommandMessageTarget::StartField(), anonymous_namespace{MIDIPlay.h}::MIDIPlay::StartPortMidiStream(), XMLUtf8BufferWriter::StartTag(), XMLWriter::StartTag(), ProjectSerializer::StartTag(), MuteButtonHandle::Tip(), SoloButtonHandle::Tip(), EffectsButtonHandle::Tip(), MenuButtonHandle::Tip(), CloseButtonHandle::Tip(), DBConnectionTransactionScopeImpl::TransactionCommit(), DBConnectionTransactionScopeImpl::TransactionRollback(), DBConnectionTransactionScopeImpl::TransactionStart(), LabelDialog::TransferDataFromWindow(), EffectDistortion::UpdateControl(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::UpdateUserData(), AudioUnitUtils::UserPreset::UserPreset(), UserPresetsGroup(), VerifyFilename(), anonymous_namespace{Registry.cpp}::VisitItems(), XMLUtf8BufferWriter::WriteAttr(), anonymous_namespace{ProjectSerializer.cpp}::XMLTagHandlerAdapter::WriteAttr(), ProjectSerializer::WriteAttr(), XMLWriter::WriteAttr(), Importer::WriteImportItems(), MacroCommands::WriteMacro(), and ProjectSerializer::WriteName().

◆ params