From d7f37d0c21ba008e4b609c68e5ba130c2d2f6b11 Mon Sep 17 00:00:00 2001 From: Alberto Roletto <73691506+sadmemelord@users.noreply.github.com> Date: Wed, 1 Feb 2023 19:19:10 +0100 Subject: [PATCH] Initial commit --- .gitattributes | 2 + .gitignore | 1 + JuceLibraryCode/JuceHeader.h | 49 ++++ JuceLibraryCode/JucePluginDefines.h | 162 +++++++++++ JuceLibraryCode/ReadMe.txt | 12 + JuceLibraryCode/include_juce_audio_basics.cpp | 8 + JuceLibraryCode/include_juce_audio_basics.mm | 8 + .../include_juce_audio_devices.cpp | 8 + JuceLibraryCode/include_juce_audio_devices.mm | 8 + .../include_juce_audio_formats.cpp | 8 + JuceLibraryCode/include_juce_audio_formats.mm | 8 + .../include_juce_audio_plugin_client_AAX.cpp | 8 + .../include_juce_audio_plugin_client_AAX.mm | 8 + .../include_juce_audio_plugin_client_ARA.cpp | 8 + .../include_juce_audio_plugin_client_AU.r | 8 + .../include_juce_audio_plugin_client_AU_1.mm | 8 + .../include_juce_audio_plugin_client_AU_2.mm | 8 + .../include_juce_audio_plugin_client_AUv3.mm | 8 + .../include_juce_audio_plugin_client_LV2.cpp | 8 + .../include_juce_audio_plugin_client_LV2.mm | 8 + ...de_juce_audio_plugin_client_Standalone.cpp | 8 + ...include_juce_audio_plugin_client_Unity.cpp | 8 + .../include_juce_audio_plugin_client_VST2.cpp | 8 + .../include_juce_audio_plugin_client_VST3.cpp | 8 + ...lude_juce_audio_plugin_client_VST_utils.mm | 8 + ...include_juce_audio_plugin_client_utils.cpp | 8 + .../include_juce_audio_processors.cpp | 8 + .../include_juce_audio_processors.mm | 8 + .../include_juce_audio_processors_ara.cpp | 8 + ...include_juce_audio_processors_lv2_libs.cpp | 8 + JuceLibraryCode/include_juce_audio_utils.cpp | 8 + JuceLibraryCode/include_juce_audio_utils.mm | 8 + JuceLibraryCode/include_juce_core.cpp | 8 + JuceLibraryCode/include_juce_core.mm | 8 + .../include_juce_data_structures.cpp | 8 + .../include_juce_data_structures.mm | 8 + JuceLibraryCode/include_juce_dsp.cpp | 8 + JuceLibraryCode/include_juce_dsp.mm | 8 + JuceLibraryCode/include_juce_events.cpp | 8 + JuceLibraryCode/include_juce_events.mm | 8 + JuceLibraryCode/include_juce_graphics.cpp | 8 + JuceLibraryCode/include_juce_graphics.mm | 8 + JuceLibraryCode/include_juce_gui_basics.cpp | 8 + JuceLibraryCode/include_juce_gui_basics.mm | 8 + JuceLibraryCode/include_juce_gui_extra.cpp | 8 + JuceLibraryCode/include_juce_gui_extra.mm | 8 + QuasoCompressor.jucer | 66 +++++ README.md | 2 + Source/GUI/LookAndFeel/DialLAF.cpp | 143 ++++++++++ Source/GUI/LookAndFeel/DialLAF.h | 23 ++ Source/GUI/Sliders/SliderProps.cpp | 40 +++ Source/PluginEditor.cpp | 107 +++++++ Source/PluginEditor.h | 85 ++++++ Source/PluginProcessor.cpp | 270 ++++++++++++++++++ Source/PluginProcessor.h | 80 ++++++ quasoCompressor.filtergraph | 101 +++++++ 56 files changed, 1471 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 JuceLibraryCode/JuceHeader.h create mode 100644 JuceLibraryCode/JucePluginDefines.h create mode 100644 JuceLibraryCode/ReadMe.txt create mode 100644 JuceLibraryCode/include_juce_audio_basics.cpp create mode 100644 JuceLibraryCode/include_juce_audio_basics.mm create mode 100644 JuceLibraryCode/include_juce_audio_devices.cpp create mode 100644 JuceLibraryCode/include_juce_audio_devices.mm create mode 100644 JuceLibraryCode/include_juce_audio_formats.cpp create mode 100644 JuceLibraryCode/include_juce_audio_formats.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_AAX.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_AAX.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_ARA.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_AU.r create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_AU_2.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_AUv3.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_LV2.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_LV2.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_VST3.cpp create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_VST_utils.mm create mode 100644 JuceLibraryCode/include_juce_audio_plugin_client_utils.cpp create mode 100644 JuceLibraryCode/include_juce_audio_processors.cpp create mode 100644 JuceLibraryCode/include_juce_audio_processors.mm create mode 100644 JuceLibraryCode/include_juce_audio_processors_ara.cpp create mode 100644 JuceLibraryCode/include_juce_audio_processors_lv2_libs.cpp create mode 100644 JuceLibraryCode/include_juce_audio_utils.cpp create mode 100644 JuceLibraryCode/include_juce_audio_utils.mm create mode 100644 JuceLibraryCode/include_juce_core.cpp create mode 100644 JuceLibraryCode/include_juce_core.mm create mode 100644 JuceLibraryCode/include_juce_data_structures.cpp create mode 100644 JuceLibraryCode/include_juce_data_structures.mm create mode 100644 JuceLibraryCode/include_juce_dsp.cpp create mode 100644 JuceLibraryCode/include_juce_dsp.mm create mode 100644 JuceLibraryCode/include_juce_events.cpp create mode 100644 JuceLibraryCode/include_juce_events.mm create mode 100644 JuceLibraryCode/include_juce_graphics.cpp create mode 100644 JuceLibraryCode/include_juce_graphics.mm create mode 100644 JuceLibraryCode/include_juce_gui_basics.cpp create mode 100644 JuceLibraryCode/include_juce_gui_basics.mm create mode 100644 JuceLibraryCode/include_juce_gui_extra.cpp create mode 100644 JuceLibraryCode/include_juce_gui_extra.mm create mode 100644 QuasoCompressor.jucer create mode 100644 README.md create mode 100644 Source/GUI/LookAndFeel/DialLAF.cpp create mode 100644 Source/GUI/LookAndFeel/DialLAF.h create mode 100644 Source/GUI/Sliders/SliderProps.cpp create mode 100644 Source/PluginEditor.cpp create mode 100644 Source/PluginEditor.h create mode 100644 Source/PluginProcessor.cpp create mode 100644 Source/PluginProcessor.h create mode 100644 quasoCompressor.filtergraph diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..349b2df --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Builds/ \ No newline at end of file diff --git a/JuceLibraryCode/JuceHeader.h b/JuceLibraryCode/JuceHeader.h new file mode 100644 index 0000000..1a83dbd --- /dev/null +++ b/JuceLibraryCode/JuceHeader.h @@ -0,0 +1,49 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + + This is the header file that your files should include in order to get all the + JUCE library headers. You should avoid including the JUCE headers directly in + your own source files, because that wouldn't pick up the correct configuration + options for your app. + +*/ + +#pragma once + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION + /** If you've hit this error then the version of the Projucer that was used to generate this project is + older than the version of the JUCE modules being included. To fix this error, re-save your project + using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, + remove the JUCE_PROJUCER_VERSION define. + */ + #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error." +#endif + + +#if ! JUCE_DONT_DECLARE_PROJECTINFO +namespace ProjectInfo +{ + const char* const projectName = "QuasoCompressor"; + const char* const companyName = "sadmemelord"; + const char* const versionString = "1.0.0"; + const int versionNumber = 0x10000; +} +#endif diff --git a/JuceLibraryCode/JucePluginDefines.h b/JuceLibraryCode/JucePluginDefines.h new file mode 100644 index 0000000..f4404df --- /dev/null +++ b/JuceLibraryCode/JucePluginDefines.h @@ -0,0 +1,162 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#pragma once + +//============================================================================== +// Audio plugin settings.. + +#ifndef JucePlugin_Build_VST + #define JucePlugin_Build_VST 0 +#endif +#ifndef JucePlugin_Build_VST3 + #define JucePlugin_Build_VST3 1 +#endif +#ifndef JucePlugin_Build_AU + #define JucePlugin_Build_AU 1 +#endif +#ifndef JucePlugin_Build_AUv3 + #define JucePlugin_Build_AUv3 0 +#endif +#ifndef JucePlugin_Build_AAX + #define JucePlugin_Build_AAX 0 +#endif +#ifndef JucePlugin_Build_Standalone + #define JucePlugin_Build_Standalone 1 +#endif +#ifndef JucePlugin_Build_Unity + #define JucePlugin_Build_Unity 0 +#endif +#ifndef JucePlugin_Build_LV2 + #define JucePlugin_Build_LV2 0 +#endif +#ifndef JucePlugin_Enable_IAA + #define JucePlugin_Enable_IAA 0 +#endif +#ifndef JucePlugin_Enable_ARA + #define JucePlugin_Enable_ARA 0 +#endif +#ifndef JucePlugin_Name + #define JucePlugin_Name "QuasoCompressor" +#endif +#ifndef JucePlugin_Desc + #define JucePlugin_Desc "QuasoCompressor" +#endif +#ifndef JucePlugin_Manufacturer + #define JucePlugin_Manufacturer "sadmemelord" +#endif +#ifndef JucePlugin_ManufacturerWebsite + #define JucePlugin_ManufacturerWebsite "www.sadmemelord.com" +#endif +#ifndef JucePlugin_ManufacturerEmail + #define JucePlugin_ManufacturerEmail "" +#endif +#ifndef JucePlugin_ManufacturerCode + #define JucePlugin_ManufacturerCode 0x4d616e75 +#endif +#ifndef JucePlugin_PluginCode + #define JucePlugin_PluginCode 0x59793436 +#endif +#ifndef JucePlugin_IsSynth + #define JucePlugin_IsSynth 0 +#endif +#ifndef JucePlugin_WantsMidiInput + #define JucePlugin_WantsMidiInput 0 +#endif +#ifndef JucePlugin_ProducesMidiOutput + #define JucePlugin_ProducesMidiOutput 0 +#endif +#ifndef JucePlugin_IsMidiEffect + #define JucePlugin_IsMidiEffect 0 +#endif +#ifndef JucePlugin_EditorRequiresKeyboardFocus + #define JucePlugin_EditorRequiresKeyboardFocus 0 +#endif +#ifndef JucePlugin_Version + #define JucePlugin_Version 1.0.0 +#endif +#ifndef JucePlugin_VersionCode + #define JucePlugin_VersionCode 0x10000 +#endif +#ifndef JucePlugin_VersionString + #define JucePlugin_VersionString "1.0.0" +#endif +#ifndef JucePlugin_VSTUniqueID + #define JucePlugin_VSTUniqueID JucePlugin_PluginCode +#endif +#ifndef JucePlugin_VSTCategory + #define JucePlugin_VSTCategory kPlugCategEffect +#endif +#ifndef JucePlugin_Vst3Category + #define JucePlugin_Vst3Category "Fx" +#endif +#ifndef JucePlugin_AUMainType + #define JucePlugin_AUMainType 'aufx' +#endif +#ifndef JucePlugin_AUSubType + #define JucePlugin_AUSubType JucePlugin_PluginCode +#endif +#ifndef JucePlugin_AUExportPrefix + #define JucePlugin_AUExportPrefix QuasoCompressorAU +#endif +#ifndef JucePlugin_AUExportPrefixQuoted + #define JucePlugin_AUExportPrefixQuoted "QuasoCompressorAU" +#endif +#ifndef JucePlugin_AUManufacturerCode + #define JucePlugin_AUManufacturerCode JucePlugin_ManufacturerCode +#endif +#ifndef JucePlugin_CFBundleIdentifier + #define JucePlugin_CFBundleIdentifier com.sadmemelord.QuasoCompressor +#endif +#ifndef JucePlugin_AAXIdentifier + #define JucePlugin_AAXIdentifier com.sadmemelord.QuasoCompressor +#endif +#ifndef JucePlugin_AAXManufacturerCode + #define JucePlugin_AAXManufacturerCode JucePlugin_ManufacturerCode +#endif +#ifndef JucePlugin_AAXProductId + #define JucePlugin_AAXProductId JucePlugin_PluginCode +#endif +#ifndef JucePlugin_AAXCategory + #define JucePlugin_AAXCategory 0 +#endif +#ifndef JucePlugin_AAXDisableBypass + #define JucePlugin_AAXDisableBypass 0 +#endif +#ifndef JucePlugin_AAXDisableMultiMono + #define JucePlugin_AAXDisableMultiMono 0 +#endif +#ifndef JucePlugin_IAAType + #define JucePlugin_IAAType 0x61757278 +#endif +#ifndef JucePlugin_IAASubType + #define JucePlugin_IAASubType JucePlugin_PluginCode +#endif +#ifndef JucePlugin_IAAName + #define JucePlugin_IAAName "sadmemelord: QuasoCompressor" +#endif +#ifndef JucePlugin_VSTNumMidiInputs + #define JucePlugin_VSTNumMidiInputs 16 +#endif +#ifndef JucePlugin_VSTNumMidiOutputs + #define JucePlugin_VSTNumMidiOutputs 16 +#endif +#ifndef JucePlugin_ARAContentTypes + #define JucePlugin_ARAContentTypes 0 +#endif +#ifndef JucePlugin_ARATransformationFlags + #define JucePlugin_ARATransformationFlags 0 +#endif +#ifndef JucePlugin_ARAFactoryID + #define JucePlugin_ARAFactoryID "com.sadmemelord.QuasoCompressor.factory" +#endif +#ifndef JucePlugin_ARADocumentArchiveID + #define JucePlugin_ARADocumentArchiveID "com.sadmemelord.QuasoCompressor.aradocumentarchive.1.0.0" +#endif +#ifndef JucePlugin_ARACompatibleArchiveIDs + #define JucePlugin_ARACompatibleArchiveIDs "" +#endif diff --git a/JuceLibraryCode/ReadMe.txt b/JuceLibraryCode/ReadMe.txt new file mode 100644 index 0000000..1e6784f --- /dev/null +++ b/JuceLibraryCode/ReadMe.txt @@ -0,0 +1,12 @@ + + Important Note!! + ================ + +The purpose of this folder is to contain files that are auto-generated by the Projucer, +and ALL files in this folder will be mercilessly DELETED and completely re-written whenever +the Projucer saves your project. + +Therefore, it's a bad idea to make any manual changes to the files in here, or to +put any of your own files in here if you don't want to lose them. (Of course you may choose +to add the folder's contents to your version-control system so that you can re-merge your own +modifications after the Projucer has saved its changes). diff --git a/JuceLibraryCode/include_juce_audio_basics.cpp b/JuceLibraryCode/include_juce_audio_basics.cpp new file mode 100644 index 0000000..4070844 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_basics.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_basics.mm b/JuceLibraryCode/include_juce_audio_basics.mm new file mode 100644 index 0000000..0c09914 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_basics.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_devices.cpp b/JuceLibraryCode/include_juce_audio_devices.cpp new file mode 100644 index 0000000..c9c2d11 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_devices.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_devices.mm b/JuceLibraryCode/include_juce_audio_devices.mm new file mode 100644 index 0000000..77e69b1 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_devices.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_formats.cpp b/JuceLibraryCode/include_juce_audio_formats.cpp new file mode 100644 index 0000000..78e74f7 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_formats.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_formats.mm b/JuceLibraryCode/include_juce_audio_formats.mm new file mode 100644 index 0000000..0adf319 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_formats.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_AAX.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_AAX.cpp new file mode 100644 index 0000000..a20d1e3 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_AAX.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_AAX.mm b/JuceLibraryCode/include_juce_audio_plugin_client_AAX.mm new file mode 100644 index 0000000..0d740d8 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_AAX.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_ARA.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_ARA.cpp new file mode 100644 index 0000000..d64efb0 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_ARA.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_AU.r b/JuceLibraryCode/include_juce_audio_plugin_client_AU.r new file mode 100644 index 0000000..207c35e --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_AU.r @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm b/JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm new file mode 100644 index 0000000..0924b03 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_AU_2.mm b/JuceLibraryCode/include_juce_audio_plugin_client_AU_2.mm new file mode 100644 index 0000000..402f054 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_AU_2.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_AUv3.mm b/JuceLibraryCode/include_juce_audio_plugin_client_AUv3.mm new file mode 100644 index 0000000..5c705a2 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_AUv3.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_LV2.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_LV2.cpp new file mode 100644 index 0000000..dd2858f --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_LV2.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_LV2.mm b/JuceLibraryCode/include_juce_audio_plugin_client_LV2.mm new file mode 100644 index 0000000..ef6fab7 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_LV2.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp new file mode 100644 index 0000000..198ae8c --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp new file mode 100644 index 0000000..acf6830 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp new file mode 100644 index 0000000..b019de9 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_VST3.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_VST3.cpp new file mode 100644 index 0000000..ac79442 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_VST3.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_VST_utils.mm b/JuceLibraryCode/include_juce_audio_plugin_client_VST_utils.mm new file mode 100644 index 0000000..0b79acb --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_VST_utils.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_utils.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_utils.cpp new file mode 100644 index 0000000..6c06467 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_utils.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_processors.cpp b/JuceLibraryCode/include_juce_audio_processors.cpp new file mode 100644 index 0000000..0dbc0b6 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_processors.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_processors.mm b/JuceLibraryCode/include_juce_audio_processors.mm new file mode 100644 index 0000000..dac7f37 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_processors.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_processors_ara.cpp b/JuceLibraryCode/include_juce_audio_processors_ara.cpp new file mode 100644 index 0000000..1651fc5 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_processors_ara.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_processors_lv2_libs.cpp b/JuceLibraryCode/include_juce_audio_processors_lv2_libs.cpp new file mode 100644 index 0000000..1151b5a --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_processors_lv2_libs.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_utils.cpp b/JuceLibraryCode/include_juce_audio_utils.cpp new file mode 100644 index 0000000..f31e8b6 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_utils.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_audio_utils.mm b/JuceLibraryCode/include_juce_audio_utils.mm new file mode 100644 index 0000000..4dfd5b4 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_utils.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_core.cpp b/JuceLibraryCode/include_juce_core.cpp new file mode 100644 index 0000000..6f55178 --- /dev/null +++ b/JuceLibraryCode/include_juce_core.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_core.mm b/JuceLibraryCode/include_juce_core.mm new file mode 100644 index 0000000..db83b69 --- /dev/null +++ b/JuceLibraryCode/include_juce_core.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_data_structures.cpp b/JuceLibraryCode/include_juce_data_structures.cpp new file mode 100644 index 0000000..f53f241 --- /dev/null +++ b/JuceLibraryCode/include_juce_data_structures.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_data_structures.mm b/JuceLibraryCode/include_juce_data_structures.mm new file mode 100644 index 0000000..db212c9 --- /dev/null +++ b/JuceLibraryCode/include_juce_data_structures.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_dsp.cpp b/JuceLibraryCode/include_juce_dsp.cpp new file mode 100644 index 0000000..ec2c898 --- /dev/null +++ b/JuceLibraryCode/include_juce_dsp.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_dsp.mm b/JuceLibraryCode/include_juce_dsp.mm new file mode 100644 index 0000000..e641589 --- /dev/null +++ b/JuceLibraryCode/include_juce_dsp.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_events.cpp b/JuceLibraryCode/include_juce_events.cpp new file mode 100644 index 0000000..33a3a69 --- /dev/null +++ b/JuceLibraryCode/include_juce_events.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_events.mm b/JuceLibraryCode/include_juce_events.mm new file mode 100644 index 0000000..6ad0eda --- /dev/null +++ b/JuceLibraryCode/include_juce_events.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_graphics.cpp b/JuceLibraryCode/include_juce_graphics.cpp new file mode 100644 index 0000000..12f6750 --- /dev/null +++ b/JuceLibraryCode/include_juce_graphics.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_graphics.mm b/JuceLibraryCode/include_juce_graphics.mm new file mode 100644 index 0000000..ab22eb4 --- /dev/null +++ b/JuceLibraryCode/include_juce_graphics.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_gui_basics.cpp b/JuceLibraryCode/include_juce_gui_basics.cpp new file mode 100644 index 0000000..80a5878 --- /dev/null +++ b/JuceLibraryCode/include_juce_gui_basics.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_gui_basics.mm b/JuceLibraryCode/include_juce_gui_basics.mm new file mode 100644 index 0000000..708837c --- /dev/null +++ b/JuceLibraryCode/include_juce_gui_basics.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_gui_extra.cpp b/JuceLibraryCode/include_juce_gui_extra.cpp new file mode 100644 index 0000000..ea050e5 --- /dev/null +++ b/JuceLibraryCode/include_juce_gui_extra.cpp @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/JuceLibraryCode/include_juce_gui_extra.mm b/JuceLibraryCode/include_juce_gui_extra.mm new file mode 100644 index 0000000..9bb3fea --- /dev/null +++ b/JuceLibraryCode/include_juce_gui_extra.mm @@ -0,0 +1,8 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include diff --git a/QuasoCompressor.jucer b/QuasoCompressor.jucer new file mode 100644 index 0000000..0141445 --- /dev/null +++ b/QuasoCompressor.jucer @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7c72a4 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# QuasoCompressor + basic Compressor BST with custom GUI based on @landonviator of ViatorDSP tutorials diff --git a/Source/GUI/LookAndFeel/DialLAF.cpp b/Source/GUI/LookAndFeel/DialLAF.cpp new file mode 100644 index 0000000..c1e2c1a --- /dev/null +++ b/Source/GUI/LookAndFeel/DialLAF.cpp @@ -0,0 +1,143 @@ +/* + ============================================================================== + + DialLAF.cpp + Created: 1 Feb 2023 5:32:48pm + Author: Utente + + ============================================================================== +*/ + +#include "DialLAF.h" + +DialStyle::DialStyle() +{ + + +} + +void DialStyle::drawRotarySlider(juce::Graphics& g, int x, int y, int width, int height, float sliderPos, + const float rotaryStartAngle, const float rotaryEndAngle, juce::Slider& slider) +{ + /** Define color variables for customization. */ + const auto outlineColor = slider.findColour(juce::Slider::rotarySliderOutlineColourId); + const auto fillColor = slider.findColour(juce::Slider::rotarySliderFillColourId); + const auto mainColor = slider.findColour(juce::Slider::thumbColourId); + const auto brighterColor = slider.findColour(juce::Slider::thumbColourId).brighter(0.1f); + const auto trackColor = slider.findColour(juce::Slider::ColourIds::trackColourId); + const auto dialOutlineColor = slider.findColour(juce::Slider::backgroundColourId); + + auto dialBounds = juce::Rectangle(x, y, width, height).toFloat(); + auto centre = dialBounds.getCentre(); + auto fullRadius = juce::jmin(dialBounds.getWidth() / 1.95f, dialBounds.getHeight() / 1.95f); + + sliderWidth = width; + + /** Dot color*/ + g.setColour(juce::Colours::whitesmoke.withAlpha(0.5f)); + centre = dialBounds.getCentre(); + + /** Draw dots */ + /** How many dots to draw, works well as num dial intervals + 1 for small ranges, e.g. [0 - 10]*/ + for (int i = 0; i < 11; ++i) + { + auto dotSize = width * 0.025; + + /** IF you change the number of dots, do i / (num dots - 1) */ + const auto angle = juce::jmap(i / 10.0f, rotaryStartAngle, rotaryEndAngle); + + /** Dot distance from slider center */ + const auto point = centre.getPointOnCircumference(fullRadius - width * 0.06f, angle); + + /** Dot thickness*/ + g.fillEllipse(point.getX() - 3, point.getY() - 3, dotSize, dotSize); + } + + fullRadius -= 10.0f; + + auto toAngle = rotaryStartAngle + sliderPos * (rotaryEndAngle - rotaryStartAngle); + + /** Track thickness*/ + float lineWidthMultiplier = width * 0.035; + auto lineWidth = juce::jmin(lineWidthMultiplier, fullRadius * 0.5f); + auto arcRadius = fullRadius - lineWidth * 2.25; + + juce::Path backgroundArc; + backgroundArc.addCentredArc + ( + dialBounds.getCentreX(), + dialBounds.getCentreY(), + arcRadius, + arcRadius, + 0.0f, + rotaryStartAngle, + rotaryEndAngle, + true + ); + + /** Dial fill track color*/ + g.setColour(outlineColor); + g.strokePath(backgroundArc, juce::PathStrokeType(lineWidth, juce::PathStrokeType::curved, juce::PathStrokeType::rounded)); + + auto dialRadius = std::max(fullRadius - 4.0f * lineWidth, 10.0f); + { + juce::Graphics::ScopedSaveState saved(g); + if (slider.isEnabled()) + { + juce::ColourGradient fillGradient + ( + brighterColor, + centre.getX() + lineWidth * 0.9f, + centre.getY() - lineWidth * 4.0f, + mainColor, + centre.getX() + dialRadius, + centre.getY() + dialRadius, + true + ); + + /** Dial center color gradient*/ + g.setGradientFill(fillGradient); + } + + g.fillEllipse(centre.getX() - dialRadius, centre.getY() - dialRadius, dialRadius * 2.0f, dialRadius * 2.0f); + } + + //dialRadius = std:: max (dialRadius - 4.0f, 10.0f); + + /** Dial outline color*/ + g.setColour(trackColor); + + auto scale = 2.0f; + + /** Dial outline thickness*/ + g.drawEllipse(centre.getX() - dialRadius, centre.getY() - dialRadius, dialRadius * scale, dialRadius * scale, 4.5f); + + /** Fill Math*/ + juce::Path dialValueTrack; + dialValueTrack.addCentredArc + ( + dialBounds.getCentreX(), + dialBounds.getCentreY(), + arcRadius, + arcRadius, + 0.0f, + rotaryStartAngle, + toAngle, + true + ); + + /** Value track fill color*/ + g.setColour(fillColor); + g.strokePath(dialValueTrack, juce::PathStrokeType(lineWidth, juce::PathStrokeType::curved, juce::PathStrokeType::rounded)); + + /** Dial tick color*/ + g.setColour(dialOutlineColor); + juce::Path dialTick; + dialTick.startNewSubPath(centre.getPointOnCircumference(dialRadius - lineWidth, toAngle)); + + /** Dial tick length*/ + dialTick.lineTo(centre.getPointOnCircumference((dialRadius - lineWidth) * 0.6f, toAngle)); + + /** Dial tick thickness*/ + g.strokePath(dialTick, juce::PathStrokeType(lineWidth * 0.75, juce::PathStrokeType::curved, juce::PathStrokeType::rounded)); +} \ No newline at end of file diff --git a/Source/GUI/LookAndFeel/DialLAF.h b/Source/GUI/LookAndFeel/DialLAF.h new file mode 100644 index 0000000..e2c0dd8 --- /dev/null +++ b/Source/GUI/LookAndFeel/DialLAF.h @@ -0,0 +1,23 @@ +/* + ============================================================================== + + DialLAF.h + Created: 1 Feb 2023 5:32:48pm + Author: Utente + + ============================================================================== +*/ + +#pragma once +#include + +class DialStyle: public juce::LookAndFeel_V4 +{ +public: + DialStyle(); + void drawRotarySlider(juce::Graphics& g, int x, int y, int width, int height, float sliderPos, + const float rotaryStartAngle, const float rotaryEndAngle, juce::Slider& slider) override; + +private: + float sliderWidth; +}; \ No newline at end of file diff --git a/Source/GUI/Sliders/SliderProps.cpp b/Source/GUI/Sliders/SliderProps.cpp new file mode 100644 index 0000000..db9c58a --- /dev/null +++ b/Source/GUI/Sliders/SliderProps.cpp @@ -0,0 +1,40 @@ +/* + ============================================================================== + + SliderProps.cpp + Created: 1 Feb 2023 11:41:19am + Author: Utente + + ============================================================================== +*/ + +#include "../../PluginEditor.h" + +void QuasoCompressorAudioProcessorEditor::setCommonSliderProps(juce::Slider& slider) +{ + //setting properties common to every slider + addAndMakeVisible(slider); + slider.setSliderStyle(juce::Slider::SliderStyle::RotaryVerticalDrag); + slider.setTextBoxStyle(juce::Slider::TextBoxBelow, false, 72, 36); + slider.setColour(juce::Slider::ColourIds::textBoxOutlineColourId, juce::Colours::transparentBlack); + slider.setColour(juce::Slider::ColourIds::trackColourId, juce::Colours::whitesmoke.darker(0.75)); + slider.setColour(juce::Slider::ColourIds::rotarySliderOutlineColourId, + slider.findColour(juce::Slider::ColourIds::rotarySliderOutlineColourId).brighter(0.2)); + slider.setLookAndFeel(&customDialLAF); + + shadowProperties.radius = 25; + shadowProperties.offset = juce::Point(0,0); + shadowProperties.colour = juce::Colours::black.brighter(0.1); + dialShadow.setShadowProperties(shadowProperties); + slider.setComponentEffect(&dialShadow); + +} + +void QuasoCompressorAudioProcessorEditor::setCommonLabelProps(juce::Label& label) +{ + //setting properties common to every slider + addAndMakeVisible(label); + label.setFont(juce::Font("Helvetica", 16.0f, juce::Font::FontStyleFlags::bold)); + label.setJustificationType(juce::Justification::centred); +} + diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp new file mode 100644 index 0000000..42574de --- /dev/null +++ b/Source/PluginEditor.cpp @@ -0,0 +1,107 @@ +/* + ============================================================================== + + This file contains the basic framework code for a JUCE plugin editor. + + ============================================================================== +*/ + +#include "PluginProcessor.h" +#include "PluginEditor.h" + +//============================================================================== +QuasoCompressorAudioProcessorEditor::QuasoCompressorAudioProcessorEditor (QuasoCompressorAudioProcessor& p) + : AudioProcessorEditor (&p), audioProcessor (p) +{ + + //setting the label text + inputDialLabel.setText("Input", juce::dontSendNotification); + threshDialLabel.setText("Threshold", juce::dontSendNotification); + ratioDialLabel.setText("Ratio", juce::dontSendNotification); + attackDialLabel.setText("Attack", juce::dontSendNotification); + releaseDialLabel.setText("Release", juce::dontSendNotification); + outputDialLabel.setText("Output", juce::dontSendNotification); + + //setting the slider properties is called for every slider in the vector + for (int i = 0; i < dials.size(); i++) + { + setCommonSliderProps(*dials[i]); + setCommonLabelProps(*dialLabels[i]); + dialLabels[i]->attachToComponent(dials[i], false); + } + + + + setSize(1000, 500); + + //the windows can be resized by mantaining the dafault 2:1 aspect ratio and only by 25% bigger or smaller + juce::AudioProcessorEditor::setResizable(true,true); + juce::AudioProcessorEditor::setResizeLimits(getWidth() * 0.75, getHeight() * 0.75, getWidth() * 1.25, getHeight() * 1.25); + juce::AudioProcessorEditor::getConstrainer()->setFixedAspectRatio(2.0); +} + +QuasoCompressorAudioProcessorEditor::~QuasoCompressorAudioProcessorEditor() +{ + for (auto& dial : dials) + { + dial->setLookAndFeel(nullptr); + } + //the vector is cleared and then shrinked to size zero inside the destructor + dials.clear(); + dials.shrink_to_fit(); +} + +//============================================================================== +void QuasoCompressorAudioProcessorEditor::paint (juce::Graphics& g) +{ + //the background is filled with a vertical gradient + g.setGradientFill(juce::ColourGradient::vertical(juce::Colour::fromRGB(40, 42, 50).darker(0.50f), getHeight(), + juce::Colour::fromRGB(40,42,50).brighter(0.05f),getHeight()*0.4f)); + g.fillRect(getLocalBounds()); + +} + +void QuasoCompressorAudioProcessorEditor::resized() +{ + auto dialSize = getWidth() * 0.15; + auto mainLeftMargin = getWidth() * 0.25; + auto leftMargin = getWidth() * 0.02; + auto secondRowHeight = 1.5; + + ////first row of GUI with input, thresh and ratio + //juce::FlexBox flexboxRowOne; + //flexboxRowOne.flexDirection = juce::FlexBox::Direction::row; + //flexboxRowOne.flexWrap = juce::FlexBox::Wrap::noWrap; + //flexboxRowOne.alignContent = juce::FlexBox::AlignContent::center; + // + //juce::Array itemArrayRowOne; + //itemArrayRowOne.add(juce::FlexItem(dialSize, dialSize, inputDial).withMargin(juce::FlexItem::Margin(0, 0, 0, leftMargin))); + //itemArrayRowOne.add(juce::FlexItem(dialSize, dialSize, threshDial).withMargin(juce::FlexItem::Margin(0, 0, 0, mainLeftMargin))); + //itemArrayRowOne.add(juce::FlexItem(dialSize, dialSize, ratioDial).withMargin(juce::FlexItem::Margin(0, 0, 0, leftMargin))); + // + //flexboxRowOne.items = itemArrayRowOne; + //flexboxRowOne.performLayout(getLocalBounds().withY(0).withHeight(getHeight() * 0.5)); + // + ////second row of GUI with output, attack and release + //juce::FlexBox flexboxRowTwo; + //flexboxRowTwo.flexDirection = juce::FlexBox::Direction::row; + //flexboxRowTwo.flexWrap = juce::FlexBox::Wrap::noWrap; + //flexboxRowTwo.alignContent = juce::FlexBox::AlignContent::center; + // + //juce::Array itemArrayRowTwo; + //itemArrayRowTwo.add(juce::FlexItem(dialSize, dialSize, outputDial).withMargin(juce::FlexItem::Margin(0, 0, 0, leftMargin))); + //itemArrayRowTwo.add(juce::FlexItem(dialSize, dialSize, attackDial).withMargin(juce::FlexItem::Margin(0, 0, 0, mainLeftMargin))); + //itemArrayRowTwo.add(juce::FlexItem(dialSize, dialSize, releaseDial).withMargin(juce::FlexItem::Margin(0, 0, 0, leftMargin))); + // + //flexboxRowTwo.items = itemArrayRowTwo; + //flexboxRowTwo.performLayout(getLocalBounds().withY(getHeight() * 0.5).withHeight(getHeight()*0.5)); + inputDial.setBounds(leftMargin, 75, dialSize, dialSize); + threshDial.setBounds(mainLeftMargin, 75, dialSize, dialSize); + ratioDial.setBounds(threshDial.getX() + threshDial.getWidth(), 75, dialSize, dialSize); + + outputDial.setBounds(leftMargin, inputDial.getY() + inputDial.getHeight() *secondRowHeight, dialSize, dialSize); + attackDial.setBounds(threshDial.getX(), outputDial.getY(), dialSize, dialSize); + releaseDial.setBounds(ratioDial.getX(), outputDial.getY(), dialSize, dialSize); + + +} diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h new file mode 100644 index 0000000..fabcb52 --- /dev/null +++ b/Source/PluginEditor.h @@ -0,0 +1,85 @@ +/* + ============================================================================== + + This file contains the basic framework code for a JUCE plugin editor. + + ============================================================================== +*/ + +#pragma once + +#include +#include "PluginProcessor.h" +#include "GUI/LookAndFeel/DialLAF.h" + +//============================================================================== +/** +*/ +class QuasoCompressorAudioProcessorEditor : public juce::AudioProcessorEditor +{ +public: + QuasoCompressorAudioProcessorEditor (QuasoCompressorAudioProcessor&); + ~QuasoCompressorAudioProcessorEditor() override; + + //============================================================================== + void paint (juce::Graphics&) override; + void resized() override; + +private: + // This reference is provided as a quick way for your editor to + // access the processor object that created it. + QuasoCompressorAudioProcessor& audioProcessor; + + //six dials attached to the six apvts parameters + juce::Slider inputDial; + juce::Slider threshDial; + juce::Slider ratioDial; + juce::Slider attackDial; + juce::Slider releaseDial; + juce::Slider outputDial; + + //using custom look and feel + DialStyle customDialLAF; + + //shadows + juce::DropShadow shadowProperties; + juce::DropShadowEffect dialShadow; + + //dials can be accessed faster by creating a vector + std::vector dials = + { + &inputDial, + &threshDial, + &ratioDial, + &attackDial, + &releaseDial, + &outputDial + }; + + juce::Label inputDialLabel; + juce::Label threshDialLabel; + juce::Label ratioDialLabel; + juce::Label attackDialLabel; + juce::Label releaseDialLabel; + juce::Label outputDialLabel; + + std::vector dialLabels = + { + &inputDialLabel, + &threshDialLabel, + &ratioDialLabel, + &attackDialLabel, + &releaseDialLabel, + &outputDialLabel + }; + + //method to set some properties common to every silder and label + void setCommonSliderProps(juce::Slider& slider); + void setCommonLabelProps(juce::Label& label); + + + + + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (QuasoCompressorAudioProcessorEditor) +}; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp new file mode 100644 index 0000000..f01e736 --- /dev/null +++ b/Source/PluginProcessor.cpp @@ -0,0 +1,270 @@ +/* + ============================================================================== + + This file contains the basic framework code for a JUCE plugin processor. + + ============================================================================== +*/ + +#include "PluginProcessor.h" +#include "PluginEditor.h" + +//============================================================================== +QuasoCompressorAudioProcessor::QuasoCompressorAudioProcessor() +#ifndef JucePlugin_PreferredChannelConfigurations + : AudioProcessor (BusesProperties() + #if ! JucePlugin_IsMidiEffect + #if ! JucePlugin_IsSynth + .withInput ("Input", juce::AudioChannelSet::stereo(), true) + #endif + .withOutput ("Output", juce::AudioChannelSet::stereo(), true) + #endif + ), + //the apvts has to be constructed + apvts(*this,nullptr, "PARAMETERS", createParameterLayout()) + +#endif +{ + //every paramaters needs a listener inside the constructor of the main AudioProcessor class + //everything the listener receives a changes from its parameter ID the parameterChanged method is called + apvts.addParameterListener("input", this); + apvts.addParameterListener("thresh", this); + apvts.addParameterListener("ratio", this); + apvts.addParameterListener("attack", this); + apvts.addParameterListener("release", this); + apvts.addParameterListener("output", this); +} + +QuasoCompressorAudioProcessor::~QuasoCompressorAudioProcessor() +{ + //the listener for each parameter has to be removed in the destructor + apvts.removeParameterListener("input", this); + apvts.removeParameterListener("thresh", this); + apvts.removeParameterListener("ratio", this); + apvts.removeParameterListener("attack", this); + apvts.removeParameterListener("release", this); + apvts.removeParameterListener("output", this); + +} + +//the apvts' methods needs to be defined +juce::AudioProcessorValueTreeState::ParameterLayout QuasoCompressorAudioProcessor::createParameterLayout() +{ + //parameters of the apvts are stored in a vector as unique_pointers to RangedAudioParamter + std::vector> params; + + //attack and release parameters need to be skewed and not linear + juce::NormalisableRange attackRange = juce::NormalisableRange(0.0f, 200.0f, 1.0f); + attackRange.setSkewForCentre(50.0f); + + juce::NormalisableRange releaseRange = juce::NormalisableRange(0.0f, 5000.0f, 1.0f); + releaseRange.setSkewForCentre(160.0f); + + //parameters are created + auto pInput = std::make_unique("input", "Input", -60.0f, 24.0f, 0.0f); + auto pThresh = std::make_unique("thresh", "Threshold", -60.0f, 10.0f, 0.0f); + auto pRatio = std::make_unique("ratio", "Ratio", 1.0f, 20.0f, 1.0f); + auto pAttack = std::make_unique("attack", "Attack", attackRange, 50.0f); + auto pRelease = std::make_unique("release", "Release", releaseRange, 160.0f); + auto pOutput = std::make_unique("output", "Output", -60.0f, 24.0f, 0.0f); + + //different type of parameters like floats or selection are pushed into the params vector + params.push_back(std::move(pInput)); + params.push_back(std::move(pThresh)); + params.push_back(std::move(pRatio)); + params.push_back(std::move(pAttack)); + params.push_back(std::move(pRelease)); + params.push_back(std::move(pOutput)); + + + return { params.begin() , params.end() }; + + +} + +void QuasoCompressorAudioProcessor::parameterChanged(const juce::String& parameterID, float newValue) +{ + updateParameters(); +} + +void QuasoCompressorAudioProcessor::updateParameters() +{ + //the load method is needed because the raw parameters are atomic + inputModule.setGainDecibels(apvts.getRawParameterValue("input")->load()); + compressorModule.setThreshold(apvts.getRawParameterValue("thresh")->load()); + compressorModule.setRatio(apvts.getRawParameterValue("ratio")->load()); + compressorModule.setAttack(apvts.getRawParameterValue("attack")->load()); + compressorModule.setRelease(apvts.getRawParameterValue("release")->load()); + outputModule.setGainDecibels(apvts.getRawParameterValue("output")->load()); + +} + + + +//============================================================================== +const juce::String QuasoCompressorAudioProcessor::getName() const +{ + return JucePlugin_Name; +} + +bool QuasoCompressorAudioProcessor::acceptsMidi() const +{ + #if JucePlugin_WantsMidiInput + return true; + #else + return false; + #endif +} + +bool QuasoCompressorAudioProcessor::producesMidi() const +{ + #if JucePlugin_ProducesMidiOutput + return true; + #else + return false; + #endif +} + +bool QuasoCompressorAudioProcessor::isMidiEffect() const +{ + #if JucePlugin_IsMidiEffect + return true; + #else + return false; + #endif +} + +double QuasoCompressorAudioProcessor::getTailLengthSeconds() const +{ + return 0.0; +} + +int QuasoCompressorAudioProcessor::getNumPrograms() +{ + return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs, + // so this should be at least 1, even if you're not really implementing programs. +} + +int QuasoCompressorAudioProcessor::getCurrentProgram() +{ + return 0; +} + +void QuasoCompressorAudioProcessor::setCurrentProgram (int index) +{ +} + +const juce::String QuasoCompressorAudioProcessor::getProgramName (int index) +{ + return {}; +} + +void QuasoCompressorAudioProcessor::changeProgramName (int index, const juce::String& newName) +{ +} + +//============================================================================== +void QuasoCompressorAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) +{ + //initialize spec for dsp modules + juce::dsp::ProcessSpec spec; + spec.maximumBlockSize = samplesPerBlock; + spec.sampleRate = sampleRate; + spec.numChannels = getTotalNumOutputChannels(); + + //prepare dsp modules for processing + inputModule.prepare(spec); + inputModule.setRampDurationSeconds(0.02); + outputModule.prepare(spec); + outputModule.setRampDurationSeconds(0.02); + compressorModule.prepare(spec); + + updateParameters(); +} + +void QuasoCompressorAudioProcessor::releaseResources() +{ + // When playback stops, you can use this as an opportunity to free up any + // spare memory, etc. +} + +#ifndef JucePlugin_PreferredChannelConfigurations +bool QuasoCompressorAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const +{ + #if JucePlugin_IsMidiEffect + juce::ignoreUnused (layouts); + return true; + #else + // This is the place where you check if the layout is supported. + // In this template code we only support mono or stereo. + // Some plugin hosts, such as certain GarageBand versions, will only + // load plugins that support stereo bus layouts. + if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono() + && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()) + return false; + + // This checks if the input layout matches the output layout + #if ! JucePlugin_IsSynth + if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) + return false; + #endif + + return true; + #endif +} +#endif + +void QuasoCompressorAudioProcessor::processBlock (juce::AudioBuffer& buffer, juce::MidiBuffer& midiMessages) +{ + juce::ScopedNoDenormals noDenormals; + auto totalNumInputChannels = getTotalNumInputChannels(); + auto totalNumOutputChannels = getTotalNumOutputChannels(); + + juce::dsp::AudioBlock block(buffer); + + //process DSP modules + inputModule.process(juce::dsp::ProcessContextReplacing(block)); + compressorModule.process(juce::dsp::ProcessContextReplacing(block)); + outputModule.process(juce::dsp::ProcessContextReplacing(block)); + + +} + +//============================================================================== +bool QuasoCompressorAudioProcessor::hasEditor() const +{ + return true; // (change this to false if you choose to not supply an editor) +} + +juce::AudioProcessorEditor* QuasoCompressorAudioProcessor::createEditor() +{ + return new QuasoCompressorAudioProcessorEditor (*this); + //return new juce::GenericAudioProcessorEditor(*this); +} + +//============================================================================== +void QuasoCompressorAudioProcessor::getStateInformation (juce::MemoryBlock& destData) +{ + //method to save the vst parameters + juce::MemoryOutputStream stream(destData, false); + apvts.state.writeToStream(stream); +} + +void QuasoCompressorAudioProcessor::setStateInformation (const void* data, int sizeInBytes) +{ + //method to restore the vst parameters + auto tree = juce::ValueTree::readFromData(data, size_t(sizeInBytes)); + + if (tree.isValid()) + { + apvts.state = tree; + } + +} + +//============================================================================== +// This creates new instances of the plugin.. +juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() +{ + return new QuasoCompressorAudioProcessor(); +} diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h new file mode 100644 index 0000000..5e543e5 --- /dev/null +++ b/Source/PluginProcessor.h @@ -0,0 +1,80 @@ +/* + ============================================================================== + + This file contains the basic framework code for a JUCE plugin processor. + + ============================================================================== +*/ + +#pragma once + +#include + +//============================================================================== +/** +*/ +class QuasoCompressorAudioProcessor : public juce::AudioProcessor, juce::AudioProcessorValueTreeState::Listener +{ +public: + //============================================================================== + QuasoCompressorAudioProcessor(); + ~QuasoCompressorAudioProcessor() override; + + //============================================================================== + void prepareToPlay (double sampleRate, int samplesPerBlock) override; + void releaseResources() override; + + #ifndef JucePlugin_PreferredChannelConfigurations + bool isBusesLayoutSupported (const BusesLayout& layouts) const override; + #endif + + void processBlock (juce::AudioBuffer&, juce::MidiBuffer&) override; + + //============================================================================== + juce::AudioProcessorEditor* createEditor() override; + bool hasEditor() const override; + + //============================================================================== + const juce::String getName() const override; + + bool acceptsMidi() const override; + bool producesMidi() const override; + bool isMidiEffect() const override; + double getTailLengthSeconds() const override; + + //============================================================================== + int getNumPrograms() override; + int getCurrentProgram() override; + void setCurrentProgram (int index) override; + const juce::String getProgramName (int index) override; + void changeProgramName (int index, const juce::String& newName) override; + + //============================================================================== + void getStateInformation (juce::MemoryBlock& destData) override; + void setStateInformation (const void* data, int sizeInBytes) override; + + //audio processor value tree state + juce::AudioProcessorValueTreeState apvts; + +private: + + //two main methods are needed for the apvts a custom method to creater the parameter layout + //and an overrided method to listen to parameters changed for the GUI + //to do so the AudioProcessor class needs to inherit also from juce::AudioProcessorValueTreeState::Listener + juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout(); + void parameterChanged(const juce::String& parameterID, float newValue) override; + + //to change the input and output gain two dsp modules are used + juce::dsp::Gain inputModule; + juce::dsp::Gain outputModule; + + //the dsp module also implements a compressor module + juce::dsp::Compressor compressorModule; + + //method to set the various parameters + void updateParameters(); + + + //============================================================================== + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (QuasoCompressorAudioProcessor) +}; diff --git a/quasoCompressor.filtergraph b/quasoCompressor.filtergraph new file mode 100644 index 0000000..f0bb757 --- /dev/null +++ b/quasoCompressor.filtergraph @@ -0,0 +1,101 @@ + + + + + + 0. + + + + + + + + + + + + 0. + + + + + + + + + + + + 0. + + + + + + + + + + + + 0. + + + + + + + + + + + + 191.VMjLgXK....O+fWarAhckI2bo8la8HRLt.iHfTlai8FYo41Y8HRUTYTK3HxO9.BOVMEUy.Ea0cVZtMEcgQWY9vSRC8Vav8lak4Fc9XCLt3hKt3hKt3hKt3hYRUUSTEETIckVwTjQisVTTgkdEYjKAQjYPQSPWgUdMcjKAQjct3hdA4hKt3hKt3hKtnTUv.UQAslXuk0UXoWUFE0YQcEV77RRC8Vav8lak4Fc9vyKVMEUy.Ea0cVZtMEcgQWY9.. + + + + + + + + + + + + 350.VMjLgTU....O+fWarAhckI2bo8la8HRLt.iHfTlai8FYo41Y8HRUTYTK3HxO9.BOVMEUy.Ea0cVZtMEcgQWY9vSRC8Vav8lak4Fc9DyM33BTIISX1UEaho2ZVkUdAAkKAwDUigWRWkEcQ0VTucmUY4BQlYUQLolShUELhsVRxHlXUUzXqQiQis1cEE0ZMIiV5giQhIVTUE0TqQzUJUkLXsVPBQEd3vlVq0jQik2cUMEL2YzXuEzQgs1ZpElcUczXhUDUio1ZwDFUIcEVoMWLhI1cTkkdMcETxcmQSUWVWkESEYkVzQiTgYWSC4hKt3hKt3hKt3hKt3hRUACTEEzZh8VVWgkdUYTTmE0UX4BQP4hPqcjXm0jLh4BQP4xPt.0Qt3hKt3hKt3hKtQUUCUEQTg2ZrM1YQcUVDUjQicVP77RRC8Vav8lak4Fc9vyKVMEUy.Ea0cVZtMEcgQWY9.. + + + + + + + + + + + + + +