├── .gitattributes ├── Assets ├── Icons │ └── Icon.png ├── Images │ ├── Lines.png │ ├── Menu.png │ ├── Delta_ON.png │ ├── Background.png │ ├── Delta_OFF.png │ ├── Compensation_ON.png │ ├── Oversampling_ON.png │ ├── Compensation_OFF.png │ └── Oversampling_OFF.png └── Fonts │ ├── Roboto-Regular.ttf │ └── LICENSE.txt ├── Docs └── User_Interface.jpg ├── JuceLibraryCode ├── include_juce_core.mm ├── include_juce_dsp.cpp ├── include_juce_dsp.mm ├── include_juce_core.cpp ├── include_juce_events.mm ├── include_juce_events.cpp ├── include_juce_graphics.cpp ├── include_juce_graphics.mm ├── include_juce_gui_extra.mm ├── include_juce_audio_utils.mm ├── include_juce_gui_basics.cpp ├── include_juce_gui_basics.mm ├── include_juce_gui_extra.cpp ├── include_juce_audio_basics.cpp ├── include_juce_audio_basics.mm ├── include_juce_audio_utils.cpp ├── include_juce_audio_devices.cpp ├── include_juce_audio_devices.mm ├── include_juce_audio_formats.cpp ├── include_juce_audio_formats.mm ├── include_juce_audio_processors.mm ├── include_juce_data_structures.cpp ├── include_juce_data_structures.mm ├── include_juce_audio_processors.cpp ├── include_juce_audio_processors_ara.cpp ├── include_juce_audio_plugin_client_AAX.cpp ├── include_juce_audio_plugin_client_AAX.mm ├── include_juce_audio_plugin_client_ARA.cpp ├── include_juce_audio_plugin_client_AU_1.mm ├── include_juce_audio_plugin_client_AU_2.mm ├── include_juce_audio_plugin_client_AUv3.mm ├── include_juce_audio_plugin_client_LV2.cpp ├── include_juce_audio_plugin_client_LV2.mm ├── include_juce_audio_plugin_client_VST2.mm ├── include_juce_audio_plugin_client_VST3.mm ├── include_juce_audio_processors_lv2_libs.cpp ├── include_juce_audio_plugin_client_Unity.cpp ├── include_juce_audio_plugin_client_VST2.cpp ├── include_juce_audio_plugin_client_VST3.cpp ├── include_juce_audio_plugin_client_AAX_utils.cpp ├── include_juce_audio_plugin_client_Standalone.cpp ├── ReadMe.txt ├── JuceHeader.h ├── BinaryData.h └── JucePluginDefines.h ├── Source ├── Keisari-Modules │ ├── DSP │ │ ├── Distortion.h │ │ └── Distortion.cpp │ ├── LookAndFeel │ │ ├── Gauge │ │ │ ├── GaugeLabel.h │ │ │ ├── GaugeLabel.cpp │ │ │ ├── Gauge.h │ │ │ ├── GaugeLookAndFeel.h │ │ │ ├── Gauge.cpp │ │ │ └── GaugeLookAndFeel.cpp │ │ ├── ImageToggle │ │ │ ├── ImageToggle.cpp │ │ │ ├── ImageToggleLookAndFeel.h │ │ │ ├── ImageToggle.h │ │ │ └── ImageToggleLookAndFeel.cpp │ │ ├── CeilingVisualizer │ │ │ ├── CeilingVisualizer.h │ │ │ └── CeilingVisualizer.cpp │ │ └── WaveformVisualizer │ │ │ ├── WaveformVisualizer.h │ │ │ └── WaveformVisualizer.cpp │ └── UI-Components │ │ ├── ToggleButtonComponent.h │ │ ├── SliderComponent.h │ │ └── UIComponent.h ├── PluginEditor.cpp ├── UI-Methods │ ├── UI-Paint.cpp │ ├── UI-Save.cpp │ ├── UI-Resized.cpp │ ├── UI-Constructor.cpp │ └── UI-Create.cpp ├── Globals │ ├── Init-Parameters.cpp │ ├── Globals.h │ ├── Parameters.h │ ├── Parameters.cpp │ └── Globals.cpp ├── PluginEditor.h ├── Pro-Methods │ ├── Pro-Prepare.cpp │ ├── Pro-State.cpp │ ├── Pro-Parameters.cpp │ └── Pro-Process.cpp ├── PluginProcessor.cpp └── PluginProcessor.h ├── .gitignore ├── .github └── FUNDING.yml ├── README.md ├── Leikkaus.jucer └── LICENSE /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Assets/Icons/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Icons/Icon.png -------------------------------------------------------------------------------- /Assets/Images/Lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Lines.png -------------------------------------------------------------------------------- /Assets/Images/Menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Menu.png -------------------------------------------------------------------------------- /Docs/User_Interface.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Docs/User_Interface.jpg -------------------------------------------------------------------------------- /Assets/Images/Delta_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Delta_ON.png -------------------------------------------------------------------------------- /Assets/Images/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Background.png -------------------------------------------------------------------------------- /Assets/Images/Delta_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Delta_OFF.png -------------------------------------------------------------------------------- /Assets/Fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Assets/Images/Compensation_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Compensation_ON.png -------------------------------------------------------------------------------- /Assets/Images/Oversampling_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Oversampling_ON.png -------------------------------------------------------------------------------- /Assets/Images/Compensation_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Compensation_OFF.png -------------------------------------------------------------------------------- /Assets/Images/Oversampling_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EemilAhonen/leikkaus/HEAD/Assets/Images/Oversampling_OFF.png -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_dsp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_dsp.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_graphics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_graphics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_extra.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_utils.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_extra.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_devices.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_devices.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_formats.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_formats.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_processors.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_processors.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_processors_ara.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_AAX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_AAX.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_ARA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_AU_2.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_AUv3.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_LV2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_LV2.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_VST2.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_VST3.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_processors_lv2_libs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_VST3.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_AAX_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/DSP/Distortion.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Distortion.h 5 | Created: 4 Feb 2024 8:37:05pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | //============================================================================== 14 | 15 | float clipWithRatio(const float sample, const float ceiling, const float ratio); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # JUCE framework 35 | **/Builds 36 | **/Release 37 | 38 | # Visual Studio Code 39 | .vscode 40 | 41 | # Mac specific 42 | *.ds_store 43 | -------------------------------------------------------------------------------- /JuceLibraryCode/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Important Note!! 3 | ================ 4 | 5 | The purpose of this folder is to contain files that are auto-generated by the Projucer, 6 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever 7 | the Projucer saves your project. 8 | 9 | Therefore, it's a bad idea to make any manual changes to the files in here, or to 10 | put any of your own files in here if you don't want to lose them. (Of course you may choose 11 | to add the folder's contents to your version-control system so that you can re-merge your own 12 | modifications after the Projucer has saved its changes). 13 | -------------------------------------------------------------------------------- /Source/PluginEditor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file contains the basic framework code for a JUCE plugin editor. 5 | 6 | ============================================================================== 7 | */ 8 | 9 | #include "PluginProcessor.h" 10 | #include "PluginEditor.h" 11 | 12 | //============================================================================== 13 | LeikkausAudioProcessorEditor::LeikkausAudioProcessorEditor(LeikkausAudioProcessor &p) 14 | : AudioProcessorEditor(&p), audioProcessor(p) 15 | { 16 | uiConstructor(); 17 | } 18 | 19 | LeikkausAudioProcessorEditor::~LeikkausAudioProcessorEditor() 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: keisaristudios 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: keisari 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/Gauge/GaugeLabel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | GaugeLabel.h 5 | Created: 5 Feb 2024 10:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | //============================================================================== 16 | 17 | class GaugeLabel : public juce::Label 18 | { 19 | public: 20 | GaugeLabel() 21 | { 22 | } 23 | 24 | ~GaugeLabel() 25 | { 26 | setLookAndFeel(nullptr); 27 | } 28 | 29 | protected: 30 | void resized() override; 31 | void editorShown(juce::TextEditor *editor) override; 32 | 33 | private: 34 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(GaugeLabel) 35 | }; 36 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/ImageToggle/ImageToggle.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | ImageToggle.cpp 5 | Created: 7 Feb 2024 1:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "ImageToggle.h" 12 | 13 | //============================================================================== 14 | 15 | void ImageToggle::mouseDown(const juce::MouseEvent &e) 16 | { 17 | juce::ModifierKeys modifiers = juce::ModifierKeys::getCurrentModifiersRealtime(); 18 | 19 | // Right click 20 | if (modifiers.isRightButtonDown()) 21 | { 22 | if (_rightClickCallback) 23 | { 24 | _rightClickCallback(); 25 | } 26 | } 27 | else 28 | { 29 | ToggleButton::mouseDown(e); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/CeilingVisualizer/CeilingVisualizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | CeilingVisualizer.h 5 | Created: 8 Feb 2024 2:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | //============================================================================== 16 | 17 | class CeilingVisualizer : public juce::Component 18 | { 19 | public: 20 | CeilingVisualizer() 21 | { 22 | } 23 | 24 | void setCeiling(const float ceiling) 25 | { 26 | _ceiling = ceiling; 27 | repaint(); 28 | } 29 | 30 | void paint(juce::Graphics &g) override; 31 | 32 | private: 33 | float _ceiling = 0.0f; 34 | 35 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CeilingVisualizer) 36 | }; 37 | -------------------------------------------------------------------------------- /Source/UI-Methods/UI-Paint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UI-Paint.cpp 5 | Created: 23 Jan 2024 8:54:08pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginEditor.h" 12 | 13 | //============================================================================== 14 | 15 | void LeikkausAudioProcessorEditor::paint(juce::Graphics &g) 16 | { 17 | // Our component is opaque, so we must completely fill the background with a solid colour) 18 | g.fillAll(juce::Colours::black); 19 | 20 | // Load and set background image if available 21 | juce::Image backgroundImage = juce::ImageCache::getFromMemory(BinaryData::Background_png, BinaryData::Background_pngSize); 22 | 23 | if (!backgroundImage.isNull()) 24 | { 25 | g.drawImage(backgroundImage, getLocalBounds().toFloat()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/UI-Components/ToggleButtonComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UIComponent.h 5 | Created: 7 Feb 2024 2:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | #include "UIComponent.h" 13 | 14 | //============================================================================== 15 | 16 | class ToggleButtonComponent : public UIComponent 17 | 18 | { 19 | public: 20 | ToggleButtonComponent(const juce::String id, const juce::String name, const juce::String toolTip, const int x, const int y, const int width, const int height, int lookAndFeelID, bool initValue) 21 | : UIComponent(id, name, toolTip, x, y, width, height, lookAndFeelID), _initValue(initValue) 22 | { 23 | _component = std::make_unique(); 24 | } 25 | 26 | public: 27 | const bool _initValue; 28 | }; -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/ImageToggle/ImageToggleLookAndFeel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | ImageToggleAndFeel.h 5 | Created: 6 Feb 2024 10:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | //============================================================================== 16 | 17 | class ImageToggleLookAndFeel : public juce::LookAndFeel_V4 18 | { 19 | public: 20 | ImageToggleLookAndFeel() 21 | { 22 | } 23 | void setImages(juce::Image onImage, juce::Image offImage) 24 | { 25 | _onImage = onImage; 26 | _offImage = offImage; 27 | } 28 | 29 | protected: 30 | void drawTickBox(juce::Graphics &g, juce::Component &toggle, float x, float y, float width, float height, bool ticked, bool isEnabled, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override; 31 | 32 | private: 33 | juce::Image _onImage; 34 | juce::Image _offImage; 35 | }; 36 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/Gauge/GaugeLabel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | GaugeLabel.h 5 | Created: 5 Feb 2024 10:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "GaugeLabel.h" 12 | 13 | //============================================================================== 14 | 15 | /** 16 | * @brief Resizes the label and adjusts font size during component resizing. 17 | */ 18 | void GaugeLabel::resized() 19 | { 20 | if (getCurrentTextEditor() != nullptr) 21 | getCurrentTextEditor()->setBounds(getLocalBounds()); 22 | 23 | juce::Font labelFont = getFont(); 24 | labelFont.setHeight(getHeight()); 25 | setFont(labelFont); 26 | } 27 | 28 | /** 29 | * @brief Sets TextEditor justification to centered when shown. 30 | * @param editor A pointer to the shown TextEditor. 31 | */ 32 | void GaugeLabel::editorShown(juce::TextEditor *editor) 33 | { 34 | editor->setJustification(juce::Justification::centred); 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Leikkaus 2 | 3 | A dynamic clipper effect plugin. 4 |
5 | Leikkaus is compatible with both Windows and MacOS (Intel/Apple Silicon). Available as a VST3 and AU plugin. 6 | 7 | ## User Interface 8 | 9 | ![User Interface](Docs/User_Interface.jpg) 10 | 11 | ## Changelog 12 | 13 | ### Version 1.0.1 14 | 15 | - Fix visualizer scaling issues 16 | - Change 'Knee' parameter name to 'Ratio' 17 | 18 | ## Download 19 | 20 | To download the latest release, visit the [official website](https://keisaristudios.com/plugins/leikkaus). 21 | 22 | ## Credits 23 | 24 | - Lead Developer & Graphics - [Keisari](https://github.com/EemilAhonen) 25 | - Plugin name - [Outobugi](https://github.com/outobugi) 26 | - Feature and UI layout ideas from - [Turbo](https://www.youtube.com/@TurboA) 27 | 28 | ## Special Thanks 29 | 30 | I express my gratitude to anyone who provided support, feedback, or additional contributions, even if they didn't directly work on the codebase. 31 | 32 | ## License 33 | 34 | The source code is licensed under the GPLv3. For more details, please see the [license documentation](LICENSE). 35 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/UI-Components/SliderComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | SliderComponent.h 5 | Created: 27 Jan 2024 3:27:03am 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | #include "UIComponent.h" 13 | 14 | //============================================================================== 15 | 16 | class SliderComponent : public UIComponent 17 | { 18 | public: 19 | SliderComponent(const juce::String id, const juce::String name, const juce::String toolTip, const float minValue, const float maxValue, const float initValue, const float interval, const int x, const int y, const int width, const int height, int lookAndFeelID) 20 | : UIComponent(id, name, toolTip, x, y, width, height, lookAndFeelID), _minValue(minValue), _maxValue(maxValue), _initValue(initValue), _interval(interval) 21 | { 22 | _component = std::make_unique(); 23 | } 24 | 25 | public: 26 | const float _minValue; 27 | const float _maxValue; 28 | const float _initValue; 29 | const float _interval; 30 | }; 31 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/CeilingVisualizer/CeilingVisualizer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | CeilingVisualizer.cpp 5 | Created: 8 Feb 2024 2:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "CeilingVisualizer.h" 12 | 13 | //============================================================================== 14 | 15 | void CeilingVisualizer::paint(juce::Graphics &g) 16 | { 17 | // Get the height of the component 18 | float height = static_cast(getHeight()); 19 | 20 | // Define ceiling min and max Y-coordinates 21 | float ceilingZero = 150.0f / 1800.0f * height; 22 | float ceilingNeg24 = 0.75f * height; 23 | 24 | // Define line width 25 | float lineWidth = 0.005f * height; 26 | 27 | // Map the _ceiling value to a scaled Y-axis range 28 | float scaledY = juce::jmap(_ceiling, -24.0f, 0.0f, ceilingNeg24, ceilingZero); 29 | 30 | g.setColour(juce::Colours::white); 31 | 32 | // Create a path for the graph 33 | juce::Path path; 34 | path.startNewSubPath(0, height); 35 | path.lineTo(getWidth() / 4, scaledY); 36 | path.lineTo(getWidth(), scaledY); 37 | 38 | g.strokePath(path, juce::PathStrokeType(lineWidth)); 39 | } 40 | -------------------------------------------------------------------------------- /Source/Globals/Init-Parameters.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Initialize-Parameters.cpp 5 | Created: 7 Feb 2024 7:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "Parameters.h" 12 | #include "Globals.h" 13 | 14 | //============================================================================== 15 | 16 | void Parameters::initParameters() 17 | { 18 | // Add your parameters here 19 | addSliderParameter(inputID, inputName, inputToolTip, -24.0f, 24.0f, 0.0f, 0.1f, 1, 250, 1200, 400, 400, 0); 20 | addSliderParameter(outputID, outputName, outputToolTip, -24.0f, 24.0f, 0.0f, 0.1f, 1, 1825, 1200, 400, 400, 0); 21 | addSliderParameter(ceilingID, ceilingName, ceilingToolTip, -24.0f, 0.0f, 0.0f, 0.1f, 1, 775, 1200, 400, 400, 0); 22 | addSliderParameter(ratioID, ratioName, ratioToolTip, 0.0f, 100.0f, 0.0f, 0.1f, -1, 1300, 1200, 400, 400, 0); 23 | addSliderParameter(mixID, mixName, mixToolTip, 0.0f, 100.0f, 100.0f, 0.1f, -1, 2350, 1200, 400, 400, 0); 24 | 25 | addToggleButtonParameter(compensationID, compensationName, compensationToolTip, 562, 1753, 300, 100, 0, false); 26 | addToggleButtonParameter(oversamplingID, oversamplingName, oversamplingToolTip, 1350, 1753, 300, 100, 1, false); 27 | addToggleButtonParameter(deltaID, deltaName, deltaToolTip, 2137, 1753, 300, 100, 2, false); 28 | } -------------------------------------------------------------------------------- /Source/Keisari-Modules/DSP/Distortion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Distortion.cpp 5 | Created: 4 Feb 2024 8:37:05pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "Distortion.h" 12 | 13 | //============================================================================== 14 | 15 | /** 16 | * Clips the input sample with a smooth transition (ratio) around the specified ceiling. 17 | * 18 | * @param sample The input sample to be clipped. 19 | * @param ceiling The threshold for positive and negative clipping. 20 | * @param ratio The factor determining the smoothness of the transition. 21 | * @return The clipped value with a smooth transition. 22 | * 23 | * @note This implementation is optimized for ARM processors. For X86 architectures, consider using 24 | * fabs for conditionals for better performance. 25 | */ 26 | float clipWithRatio(const float sample, const float ceiling, const float ratio) 27 | { 28 | if (sample > ceiling) 29 | { 30 | // Clip above the threshold with 'ratio' for a gradual transition. 31 | return ceiling + (sample - ceiling) * ratio; 32 | } 33 | else if (sample < -ceiling) 34 | { 35 | // Clip below the threshold with 'ratio' for a gradual transition. 36 | return -(ceiling + (-sample - ceiling) * ratio); 37 | } 38 | // No clipping needed 39 | return sample; 40 | } -------------------------------------------------------------------------------- /Source/UI-Methods/UI-Save.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UI-Save.cpp 5 | Created: 5 Feb 2024 8:50:17pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginEditor.h" 12 | 13 | //============================================================================== 14 | 15 | /** 16 | * @brief Saves the current bounds (width and height) of AudioProcessorEditor. 17 | * 18 | * This method updates the stored width and height properties in the associated 19 | * ValueTree of the LeikkausAudioProcessor. It also updates the corresponding member 20 | * variables in the audioProcessor object for future reference. 21 | * 22 | * @note This method is called when the bounds of the GUI component change 23 | */ 24 | void LeikkausAudioProcessorEditor::savePluginBounds() 25 | { 26 | // Retrieve the current width and height of the GUI component 27 | const int newWidth = getWidth(); 28 | const int newHeight = getHeight(); 29 | 30 | // Update the width and height properties in the associated ValueTree 31 | audioProcessor._valueTree.setProperty("width", newWidth, nullptr); 32 | audioProcessor._valueTree.setProperty("height", newHeight, nullptr); 33 | 34 | // Update the corresponding member variables in the audioProcessor object 35 | audioProcessor._width = newWidth; 36 | audioProcessor._height = newHeight; 37 | } -------------------------------------------------------------------------------- /Source/Globals/Globals.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Globals.h 5 | Created: 23 Jan 2024 10:21:41pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | #include 13 | 14 | //== Parameters ================================================================ 15 | 16 | extern const juce::String inputID; 17 | extern const juce::String inputName; 18 | extern const juce::String inputToolTip; 19 | 20 | extern const juce::String outputID; 21 | extern const juce::String outputName; 22 | extern const juce::String outputToolTip; 23 | 24 | extern const juce::String ceilingID; 25 | extern const juce::String ceilingName; 26 | extern const juce::String ceilingToolTip; 27 | 28 | extern const juce::String ratioID; 29 | extern const juce::String ratioName; 30 | extern const juce::String ratioToolTip; 31 | 32 | extern const juce::String mixID; 33 | extern const juce::String mixName; 34 | extern const juce::String mixToolTip; 35 | 36 | extern const juce::String compensationID; 37 | extern const juce::String compensationName; 38 | extern const juce::String compensationToolTip; 39 | 40 | extern const juce::String oversamplingID; 41 | extern const juce::String oversamplingName; 42 | extern const juce::String oversamplingToolTip; 43 | 44 | extern const juce::String deltaID; 45 | extern const juce::String deltaName; 46 | extern const juce::String deltaToolTip; 47 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/ImageToggle/ImageToggle.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | ImageToggle.h 5 | Created: 7 Feb 2024 1:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | #include "ImageToggleLookAndFeel.h" 15 | 16 | //============================================================================== 17 | 18 | class ImageToggle : public juce::ToggleButton 19 | { 20 | public: 21 | ImageToggle() 22 | { 23 | imageToggleLookAndFeel = std::make_unique(); 24 | setLookAndFeel(imageToggleLookAndFeel.get()); 25 | } 26 | 27 | ~ImageToggle() 28 | { 29 | setLookAndFeel(nullptr); 30 | } 31 | 32 | void setImages(juce::Image onImage, juce::Image offImage) 33 | { 34 | imageToggleLookAndFeel->setImages(onImage, offImage); 35 | } 36 | 37 | using RightClickCallback = std::function; 38 | 39 | void setRightClickCallback(RightClickCallback callback) 40 | { 41 | _rightClickCallback = callback; 42 | } 43 | 44 | protected: 45 | void mouseDown(const juce::MouseEvent &e) override; 46 | 47 | private: 48 | RightClickCallback _rightClickCallback; 49 | std::unique_ptr imageToggleLookAndFeel; 50 | 51 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageToggle) 52 | }; 53 | -------------------------------------------------------------------------------- /Source/Globals/Parameters.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Parameters.h 5 | Created: 27 Jan 2024 8:37:05pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | #include "../Keisari-Modules/UI-Components/UIComponent.h" 15 | #include "../Keisari-Modules/UI-Components/SliderComponent.h" 16 | #include "../Keisari-Modules/UI-Components/ToggleButtonComponent.h" 17 | 18 | //============================================================================== 19 | 20 | class Parameters 21 | { 22 | public: 23 | Parameters(); 24 | std::vector> &getUIComponents() { return _uiComponents; } 25 | std::vector> &getAudioParameters() { return _audioParameters; } 26 | 27 | private: 28 | void initParameters(); 29 | void addSliderParameter(const juce::String id, const juce::String name, const juce::String toolTip, float minValue, float maxValue, float initValue, float interval, int decimalPlaces, int x, int y, int width, int height, int lookAndFeelID); 30 | void addToggleButtonParameter(const juce::String id, const juce::String name, const juce::String toolTip, int x, int y, int width, int height, int lookAndFeelID, bool initValue); 31 | 32 | std::vector> _uiComponents; 33 | std::vector> _audioParameters; 34 | 35 | const int JUCE_SCALING_ERROR = 2; 36 | }; 37 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/ImageToggle/ImageToggleLookAndFeel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | ImageToggleLookAndFeel.cpp 5 | Created: 7 Feb 2024 1:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "ImageToggleLookAndFeel.h" 12 | 13 | //============================================================================== 14 | 15 | void ImageToggleLookAndFeel::drawTickBox(juce::Graphics &g, juce::Component &toggle, float x, float y, float width, float height, bool ticked, bool isEnabled, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) 16 | { 17 | // Obtain the height of the local bounds of the toggle component. 18 | float boundsHeight = toggle.getLocalBounds().getHeight(); 19 | 20 | // Determine which image to draw based on the 'ticked' condition. 21 | // If 'ticked' is true, use the '_onImage'; otherwise, use the '_offImage'. 22 | auto &imageToDraw = ticked ? _onImage : _offImage; 23 | 24 | // Check if the selected image is valid (not null) before attempting to draw. 25 | // If the image is valid, calculate a scaling transformation based on the 26 | // ratio of 'boundsHeight' to the height of the selected image. Then, draw 27 | // the transformed image on the graphics context 'g'. 28 | if (!imageToDraw.isNull()) 29 | { 30 | auto transform = juce::AffineTransform::scale(boundsHeight / imageToDraw.getHeight()); 31 | g.drawImageTransformed(imageToDraw, transform, false); 32 | } 33 | } -------------------------------------------------------------------------------- /Source/Keisari-Modules/UI-Components/UIComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UIComponent.h 5 | Created: 7 Feb 2024 2:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | #include 13 | 14 | //============================================================================== 15 | 16 | class UIComponent 17 | { 18 | public: 19 | virtual ~UIComponent() = default; 20 | 21 | virtual void setBounds(float ratio = 1.0f) 22 | { 23 | _component.get()->setBounds(_x * ratio, _y * ratio, _width * ratio, _height * ratio); 24 | } 25 | 26 | void setComponent(std::unique_ptr newComponent) 27 | { 28 | _component = std::move(newComponent); 29 | } 30 | 31 | juce::Component *getComponent() { return _component.get(); } 32 | 33 | public: 34 | const juce::String _id; 35 | const juce::String _name; 36 | const juce::String _toolTip; 37 | 38 | const int _x; 39 | const int _y; 40 | const int _width; 41 | const int _height; 42 | 43 | const int _lookAndFeelID; 44 | 45 | protected: 46 | UIComponent(const juce::String id, const juce::String name, const juce::String toolTip, const int x, const int y, const int width, const int height, int lookAndFeelID) 47 | : _id(id), _name(name), _toolTip(toolTip), _x(x), _y(y), _width(width), _height(height), _lookAndFeelID(lookAndFeelID) 48 | { 49 | } 50 | 51 | std::unique_ptr _component; 52 | }; -------------------------------------------------------------------------------- /Source/UI-Methods/UI-Resized.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UI-Resized.cpp 5 | Created: 23 Jan 2024 8:54:17pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginEditor.h" 12 | 13 | //============================================================================== 14 | 15 | void LeikkausAudioProcessorEditor::resized() 16 | { 17 | // The size of the window where I copied the coordinates from 18 | float windowSizeForCoordinates = 3000.0f; 19 | 20 | float scaleFactor = getWidth() / windowSizeForCoordinates; 21 | 22 | // Constant for top padding 23 | const float topPadding = 200.0f * scaleFactor; 24 | 25 | // Waveform visualizer 26 | audioProcessor._waveformVisualizer.setBounds(0, topPadding, getWidth(), getHeight() - topPadding); 27 | 28 | // Overlay 29 | _overlayImageComponent.setBounds(0, 332.0f * scaleFactor, getWidth(), 1534.0f * scaleFactor); 30 | 31 | // Ceiling visualizer 32 | audioProcessor._ceilingVisualizer.setBounds(0, topPadding, getWidth(), getHeight() - topPadding); 33 | 34 | // Menu 35 | _menuImageComponent.setBounds(86.0f * scaleFactor, 1189.0f * scaleFactor, 2829.0f * scaleFactor, 776.0f * scaleFactor); 36 | 37 | // Scale UI components 38 | for (auto &uiComponentPtr : audioProcessor._parameters.getUIComponents()) 39 | { 40 | UIComponent &uiComponent = *uiComponentPtr; 41 | uiComponent.setBounds(scaleFactor); 42 | } 43 | 44 | // Save the set bound to the treestate 45 | savePluginBounds(); 46 | } 47 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/Gauge/Gauge.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Gauge.h 5 | Created: 6 Feb 2024 1:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | #include "GaugeLookAndFeel.h" 15 | 16 | //============================================================================== 17 | 18 | class Gauge : public juce::Slider 19 | { 20 | public: 21 | Gauge() 22 | { 23 | gaugeLookAndFeel = std::make_unique(); 24 | setLookAndFeel(gaugeLookAndFeel.get()); 25 | } 26 | 27 | ~Gauge() 28 | { 29 | setLookAndFeel(nullptr); 30 | } 31 | 32 | void setTextHeight(float textHeight) 33 | { 34 | _textHeight = textHeight; 35 | gaugeLookAndFeel->setTextHeight(textHeight); 36 | } 37 | 38 | using RightClickCallback = std::function; 39 | 40 | void setRightClickCallback(RightClickCallback callback) 41 | { 42 | _rightClickCallback = callback; 43 | } 44 | 45 | protected: 46 | void mouseEnter(const juce::MouseEvent &e) override; 47 | void mouseExit(const juce::MouseEvent &e) override; 48 | void mouseUp(const juce::MouseEvent &e) override; 49 | void mouseDown(const juce::MouseEvent &e) override; 50 | 51 | void mouseDoubleClick(const juce::MouseEvent &) override; 52 | 53 | private: 54 | float _textHeight = 1.0f; 55 | RightClickCallback _rightClickCallback; 56 | 57 | std::unique_ptr gaugeLookAndFeel; 58 | 59 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Gauge) 60 | }; 61 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/Gauge/GaugeLookAndFeel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | GaugeLookAndFeel.h 5 | Created: 5 Feb 2024 10:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | #include "GaugeLabel.h" 15 | 16 | //============================================================================== 17 | 18 | class GaugeLookAndFeel : public juce::LookAndFeel_V4 19 | { 20 | public: 21 | GaugeLookAndFeel() 22 | { 23 | } 24 | 25 | void setTextHeight(float textHeight) 26 | { 27 | _textHeight = textHeight; 28 | } 29 | 30 | void mouseEnter() 31 | { 32 | _hovering = true; 33 | } 34 | 35 | void mouseExit() 36 | { 37 | _hovering = false; 38 | } 39 | 40 | void mouseDown() 41 | { 42 | _mouseDown = true; 43 | } 44 | 45 | void mouseUp() 46 | { 47 | _mouseDown = false; 48 | } 49 | 50 | protected: 51 | void drawRotarySlider(juce::Graphics &g, int x, int y, int width, int height, float sliderPosition, const float rotaryStartAngle, const float rotaryEndAngle, juce::Slider &slider) override; 52 | juce::Slider::SliderLayout getSliderLayout(juce::Slider &slider) override; 53 | juce::Label *createSliderTextBox(juce::Slider &) override; 54 | 55 | private: 56 | bool _hovering = false; 57 | bool _mouseDown = false; 58 | void drawArrow(juce::Graphics &g, float x, float y, float width, float height, bool flip); 59 | 60 | float _textHeight = 1.0f; 61 | 62 | // TODO: Might as well make these parameters, also the mess in the arrow drawing function 63 | float shadowWeakness = 0.65f; 64 | float centerOpacity = 0.85f; 65 | float innerCircleSize = 0.85f; 66 | }; 67 | -------------------------------------------------------------------------------- /Source/Globals/Parameters.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Parameters.cpp 5 | Created: 27 Jan 2024 8:37:05pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "Parameters.h" 12 | #include "Globals.h" 13 | 14 | //============================================================================== 15 | 16 | Parameters::Parameters() 17 | { 18 | initParameters(); 19 | } 20 | 21 | void Parameters::addSliderParameter(const juce::String id, const juce::String name, const juce::String toolTip, float minValue, float maxValue, float initValue, float interval, int decimalPlaces, int x, int y, int width, int height, int lookAndFeelID) 22 | { 23 | _uiComponents.push_back(std::make_unique(id, name, toolTip, minValue, maxValue, initValue, interval, x + JUCE_SCALING_ERROR, y + JUCE_SCALING_ERROR, width, height, lookAndFeelID)); 24 | _audioParameters.push_back(std::make_unique( 25 | juce::ParameterID{id, 1}, 26 | name, 27 | juce::NormalisableRange(minValue, maxValue, interval), 28 | initValue, 29 | juce::String(), 30 | juce::AudioProcessorParameter::Category::genericParameter, 31 | [decimalPlaces](float value, int) 32 | { 33 | if (decimalPlaces == 0) 34 | return juce::String((int)value); 35 | else 36 | return juce::String(value, decimalPlaces); 37 | }, 38 | [](const juce::String &text) 39 | { return text.getFloatValue(); })); 40 | } 41 | 42 | void Parameters::addToggleButtonParameter(const juce::String id, const juce::String name, const juce::String toolTip, int x, int y, int width, int height, int lookAndFeelID, bool initValue) 43 | { 44 | _audioParameters.push_back(std::make_unique(juce::ParameterID{id, 1}, name, initValue)); 45 | _uiComponents.push_back(std::make_unique(id, name, toolTip, x + JUCE_SCALING_ERROR, y + JUCE_SCALING_ERROR, width, height, lookAndFeelID, initValue)); 46 | } 47 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/Gauge/Gauge.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Gauge.cpp 5 | Created: 6 Feb 2024 1:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "Gauge.h" 12 | 13 | //============================================================================== 14 | 15 | void Gauge::mouseEnter(const juce::MouseEvent &e) 16 | { 17 | gaugeLookAndFeel->mouseEnter(); 18 | Slider::mouseEnter(e); 19 | } 20 | 21 | void Gauge::mouseExit(const juce::MouseEvent &e) 22 | { 23 | gaugeLookAndFeel->mouseExit(); 24 | Slider::mouseExit(e); 25 | } 26 | 27 | void Gauge::mouseUp(const juce::MouseEvent &e) 28 | { 29 | gaugeLookAndFeel->mouseUp(); 30 | Slider::mouseUp(e); 31 | } 32 | 33 | void Gauge::mouseDown(const juce::MouseEvent &e) 34 | { 35 | juce::ModifierKeys modifiers = juce::ModifierKeys::getCurrentModifiersRealtime(); 36 | 37 | // Right click 38 | if (modifiers.isRightButtonDown()) 39 | { 40 | if (_rightClickCallback) 41 | { 42 | _rightClickCallback(); 43 | } 44 | } 45 | else 46 | { 47 | gaugeLookAndFeel->mouseDown(); 48 | Slider::mouseDown(e); 49 | } 50 | } 51 | 52 | void Gauge::mouseDoubleClick(const juce::MouseEvent &e) 53 | { 54 | // Get the local bounds of the component and convert to float 55 | juce::Rectangle localBounds = getLocalBounds().toFloat(); 56 | 57 | // Calculate the center y coordinate of the local bounds 58 | float centerY = localBounds.getCentreY(); 59 | 60 | // Calculate the half of the desired range based on the _textHeight percentage 61 | float halfRange = localBounds.getHeight() * _textHeight / 2; 62 | 63 | // Check if the mouse Y coordinate is within the text height range 64 | if (auto mouseY = e.getMouseDownY(); std::abs(mouseY - centerY) <= halfRange) 65 | { 66 | // Show the Text Editor 67 | showTextBox(); 68 | } 69 | else 70 | { 71 | // Call the base class implementation if the mouse Y is outside the range 72 | Slider::mouseDoubleClick(e); 73 | } 74 | } -------------------------------------------------------------------------------- /JuceLibraryCode/JuceHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "BinaryData.h" 31 | 32 | #if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION 33 | /** If you've hit this error then the version of the Projucer that was used to generate this project is 34 | older than the version of the JUCE modules being included. To fix this error, re-save your project 35 | using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, 36 | remove the JUCE_PROJUCER_VERSION define. 37 | */ 38 | #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." 39 | #endif 40 | 41 | 42 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 43 | namespace ProjectInfo 44 | { 45 | const char* const projectName = "Leikkaus"; 46 | const char* const companyName = "KeisariStudios"; 47 | const char* const versionString = "1.0.1"; 48 | const int versionNumber = 0x10001; 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /Source/Globals/Globals.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Globals.cpp 5 | Created: 23 Jan 2024 10:21:41pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "Globals.h" 12 | 13 | //== Parameters ================================================================ 14 | 15 | const juce::String inputID = "input"; 16 | const juce::String inputName = "Input"; 17 | const juce::String inputToolTip = "Adjust the input gain. Increase for more volume, decrease for less."; 18 | 19 | const juce::String outputID = "output"; 20 | const juce::String outputName = "Output"; 21 | const juce::String outputToolTip = "Adjust the output gain. Increase for more volume, decrease for less"; 22 | 23 | const juce::String ceilingID = "ceiling"; 24 | const juce::String ceilingName = "Ceiling"; 25 | const juce::String ceilingToolTip = "Adjust the clipping ceiling to control the clipping threshold. Decrease for more distortion, increase for less."; 26 | 27 | const juce::String ratioID = "ratio"; 28 | const juce::String ratioName = "Ratio"; 29 | const juce::String ratioToolTip = "Adjust the ratio to control clipping softness. 0% for hard clip (inf:1), 100% for complete bypass (1:1)."; 30 | 31 | const juce::String mixID = "mix"; 32 | const juce::String mixName = "Mix"; 33 | const juce::String mixToolTip = "Adjust the dry/wet mix. 0% for full dry (input), 100% for full wet (processed)"; 34 | 35 | const juce::String compensationID = "compensation"; 36 | const juce::String compensationName = "Compensation"; 37 | const juce::String compensationToolTip = "Toggle compensation to counteract input gain changes. When enabled, the opposite of the input gain is added to the output for consistent volume levels."; 38 | 39 | const juce::String oversamplingID = "oversampling"; 40 | const juce::String oversamplingName = "Oversampling"; 41 | const juce::String oversamplingToolTip = "Toggle 2x oversampling. Enable for smoother processing at the cost of increased CPU usage."; 42 | 43 | const juce::String deltaID = "delta"; 44 | const juce::String deltaName = "Delta"; 45 | const juce::String deltaToolTip = "Toggle to output the delta signal, representing the difference between the input and processed signal."; 46 | -------------------------------------------------------------------------------- /JuceLibraryCode/BinaryData.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================================= 2 | 3 | This is an auto-generated file: Any edits you make may be overwritten! 4 | 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace BinaryData 10 | { 11 | extern const char* RobotoRegular_ttf; 12 | const int RobotoRegular_ttfSize = 168260; 13 | 14 | extern const char* Icon_png; 15 | const int Icon_pngSize = 745589; 16 | 17 | extern const char* Background_png; 18 | const int Background_pngSize = 43053; 19 | 20 | extern const char* Compensation_OFF_png; 21 | const int Compensation_OFF_pngSize = 10538; 22 | 23 | extern const char* Compensation_ON_png; 24 | const int Compensation_ON_pngSize = 10546; 25 | 26 | extern const char* Delta_OFF_png; 27 | const int Delta_OFF_pngSize = 6347; 28 | 29 | extern const char* Delta_ON_png; 30 | const int Delta_ON_pngSize = 6393; 31 | 32 | extern const char* Lines_png; 33 | const int Lines_pngSize = 31267; 34 | 35 | extern const char* Menu_png; 36 | const int Menu_pngSize = 118310; 37 | 38 | extern const char* Oversampling_OFF_png; 39 | const int Oversampling_OFF_pngSize = 10344; 40 | 41 | extern const char* Oversampling_ON_png; 42 | const int Oversampling_ON_pngSize = 10362; 43 | 44 | // Number of elements in the namedResourceList and originalFileNames arrays. 45 | const int namedResourceListSize = 11; 46 | 47 | // Points to the start of a list of resource names. 48 | extern const char* namedResourceList[]; 49 | 50 | // Points to the start of a list of resource filenames. 51 | extern const char* originalFilenames[]; 52 | 53 | // If you provide the name of one of the binary resource variables above, this function will 54 | // return the corresponding data and its size (or a null pointer if the name isn't found). 55 | const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes); 56 | 57 | // If you provide the name of one of the binary resource variables above, this function will 58 | // return the corresponding original, non-mangled filename (or a null pointer if the name isn't found). 59 | const char* getNamedResourceOriginalFilename (const char* resourceNameUTF8); 60 | } 61 | -------------------------------------------------------------------------------- /Source/PluginEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file contains the basic framework code for a JUCE plugin editor. 5 | 6 | ============================================================================== 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "PluginProcessor.h" 13 | #include "Keisari-Modules/LookAndFeel/ImageToggle/ImageToggle.h" 14 | 15 | //============================================================================== 16 | 17 | class LeikkausAudioProcessorEditor : public juce::AudioProcessorEditor 18 | { 19 | public: 20 | LeikkausAudioProcessorEditor(LeikkausAudioProcessor &); 21 | ~LeikkausAudioProcessorEditor() override; 22 | 23 | private: 24 | // This reference is provided as a quick way for your editor to 25 | // access the processor object that created it. 26 | LeikkausAudioProcessor &audioProcessor; 27 | 28 | //== UI Methods ================================================================ 29 | void uiConstructor(); 30 | void paint(juce::Graphics &) override; 31 | void resized() override; 32 | void savePluginBounds(); 33 | 34 | void createUIComponent(std::unique_ptr &uiComponent); 35 | void createSlider(SliderComponent &sliderComponent); 36 | void createToggleButton(ToggleButtonComponent &toggleButtonComponent); 37 | void setupToggleLookAndFeel(ImageToggle &imageToggle, int lookAndFeelID); 38 | void handleRightClick(juce::String parameterID); 39 | 40 | //== Window Size =============================================================== 41 | const int INIT_WIDTH = 750; 42 | const int INIT_HEIGHT = 500; 43 | 44 | const int MIN_WIDTH = 500; 45 | const int MIN_HEIGHT = 333; 46 | 47 | const int MAX_HEIGHT = 2000; 48 | const int MAX_WIDTH = 3000; 49 | 50 | //== Widgets =================================================================== 51 | juce::SharedResourcePointer tooltipWindow; 52 | juce::ImageComponent _menuImageComponent; 53 | juce::ImageComponent _overlayImageComponent; 54 | 55 | //== Slider Attachments ======================================================== 56 | std::vector> _sliderAttachments; 57 | std::vector> _toggleButtonAttachments; 58 | 59 | //============================================================================== 60 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(LeikkausAudioProcessorEditor) 61 | }; 62 | -------------------------------------------------------------------------------- /Source/Pro-Methods/Pro-Prepare.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Pro-Prepare.cpp 5 | Created: 27 Jan 2024 8:07:40pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginProcessor.h" 12 | 13 | //============================================================================== 14 | 15 | /** 16 | * @brief Called before playback starts to allow the processor to prepare itself. 17 | * 18 | * The sample rate is the target sample rate, and it remains constant until playback stops. 19 | * 20 | * Use getTotalNumInputChannels and getTotalNumOutputChannels or query the busLayout member variable 21 | * to determine the number of channels your processBlock callback must process. 22 | * 23 | * The maximumExpectedSamplesPerBlock value is a strong hint about the maximum number of samples 24 | * that will be provided in each block. It can be used to resize internal buffers. Program defensively 25 | * in case a buggy host exceeds this value, as the actual block sizes can vary between callback calls. 26 | * 27 | * @param sampleRate The target sample rate for the audio stream. 28 | * @param maximumExpectedSamplesPerBlock A hint about the maximum number of samples per block. 29 | */ 30 | void LeikkausAudioProcessor::prepareToPlay(double sampleRate, int maximumExpectedSamplesPerBlock) 31 | { 32 | // Store the sample rate for later use 33 | _lastSampleRate = sampleRate; 34 | 35 | // Setup audio processing specifications 36 | juce::dsp::ProcessSpec spec; 37 | spec.sampleRate = sampleRate; 38 | spec.maximumBlockSize = maximumExpectedSamplesPerBlock; 39 | spec.numChannels = getTotalNumInputChannels(); 40 | 41 | // Reset and set the ramp duration for transitioning audio processing parameters 42 | _ceilingValue.reset(_lastSampleRate, _smoothingParameter); 43 | _ratioValue.reset(_lastSampleRate, _smoothingParameter); 44 | 45 | // Prepare the audio processing blocks 46 | _inputModule.prepare(spec); 47 | _outputModule.prepare(spec); 48 | _dryWetMixerModule.prepare(spec); 49 | 50 | _inputModule.setRampDurationSeconds(_smoothingParameter * 0.05); 51 | _outputModule.setRampDurationSeconds(_smoothingParameter * 0.05); 52 | 53 | // Reset and initialize oversampling module processing with the given samples per block 54 | _oversamplingModule.reset(); 55 | _oversamplingModule.initProcessing(maximumExpectedSamplesPerBlock); 56 | 57 | // Update all parameter values 58 | parameterChanged(juce::String(), 0.0f); 59 | } 60 | -------------------------------------------------------------------------------- /Source/UI-Methods/UI-Constructor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UI-Constructor.cpp 5 | Created: 23 Jan 2024 8:53:51pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginEditor.h" 12 | 13 | //============================================================================== 14 | 15 | void LeikkausAudioProcessorEditor::uiConstructor() 16 | { 17 | // Set font for this editor 18 | juce::LookAndFeel::getDefaultLookAndFeel().setDefaultSansSerifTypeface(juce::Typeface::createSystemTypefaceFor(BinaryData::RobotoRegular_ttf, BinaryData::RobotoRegular_ttfSize)); 19 | 20 | // Create waveform visualizer 21 | addAndMakeVisible(audioProcessor._waveformVisualizer); 22 | // Set waveform and clipped area colours 23 | audioProcessor._waveformVisualizer.setColours(juce::Colour(80, 90, 100), juce::Colours::red); 24 | 25 | // Create overlay image component 26 | juce::Image overlayImage = juce::ImageCache::getFromMemory(BinaryData::Lines_png, BinaryData::Lines_pngSize); 27 | if (!overlayImage.isNull()) 28 | { 29 | addAndMakeVisible(_overlayImageComponent); 30 | _overlayImageComponent.setImage(overlayImage); 31 | } 32 | 33 | // Create ceiling visualizer 34 | addAndMakeVisible(audioProcessor._ceilingVisualizer); 35 | 36 | // Create menu image component 37 | juce::Image menuImage = juce::ImageCache::getFromMemory(BinaryData::Menu_png, BinaryData::Menu_pngSize); 38 | if (!menuImage.isNull()) 39 | { 40 | addAndMakeVisible(_menuImageComponent); 41 | _menuImageComponent.setImage(menuImage); 42 | } 43 | 44 | // Create uiComponents 45 | for (auto &uiComponent : audioProcessor._parameters.getUIComponents()) 46 | { 47 | createUIComponent(uiComponent); 48 | } 49 | 50 | // Set editor size 51 | setSize(audioProcessor._width == 0.0 ? INIT_WIDTH : audioProcessor._width, audioProcessor._height); 52 | 53 | // Set resizable and constraints 54 | setResizable(true, true); 55 | getConstrainer()->setFixedAspectRatio(1.5); 56 | setResizeLimits(MIN_WIDTH, MIN_HEIGHT, MAX_WIDTH, MAX_HEIGHT); 57 | } 58 | 59 | void LeikkausAudioProcessorEditor::createUIComponent(std::unique_ptr &uiComponent) 60 | { 61 | // Check the type of received UIComponent and create it accordingly 62 | if (auto sliderComponent = dynamic_cast(uiComponent.get())) 63 | { 64 | createSlider(*sliderComponent); 65 | } 66 | else if (auto toggleButtonComponent = dynamic_cast(uiComponent.get())) 67 | { 68 | createToggleButton(*toggleButtonComponent); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Source/Pro-Methods/Pro-State.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Pro-State.cpp 5 | Created: 27 Jan 2024 8:09:01pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginProcessor.h" 12 | 13 | //============================================================================== 14 | 15 | /** 16 | * @brief Saves the AudioProcessor's internal state into a memory block. 17 | * 18 | * The host invokes this method to request the processor to save its internal state. 19 | * It is responsible for copying relevant information into the provided memory block. 20 | * The saved state can later be restored using setStateInformation(). 21 | * 22 | * @param destData A reference to the memory block where the state information will be stored. 23 | */ 24 | void LeikkausAudioProcessor::getStateInformation(juce::MemoryBlock &destData) 25 | { 26 | // You should use this method to store your parameters in the memory block. 27 | // You could do that either as raw data, or use the XML or ValueTree classes 28 | // as intermediaries to make it easy to save and load complex data. 29 | _treeState.state.appendChild(_valueTree, nullptr); 30 | juce::MemoryOutputStream stream(destData, false); 31 | _treeState.state.writeToStream(stream); 32 | } 33 | 34 | /** 35 | * @brief Restores the processor's state from a previously saved memory block. 36 | * 37 | * This method is responsible for restoring the processor's state from a memory block 38 | * that was previously created using the getStateInformation() method. It should be 39 | * implemented to reconstruct the internal state based on the provided data. 40 | * 41 | * @param data A pointer to the memory block containing the saved state information. 42 | * @param sizeInBytes The size of the memory block in bytes. 43 | */ 44 | void LeikkausAudioProcessor::setStateInformation(const void *data, int sizeInBytes) 45 | { 46 | // You should use this method to restore your parameters from this memory block, 47 | // whose contents will have been created by the getStateInformation() call. 48 | juce::ValueTree tree = juce::ValueTree::readFromData(data, size_t(sizeInBytes)); 49 | _valueTree = tree.getChildWithName("Variables"); 50 | 51 | // Note: This check is a temporary measure and may be removed in the future. 52 | // Altering the structure of the ValueTree can render existing saved states incompatible. 53 | if (tree.isValid()) 54 | { 55 | _treeState.state = tree; 56 | 57 | // Extract the "width" and "height" properties from the "Variables" node. 58 | _width = _valueTree.getProperty("width"); 59 | _height = _valueTree.getProperty("height"); 60 | 61 | // Update parameter values 62 | parameterChanged(juce::String(), 0.0f); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Source/Pro-Methods/Pro-Parameters.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Pro-Parameters.cpp 5 | Created: 27 Jan 2024 8:01:08pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginProcessor.h" 12 | #include "../Globals/Globals.h" 13 | 14 | //============================================================================== 15 | 16 | /** 17 | * @brief Adds parameter listeners to the AudioProcessorValueTreeState. 18 | * 19 | * This function adds parameter listeners for the parameters in the AudioProcessorValueTreeState. 20 | * Note: Consider refactoring to a more efficient approach. 21 | */ 22 | void LeikkausAudioProcessor::addParameterListeners() 23 | { 24 | _treeState.addParameterListener(inputID, this); 25 | _treeState.addParameterListener(outputID, this); 26 | _treeState.addParameterListener(ceilingID, this); 27 | _treeState.addParameterListener(ratioID, this); 28 | _treeState.addParameterListener(mixID, this); 29 | _treeState.addParameterListener(compensationID, this); 30 | _treeState.addParameterListener(oversamplingID, this); 31 | _treeState.addParameterListener(deltaID, this); 32 | } 33 | 34 | /** 35 | * @brief Creates the parameter layout for the AudioProcessorValueTreeState. 36 | * 37 | * This function constructs the parameter layout for the AudioProcessorValueTreeState by 38 | * retrieving the audio parameters from the Parameters object associated with the processor. 39 | * 40 | * @return A ParameterLayout containing the audio parameters for the ValueTreeState. 41 | */ 42 | juce::AudioProcessorValueTreeState::ParameterLayout LeikkausAudioProcessor::createParameterLayout() 43 | { 44 | // Retrieve the audio parameters from the Parameters object and create the parameter layout 45 | return {_parameters.getAudioParameters().begin(), _parameters.getAudioParameters().end()}; 46 | } 47 | 48 | /** 49 | * @brief Handles changes to audio processor parameters. 50 | * 51 | * This function is called when a parameter in the AudioProcessorValueTreeState is modified. 52 | * It updates the target values for relevant parameters, providing smoothing and scaling where necessary. 53 | * 54 | * @param parameterId The ID of the parameter that has changed. 55 | * @param newValue The new value of the changed parameter. 56 | */ 57 | void LeikkausAudioProcessor::parameterChanged(const juce::String ¶meterId, float newValue) 58 | { 59 | // TODO: REDO THIS 60 | // Update all parameter values 61 | 62 | // Set the target value for the input. 63 | _inputValue = *_treeState.getRawParameterValue(inputID); 64 | // Set the target value for the output. 65 | _outputValue = *_treeState.getRawParameterValue(outputID); 66 | 67 | // Set the target value for the ceiling with smoothing, using the decibels-to-gain conversion 68 | // on the raw parameter value retrieved from the AudioProcessorValueTreeState. 69 | float ceilingRawValue = *_treeState.getRawParameterValue(ceilingID); 70 | _ceilingValue.setTargetValue(juce::Decibels::decibelsToGain(ceilingRawValue)); 71 | _ceilingVisualizer.setCeiling(ceilingRawValue); 72 | _waveformVisualizer.setCeiling(ceilingRawValue); 73 | 74 | // Set the target value for the ratio with smoothing, 75 | // scaling the raw parameter value (0-100) to the range 0-1. 76 | _ratioValue.setTargetValue(*_treeState.getRawParameterValue(ratioID) / 100.0f); 77 | 78 | // Set the target value for the mix with smoothing, 79 | // scaling the raw parameter value (0-100) to the range 0-1. 80 | _mixValue = *_treeState.getRawParameterValue(mixID) / 100.0f; 81 | 82 | // Set compensation target value 83 | _compensationValue = *_treeState.getRawParameterValue(compensationID); 84 | 85 | // Set oversampling target value 86 | _oversamplingValue = *_treeState.getRawParameterValue(oversamplingID); 87 | 88 | // Set delta target value 89 | _deltaValue = *_treeState.getRawParameterValue(deltaID); 90 | } 91 | -------------------------------------------------------------------------------- /Source/PluginProcessor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file contains the basic framework code for a JUCE plugin processor. 5 | 6 | ============================================================================== 7 | */ 8 | 9 | #include "PluginProcessor.h" 10 | #include "PluginEditor.h" 11 | 12 | //============================================================================== 13 | 14 | LeikkausAudioProcessor::LeikkausAudioProcessor() 15 | #ifndef JucePlugin_PreferredChannelConfigurations 16 | : AudioProcessor(BusesProperties() 17 | #if !JucePlugin_IsMidiEffect 18 | #if !JucePlugin_IsSynth 19 | .withInput("Input", juce::AudioChannelSet::stereo(), true) 20 | #endif 21 | .withOutput("Output", juce::AudioChannelSet::stereo(), true) 22 | #endif 23 | ), 24 | _treeState(*this, nullptr, "PARAMETERS", createParameterLayout()), 25 | _waveformVisualizer(2) 26 | #endif 27 | { 28 | _waveformVisualizer.setRepaintRate(30); 29 | _waveformVisualizer.setBufferSize(512); 30 | addParameterListeners(); 31 | } 32 | 33 | LeikkausAudioProcessor::~LeikkausAudioProcessor() 34 | { 35 | addParameterListeners(); 36 | } 37 | 38 | //============================================================================== 39 | 40 | const juce::String LeikkausAudioProcessor::getName() const 41 | { 42 | return JucePlugin_Name; 43 | } 44 | 45 | bool LeikkausAudioProcessor::acceptsMidi() const 46 | { 47 | #if JucePlugin_WantsMidiInput 48 | return true; 49 | #else 50 | return false; 51 | #endif 52 | } 53 | 54 | bool LeikkausAudioProcessor::producesMidi() const 55 | { 56 | #if JucePlugin_ProducesMidiOutput 57 | return true; 58 | #else 59 | return false; 60 | #endif 61 | } 62 | 63 | bool LeikkausAudioProcessor::isMidiEffect() const 64 | { 65 | #if JucePlugin_IsMidiEffect 66 | return true; 67 | #else 68 | return false; 69 | #endif 70 | } 71 | 72 | double LeikkausAudioProcessor::getTailLengthSeconds() const 73 | { 74 | return 0.0; 75 | } 76 | 77 | int LeikkausAudioProcessor::getNumPrograms() 78 | { 79 | return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs, 80 | // so this should be at least 1, even if you're not really implementing programs. 81 | } 82 | 83 | int LeikkausAudioProcessor::getCurrentProgram() 84 | { 85 | return 0; 86 | } 87 | 88 | void LeikkausAudioProcessor::setCurrentProgram(int index) 89 | { 90 | } 91 | 92 | const juce::String LeikkausAudioProcessor::getProgramName(int index) 93 | { 94 | return {}; 95 | } 96 | 97 | void LeikkausAudioProcessor::changeProgramName(int index, const juce::String &newName) 98 | { 99 | } 100 | 101 | //============================================================================== 102 | 103 | void LeikkausAudioProcessor::releaseResources() 104 | { 105 | // When playback stops, you can use this as an opportunity to free up any 106 | // spare memory, etc. 107 | } 108 | 109 | #ifndef JucePlugin_PreferredChannelConfigurations 110 | bool LeikkausAudioProcessor::isBusesLayoutSupported(const BusesLayout &layouts) const 111 | { 112 | #if JucePlugin_IsMidiEffect 113 | juce::ignoreUnused(layouts); 114 | return true; 115 | #else 116 | // This is the place where you check if the layout is supported. 117 | // In this template code we only support mono or stereo. 118 | // Some plugin hosts, such as certain GarageBand versions, will only 119 | // load plugins that support stereo bus layouts. 120 | if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono() && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()) 121 | return false; 122 | 123 | // This checks if the input layout matches the output layout 124 | #if !JucePlugin_IsSynth 125 | if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) 126 | return false; 127 | #endif 128 | 129 | return true; 130 | #endif 131 | } 132 | #endif 133 | 134 | //============================================================================== 135 | bool LeikkausAudioProcessor::hasEditor() const 136 | { 137 | return true; // (change this to false if you choose to not supply an editor) 138 | } 139 | 140 | juce::AudioProcessorEditor *LeikkausAudioProcessor::createEditor() 141 | { 142 | return new LeikkausAudioProcessorEditor(*this); 143 | // Generic UI for debugging 144 | // return new juce::GenericAudioProcessorEditor(*this); 145 | } 146 | 147 | //============================================================================== 148 | // This creates new instances of the plugin.. 149 | juce::AudioProcessor *JUCE_CALLTYPE createPluginFilter() 150 | { 151 | return new LeikkausAudioProcessor(); 152 | } 153 | -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/WaveformVisualizer/WaveformVisualizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #include 27 | 28 | class WaveformVisualizer : public juce::Component, 29 | private juce::Timer 30 | { 31 | public: 32 | /** Creates a visualiser with the given number of channels. */ 33 | WaveformVisualizer(int initialNumChannels); 34 | 35 | /** Destructor. */ 36 | ~WaveformVisualizer() override; 37 | 38 | /** Changes the number of channels that the visualiser stores. */ 39 | void setNumChannels(int numChannels); 40 | 41 | /** Changes the number of samples that the visualiser keeps in its history. 42 | Note that this value refers to the number of averaged sample blocks, and each 43 | block is calculated as the peak of a number of incoming audio samples. To set 44 | the number of incoming samples per block, use setSamplesPerBlock(). 45 | */ 46 | void setBufferSize(int bufferSize); 47 | 48 | /** */ 49 | void setSamplesPerBlock(int newNumInputSamplesPerBlock) noexcept; 50 | 51 | /** */ 52 | int getSamplesPerBlock() const noexcept { return inputSamplesPerBlock; } 53 | 54 | /** Clears the contents of the buffers. */ 55 | void clear(); 56 | 57 | /** Pushes a buffer of channels data. 58 | The number of channels provided here is expected to match the number of channels 59 | that this WaveformVisualizer has been told to use. 60 | */ 61 | void pushBuffer(const juce::AudioBuffer &bufferToPush); 62 | 63 | /** Pushes a buffer of channels data. 64 | The number of channels provided here is expected to match the number of channels 65 | that this WaveformVisualizer has been told to use. 66 | */ 67 | void pushBuffer(const juce::AudioSourceChannelInfo &bufferToPush); 68 | 69 | /** Pushes a buffer of channels data. 70 | The number of channels provided here is expected to match the number of channels 71 | that this WaveformVisualizer has been told to use. 72 | */ 73 | void pushBuffer(const float *const *channelData, int numChannels, int numSamples); 74 | 75 | /** Pushes a single sample (per channel). 76 | The number of channels provided here is expected to match the number of channels 77 | that this WaveformVisualizer has been told to use. 78 | */ 79 | void pushSample(const float *samplesForEachChannel, int numChannels); 80 | 81 | /** Sets the colours used to paint the */ 82 | void setColours(juce::Colour waveformColour, juce::Colour clippedColour) noexcept; 83 | 84 | /** Sets the frequency at which the component repaints itself. */ 85 | void setRepaintRate(int frequencyInHz); 86 | 87 | /** Draws a channel of audio data in the given bounds. 88 | The default implementation just calls getChannelAsPath() and fits this into the given 89 | area. You may want to override this to draw things differently. 90 | */ 91 | virtual void paintChannel(juce::Graphics &, juce::Rectangle bounds, 92 | const juce::Range *levels, int numLevels, int nextSample); 93 | 94 | /** Creates a path which contains the waveform shape of a given set of range data. 95 | The path is normalised so that -1 and +1 are its upper and lower bounds, and it 96 | goes from 0 to numLevels on the X axis. 97 | */ 98 | void getChannelAsPath(juce::Path &result, const juce::Range *levels, int numLevels, int nextSample); 99 | 100 | void setCeiling(float ceiling) 101 | { 102 | _ceiling = ceiling; 103 | } 104 | 105 | protected: 106 | void paint(juce::Graphics &) override; 107 | 108 | private: 109 | float _ceiling = 1.0f; 110 | juce::Colour _waveformColour, _clippedColour; 111 | 112 | struct ChannelInfo; 113 | juce::OwnedArray channels; 114 | int numSamples, inputSamplesPerBlock; 115 | 116 | void timerCallback() override; 117 | 118 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(WaveformVisualizer) 119 | }; -------------------------------------------------------------------------------- /Source/Pro-Methods/Pro-Process.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | Pro-Process.cpp 5 | Created: 27 Jan 2024 8:07:32pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginProcessor.h" 12 | #include "../Keisari-Modules/DSP/Distortion.h" 13 | 14 | //============================================================================== 15 | 16 | /** 17 | * Clears any unused output channels in the given audio buffer. 18 | * 19 | * This method is used to ensure that any output channels beyond the last used input 20 | * channel are set to zero, preventing potential artifacts from unused channels. 21 | * 22 | * @param buffer The audio buffer to clear unused output channels. 23 | */ 24 | void LeikkausAudioProcessor::clearUnusedOutputChannels(juce::AudioBuffer &buffer) 25 | { 26 | // Get the total number of input and output channels 27 | int totalNumInputChannels = getTotalNumInputChannels(); 28 | int totalNumOutputChannels = getTotalNumOutputChannels(); 29 | 30 | // Clear any unused output channels 31 | for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i) 32 | buffer.clear(i, 0, buffer.getNumSamples()); 33 | } 34 | 35 | /** 36 | * @brief Processes the next audio block. 37 | * 38 | * This method is called by JUCE to process the next block of audio samples. 39 | * The buffer parameter contains input data and should be replaced with the processor's output data. 40 | * It's crucial to handle variable-sized blocks and MIDI messages properly to avoid artifacts or crashes. 41 | * 42 | * @param buffer The audio buffer containing input and output samples. 43 | * @param midiMessages A buffer containing incoming MIDI messages for this block. 44 | * 45 | * @note Ensure careful handling of bypass parameters and avoid UI interactions within this callback, 46 | * as it runs on the audio thread. 47 | */ 48 | void LeikkausAudioProcessor::processBlock(juce::AudioBuffer &buffer, juce::MidiBuffer &midiMessages) 49 | { 50 | // Clear any output channels that didn't contain input data 51 | clearUnusedOutputChannels(buffer); 52 | 53 | // Initialize an AudioBlock using the audio buffer 54 | juce::dsp::AudioBlock block{buffer}; 55 | 56 | // Add dry block to dry-wet mixer 57 | _dryWetMixerModule.pushDrySamples(block); 58 | 59 | // Add input volume to block 60 | _inputModule.setGainDecibels(_inputValue); 61 | _inputModule.process(juce::dsp::ProcessContextReplacing(block)); 62 | 63 | // Add buffer to the waveform visualizer component 64 | _waveformVisualizer.pushBuffer(buffer); 65 | 66 | // Process clipping with oversampling if enabled 67 | if (_oversamplingValue) 68 | { 69 | // Upsample block using oversampling module 70 | juce::dsp::AudioBlock upSampledBlock = _oversamplingModule.processSamplesUp(block); 71 | 72 | // Apply clipping processing to each sample 73 | processClipping(upSampledBlock); 74 | 75 | // Restore original sampling rate 76 | _oversamplingModule.processSamplesDown(block); 77 | } 78 | else 79 | { 80 | // Apply clipping processing to each sample 81 | processClipping(block); 82 | } 83 | 84 | // Add output volume to block 85 | // Apply input compensation if enabled 86 | if (_compensationValue) 87 | { 88 | // Invert the effect of the input gain on the processed sample 89 | _outputModule.setGainDecibels(_outputValue - _inputValue); 90 | } 91 | else 92 | { 93 | // Set the output gain in decibels based on the outputValue 94 | _outputModule.setGainDecibels(_outputValue); 95 | } 96 | _outputModule.process(juce::dsp::ProcessContextReplacing(block)); 97 | 98 | // Set the balance between dry-wet mix 99 | _dryWetMixerModule.setWetMixProportion(_mixValue); 100 | // Mix dry wet samples 101 | _dryWetMixerModule.mixWetSamples(block); 102 | } 103 | 104 | /** 105 | * @brief Process clipping for each sample in the given audio block. 106 | * 107 | * This function applies clipping with ratio to each sample in each channel of the 108 | * provided audio block. Optionally, it adds the negation of the original signal 109 | * (delta) to the processed sample if enabled. 110 | * 111 | * @param block The audio block to process. 112 | */ 113 | void LeikkausAudioProcessor::processClipping(juce::dsp::AudioBlock &block) 114 | { 115 | // Process each channel in the audio block 116 | for (int channel = 0; channel < block.getNumChannels(); ++channel) 117 | { 118 | // Obtain a pointer to the audio data for the current channel 119 | auto *channelData = block.getChannelPointer(channel); 120 | 121 | // Iterate through each sample in the current channel 122 | for (int sample = 0; sample < block.getNumSamples(); ++sample) 123 | { 124 | // Get original sample 125 | const float originalSample = channelData[sample]; 126 | 127 | // Add clipping with ratio 128 | float processedSample = clipWithRatio(originalSample, _ceilingValue.getNextValue(), _ratioValue.getNextValue()); 129 | 130 | // Apply delta if enabled 131 | // If _deltaValue is true, add the negation of the original signal to the processed sample 132 | // This effectively outputs the difference between the new and original signal 133 | if (_deltaValue) 134 | { 135 | processedSample += originalSample * -1.0f; 136 | } 137 | 138 | // Replace the channel data with the processed sample 139 | channelData[sample] = processedSample; 140 | } 141 | } 142 | } -------------------------------------------------------------------------------- /Source/PluginProcessor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file contains the basic framework code for a JUCE plugin processor. 5 | 6 | ============================================================================== 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "Globals/Parameters.h" 13 | #include "Keisari-Modules/LookAndFeel/CeilingVisualizer/CeilingVisualizer.h" 14 | #include "Keisari-Modules/LookAndFeel/WaveformVisualizer/WaveformVisualizer.h" 15 | 16 | //============================================================================== 17 | 18 | class LeikkausAudioProcessor : public juce::AudioProcessor, juce::AudioProcessorValueTreeState::Listener 19 | { 20 | public: 21 | //============================================================================== 22 | LeikkausAudioProcessor(); 23 | ~LeikkausAudioProcessor() override; 24 | 25 | //============================================================================== 26 | void prepareToPlay(double sampleRate, int maximumExpectedSamplesPerBlock) override; 27 | void releaseResources() override; 28 | 29 | #ifndef JucePlugin_PreferredChannelConfigurations 30 | bool isBusesLayoutSupported(const BusesLayout &layouts) const override; 31 | #endif 32 | 33 | //============================================================================== 34 | juce::AudioProcessorEditor *createEditor() override; 35 | bool hasEditor() const override; 36 | 37 | //============================================================================== 38 | const juce::String getName() const override; 39 | 40 | bool acceptsMidi() const override; 41 | bool producesMidi() const override; 42 | bool isMidiEffect() const override; 43 | double getTailLengthSeconds() const override; 44 | 45 | //============================================================================== 46 | int getNumPrograms() override; 47 | int getCurrentProgram() override; 48 | void setCurrentProgram(int index) override; 49 | const juce::String getProgramName(int index) override; 50 | void changeProgramName(int index, const juce::String &newName) override; 51 | 52 | //== Parameters ================================================================ 53 | void getStateInformation(juce::MemoryBlock &destData) override; 54 | void setStateInformation(const void *data, int sizeInBytes) override; 55 | 56 | // Parameters object for managing plugin parameters 57 | Parameters _parameters; 58 | 59 | // State manager for plugin parameter tree 60 | juce::AudioProcessorValueTreeState _treeState; 61 | 62 | // ValueTree to store additional variables, such as width and height 63 | juce::ValueTree _valueTree{"Variables", {}, {{"Group", {{"name", "variables"}}, { 64 | {"Parameter", {{"id", "width"}, {"value", 0.0}}}, 65 | {"Parameter", {{"id", "width"}, {"value", 0.0}}}, 66 | } 67 | 68 | }}}; 69 | 70 | // Additional variables for width and height 71 | float _width = 0.0f; 72 | float _height = 0.0f; 73 | 74 | //== Processing ================================================================ 75 | void processBlock(juce::AudioBuffer &, juce::MidiBuffer &) override; 76 | void clearUnusedOutputChannels(juce::AudioBuffer &buffer); 77 | void processClipping(juce::dsp::AudioBlock &block); 78 | 79 | //== Visualizers =============================================================== 80 | CeilingVisualizer _ceilingVisualizer; 81 | WaveformVisualizer _waveformVisualizer; 82 | 83 | private: 84 | //== Parameters ================================================================ 85 | juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout(); 86 | 87 | void parameterChanged(const juce::String ¶meterID, float newValue) override; 88 | void addParameterListeners(); 89 | 90 | //== Modules =================================================================== 91 | juce::dsp::Gain _inputModule; 92 | juce::dsp::Gain _outputModule; 93 | juce::dsp::DryWetMixer _dryWetMixerModule; 94 | juce::dsp::Oversampling _oversamplingModule{2, 2, juce::dsp::Oversampling::filterHalfBandPolyphaseIIR}; 95 | 96 | //== Parameters ================================================================ 97 | // User sample rate 98 | float _lastSampleRate; 99 | 100 | // Setting the smoothing parameter for ramping value transitions in audio processing 101 | const double _smoothingParameter = 0.2; 102 | 103 | // Values for user modifiable parameters 104 | float _inputValue; //-24db to 24db 105 | float _outputValue; //-24db to 24db 106 | float _mixValue; // 0 to 100% normalized to 0 to 1 107 | juce::SmoothedValue _ceilingValue; // 0 to -24d normalized to gain 108 | juce::SmoothedValue _ratioValue; // 0 to 100% normalized to 0 to 1 109 | bool _compensationValue = false; 110 | bool _oversamplingValue = false; 111 | bool _deltaValue = false; 112 | 113 | //============================================================================== 114 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(LeikkausAudioProcessor) 115 | }; 116 | -------------------------------------------------------------------------------- /JuceLibraryCode/JucePluginDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #pragma once 9 | 10 | //============================================================================== 11 | // Audio plugin settings.. 12 | 13 | #ifndef JucePlugin_Build_VST 14 | #define JucePlugin_Build_VST 0 15 | #endif 16 | #ifndef JucePlugin_Build_VST3 17 | #define JucePlugin_Build_VST3 1 18 | #endif 19 | #ifndef JucePlugin_Build_AU 20 | #define JucePlugin_Build_AU 1 21 | #endif 22 | #ifndef JucePlugin_Build_AUv3 23 | #define JucePlugin_Build_AUv3 0 24 | #endif 25 | #ifndef JucePlugin_Build_AAX 26 | #define JucePlugin_Build_AAX 0 27 | #endif 28 | #ifndef JucePlugin_Build_Standalone 29 | #define JucePlugin_Build_Standalone 1 30 | #endif 31 | #ifndef JucePlugin_Build_Unity 32 | #define JucePlugin_Build_Unity 0 33 | #endif 34 | #ifndef JucePlugin_Build_LV2 35 | #define JucePlugin_Build_LV2 0 36 | #endif 37 | #ifndef JucePlugin_Enable_IAA 38 | #define JucePlugin_Enable_IAA 0 39 | #endif 40 | #ifndef JucePlugin_Enable_ARA 41 | #define JucePlugin_Enable_ARA 0 42 | #endif 43 | #ifndef JucePlugin_Name 44 | #define JucePlugin_Name "Leikkaus" 45 | #endif 46 | #ifndef JucePlugin_Desc 47 | #define JucePlugin_Desc "Leikkaus is a dynamic clipper effect plugin" 48 | #endif 49 | #ifndef JucePlugin_Manufacturer 50 | #define JucePlugin_Manufacturer "KeisariStudios" 51 | #endif 52 | #ifndef JucePlugin_ManufacturerWebsite 53 | #define JucePlugin_ManufacturerWebsite "https://keisaristudios.com" 54 | #endif 55 | #ifndef JucePlugin_ManufacturerEmail 56 | #define JucePlugin_ManufacturerEmail "keisaristudios@gmail.com" 57 | #endif 58 | #ifndef JucePlugin_ManufacturerCode 59 | #define JucePlugin_ManufacturerCode 0x4b656973 60 | #endif 61 | #ifndef JucePlugin_PluginCode 62 | #define JucePlugin_PluginCode 0x4b6c6b73 63 | #endif 64 | #ifndef JucePlugin_IsSynth 65 | #define JucePlugin_IsSynth 0 66 | #endif 67 | #ifndef JucePlugin_WantsMidiInput 68 | #define JucePlugin_WantsMidiInput 0 69 | #endif 70 | #ifndef JucePlugin_ProducesMidiOutput 71 | #define JucePlugin_ProducesMidiOutput 0 72 | #endif 73 | #ifndef JucePlugin_IsMidiEffect 74 | #define JucePlugin_IsMidiEffect 0 75 | #endif 76 | #ifndef JucePlugin_EditorRequiresKeyboardFocus 77 | #define JucePlugin_EditorRequiresKeyboardFocus 0 78 | #endif 79 | #ifndef JucePlugin_Version 80 | #define JucePlugin_Version 1.0.1 81 | #endif 82 | #ifndef JucePlugin_VersionCode 83 | #define JucePlugin_VersionCode 0x10001 84 | #endif 85 | #ifndef JucePlugin_VersionString 86 | #define JucePlugin_VersionString "1.0.1" 87 | #endif 88 | #ifndef JucePlugin_VSTUniqueID 89 | #define JucePlugin_VSTUniqueID JucePlugin_PluginCode 90 | #endif 91 | #ifndef JucePlugin_VSTCategory 92 | #define JucePlugin_VSTCategory kPlugCategEffect 93 | #endif 94 | #ifndef JucePlugin_Vst3Category 95 | #define JucePlugin_Vst3Category "Fx|Distortion" 96 | #endif 97 | #ifndef JucePlugin_AUMainType 98 | #define JucePlugin_AUMainType 'aufx' 99 | #endif 100 | #ifndef JucePlugin_AUSubType 101 | #define JucePlugin_AUSubType JucePlugin_PluginCode 102 | #endif 103 | #ifndef JucePlugin_AUExportPrefix 104 | #define JucePlugin_AUExportPrefix LeikkausAU 105 | #endif 106 | #ifndef JucePlugin_AUExportPrefixQuoted 107 | #define JucePlugin_AUExportPrefixQuoted "LeikkausAU" 108 | #endif 109 | #ifndef JucePlugin_AUManufacturerCode 110 | #define JucePlugin_AUManufacturerCode JucePlugin_ManufacturerCode 111 | #endif 112 | #ifndef JucePlugin_CFBundleIdentifier 113 | #define JucePlugin_CFBundleIdentifier com.KeisariStudios.Leikkaus 114 | #endif 115 | #ifndef JucePlugin_AAXIdentifier 116 | #define JucePlugin_AAXIdentifier com.KeisariStudios.Leikkaus 117 | #endif 118 | #ifndef JucePlugin_AAXManufacturerCode 119 | #define JucePlugin_AAXManufacturerCode JucePlugin_ManufacturerCode 120 | #endif 121 | #ifndef JucePlugin_AAXProductId 122 | #define JucePlugin_AAXProductId JucePlugin_PluginCode 123 | #endif 124 | #ifndef JucePlugin_AAXCategory 125 | #define JucePlugin_AAXCategory 8193 126 | #endif 127 | #ifndef JucePlugin_AAXDisableBypass 128 | #define JucePlugin_AAXDisableBypass 0 129 | #endif 130 | #ifndef JucePlugin_AAXDisableMultiMono 131 | #define JucePlugin_AAXDisableMultiMono 0 132 | #endif 133 | #ifndef JucePlugin_IAAType 134 | #define JucePlugin_IAAType 0x61757278 135 | #endif 136 | #ifndef JucePlugin_IAASubType 137 | #define JucePlugin_IAASubType JucePlugin_PluginCode 138 | #endif 139 | #ifndef JucePlugin_IAAName 140 | #define JucePlugin_IAAName "KeisariStudios: Leikkaus" 141 | #endif 142 | #ifndef JucePlugin_VSTNumMidiInputs 143 | #define JucePlugin_VSTNumMidiInputs 16 144 | #endif 145 | #ifndef JucePlugin_VSTNumMidiOutputs 146 | #define JucePlugin_VSTNumMidiOutputs 16 147 | #endif 148 | #ifndef JucePlugin_ARAContentTypes 149 | #define JucePlugin_ARAContentTypes 0 150 | #endif 151 | #ifndef JucePlugin_ARATransformationFlags 152 | #define JucePlugin_ARATransformationFlags 0 153 | #endif 154 | #ifndef JucePlugin_ARAFactoryID 155 | #define JucePlugin_ARAFactoryID "com.KeisariStudios.Leikkaus.factory" 156 | #endif 157 | #ifndef JucePlugin_ARADocumentArchiveID 158 | #define JucePlugin_ARADocumentArchiveID "com.KeisariStudios.Leikkaus.aradocumentarchive.1.0.0" 159 | #endif 160 | #ifndef JucePlugin_ARACompatibleArchiveIDs 161 | #define JucePlugin_ARACompatibleArchiveIDs "" 162 | #endif 163 | -------------------------------------------------------------------------------- /Source/UI-Methods/UI-Create.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | UI-Create.cpp 5 | Created: 7 Feb 2024 6:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "../PluginEditor.h" 12 | #include "../Keisari-Modules/LookAndFeel/Gauge/Gauge.h" 13 | #include "../Keisari-Modules/LookAndFeel/ImageToggle/ImageToggle.h" 14 | 15 | //============================================================================== 16 | 17 | void LeikkausAudioProcessorEditor::createSlider(SliderComponent &sliderComponent) 18 | { 19 | // Create and set the Gauge 20 | sliderComponent.setComponent(std::make_unique()); 21 | 22 | // Retrieve the Gauge 23 | auto gauge = dynamic_cast(sliderComponent.getComponent()); 24 | if (gauge != nullptr) 25 | { 26 | addAndMakeVisible(gauge); 27 | 28 | // These values don't actually matter, as they are set in the resized() method 29 | gauge->setTextBoxStyle(juce::Slider::TextBoxBelow, false, 400, 400); 30 | 31 | gauge->setDoubleClickReturnValue(true, sliderComponent._initValue); 32 | gauge->setRange(sliderComponent._minValue, sliderComponent._maxValue, sliderComponent._interval); 33 | gauge->setSliderStyle(juce::Slider::SliderStyle::RotaryVerticalDrag); 34 | gauge->setTooltip(sliderComponent._toolTip); 35 | 36 | // Set Gauge colours 37 | gauge->setColour(juce::Slider::rotarySliderFillColourId, juce::Colour(static_cast(255), 100, 255, 1.0f)); 38 | gauge->setColour(juce::Slider::rotarySliderOutlineColourId, juce::Colour(100, 120, 130)); 39 | gauge->setColour(juce::Slider::trackColourId, juce::Colour(15, 15, 20)); 40 | 41 | // Set Gauge TextEditor colours 42 | gauge->setColour(juce::TextEditor::backgroundColourId, juce::Colour(30, 30, 30)); 43 | gauge->setColour(juce::TextEditor::outlineColourId, juce::Colour(45, 133, 194)); 44 | gauge->setColour(juce::TextEditor::focusedOutlineColourId, juce::Colour(45, 133, 194)); 45 | gauge->setColour(juce::TextEditor::highlightColourId, juce::Colour(137, 87, 110)); 46 | 47 | gauge->setTextHeight(0.2f); 48 | 49 | gauge->setRightClickCallback([this, parameterID = sliderComponent._id]() 50 | { handleRightClick(parameterID); }); 51 | } 52 | 53 | // Add slider attachment 54 | _sliderAttachments.push_back(std::make_unique(audioProcessor._treeState, sliderComponent._id, *gauge)); 55 | } 56 | 57 | void LeikkausAudioProcessorEditor::createToggleButton(ToggleButtonComponent &toggleButtonComponent) 58 | { 59 | // Create and set toggle image button 60 | toggleButtonComponent.setComponent(std::make_unique()); 61 | 62 | // Retrieve the toggle image button 63 | auto imageToggle = dynamic_cast(toggleButtonComponent.getComponent()); 64 | if (imageToggle != nullptr) 65 | { 66 | addAndMakeVisible(imageToggle); 67 | imageToggle->setTooltip(toggleButtonComponent._toolTip); 68 | 69 | // Look and feel settings here 70 | setupToggleLookAndFeel(*imageToggle, toggleButtonComponent._lookAndFeelID); 71 | 72 | imageToggle->setRightClickCallback([this, parameterID = toggleButtonComponent._id]() 73 | { handleRightClick(parameterID); }); 74 | } 75 | 76 | // Add toggle button attachment 77 | _toggleButtonAttachments.push_back(std::make_unique(audioProcessor._treeState, toggleButtonComponent._id, *imageToggle)); 78 | } 79 | 80 | void LeikkausAudioProcessorEditor::setupToggleLookAndFeel(ImageToggle &imageToggle, int lookAndFeelID) 81 | { 82 | juce::Image toggleOnImage; 83 | juce::Image toggleOffImage; 84 | 85 | switch (lookAndFeelID) 86 | { 87 | case 0: 88 | toggleOnImage = juce::ImageCache::getFromMemory(BinaryData::Compensation_ON_png, BinaryData::Compensation_ON_pngSize); 89 | toggleOffImage = juce::ImageCache::getFromMemory(BinaryData::Compensation_OFF_png, BinaryData::Compensation_OFF_pngSize); 90 | break; 91 | case 1: 92 | toggleOnImage = juce::ImageCache::getFromMemory(BinaryData::Oversampling_ON_png, BinaryData::Oversampling_ON_pngSize); 93 | toggleOffImage = juce::ImageCache::getFromMemory(BinaryData::Oversampling_OFF_png, BinaryData::Oversampling_OFF_pngSize); 94 | break; 95 | case 2: 96 | toggleOnImage = juce::ImageCache::getFromMemory(BinaryData::Delta_ON_png, BinaryData::Delta_ON_pngSize); 97 | toggleOffImage = juce::ImageCache::getFromMemory(BinaryData::Delta_OFF_png, BinaryData::Delta_OFF_pngSize); 98 | break; 99 | 100 | default: 101 | // Handle default case or throw an exception if necessary 102 | break; 103 | } 104 | 105 | imageToggle.setImages(toggleOnImage, toggleOffImage); 106 | } 107 | 108 | void LeikkausAudioProcessorEditor::handleRightClick(juce::String parameterID) 109 | { 110 | auto parameter = audioProcessor._treeState.getParameter(parameterID); 111 | if (parameter != nullptr) 112 | { 113 | auto hostContext = getHostContext(); 114 | if (hostContext != nullptr) 115 | { 116 | auto contextMenu = hostContext->getContextMenuForParameter(parameter); 117 | if (contextMenu != nullptr) 118 | { 119 | // This is a hack to make the context menu appear in the right place on MAC 120 | // TODO: Fix the HiDPI JUCE bug that is causing this 121 | // contextMenu->showNativeMenu(getMouseXYRelative() * 2); 122 | 123 | // So this only works properly on Windows 124 | contextMenu->showNativeMenu(getMouseXYRelative()); 125 | } 126 | } 127 | } 128 | } -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/Gauge/GaugeLookAndFeel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | GaugeLookAndFeel.cpp 5 | Created: 5 Feb 2024 10:00:00pm 6 | Author: Eemil Ahonen 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include "GaugeLookAndFeel.h" 12 | 13 | //============================================================================== 14 | 15 | /** 16 | * @brief Overrides the SliderLayout to center text inside the Gauge. 17 | * 18 | * Given a juce::Slider reference, calculates and returns the SliderLayout to ensure 19 | * the associated Gauge's text is centered. It adjusts the textBoxBounds and maintains 20 | * the original sliderBounds. 21 | * 22 | * @param slider A reference to the juce::Slider associated with the Gauge. 23 | * @return The SliderLayout with updated textBoxBounds for centered text. 24 | */ 25 | juce::Slider::SliderLayout GaugeLookAndFeel::getSliderLayout(juce::Slider &slider) 26 | { 27 | auto localBounds = slider.getLocalBounds().toFloat(); 28 | juce::Slider::SliderLayout layout; 29 | auto textBounds = localBounds.withSizeKeepingCentre(localBounds.getWidth(), 30 | localBounds.getHeight() * _textHeight); 31 | layout.textBoxBounds = textBounds.toNearestInt(); 32 | layout.sliderBounds = slider.getLocalBounds(); 33 | return layout; 34 | } 35 | 36 | /** 37 | * @brief Creates and configures a TextLabel and TextEditor for the Gauge. 38 | * 39 | * Creates a GaugeLabel with a specified font size and sets various properties 40 | * such as editability, justification, and colors. Returns a pointer to the created label. 41 | * 42 | * @param slider A reference to the juce::Slider associated with the Gauge. 43 | * @return A pointer to the created GaugeLabel. 44 | */ 45 | juce::Label *GaugeLookAndFeel::createSliderTextBox(juce::Slider &slider) 46 | { 47 | // Dynamically allocate memory for gaugeLabel 48 | auto *gaugeLabel = new GaugeLabel(); 49 | 50 | gaugeLabel->setEditable(false, false, true); 51 | gaugeLabel->setJustificationType(juce::Justification::centred); 52 | gaugeLabel->setColour(juce::TextEditor::backgroundColourId, slider.findColour(juce::TextEditor::backgroundColourId)); 53 | gaugeLabel->setColour(juce::TextEditor::outlineColourId, slider.findColour(juce::TextEditor::outlineColourId)); 54 | gaugeLabel->setColour(juce::TextEditor::focusedOutlineColourId, slider.findColour(juce::TextEditor::focusedOutlineColourId)); 55 | gaugeLabel->setColour(juce::TextEditor::highlightColourId, slider.findColour(juce::TextEditor::highlightColourId)); 56 | gaugeLabel->setInterceptsMouseClicks(false, false); 57 | return gaugeLabel; 58 | } 59 | 60 | /** 61 | * @brief Draws the Gauge with a filled circle based on slider position. 62 | * 63 | * Given graphics context and dimensions, draws the Gauge with a filled 64 | * circle representing the slider position. The fill color is specified by _fillColor. 65 | * 66 | * @param g The graphics context to draw on. 67 | * @param x The x-coordinate of the slider. 68 | * @param y The y-coordinate of the slider. 69 | * @param width The width of the slider. 70 | * @param height The height of the slider. 71 | * @param sliderPosition The position of the slider. 72 | * @param rotaryStartAngle The start angle of the rotary slider. 73 | * @param rotaryEndAngle The end angle of the rotary slider. 74 | * @param slider A reference to the juce::Slider associated with the Gauge. 75 | */ 76 | void GaugeLookAndFeel::drawRotarySlider(juce::Graphics &g, int x, int y, int width, int height, float sliderPosition, const float rotaryStartAngle, const float rotaryEndAngle, juce::Slider &slider) 77 | { 78 | auto bounds = juce::Rectangle(x, y, width, height); 79 | 80 | // Define circle colors 81 | juce::Colour fillColour = slider.findColour(juce::Slider::rotarySliderFillColourId); 82 | juce::Colour outerCircle = slider.findColour(juce::Slider::rotarySliderOutlineColourId); 83 | juce::Colour innerCircle = slider.findColour(juce::Slider::trackColourId); 84 | 85 | // Draw the outer circle 86 | g.setColour(outerCircle); 87 | g.fillEllipse(x, y, width, height); 88 | 89 | // Set the inner circle size and gradient 90 | juce::ColourGradient innerGradient = juce::ColourGradient(innerCircle, bounds.getCentreX(), bounds.getCentreY(), juce::Colours::black, width * innerCircleSize, height * innerCircleSize, true); 91 | innerGradient.addColour(shadowWeakness, innerCircle); 92 | 93 | // Draw the inner circle 94 | g.setGradientFill(innerGradient); 95 | g.fillEllipse(x + (width * (1.0f - innerCircleSize) * 0.5f), y + (height * (1.0f - innerCircleSize) * 0.5f), width * innerCircleSize, height * innerCircleSize); 96 | 97 | // Calculate the vertical position to fill the circle based on the slider position. 98 | float fillY = height * (1.0f - sliderPosition); 99 | 100 | // Create a circular clipping path to restrict drawing within the specified circle. 101 | juce::Path clippingCircle; 102 | clippingCircle.addEllipse(x, y, width, height); 103 | g.reduceClipRegion(clippingCircle); 104 | 105 | // Fill the rectangle within the circular boundary with the specified color. 106 | g.setColour(fillColour); 107 | g.fillRect(static_cast(x), static_cast(fillY), static_cast(width), static_cast(height)); 108 | 109 | innerGradient.multiplyOpacity(centerOpacity); 110 | g.setGradientFill(innerGradient); 111 | g.fillEllipse(x + (width * (1.0f - innerCircleSize) * 0.5f), y + (height * (1.0f - innerCircleSize) * 0.5f), width * innerCircleSize, height * innerCircleSize); 112 | 113 | // Set arrows based on hovering and clicking state 114 | if (_hovering) 115 | { 116 | // Define arrow characteristics 117 | float arrowWidth = width * 0.1f; 118 | float opacityModifier = _mouseDown ? 0.5f : 0.25f; 119 | float fullOpacityModifier = opacityModifier * 2; 120 | 121 | // Calculate arrow color based on slider position and opacity modifiers 122 | juce::Colour arrowColor = juce::Colour(static_cast(255), 255, 255, sliderPosition == 1.0f ? opacityModifier : fullOpacityModifier); 123 | 124 | // Draw top arrow 125 | g.setColour(arrowColor); 126 | drawArrow(g, bounds.getCentreX(), bounds.getCentreY(), arrowWidth, height, true); 127 | 128 | // Draw bottom arrow 129 | g.setColour(arrowColor.withAlpha(sliderPosition == 0.0f ? opacityModifier : fullOpacityModifier)); 130 | drawArrow(g, bounds.getCentreX(), bounds.getCentreY(), arrowWidth, height, false); 131 | } 132 | } 133 | 134 | void GaugeLookAndFeel::drawArrow(juce::Graphics &g, float x, float y, float width, float height, bool flip) 135 | { 136 | // Set arrow direction based on 'flip' 137 | float arrowDirection = flip ? -1.0f : 1.0f; 138 | 139 | float arrowY = 0.2125f * height * arrowDirection; 140 | float thickness = 0.025f * height; 141 | 142 | // Create arrow path 143 | juce::Path arrow; 144 | arrow.startNewSubPath(x - width / 2, y + arrowY); 145 | arrow.lineTo(x, y + arrowY + arrowDirection * (height * 0.05f)); 146 | arrow.lineTo(x + width / 2, y + arrowY); 147 | 148 | // Stroke the arrow path 149 | g.strokePath(arrow, juce::PathStrokeType(juce::PathStrokeType(thickness, juce::PathStrokeType::curved, juce::PathStrokeType::rounded))); 150 | } -------------------------------------------------------------------------------- /Source/Keisari-Modules/LookAndFeel/WaveformVisualizer/WaveformVisualizer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #include "WaveformVisualizer.h" 27 | 28 | struct WaveformVisualizer::ChannelInfo 29 | { 30 | ChannelInfo(WaveformVisualizer &o, int bufferSize) : owner(o) 31 | { 32 | setBufferSize(bufferSize); 33 | clear(); 34 | } 35 | 36 | void clear() noexcept 37 | { 38 | levels.fill({}); 39 | value = {}; 40 | subSample = 0; 41 | } 42 | 43 | void pushSamples(const float *inputSamples, int num) noexcept 44 | { 45 | for (int i = 0; i < num; ++i) 46 | pushSample(inputSamples[i]); 47 | } 48 | 49 | void pushSample(float newSample) noexcept 50 | { 51 | if (--subSample <= 0) 52 | { 53 | if (++nextSample == levels.size()) 54 | nextSample = 0; 55 | 56 | levels.getReference(nextSample) = value; 57 | subSample = owner.getSamplesPerBlock(); 58 | value = juce::Range(newSample, newSample); 59 | } 60 | else 61 | { 62 | value = value.getUnionWith(newSample); 63 | } 64 | } 65 | 66 | void setBufferSize(int newSize) 67 | { 68 | levels.removeRange(newSize, levels.size()); 69 | levels.insertMultiple(-1, {}, newSize - levels.size()); 70 | 71 | if (nextSample >= newSize) 72 | nextSample = 0; 73 | } 74 | 75 | WaveformVisualizer &owner; 76 | juce::Array> levels; 77 | juce::Range value; 78 | std::atomic nextSample{0}, subSample{0}; 79 | 80 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ChannelInfo) 81 | }; 82 | 83 | //============================================================================== 84 | WaveformVisualizer::WaveformVisualizer(int initialNumChannels) 85 | : numSamples(1024), 86 | inputSamplesPerBlock(256) 87 | { 88 | setNumChannels(initialNumChannels); 89 | setRepaintRate(60); 90 | } 91 | 92 | WaveformVisualizer::~WaveformVisualizer() 93 | { 94 | } 95 | 96 | void WaveformVisualizer::setNumChannels(int numChannels) 97 | { 98 | channels.clear(); 99 | 100 | for (int i = 0; i < numChannels; ++i) 101 | channels.add(new ChannelInfo(*this, numSamples)); 102 | } 103 | 104 | void WaveformVisualizer::setBufferSize(int newNumSamples) 105 | { 106 | numSamples = newNumSamples; 107 | 108 | for (auto *c : channels) 109 | c->setBufferSize(newNumSamples); 110 | } 111 | 112 | void WaveformVisualizer::clear() 113 | { 114 | for (auto *c : channels) 115 | c->clear(); 116 | } 117 | 118 | void WaveformVisualizer::pushBuffer(const float *const *d, int numChannels, int num) 119 | { 120 | numChannels = juce::jmin(numChannels, channels.size()); 121 | 122 | for (int i = 0; i < numChannels; ++i) 123 | channels.getUnchecked(i)->pushSamples(d[i], num); 124 | } 125 | 126 | void WaveformVisualizer::pushBuffer(const juce::AudioBuffer &buffer) 127 | { 128 | pushBuffer(buffer.getArrayOfReadPointers(), 129 | buffer.getNumChannels(), 130 | buffer.getNumSamples()); 131 | } 132 | 133 | void WaveformVisualizer::pushBuffer(const juce::AudioSourceChannelInfo &buffer) 134 | { 135 | auto numChannels = juce::jmin(buffer.buffer->getNumChannels(), channels.size()); 136 | 137 | for (int i = 0; i < numChannels; ++i) 138 | channels.getUnchecked(i)->pushSamples(buffer.buffer->getReadPointer(i, buffer.startSample), 139 | buffer.numSamples); 140 | } 141 | 142 | void WaveformVisualizer::pushSample(const float *d, int numChannels) 143 | { 144 | numChannels = juce::jmin(numChannels, channels.size()); 145 | 146 | for (int i = 0; i < numChannels; ++i) 147 | channels.getUnchecked(i)->pushSample(d[i]); 148 | } 149 | 150 | void WaveformVisualizer::setSamplesPerBlock(int newSamplesPerPixel) noexcept 151 | { 152 | inputSamplesPerBlock = newSamplesPerPixel; 153 | } 154 | 155 | void WaveformVisualizer::setRepaintRate(int frequencyInHz) 156 | { 157 | startTimerHz(frequencyInHz); 158 | } 159 | 160 | void WaveformVisualizer::timerCallback() 161 | { 162 | repaint(); 163 | } 164 | 165 | void WaveformVisualizer::setColours(juce::Colour waveformColour, juce::Colour clippedColour) noexcept 166 | { 167 | _waveformColour = waveformColour; 168 | _clippedColour = clippedColour; 169 | repaint(); 170 | } 171 | 172 | void WaveformVisualizer::paint(juce::Graphics &g) 173 | { 174 | auto r = getLocalBounds().toFloat(); 175 | 176 | for (auto *c : channels) 177 | paintChannel(g, r, c->levels.begin(), c->levels.size(), c->nextSample); 178 | } 179 | 180 | void WaveformVisualizer::getChannelAsPath(juce::Path &path, const juce::Range *levels, 181 | int numLevels, int nextSample) 182 | { 183 | const float defaultLevel = -33.0f; 184 | const int spaceMultiplier = 4; 185 | const int pathPreallocation = 8; 186 | 187 | path.preallocateSpace(spaceMultiplier * numLevels + pathPreallocation); 188 | 189 | for (int i = 0; i < numLevels; ++i) 190 | { 191 | auto level = -(levels[(nextSample + i) % numLevels].getEnd()); 192 | 193 | if (i == 0) 194 | path.startNewSubPath(0.0f, defaultLevel); 195 | else 196 | path.lineTo((float)i, defaultLevel); 197 | } 198 | 199 | for (int i = numLevels; --i >= 0;) 200 | { 201 | float absoluteValue = juce::Decibels::gainToDecibels(std::abs(levels[(nextSample + i) % numLevels].getStart())); 202 | if (absoluteValue < defaultLevel) 203 | absoluteValue = defaultLevel; 204 | path.lineTo((float)i, absoluteValue); 205 | } 206 | 207 | path.closeSubPath(); 208 | } 209 | 210 | void WaveformVisualizer::paintChannel(juce::Graphics &g, juce::Rectangle area, 211 | const juce::Range *levels, int numLevels, int nextSample) 212 | { 213 | juce::Path p; 214 | getChannelAsPath(p, levels, numLevels, nextSample); 215 | p = p.createPathWithRoundedCorners(1.0f); 216 | 217 | g.setColour(_waveformColour); 218 | 219 | // Define ceiling min and max Y-coordinates 220 | float ceilingZero = 150.0f / 1800.0f * area.getHeight(); 221 | float ceilingNeg24 = 0.75f * area.getHeight(); 222 | 223 | // Transform the path from -33.0f to sample roof to local area 224 | p.applyTransform(juce::AffineTransform::fromTargetPoints(0.0f, 0.0f, area.getX(), area.getY() + ceilingZero, 225 | 0.0f, -33.0f, area.getX(), area.getBottom(), 226 | (float)numLevels, 0.0f, area.getRight(), area.getY() + ceilingZero)); 227 | 228 | g.fillPath(p); 229 | 230 | // Scale the ceiling to local area 231 | float scaledY = juce::jmap(_ceiling, -24.0f, 0.0f, ceilingNeg24, ceilingZero); 232 | 233 | // Use the drawn waveform as a clipping mask 234 | g.reduceClipRegion(p); 235 | 236 | // Set colour and draw the rectangle that is above the ceiling 237 | g.setColour(_clippedColour); 238 | g.fillRect(0, (int)(area.getY()), (int)area.getWidth(), (int)(scaledY)); 239 | } 240 | -------------------------------------------------------------------------------- /Assets/Fonts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /Leikkaus.jucer: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 25 | 26 | 27 | 28 | 29 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 46 | 47 | 48 | 49 | 50 | 52 | 54 | 55 | 56 | 58 | 60 | 61 | 62 | 63 | 64 | 66 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 76 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 86 | 87 | 88 | 89 | 90 | 92 | 93 | 94 | 95 | 96 | 98 | 100 | 101 | 103 | 104 | 105 | 106 | 107 | 108 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------