diff --git a/JuceLibraryCode/AppConfig.h b/JuceLibraryCode/AppConfig.h index 3931652..c5968c9 100644 --- a/JuceLibraryCode/AppConfig.h +++ b/JuceLibraryCode/AppConfig.h @@ -20,15 +20,17 @@ // [END_USER_CODE_SECTION] +#include "JucePluginDefines.h" + /* ============================================================================== - In accordance with the terms of the JUCE 5 End-Use License Agreement, the + In accordance with the terms of the JUCE 6 End-Use License Agreement, the JUCE Code in SECTION A cannot be removed, changed or otherwise rendered ineffective unless you have a JUCE Indie or Pro license, or are using JUCE under the GPL v3 license. - End User License Agreement: www.juce.com/juce-5-licence + End User License Agreement: www.juce.com/juce-6-licence ============================================================================== */ @@ -39,14 +41,12 @@ #define JUCE_DISPLAY_SPLASH_SCREEN 1 #endif -#ifndef JUCE_REPORT_APP_USAGE - #define JUCE_REPORT_APP_USAGE 1 -#endif - // END SECTION A #define JUCE_USE_DARK_SPLASH_SCREEN 1 +#define JUCE_PROJUCER_VERSION 0x60100 + //============================================================================== #define JUCE_MODULE_AVAILABLE_juce_audio_basics 1 #define JUCE_MODULE_AVAILABLE_juce_audio_devices 1 @@ -69,6 +69,10 @@ //============================================================================== // juce_audio_devices flags: +#ifndef JUCE_USE_WINRT_MIDI + //#define JUCE_USE_WINRT_MIDI 0 +#endif + #ifndef JUCE_ASIO //#define JUCE_ASIO 0 #endif @@ -77,10 +81,6 @@ //#define JUCE_WASAPI 1 #endif -#ifndef JUCE_WASAPI_EXCLUSIVE - //#define JUCE_WASAPI_EXCLUSIVE 0 -#endif - #ifndef JUCE_DIRECTSOUND //#define JUCE_DIRECTSOUND 1 #endif @@ -98,15 +98,15 @@ #endif #ifndef JUCE_USE_ANDROID_OBOE - //#define JUCE_USE_ANDROID_OBOE 0 + //#define JUCE_USE_ANDROID_OBOE 1 #endif -#ifndef JUCE_USE_ANDROID_OPENSLES - //#define JUCE_USE_ANDROID_OPENSLES 0 +#ifndef JUCE_USE_OBOE_STABILIZED_CALLBACK + //#define JUCE_USE_OBOE_STABILIZED_CALLBACK 0 #endif -#ifndef JUCE_USE_WINRT_MIDI - //#define JUCE_USE_WINRT_MIDI 0 +#ifndef JUCE_USE_ANDROID_OPENSLES + //#define JUCE_USE_ANDROID_OPENSLES 0 #endif #ifndef JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS @@ -139,6 +139,10 @@ //============================================================================== // juce_audio_plugin_client flags: +#ifndef JUCE_VST3_CAN_REPLACE_VST2 + //#define JUCE_VST3_CAN_REPLACE_VST2 1 +#endif + #ifndef JUCE_FORCE_USE_LEGACY_PARAM_IDS //#define JUCE_FORCE_USE_LEGACY_PARAM_IDS 0 #endif @@ -151,6 +155,10 @@ //#define JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS 1 #endif +#ifndef JUCE_AU_WRAPPERS_SAVE_PROGRAM_STATES + //#define JUCE_AU_WRAPPERS_SAVE_PROGRAM_STATES 0 +#endif + #ifndef JUCE_STANDALONE_FILTER_WINDOW_USE_KIOSK_MODE //#define JUCE_STANDALONE_FILTER_WINDOW_USE_KIOSK_MODE 0 #endif @@ -170,6 +178,14 @@ //#define JUCE_PLUGINHOST_AU 0 #endif +#ifndef JUCE_PLUGINHOST_LADSPA + //#define JUCE_PLUGINHOST_LADSPA 0 +#endif + +#ifndef JUCE_CUSTOM_VST3_SDK + //#define JUCE_CUSTOM_VST3_SDK 0 +#endif + //============================================================================== // juce_audio_utils flags: @@ -205,22 +221,34 @@ #endif #ifndef JUCE_USE_CURL - //#define JUCE_USE_CURL 0 + //#define JUCE_USE_CURL 1 +#endif + +#ifndef JUCE_LOAD_CURL_SYMBOLS_LAZILY + //#define JUCE_LOAD_CURL_SYMBOLS_LAZILY 0 #endif #ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 + //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 0 #endif #ifndef JUCE_ALLOW_STATIC_NULL_VARIABLES - //#define JUCE_ALLOW_STATIC_NULL_VARIABLES 1 + //#define JUCE_ALLOW_STATIC_NULL_VARIABLES 0 +#endif + +#ifndef JUCE_STRICT_REFCOUNTEDPOINTER + //#define JUCE_STRICT_REFCOUNTEDPOINTER 0 +#endif + +#ifndef JUCE_ENABLE_ALLOCATION_HOOKS + //#define JUCE_ENABLE_ALLOCATION_HOOKS 0 #endif //============================================================================== // juce_events flags: -#ifndef JUCE_EXECUTE_APP_SUSPEND_ON_IOS_BACKGROUND_TASK - //#define JUCE_EXECUTE_APP_SUSPEND_ON_IOS_BACKGROUND_TASK 0 +#ifndef JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK + //#define JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 0 #endif //============================================================================== @@ -234,6 +262,10 @@ //#define JUCE_USE_DIRECTWRITE 1 #endif +#ifndef JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING + //#define JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 0 +#endif + //============================================================================== // juce_gui_basics flags: @@ -261,6 +293,10 @@ //#define JUCE_USE_XCURSOR 1 #endif +#ifndef JUCE_WIN_PER_MONITOR_DPI_AWARE + //#define JUCE_WIN_PER_MONITOR_DPI_AWARE 1 +#endif + //============================================================================== // juce_gui_extra flags: @@ -268,6 +304,10 @@ //#define JUCE_WEB_BROWSER 1 #endif +#ifndef JUCE_USE_WIN_WEBVIEW2 + //#define JUCE_USE_WIN_WEBVIEW2 0 +#endif + #ifndef JUCE_ENABLE_LIVE_CONSTANT_EDITOR //#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR 0 #endif @@ -278,6 +318,11 @@ #ifndef JUCE_USE_CAMERA //#define JUCE_USE_CAMERA 0 #endif + +#ifndef JUCE_SYNC_VIDEO_VOLUME_WITH_OS_MEDIA_VOLUME + //#define JUCE_SYNC_VIDEO_VOLUME_WITH_OS_MEDIA_VOLUME 1 +#endif + //============================================================================== #ifndef JUCE_STANDALONE_APPLICATION #if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone) @@ -286,145 +331,3 @@ #define JUCE_STANDALONE_APPLICATION 0 #endif #endif - -//============================================================================== -// Audio plugin settings.. - -#ifndef JucePlugin_Build_VST - #define JucePlugin_Build_VST 1 -#endif -#ifndef JucePlugin_Build_VST3 - #define JucePlugin_Build_VST3 0 -#endif -#ifndef JucePlugin_Build_AU - #define JucePlugin_Build_AU 0 -#endif -#ifndef JucePlugin_Build_AUv3 - #define JucePlugin_Build_AUv3 0 -#endif -#ifndef JucePlugin_Build_RTAS - #define JucePlugin_Build_RTAS 0 -#endif -#ifndef JucePlugin_Build_AAX - #define JucePlugin_Build_AAX 0 -#endif -#ifndef JucePlugin_Build_Standalone - #define JucePlugin_Build_Standalone 1 -#endif -#ifndef JucePlugin_Enable_IAA - #define JucePlugin_Enable_IAA 0 -#endif -#ifndef JucePlugin_Name - #define JucePlugin_Name "NeuralWavetable" -#endif -#ifndef JucePlugin_Desc - #define JucePlugin_Desc "NeuralWavetable" -#endif -#ifndef JucePlugin_Manufacturer - #define JucePlugin_Manufacturer "Georgia Tech Center for Music Technology" -#endif -#ifndef JucePlugin_ManufacturerWebsite - #define JucePlugin_ManufacturerWebsite "" -#endif -#ifndef JucePlugin_ManufacturerEmail - #define JucePlugin_ManufacturerEmail "" -#endif -#ifndef JucePlugin_ManufacturerCode - #define JucePlugin_ManufacturerCode 0x4d616e75 // 'Manu' -#endif -#ifndef JucePlugin_PluginCode - #define JucePlugin_PluginCode 0x546b7868 // 'Tkxh' -#endif -#ifndef JucePlugin_IsSynth - #define JucePlugin_IsSynth 0 -#endif -#ifndef JucePlugin_WantsMidiInput - #define JucePlugin_WantsMidiInput 1 -#endif -#ifndef JucePlugin_ProducesMidiOutput - #define JucePlugin_ProducesMidiOutput 1 -#endif -#ifndef JucePlugin_IsMidiEffect - #define JucePlugin_IsMidiEffect 0 -#endif -#ifndef JucePlugin_EditorRequiresKeyboardFocus - #define JucePlugin_EditorRequiresKeyboardFocus 0 -#endif -#ifndef JucePlugin_Version - #define JucePlugin_Version 1.0.0 -#endif -#ifndef JucePlugin_VersionCode - #define JucePlugin_VersionCode 0x10000 -#endif -#ifndef JucePlugin_VersionString - #define JucePlugin_VersionString "1.0.0" -#endif -#ifndef JucePlugin_VSTUniqueID - #define JucePlugin_VSTUniqueID JucePlugin_PluginCode -#endif -#ifndef JucePlugin_VSTCategory - #define JucePlugin_VSTCategory kPlugCategEffect -#endif -#ifndef JucePlugin_Vst3Category - #define JucePlugin_Vst3Category "Fx" -#endif -#ifndef JucePlugin_AUMainType - #define JucePlugin_AUMainType 'aumf' -#endif -#ifndef JucePlugin_AUSubType - #define JucePlugin_AUSubType JucePlugin_PluginCode -#endif -#ifndef JucePlugin_AUExportPrefix - #define JucePlugin_AUExportPrefix NeuralWavetableAU -#endif -#ifndef JucePlugin_AUExportPrefixQuoted - #define JucePlugin_AUExportPrefixQuoted "NeuralWavetableAU" -#endif -#ifndef JucePlugin_AUManufacturerCode - #define JucePlugin_AUManufacturerCode JucePlugin_ManufacturerCode -#endif -#ifndef JucePlugin_CFBundleIdentifier - #define JucePlugin_CFBundleIdentifier com.yourcompany.NeuralWavetable -#endif -#ifndef JucePlugin_RTASCategory - #define JucePlugin_RTASCategory 0 -#endif -#ifndef JucePlugin_RTASManufacturerCode - #define JucePlugin_RTASManufacturerCode JucePlugin_ManufacturerCode -#endif -#ifndef JucePlugin_RTASProductId - #define JucePlugin_RTASProductId JucePlugin_PluginCode -#endif -#ifndef JucePlugin_RTASDisableBypass - #define JucePlugin_RTASDisableBypass 0 -#endif -#ifndef JucePlugin_RTASDisableMultiMono - #define JucePlugin_RTASDisableMultiMono 0 -#endif -#ifndef JucePlugin_AAXIdentifier - #define JucePlugin_AAXIdentifier com.yourcompany.NeuralWavetable -#endif -#ifndef JucePlugin_AAXManufacturerCode - #define JucePlugin_AAXManufacturerCode JucePlugin_ManufacturerCode -#endif -#ifndef JucePlugin_AAXProductId - #define JucePlugin_AAXProductId JucePlugin_PluginCode -#endif -#ifndef JucePlugin_AAXCategory - #define JucePlugin_AAXCategory 0 -#endif -#ifndef JucePlugin_AAXDisableBypass - #define JucePlugin_AAXDisableBypass 0 -#endif -#ifndef JucePlugin_AAXDisableMultiMono - #define JucePlugin_AAXDisableMultiMono 0 -#endif -#ifndef JucePlugin_IAAType - #define JucePlugin_IAAType 0x6175726d // 'aurm' -#endif -#ifndef JucePlugin_IAASubType - #define JucePlugin_IAASubType JucePlugin_PluginCode -#endif -#ifndef JucePlugin_IAAName - #define JucePlugin_IAAName "Georgia Tech Center for Music Technology: NeuralWavetable" -#endif diff --git a/JuceLibraryCode/JuceHeader.h b/JuceLibraryCode/JuceHeader.h index 96cd5b9..f72c83a 100644 --- a/JuceLibraryCode/JuceHeader.h +++ b/JuceLibraryCode/JuceHeader.h @@ -31,6 +31,15 @@ #include +#if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION + /** If you've hit this error then the version of the Projucer that was used to generate this project is + older than the version of the JUCE modules being included. To fix this error, re-save your project + using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, + remove the JUCE_PROJUCER_VERSION define. + */ + #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error." +#endif + #if ! DONT_SET_USING_JUCE_NAMESPACE // If your code uses a lot of JUCE classes, then this will obviously save you // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. @@ -41,6 +50,7 @@ namespace ProjectInfo { const char* const projectName = "NeuralWavetable"; + const char* const companyName = ""; const char* const versionString = "1.0.0"; const int versionNumber = 0x10000; } diff --git a/JuceLibraryCode/JucePluginDefines.h b/JuceLibraryCode/JucePluginDefines.h new file mode 100644 index 0000000..1200908 --- /dev/null +++ b/JuceLibraryCode/JucePluginDefines.h @@ -0,0 +1,159 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#pragma once + +//============================================================================== +// Audio plugin settings.. + +#ifndef JucePlugin_Build_VST + #define JucePlugin_Build_VST 0 +#endif +#ifndef JucePlugin_Build_VST3 + #define JucePlugin_Build_VST3 1 +#endif +#ifndef JucePlugin_Build_AU + #define JucePlugin_Build_AU 1 +#endif +#ifndef JucePlugin_Build_AUv3 + #define JucePlugin_Build_AUv3 0 +#endif +#ifndef JucePlugin_Build_RTAS + #define JucePlugin_Build_RTAS 0 +#endif +#ifndef JucePlugin_Build_AAX + #define JucePlugin_Build_AAX 0 +#endif +#ifndef JucePlugin_Build_Standalone + #define JucePlugin_Build_Standalone 1 +#endif +#ifndef JucePlugin_Build_Unity + #define JucePlugin_Build_Unity 0 +#endif +#ifndef JucePlugin_Enable_IAA + #define JucePlugin_Enable_IAA 0 +#endif +#ifndef JucePlugin_Name + #define JucePlugin_Name "NeuralWavetable" +#endif +#ifndef JucePlugin_Desc + #define JucePlugin_Desc "NeuralWavetable" +#endif +#ifndef JucePlugin_Manufacturer + #define JucePlugin_Manufacturer "Georgia Tech Center for Music Technology" +#endif +#ifndef JucePlugin_ManufacturerWebsite + #define JucePlugin_ManufacturerWebsite "" +#endif +#ifndef JucePlugin_ManufacturerEmail + #define JucePlugin_ManufacturerEmail "" +#endif +#ifndef JucePlugin_ManufacturerCode + #define JucePlugin_ManufacturerCode 0x4d616e75 +#endif +#ifndef JucePlugin_PluginCode + #define JucePlugin_PluginCode 0x58383463 +#endif +#ifndef JucePlugin_IsSynth + #define JucePlugin_IsSynth 0 +#endif +#ifndef JucePlugin_WantsMidiInput + #define JucePlugin_WantsMidiInput 1 +#endif +#ifndef JucePlugin_ProducesMidiOutput + #define JucePlugin_ProducesMidiOutput 1 +#endif +#ifndef JucePlugin_IsMidiEffect + #define JucePlugin_IsMidiEffect 0 +#endif +#ifndef JucePlugin_EditorRequiresKeyboardFocus + #define JucePlugin_EditorRequiresKeyboardFocus 0 +#endif +#ifndef JucePlugin_Version + #define JucePlugin_Version 1.0.0 +#endif +#ifndef JucePlugin_VersionCode + #define JucePlugin_VersionCode 0x10000 +#endif +#ifndef JucePlugin_VersionString + #define JucePlugin_VersionString "1.0.0" +#endif +#ifndef JucePlugin_VSTUniqueID + #define JucePlugin_VSTUniqueID JucePlugin_PluginCode +#endif +#ifndef JucePlugin_VSTCategory + #define JucePlugin_VSTCategory kPlugCategEffect +#endif +#ifndef JucePlugin_Vst3Category + #define JucePlugin_Vst3Category "Fx" +#endif +#ifndef JucePlugin_AUMainType + #define JucePlugin_AUMainType 'aumf' +#endif +#ifndef JucePlugin_AUSubType + #define JucePlugin_AUSubType JucePlugin_PluginCode +#endif +#ifndef JucePlugin_AUExportPrefix + #define JucePlugin_AUExportPrefix NeuralWavetableAU +#endif +#ifndef JucePlugin_AUExportPrefixQuoted + #define JucePlugin_AUExportPrefixQuoted "NeuralWavetableAU" +#endif +#ifndef JucePlugin_AUManufacturerCode + #define JucePlugin_AUManufacturerCode JucePlugin_ManufacturerCode +#endif +#ifndef JucePlugin_CFBundleIdentifier + #define JucePlugin_CFBundleIdentifier com.yourcompany.NeuralWavetable +#endif +#ifndef JucePlugin_RTASCategory + #define JucePlugin_RTASCategory 0 +#endif +#ifndef JucePlugin_RTASManufacturerCode + #define JucePlugin_RTASManufacturerCode JucePlugin_ManufacturerCode +#endif +#ifndef JucePlugin_RTASProductId + #define JucePlugin_RTASProductId JucePlugin_PluginCode +#endif +#ifndef JucePlugin_RTASDisableBypass + #define JucePlugin_RTASDisableBypass 0 +#endif +#ifndef JucePlugin_RTASDisableMultiMono + #define JucePlugin_RTASDisableMultiMono 0 +#endif +#ifndef JucePlugin_AAXIdentifier + #define JucePlugin_AAXIdentifier com.yourcompany.NeuralWavetable +#endif +#ifndef JucePlugin_AAXManufacturerCode + #define JucePlugin_AAXManufacturerCode JucePlugin_ManufacturerCode +#endif +#ifndef JucePlugin_AAXProductId + #define JucePlugin_AAXProductId JucePlugin_PluginCode +#endif +#ifndef JucePlugin_AAXCategory + #define JucePlugin_AAXCategory 0 +#endif +#ifndef JucePlugin_AAXDisableBypass + #define JucePlugin_AAXDisableBypass 0 +#endif +#ifndef JucePlugin_AAXDisableMultiMono + #define JucePlugin_AAXDisableMultiMono 0 +#endif +#ifndef JucePlugin_IAAType + #define JucePlugin_IAAType 0x6175726d +#endif +#ifndef JucePlugin_IAASubType + #define JucePlugin_IAASubType JucePlugin_PluginCode +#endif +#ifndef JucePlugin_IAAName + #define JucePlugin_IAAName "Georgia Tech Center for Music Technology: NeuralWavetable" +#endif +#ifndef JucePlugin_VSTNumMidiInputs + #define JucePlugin_VSTNumMidiInputs 16 +#endif +#ifndef JucePlugin_VSTNumMidiOutputs + #define JucePlugin_VSTNumMidiOutputs 16 +#endif diff --git a/JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp b/JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp new file mode 100644 index 0000000..6552559 --- /dev/null +++ b/JuceLibraryCode/include_juce_audio_plugin_client_Unity.cpp @@ -0,0 +1,9 @@ +/* + + IMPORTANT! This file is auto-generated each time you save your + project - if you alter its contents, your changes may be overwritten! + +*/ + +#include "AppConfig.h" +#include diff --git a/Source/Oscillator.cpp b/Source/Oscillator.cpp index b3665b9..aaeb4b3 100755 --- a/Source/Oscillator.cpp +++ b/Source/Oscillator.cpp @@ -21,7 +21,7 @@ processor(p) oscMenu.setJustificationType(Justification::centred); addAndMakeVisible(&oscMenu); oscMenu.addListener(this); - waveSelection = new AudioProcessorValueTreeState::ComboBoxAttachment(processor.tree, "wavetype", oscMenu); + waveSelection = std::make_unique(processor.tree, "wavetype", oscMenu); } Oscillator::~Oscillator() diff --git a/Source/Oscillator.h b/Source/Oscillator.h index 3761be4..dc91b49 100755 --- a/Source/Oscillator.h +++ b/Source/Oscillator.h @@ -34,7 +34,7 @@ class Oscillator : public Component, public ComboBox::Listener ComboBox oscMenu; - ScopedPointer waveSelection; + std::unique_ptr waveSelection; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Oscillator) diff --git a/Source/Oscillator2.cpp b/Source/Oscillator2.cpp index a34ffdf..737ac8f 100755 --- a/Source/Oscillator2.cpp +++ b/Source/Oscillator2.cpp @@ -23,7 +23,7 @@ processor(p) oscMenu.setJustificationType(Justification::centred); addAndMakeVisible(&oscMenu); oscMenu.addListener(this); - waveSelection = new AudioProcessorValueTreeState::ComboBoxAttachment(processor.tree, "wavetype2", oscMenu); + waveSelection = std::make_unique(processor.tree, "wavetype2", oscMenu); } Oscillator2::~Oscillator2() diff --git a/Source/Oscillator2.h b/Source/Oscillator2.h index 880bd9d..969d911 100755 --- a/Source/Oscillator2.h +++ b/Source/Oscillator2.h @@ -35,7 +35,7 @@ class Oscillator2 : public Component, public ComboBox::Listener ComboBox oscMenu; - ScopedPointer waveSelection; + std::unique_ptr waveSelection; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Oscillator2) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 0cafa67..8a1bcc1 100755 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -49,7 +49,7 @@ NeuralWaveTableAudioProcessorEditor::NeuralWaveTableAudioProcessorEditor (Neural attackSlider.addListener(this); addAndMakeVisible(&attackSlider); - attackTree = new AudioProcessorValueTreeState::SliderAttachment (processor.tree, "attack", attackSlider); // the correct way to interface the slider in editor with processor. + attackTree = std::make_unique (processor.tree, "attack", attackSlider); // the correct way to interface the slider in editor with processor. addAndMakeVisible(&attackLabel); attackLabel.setText("Attack", dontSendNotification); @@ -64,7 +64,7 @@ NeuralWaveTableAudioProcessorEditor::NeuralWaveTableAudioProcessorEditor (Neural releaseSlider.addListener(this); addAndMakeVisible(&releaseSlider); - releaseTree = new AudioProcessorValueTreeState::SliderAttachment (processor.tree, "release", releaseSlider); // the correct way to interface the slider in editor with processor. + releaseTree = std::make_unique (processor.tree, "release", releaseSlider); // the correct way to interface the slider in editor with processor. addAndMakeVisible(&releaseLabel); releaseLabel.setText("Release", dontSendNotification); @@ -79,7 +79,7 @@ NeuralWaveTableAudioProcessorEditor::NeuralWaveTableAudioProcessorEditor (Neural ampSlider.addListener(this); addAndMakeVisible(&Slider); - ampTree = new AudioProcessorValueTreeState::SliderAttachment (processor.tree, "amp", ampSlider); // the correct way to interface the slider in editor with processor. + ampTree = std::make_unique (processor.tree, "amp", ampSlider); // the correct way to interface the slider in editor with processor. addAndMakeVisible(&Label); ampLabel.setText("Amp", dontSendNotification); @@ -93,7 +93,7 @@ NeuralWaveTableAudioProcessorEditor::NeuralWaveTableAudioProcessorEditor (Neural freqCutoffSlider.addListener(this); addAndMakeVisible(&freqCutoffSlider); - freqCutoffTree = new AudioProcessorValueTreeState::SliderAttachment (processor.tree, "cutoff", freqCutoffSlider); // the correct way to interface the slider in editor with processor. + freqCutoffTree = std::make_unique (processor.tree, "cutoff", freqCutoffSlider); // the correct way to interface the slider in editor with processor. addAndMakeVisible(&freqCutoffLabel); freqCutoffLabel.setText("Cutoff", dontSendNotification); @@ -109,7 +109,7 @@ NeuralWaveTableAudioProcessorEditor::NeuralWaveTableAudioProcessorEditor (Neural addAndMakeVisible(&interpolationSlider); interpolationSlider.setVisible(false); - interpolationTree = new AudioProcessorValueTreeState::SliderAttachment (processor.tree, "interpolation", interpolationSlider); // the correct way to interface the slider in editor with processor. + interpolationTree = std::make_unique (processor.tree, "interpolation", interpolationSlider); // the correct way to interface the slider in editor with processor. addAndMakeVisible(&interpolationLabel); interpolationLabel.setVisible(false); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 2278919..77ed33d 100755 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -47,11 +47,11 @@ class NeuralWaveTableAudioProcessorEditor : public AudioProcessorEditor, public int oscW; int oscH; // Create Tree objects: this is JUCE's way of communicating values between `PluginEditor` and `PluginProcessor` - ScopedPointer attackTree; - ScopedPointer releaseTree; - ScopedPointer ampTree; - ScopedPointer freqCutoffTree; - ScopedPointer interpolationTree; + std::unique_ptr attackTree; + std::unique_ptr releaseTree; + std::unique_ptr ampTree; + std::unique_ptr freqCutoffTree; + std::unique_ptr interpolationTree; Slider attackSlider; Slider releaseSlider; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 3d918e5..3a9252e 100755 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -22,32 +22,9 @@ NeuralWaveTableAudioProcessor::NeuralWaveTableAudioProcessor() .withOutput ("Output", AudioChannelSet::stereo(), true) #endif ), -tree (*this, nullptr) +tree (*this, nullptr, "Parameters", createParameters()) #endif { - // >>> For Updating slider changes... a DAW requires everything to be normalized from 0.0 - 1.0 - NormalisableRange attackParam(1.0f, 5000.0f); - NormalisableRange releaseParam(1.0f, 5000.0f); - NormalisableRange ampParam(0.0f, 1.0f); - NormalisableRange freqCutoffParam(0.0f, 1.0f); // I am using a Maximillian lopass object which takes 0.0 - 1.0 as cutoff - - NormalisableRange interpolationParam(0, 100); - - // The tree object is used to communicate values between the `PluginEditor` and the `PluginProcessor` - tree.createAndAddParameter(("attack"), "Attack", "Attack", attackParam, 1.0f, nullptr, nullptr); - tree.createAndAddParameter(("release"), "Release", "Release", releaseParam, 1.0f, nullptr, nullptr); - tree.createAndAddParameter(("amp"), "Amp", "Amp", ampParam, 0.5f, nullptr, nullptr); - tree.createAndAddParameter(("cutoff"), "Cutoff", "Cutoff", freqCutoffParam, 1.0f, nullptr, nullptr); - - tree.createAndAddParameter(("interpolation"), "Interpolation", "Interpolation", interpolationParam, 50.0f, nullptr, nullptr); - - // For the drop down combobox - NormalisableRange wavetypeParam(0,3); // Index in the box is 1-3, but value passing in tree is from 0-2 - NormalisableRange wavetype2Param(0,3); // Index in the box is 1-3, but value passing in tree is from 0-2 - tree.createAndAddParameter("wavetype", "WaveType", "Wavetype", wavetypeParam, 0, nullptr, nullptr); - tree.createAndAddParameter("wavetype2", "WaveType2", "Wavetype2", wavetype2Param, 1, nullptr, nullptr); - - mySynth.clearVoices(); // >>> For Synthesizer // Add synth voices (max number of voices) @@ -67,7 +44,47 @@ NeuralWaveTableAudioProcessor::~NeuralWaveTableAudioProcessor() CPpm::destroyInstance(m_pCPpm); } -//============================================================================== +//============================================================================================= +AudioProcessorValueTreeState::ParameterLayout NeuralWaveTableAudioProcessor::createParameters() +{ + std::vector> parameters; + + // >>> For Updating slider changes... a DAW requires everything to be normalized from 0.0 - 1.0 + NormalisableRange attackParam(1.0f, 5000.0f); + NormalisableRange releaseParam(1.0f, 5000.0f); + NormalisableRange ampParam(0.0f, 1.0f); + NormalisableRange freqCutoffParam(0.0f, 1.0f); // I am using a Maximillian lopass object which takes 0.0 - 1.0 as cutoff + + NormalisableRange interpolationParam(0, 100); + + // Alias for APVTS Parameter type + using Parameter = juce::AudioProcessorValueTreeState::Parameter; + + // The tree object is used to communicate values between the `PluginEditor` and the `PluginProcessor` + parameters.push_back(std::make_unique(("attack"), "Attack", "Attack", attackParam, 1.0f, nullptr, nullptr)); + + parameters.push_back(std::make_unique(("release"), "Release", "Release", releaseParam, 1.0f, nullptr, nullptr)); + + parameters.push_back(std::make_unique(("amp"), "Amp", "Amp", ampParam, 0.5f, nullptr, nullptr)); + + parameters.push_back(std::make_unique(("cutoff"), "Cutoff", "Cutoff", freqCutoffParam, 1.0f, nullptr, nullptr)); + + parameters.push_back(std::make_unique(("interpolation"), "Interpolation", "Interpolation", interpolationParam, 50.0f, nullptr, nullptr)); + + // For the drop down combobox + NormalisableRange wavetypeParam(0,3); // Index in the box is 1-3, but value passing in tree is from 0-2 + NormalisableRange wavetype2Param(0,3); // Index in the box is 1-3, but value passing in tree is from 0-2 + + parameters.push_back(std::make_unique("wavetype", "WaveType", "Wavetype", wavetypeParam, 0, nullptr, nullptr)); + + parameters.push_back(std::make_unique("wavetype2", "WaveType2", "Wavetype2", wavetype2Param, 1, nullptr, nullptr)); + + return { parameters.begin(), parameters.end() }; + +} + +//============================================================================================= + const String NeuralWaveTableAudioProcessor::getName() const { return JucePlugin_Name; @@ -183,7 +200,6 @@ void NeuralWaveTableAudioProcessor::processBlock (AudioBuffer& buffer, Mi // switch between normal and Neural wavetable if (!buttonState) { - myVoice->setOscType(tree.getRawParameterValue("wavetype")); } else{ diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 0073d62..c02ca3e 100755 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -67,6 +67,8 @@ class NeuralWaveTableAudioProcessor : public AudioProcessor int interpolation; AudioProcessorValueTreeState tree; + AudioProcessorValueTreeState::ParameterLayout createParameters(); + //============================================================================== float getVppm(); diff --git a/Source/SynthVoice.h b/Source/SynthVoice.h index 3babe14..64ad8cb 100755 --- a/Source/SynthVoice.h +++ b/Source/SynthVoice.h @@ -1,29 +1,29 @@ -/* - ============================================================================== - - SynthVoice.h - Created: 18 Apr 2018 10:46:12pm - Author: Lamtharn Hantrakul - Edit by: Richard Yang - ============================================================================== -*/ - -#pragma once +/* + ============================================================================== + + SynthVoice.h + Created: 18 Apr 2018 10:46:12pm + Author: Lamtharn Hantrakul + Edit by: Richard Yang + ============================================================================== +*/ + +#pragma once #include "../JuceLibraryCode/JuceHeader.h" #include "SynthSound.h" #include "maximilian.h" -#include "ADSR.h" - -class SynthVoice : public SynthesiserVoice -{ -public: - bool canPlaySound (SynthesiserSound* sound) - { - return dynamic_cast(sound) != nullptr; // cast otherwise leave as nullptr +#include "ADSR.h" + +class SynthVoice : public SynthesiserVoice +{ +public: + bool canPlaySound (SynthesiserSound* sound) + { + return dynamic_cast(sound) != nullptr; // cast otherwise leave as nullptr } //=========================================== - void setParam (float* amp, float* attack, float* release) + void setParam (std::atomic* amp, std::atomic* attack, std::atomic* release) { // dereference the pointers masterAmp = *amp; @@ -34,14 +34,15 @@ class SynthVoice : public SynthesiserVoice env1.setDecay(200); env1.setRelease(double(*release)); } - void setInterpolationFile(float* interpolation) + void setInterpolationFile(std::atomic* interpolation) { osc1.interpolationRead(float(*interpolation), int(iWaveCombination), bool(bInterpolationReversed), bool(bSmooth)); } //=========================================== // For controlling the OSC type - void setOscType(float* selection) +// void setOscType(float* selection) + void setOscType(std::atomic* selection) { theWave = *selection; //dereferenec the selection theMode = 0; @@ -73,7 +74,7 @@ class SynthVoice : public SynthesiserVoice =========================================== */ - void setNeuralOscType(float* selection, float* selection2) + void setNeuralOscType(std::atomic* selection, std::atomic* selection2) { if(*selection ==0) { @@ -149,7 +150,7 @@ class SynthVoice : public SynthesiserVoice //=========================================== // For controlling the Filter Cutoff - void setFilterCutoff(float* cutoff) + void setFilterCutoff(std::atomic* cutoff) { theCutoff = *cutoff; // dereference the cutoff } @@ -183,19 +184,19 @@ class SynthVoice : public SynthesiserVoice currMidiNote = midiNoteNumber; frequency = getCurrentMidiNoteInHertz(currMidiNote, currPitchWheelPosition); } - - - //=========================================== - void stopNote (float velocity, bool allowTailOff) + + + //=========================================== + void stopNote (float velocity, bool allowTailOff) { env1.trigger = 0; allowTailOff = true; if (velocity == 0) { clearCurrentNote(); - } - - } + } + + } //=========================================== void pitchWheelMoved (int newPitchWheelValue) @@ -209,11 +210,11 @@ class SynthVoice : public SynthesiserVoice } - //=========================================== - void renderNextBlock (AudioBuffer< float > &outputBuffer, int startSample, int numSamples) + //=========================================== + void renderNextBlock (AudioBuffer< float > &outputBuffer, int startSample, int numSamples) { // ADSR level is set by `getParam`. - // Add the waveforms to the block + // Add the waveforms to the block for (int sample = 0; sample < numSamples; sample++) { double theSound = env1.adsr(setOscType(), env1.trigger) * level * masterAmp; double filteredSound = filter1.lopass(theSound, setFilterCutoff()); // simple lopass @@ -221,8 +222,8 @@ class SynthVoice : public SynthesiserVoice outputBuffer.addSample(channel, startSample, filteredSound); } ++startSample; - } - } + } + } private: double level; double frequency; @@ -240,5 +241,5 @@ class SynthVoice : public SynthesiserVoice maxiOsc osc1; ADSREnv env1; - maxiFilter filter1; -}; + maxiFilter filter1; +}; diff --git a/WaveNetWaveTable.jucer b/WaveNetWaveTable.jucer index b3165bb..f0e60ee 100644 --- a/WaveNetWaveTable.jucer +++ b/WaveNetWaveTable.jucer @@ -1,11 +1,11 @@ + pluginFormats="buildAU,buildStandalone,buildVST3" pluginCharacteristicsValue="pluginProducesMidiOut,pluginWantsMidiIn" + headerPath="../../Maximilian ../../prerender" buildVST="0" + buildVST3="1" buildAU="1" buildAUv3="0" buildRTAS="0" buildAAX="0" + enableIAA="0" pluginManufacturer="Georgia Tech Center for Music Technology" + id="X84cJZ" displaySplashScreen="1" jucerFormatVersion="1"> @@ -72,25 +72,6 @@ - - - - - - - - - - - - - - - - - - -