diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..de2fab4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +tab_width = 4 + +[*.{cpp,h,md}] +indent_style = space diff --git a/.gitignore b/.gitignore index 484be44..54c2d60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -**/.DS_Store -Builds -build +build/ +dist/ +.cache/ diff --git a/.gitmodules b/.gitmodules index 3af2379..eaf4ae9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "External/JUCE"] - path = External/JUCE +[submodule "lib/JUCE"] + path = lib/JUCE url = https://github.com/juce-framework/JUCE.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ae85d2e..11b1fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,15 @@ cmake_minimum_required(VERSION 3.13.0) -project(frequalizer VERSION 1.1.0) -add_subdirectory(External/JUCE) +project(frequalizer VERSION 2.0.0) + +add_subdirectory(lib/JUCE) + +option(INSTALL_AFTER_BUILD "Automatically copy built plugins in system directories after build" OFF) + +# useful for linting (i.e. `clangd`) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # check which formats we want to build set(FORMATS "VST3") -if (AAX_PATH) - list(APPEND FORMATS "AAX") - juce_set_aax_sdk_path(${AAX_PATH}) -endif() - -if (VST2_PATH) - list(APPEND FORMATS "VST2") - juce_set_vst2_sdk_path(${VST2_PATH}) -endif() if (APPLE) list(APPEND FORMATS "AU") @@ -20,40 +17,56 @@ endif() # add the plugin targets juce_add_plugin(frequalizer - VERSION "1.1.0" - COMPANY_NAME "foleysfinest" - PLUGIN_MANUFACTURER_CODE "FFAU" - PLUGIN_CODE "FqOS" - FORMATS ${FORMATS} - VST3_CATEGORIES "Fx" "Analyzer" "EQ" - AAX_CATEGORY "AAX_ePlugInCategory_EQ" - AU_MAIN_TYPE "kAudioUnitType_Effect" - COMPANY_WEBSITE "https://foleysfinest.com" - COMPANY_EMAIL "info@foleysfinest.com" - BUNDLE_ID "com.foleysfinest.frequalizer" - PLUGIN_NAME "Frequalizer Free" - PRODUCT_NAME "Frequalizer") + COMPANY_NAME "teobe" + PLUGIN_MANUFACTURER_CODE "TEOB" + PLUGIN_CODE "FqOS" + FORMATS ${FORMATS} + VST3_CATEGORIES "Fx" "Analyzer" "EQ" + AU_MAIN_TYPE "kAudioUnitType_Effect" + COMPANY_WEBSITE "https://teobe.net" + COMPANY_EMAIL "info@teobe.net" + BUNDLE_ID "net.teobe.frequalizer" + PLUGIN_NAME "Frequalizer" + PRODUCT_NAME "Frequalizer" +) # add the sources -add_subdirectory(Resources) -add_subdirectory(Source) +target_sources(frequalizer + PRIVATE + src/FrequalizerEditor.cpp + src/FrequalizerProcessor.cpp +) # add required flags -target_link_libraries(frequalizer PRIVATE juce::juce_recommended_warning_flags juce::juce_recommended_config_flags juce::juce_recommended_lto_flags) -target_link_libraries(frequalizer PRIVATE juce::juce_opengl juce::juce_dsp juce::juce_audio_utils) -target_compile_definitions(frequalizer - PUBLIC - JUCE_VST3_CAN_REPLACE_VST2=0 - JUCE_WEB_BROWSER=0) +target_link_libraries(frequalizer + PRIVATE + # compiler flags + juce::juce_recommended_warning_flags + juce::juce_recommended_config_flags + juce::juce_recommended_lto_flags + # juce modules + juce::juce_opengl + juce::juce_dsp + juce::juce_audio_utils +) +target_compile_definitions(frequalizer + PUBLIC + JUCE_VST3_CAN_REPLACE_VST2=OFF + JUCE_WEB_BROWSER=OFF +) +set_target_properties(frequalizer + PROPERTIES + CXX_STANDARD 17 +) # setup the copying to the output folder -if (APPLE) - set(COPY_FOLDER ${CMAKE_SOURCE_DIR}/Builds/MacOSX) -elseif(WIN32) - set(COPY_FOLDER ${CMAKE_SOURCE_DIR}/Builds/VisualStudio2015) -endif() +set(COPY_FOLDER ${CMAKE_SOURCE_DIR}/dist) foreach(FORMAT ${FORMATS}) - get_target_property(ARTEFACTS_DIR frequalizer_${FORMAT} LIBRARY_OUTPUT_DIRECTORY) - add_custom_command(TARGET frequalizer_${FORMAT} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARTEFACTS_DIR} ${COPY_FOLDER}) -endforeach() \ No newline at end of file + get_target_property(ARTEFACTS_DIR frequalizer_${FORMAT} LIBRARY_OUTPUT_DIRECTORY) + add_custom_command(TARGET frequalizer_${FORMAT} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARTEFACTS_DIR} ${COPY_FOLDER}) +endforeach() + +if(INSTALL_AFTER_BUILD) + juce_enable_copy_plugin_step(frequalizer) +endif() diff --git a/External/JUCE b/External/JUCE deleted file mode 160000 index e6ec181..0000000 --- a/External/JUCE +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e6ec1819ec0a59a7cfe82d8ce72367f64e0a4bb0 diff --git a/LICENSE.md b/LICENSE.md index 5d9f303..1410edb 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,5 @@ Copyright (c) 2018, Daniel Walz - Foleys Finest Audio UG +Copyright (c) 2024, Matteo Bernardini All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index febbd73..ae11846 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,34 @@ # Frequalizer -This is a JUCE project using the new dsp module for an Equalizer. -It features: +[![Build Status](https://github.com/mttbernardini/frequalizer/actions/workflows/build.yml/badge.svg)](https://github.com/mttbernardini/frequalizer/actions/workflows/build.yml/badge.svg) -- six individual bands -- an input and an output analyser -- solo each band -- drag frequency and gain directly in the graph +![Frequalizer Screenshot](docs/freq_demo.jpg) -![Frequalizer Screenshot](https://raw.githubusercontent.com/ffAudio/Frequalizer/master/Resources/Screenshot.png) +This project provides a 6-band Parametric Equalizer built using [JUCE](https://github.com/juce-framework/JUCE) and the `juce::dps` module. -[![CMake](https://github.com/ffAudio/Frequalizer/actions/workflows/workflow.yml/badge.svg)](https://github.com/ffAudio/Frequalizer/actions/workflows/workflow.yml) +The code is based on the work of [Foley Finest](https://github.com/ffAudio/Frequalizer) and has been forked in order to continue development for my personal needs, since, at the time of writing, the original project is unmaintaned since 2022. -Download a ready built package for Mac OSX plugins running as AU, VST, VST3 and AAX: +**⚠️ Compatibiliy Note:** branding and IDs are replaced with my own! This plugin is NOT compatible with the original Foley Finest's Frequalizer and is treated as a different plug-in by Audio Hosts and DAWs. -https://www.foleysfinest.com/plugins/frequalizer/ + +## Download + +Pre-built VST3 or Audio Unit are available over the [Releases](https://github.com/mttbernardini/frequalizer/releases) page. + +After download, move the VST/AU file to the expected location of your OS. + +Note for macOS users: the Audio Unit is self-signed. To use it you will need to remove the quarantine flag using `xattr -rd com.apple.quarantine path/to/frequalizer.component` after downloading. + +## Build + +Clone this repo and its submodules: + + git clone --recurse-submodules https://github.com/mttbernardini/frequalizer + cd frequalizer + +Use CMake to build: + + cmake -B build + cmake --build build + +You'll find the built plugins under `dist/`. diff --git a/Resources/CMakeLists.txt b/Resources/CMakeLists.txt deleted file mode 100644 index 61653a8..0000000 --- a/Resources/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -juce_add_binary_data(frequalizer_binary NAMESPACE FFAudioData SOURCES FB-logo.png - FF-text.png - GitHub-logo.png - In-logo.png - Logo-FF.png - Screenshot.png) -target_link_libraries(frequalizer PRIVATE frequalizer_binary) \ No newline at end of file diff --git a/Resources/FB-logo.png b/Resources/FB-logo.png deleted file mode 100644 index 3d39ac9..0000000 Binary files a/Resources/FB-logo.png and /dev/null differ diff --git a/Resources/FF-text.png b/Resources/FF-text.png deleted file mode 100644 index bd40c82..0000000 Binary files a/Resources/FF-text.png and /dev/null differ diff --git a/Resources/GitHub-logo.png b/Resources/GitHub-logo.png deleted file mode 100644 index ea6ff54..0000000 Binary files a/Resources/GitHub-logo.png and /dev/null differ diff --git a/Resources/In-logo.png b/Resources/In-logo.png deleted file mode 100644 index b67b638..0000000 Binary files a/Resources/In-logo.png and /dev/null differ diff --git a/Resources/InnoSetup.iss b/Resources/InnoSetup.iss deleted file mode 100644 index 6c9b574..0000000 --- a/Resources/InnoSetup.iss +++ /dev/null @@ -1,12 +0,0 @@ -[Setup] -AppName=Frequalizer -AppVersion=1.1.0 -Uninstallable=no -SourceDir="{#BuildDir}" -DefaultDirName="{commoncf64}\VST3" -DefaultGroupName=Frequalizer -OutputBaseFilename=Frequalizer_WIN -[Files] -Source: "VST3\Frequalizer.vst3"; DestDir: {app}; Flags: recursesubdirs -;Source: "VST\Frequalizer.dll"; DestDir: {cf64}\VST -;Source: "AAX\Frequalizer.aaxplugin\*"; DestDir: "{commoncf64}\Avid\Audio\Plug-Ins\Frequalizer.aaxplugin"; Flags: recursesubdirs diff --git a/Resources/Logo-FF.png b/Resources/Logo-FF.png deleted file mode 100644 index b5e5bb8..0000000 Binary files a/Resources/Logo-FF.png and /dev/null differ diff --git a/Resources/Screenshot.png b/Resources/Screenshot.png deleted file mode 100644 index c264bce..0000000 Binary files a/Resources/Screenshot.png and /dev/null differ diff --git a/SETUP_CI.md b/SETUP_CI.md deleted file mode 100644 index bc27680..0000000 --- a/SETUP_CI.md +++ /dev/null @@ -1,21 +0,0 @@ -Setup Github actions -==================== - -For my own memory this is how the github actions can be configured -to codesign and create an installer. This is mostly learned from this blog post: -https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions - -The code can be seen in this repositories file .github/workflows/workflow.yml - -Create certificate ------------------- - -Create a "Developer ID Application" certificate and import it in your "Keychain Access" -Open Keychain Access and select the certificate and the private key (expand the -certificate, select both and select "Export 2 items"). Save it as .p12. - -Save the p12 as base64 and copy the result in a repository secret MACOS_CERTIFICATE. -Place the password you chose in a repository secret MACOS_CERTIFICATE_PWD. - - - diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt deleted file mode 100644 index 09c5a61..0000000 --- a/Source/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -target_sources(frequalizer PRIVATE Analyser.h - FrequalizerEditor.cpp - FrequalizerEditor.h - FrequalizerProcessor.cpp - FrequalizerProcessor.h - SocialButtons.h) \ No newline at end of file diff --git a/Source/SocialButtons.h b/Source/SocialButtons.h deleted file mode 100644 index 246c192..0000000 --- a/Source/SocialButtons.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - ============================================================================== - - SocialButtons.h - Created: 25 Feb 2018 1:59:43pm - Author: Dobby - - ============================================================================== -*/ - -#pragma once - -#include -#include -#include - -//============================================================================== -/* -*/ -class SocialButtons : public juce::Component, - public juce::Button::Listener -{ -public: - SocialButtons() - { - setOpaque (false); - - auto* b = buttons.add (new juce::ImageButton()); - b->addListener (this); - auto ffLogo = juce::ImageCache::getFromMemory (FFAudioData::LogoFF_png, FFAudioData::LogoFF_pngSize); - b->setImages (false, true, true, ffLogo, 1.0f, juce::Colours::transparentWhite, ffLogo, 0.7f, juce::Colours::transparentWhite, ffLogo, 0.7f, juce::Colours::transparentWhite); - b->setComponentID ("https://foleysfinest.com/"); - b->setTooltip (TRANS ("Go to the Foley's Finest Audio Website \"foleysfinest.com\"")); - addAndMakeVisible (b); - - b = buttons.add (new juce::ImageButton()); - b->addListener (this); - auto fbLogo = juce::ImageCache::getFromMemory (FFAudioData::FBlogo_png, FFAudioData::FBlogo_pngSize); - b->setImages (false, true, true, fbLogo, 1.0f, juce::Colours::transparentWhite, fbLogo, 0.7f, juce::Colours::transparentWhite, fbLogo, 0.7f, juce::Colours::transparentWhite); - b->setComponentID ("https://www.fb.com/FoleysFinest/"); - b->setTooltip (TRANS ("Like or connect with us on Facebook")); - addAndMakeVisible (b); - - b = buttons.add (new juce::ImageButton()); - b->addListener (this); - auto inLogo = juce::ImageCache::getFromMemory (FFAudioData::Inlogo_png, FFAudioData::Inlogo_pngSize); - b->setImages (false, true, true, inLogo, 1.0f, juce::Colours::transparentWhite, inLogo, 0.7f, juce::Colours::transparentWhite, inLogo, 0.7f, juce::Colours::transparentWhite); - b->setComponentID ("https://www.linkedin.com/in/daniel-walz/"); - b->setTooltip (TRANS ("See our profile on Linked.In (TM)")); - addAndMakeVisible (b); - - b = buttons.add (new juce::ImageButton()); - b->addListener (this); - auto githubLogo = juce::ImageCache::getFromMemory (FFAudioData::GitHublogo_png, FFAudioData::GitHublogo_pngSize); - b->setImages (false, true, true, githubLogo, 1.0f, juce::Colours::transparentWhite, githubLogo, 0.7f, juce::Colours::transparentWhite, githubLogo, 0.7f, juce::Colours::transparentWhite); - b->setComponentID ("https://github.com/ffAudio/"); - b->setTooltip (TRANS ("Find resources on Github")); - addAndMakeVisible (b); - - } - - ~SocialButtons() override = default; - - void paint (juce::Graphics& g) override - { - auto renderedText = juce::ImageCache::getFromMemory (FFAudioData::FFtext_png, FFAudioData::FFtext_pngSize); - g.drawImageWithin (renderedText, 0, 0, getWidth(), getHeight(), juce::RectanglePlacement (juce::RectanglePlacement::xRight)); - } - - void resized() override - { - auto bounds = getLocalBounds(); - for (auto* b : buttons) - b->setBounds (bounds.removeFromLeft (bounds.getHeight()).reduced (3)); - } - - void buttonClicked (juce::Button* b) override - { - juce::URL url (b->getComponentID()); - if (url.isWellFormed()) { - url.launchInDefaultBrowser(); - } - } - -private: - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SocialButtons) - - juce::OwnedArray buttons; - -}; diff --git a/docs/freq_demo.jpg b/docs/freq_demo.jpg new file mode 100644 index 0000000..8de71d7 Binary files /dev/null and b/docs/freq_demo.jpg differ diff --git a/lib/JUCE b/lib/JUCE new file mode 160000 index 0000000..4f43011 --- /dev/null +++ b/lib/JUCE @@ -0,0 +1 @@ +Subproject commit 4f43011b96eb0636104cb3e433894cda98243626 diff --git a/Source/Analyser.h b/src/Analyser.h similarity index 99% rename from Source/Analyser.h rename to src/Analyser.h index 033b7cc..9260276 100644 --- a/Source/Analyser.h +++ b/src/Analyser.h @@ -53,7 +53,7 @@ class Analyser : public juce::Thread audioFifo.setSize (1, audioFifoSize); abstractFifo.setTotalSize (audioFifoSize); - startThread (5); + startThread (Priority::low); } void run() override diff --git a/Source/FrequalizerEditor.cpp b/src/FrequalizerEditor.cpp similarity index 97% rename from Source/FrequalizerEditor.cpp rename to src/FrequalizerEditor.cpp index 4011859..94532b1 100644 --- a/Source/FrequalizerEditor.cpp +++ b/src/FrequalizerEditor.cpp @@ -6,9 +6,6 @@ ============================================================================== */ -#include "Analyser.h" -#include "FrequalizerProcessor.h" -#include "SocialButtons.h" #include "FrequalizerEditor.h" static int clickRadius = 4; @@ -20,8 +17,6 @@ FrequalizerAudioProcessorEditor::FrequalizerAudioProcessorEditor (FrequalizerAud { tooltipWindow->setMillisecondsBeforeTipAppears (1000); - addAndMakeVisible (socialButtons); - for (size_t i=0; i < freqProcessor.getNumBands(); ++i) { auto* bandEditor = bandEditors.add (new BandEditor (i, freqProcessor)); addAndMakeVisible (bandEditor); @@ -34,6 +29,10 @@ FrequalizerAudioProcessorEditor::FrequalizerAudioProcessorEditor (FrequalizerAud attachments.add (new juce::AudioProcessorValueTreeState::SliderAttachment (freqProcessor.getPluginState(), FrequalizerAudioProcessor::paramOutput, output)); output.setTooltip (TRANS ("Overall Gain")); + credits.setText("v" JucePlugin_VersionString "\nteobe.net", juce::dontSendNotification); + credits.setJustificationType(juce::Justification::bottomRight); + addAndMakeVisible(credits); + auto size = freqProcessor.getSavedSize(); setResizable (true, true); setSize (size.x, size.y); @@ -70,9 +69,6 @@ void FrequalizerAudioProcessorEditor::paint (juce::Graphics& g) g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId)); - auto logo = juce::ImageCache::getFromMemory (FFAudioData::LogoFF_png, FFAudioData::LogoFF_pngSize); - g.drawImage (logo, brandingFrame.toFloat(), juce::RectanglePlacement (juce::RectanglePlacement::fillDestination)); - g.setFont (12.0f); g.setColour (juce::Colours::silver); g.drawRoundedRectangle (plotFrame.toFloat(), 5, 2); @@ -132,8 +128,6 @@ void FrequalizerAudioProcessorEditor::resized() freqProcessor.setSavedSize ({ getWidth(), getHeight() }); plotFrame = getLocalBounds().reduced (3, 3); - socialButtons.setBounds (plotFrame.removeFromBottom (35)); - auto bandSpace = plotFrame.removeFromBottom (getHeight() / 2); auto width = juce::roundToInt (bandSpace.getWidth()) / (bandEditors.size() + 1); for (auto* bandEditor : bandEditors) @@ -145,6 +139,8 @@ void FrequalizerAudioProcessorEditor::resized() plotFrame.reduce (3, 3); brandingFrame = bandSpace.reduced (5); + credits.setBounds(brandingFrame); + updateFrequencyResponses(); } diff --git a/Source/FrequalizerEditor.h b/src/FrequalizerEditor.h similarity index 98% rename from Source/FrequalizerEditor.h rename to src/FrequalizerEditor.h index f7e2275..ebd07d4 100644 --- a/Source/FrequalizerEditor.h +++ b/src/FrequalizerEditor.h @@ -8,9 +8,9 @@ #pragma once -#include "FrequalizerProcessor.h" #include #include +#include "FrequalizerProcessor.h" //============================================================================== @@ -111,8 +111,7 @@ class FrequalizerAudioProcessorEditor : public juce::AudioProcessorEditor, juce::GroupComponent frame; juce::Slider output { juce::Slider::RotaryHorizontalVerticalDrag, juce::Slider::TextBoxBelow }; - - SocialButtons socialButtons; + juce::Label credits; int draggingBand = -1; bool draggingGain = false; diff --git a/Source/FrequalizerProcessor.cpp b/src/FrequalizerProcessor.cpp similarity index 98% rename from Source/FrequalizerProcessor.cpp rename to src/FrequalizerProcessor.cpp index 8b2a764..cb08ce0 100644 --- a/Source/FrequalizerProcessor.cpp +++ b/src/FrequalizerProcessor.cpp @@ -6,9 +6,7 @@ ============================================================================== */ -#include "Analyser.h" #include "FrequalizerProcessor.h" -#include "SocialButtons.h" #include "FrequalizerEditor.h" @@ -50,7 +48,7 @@ int FrequalizerAudioProcessor::getBandIndexFromID (juce::String paramID) return -1; } -std::vector createDefaultBands() +static std::vector createDefaultBands() { std::vector defaults; defaults.push_back (FrequalizerAudioProcessor::Band (TRANS ("Lowest"), juce::Colours::blue, FrequalizerAudioProcessor::HighPass, 20.0f, 0.707f)); @@ -62,7 +60,7 @@ std::vector createDefaultBands() return defaults; } -juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout() +static juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout() { std::vector> params; @@ -106,11 +104,11 @@ juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout() auto qltyParameter = std::make_unique (FrequalizerAudioProcessor::getQualityParamName (i), prefix + TRANS ("Quality"), - juce::NormalisableRange {0.1f, 10.0f, 1.0f, std::log (0.5f) / std::log (0.9f / 9.9f)}, + juce::NormalisableRange {0.1f, 10.0f, 0.01f, std::log (0.5f) / std::log (0.9f / 9.9f)}, defaults [i].quality, juce::String(), juce::AudioProcessorParameter::genericParameter, - [](float value, int) { return juce::String (value, 1); }, + [](float value, int) { return juce::String (value, 2); }, [](const juce::String& text) { return text.getFloatValue(); }); auto gainParameter = std::make_unique (FrequalizerAudioProcessor::getGainParamName (i), diff --git a/Source/FrequalizerProcessor.h b/src/FrequalizerProcessor.h similarity index 98% rename from Source/FrequalizerProcessor.h rename to src/FrequalizerProcessor.h index a616b21..0f20184 100644 --- a/Source/FrequalizerProcessor.h +++ b/src/FrequalizerProcessor.h @@ -9,7 +9,7 @@ #pragma once #include - +#include "Analyser.h" //============================================================================== /** @@ -114,7 +114,7 @@ class FrequalizerAudioProcessor : public juce::AudioProcessor, //============================================================================== struct Band { Band (const juce::String& nameToUse, juce::Colour colourToUse, FilterType typeToUse, - float frequencyToUse, float qualityToUse, float gainToUse=1.0f, bool shouldBeActive=true) + float frequencyToUse, float qualityToUse, float gainToUse=1.0f, bool shouldBeActive=false) : name (nameToUse), colour (colourToUse), type (typeToUse),