2
0
Fork 0
Parameter exposure (AU/iOS AUv3/VST/VST3) for host automation.
iOS Universal build with iPhone support.
Enhanced AUv3 GUI window display fit.
AUv3 GUI scrolling using left and right border sides.
This commit is contained in:
George Reales 2020-09-14 11:02:19 +02:00
parent 7aff1e75ed
commit 03b6d2c2ef
39 changed files with 1201 additions and 4894 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="wUKQiT" name="OPL" projectType="audioplug" version="1.7.0" <JUCERPROJECT id="wUKQiT" name="OPL" projectType="audioplug" version="1.8.0"
bundleIdentifier="com.discodsp.OPL" pluginName="OPL" pluginDesc="Digital sound synthesis chip developed by Yamaha in the mid 1980s" bundleIdentifier="com.discodsp.OPL" pluginName="OPL" pluginDesc="Digital sound synthesis chip developed by Yamaha in the mid 1980s"
pluginManufacturer="discoDSP" pluginManufacturerCode="DDSP" pluginCode="OPL1" pluginManufacturer="discoDSP" pluginManufacturerCode="DDSP" pluginCode="OPL1"
pluginChannelConfigs="{0, 2}" pluginIsSynth="1" pluginWantsMidiIn="1" pluginChannelConfigs="{0, 2}" pluginIsSynth="1" pluginWantsMidiIn="1"
@ -12,11 +12,21 @@
companyName="discoDSP" companyEmail="contactus@discodsp.com" companyName="discoDSP" companyEmail="contactus@discodsp.com"
pluginRTASDisableBypass="0" pluginRTASDisableMultiMono="0" pluginAAXDisableBypass="0" pluginRTASDisableBypass="0" pluginRTASDisableMultiMono="0" pluginAAXDisableBypass="0"
pluginAAXDisableMultiMono="0" pluginAUMainType="'aumu'" pluginVST3Category="Instrument,Synth" pluginAAXDisableMultiMono="0" pluginAUMainType="'aumu'" pluginVST3Category="Instrument,Synth"
pluginVSTCategory="kPlugCategSynth" pluginFormats="buildAU,buildStandalone,buildVST3" pluginVSTCategory="kPlugCategSynth" pluginFormats="buildAU,buildStandalone,buildVST,buildVST3"
buildVST="0" buildVST3="1" buildAU="1" buildAUv3="0" buildRTAS="0" buildVST="1" buildVST3="1" buildAU="1" buildAUv3="0" buildRTAS="0"
buildAAX="0" buildStandalone="1" enableIAA="0"> buildAAX="0" buildStandalone="1" enableIAA="0">
<MAINGROUP id="TOefyq" name="OPL"> <MAINGROUP id="TOefyq" name="OPL">
<GROUP id="{DCA755EB-7953-0641-E719-95C7850E5B2B}" name="Source"> <GROUP id="{DCA755EB-7953-0641-E719-95C7850E5B2B}" name="Source">
<GROUP id="{8A2D4016-5C21-02E2-63A0-70230FA5D74F}" name="iOSPluginEditorWrapper">
<FILE id="UGHvrG" name="iOSPluginEditorWrapper.cpp" compile="1" resource="0"
file="Source/iOSPluginEditorWrapper/iOSPluginEditorWrapper.cpp"/>
<FILE id="WVOOou" name="iOSPluginEditorWrapper.h" compile="0" resource="0"
file="Source/iOSPluginEditorWrapper/iOSPluginEditorWrapper.h"/>
<FILE id="RwYHJa" name="ScrollbarManager.cpp" compile="1" resource="0"
file="Source/iOSPluginEditorWrapper/ScrollbarManager.cpp"/>
<FILE id="Lk4bt4" name="ScrollbarManager.h" compile="0" resource="0"
file="Source/iOSPluginEditorWrapper/ScrollbarManager.h"/>
</GROUP>
<FILE id="aNR5I9" name="icon.png" compile="0" resource="0" file="Media/icon.png"/> <FILE id="aNR5I9" name="icon.png" compile="0" resource="0" file="Media/icon.png"/>
<FILE id="lWChlc" name="icon_ios.png" compile="0" resource="0" file="Media/icon_ios.png"/> <FILE id="lWChlc" name="icon_ios.png" compile="0" resource="0" file="Media/icon_ios.png"/>
<FILE id="AqQcu5" name="ChannelButtonLookAndFeel.cpp" compile="1" resource="0" <FILE id="AqQcu5" name="ChannelButtonLookAndFeel.cpp" compile="1" resource="0"
@ -70,29 +80,31 @@
</GROUP> </GROUP>
</MAINGROUP> </MAINGROUP>
<MODULES> <MODULES>
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_audio_devices" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_audio_devices" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_audio_formats" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_audio_formats" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_audio_plugin_client" showAllCode="1" useLocalCopy="1" <MODULES id="juce_audio_plugin_client" showAllCode="1" useLocalCopy="1"
useGlobalPath="1"/> useGlobalPath="0"/>
<MODULES id="juce_audio_processors" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_audio_processors" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULE id="juce_audio_utils" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULE id="juce_audio_utils" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_core" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_core" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_cryptography" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_cryptography" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_events" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_events" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_opengl" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_opengl" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
<MODULES id="juce_video" showAllCode="1" useLocalCopy="1" useGlobalPath="1"/> <MODULES id="juce_video" showAllCode="1" useLocalCopy="1" useGlobalPath="0"/>
</MODULES> </MODULES>
<JUCEOPTIONS JUCE_QUICKTIME="disabled" JUCE_WEB_BROWSER="0" JUCE_JACK="1"/> <JUCEOPTIONS JUCE_QUICKTIME="disabled" JUCE_WEB_BROWSER="0" JUCE_JACK="1"/>
<EXPORTFORMATS> <EXPORTFORMATS>
<XCODE_IPHONE targetFolder="Builds/iOS" iosScreenOrientation="landscape" iPadScreenOrientation="landscape" <XCODE_IPHONE targetFolder="Builds/iOS" iosScreenOrientation="landscape" iPadScreenOrientation="landscape"
UIStatusBarHidden="1" iosBackgroundAudio="1" iosBackgroundBle="1" UIStatusBarHidden="1" iosBackgroundAudio="1" iosBackgroundBle="1"
iosDeviceFamily="2" smallIcon="lWChlc" bigIcon="lWChlc" iosAppGroupsId="group.com.discodsp.opl" smallIcon="lWChlc" bigIcon="lWChlc" iosAppGroupsId="group.com.discodsp.opl"
extraDefs="JUCE_DISABLE_NATIVE_FILECHOOSERS=1" customXcodeResourceFolders="sbi"> extraDefs="JUCE_DISABLE_NATIVE_FILECHOOSERS=1" customXcodeResourceFolders="sbi"
iCloudPermissions="0" UISupportsDocumentBrowser="0"
UIFileSharingEnabled="0">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" iosCompatibility="11.0"/> <CONFIGURATION isDebug="1" name="Debug" iosCompatibility="11.0"/>
<CONFIGURATION isDebug="0" name="Release" iosCompatibility="11.0"/> <CONFIGURATION isDebug="0" name="Release" iosCompatibility="11.0"/>
@ -115,8 +127,9 @@
<MODULEPATH id="juce_audio_utils" path="modules"/> <MODULEPATH id="juce_audio_utils" path="modules"/>
</MODULEPATHS> </MODULEPATHS>
</XCODE_IPHONE> </XCODE_IPHONE>
<XCODE_MAC targetFolder="Builds/MacOSX" vstLegacyFolder="modules/vstsdk2.4" <XCODE_MAC targetFolder="Builds/MacOSX"
vst3Folder="modules/vstsdk3" smallIcon="aNR5I9" bigIcon="aNR5I9"> vstLegacyFolder="modules/vstsdk2.4" vst3Folder="modules/vstsdk3"
smallIcon="aNR5I9" bigIcon="aNR5I9">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/> <CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/> <CONFIGURATION isDebug="0" name="Release"/>
@ -144,10 +157,11 @@
extraLinkerFlags="-no-pie"> extraLinkerFlags="-no-pie">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION isDebug="0" name="Release" libraryPath="/usr/X11R6/lib/" linuxArchitecture="-m64" <CONFIGURATION isDebug="0" name="Release" libraryPath="/usr/X11R6/lib/" linuxArchitecture="-m64"
headerPath="../../JuceLibraryCode&#10;../../Source&#10;../../Modules/vstsdk2.4&#10;/usr/include/freetype2&#10;/usr/include"/> headerPath="../../JuceLibraryCode&#10;../../Source&#10;../Modules/vstsdk2.4&#10;/usr/include/freetype2&#10;/usr/include"
binaryPath="Bin/Release"/>
<CONFIGURATION isDebug="0" name="Demo" libraryPath="/usr/X11R6/lib/" linuxArchitecture="-m64" <CONFIGURATION isDebug="0" name="Demo" libraryPath="/usr/X11R6/lib/" linuxArchitecture="-m64"
headerPath="../../JuceLibraryCode&#10;../../Source&#10;../../Modules/vstsdk2.4&#10;/usr/include/freetype2&#10;/usr/include" headerPath="../../JuceLibraryCode&#10;../../Source&#10;../Modules/vstsdk2.4&#10;/usr/include/freetype2&#10;/usr/include"
defines="DEMOVERSION=1"/> defines="DEMOVERSION=1" binaryPath="Bin/Demo"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>
<MODULEPATH id="juce_video" path="modules"/> <MODULEPATH id="juce_video" path="modules"/>

0
Source/ChannelButtonLookAndFeel.cpp Normal file → Executable file
View file

0
Source/ChannelButtonLookAndFeel.h Normal file → Executable file
View file

0
Source/EnumFloatParameter.cpp Normal file → Executable file
View file

0
Source/EnumFloatParameter.h Normal file → Executable file
View file

0
Source/FloatParameter.cpp Normal file → Executable file
View file

0
Source/FloatParameter.h Normal file → Executable file
View file

1
Source/InstrumentLoader.h Normal file → Executable file
View file

@ -8,4 +8,5 @@ class InstrumentLoader
public: public:
virtual void loadInstrumentData(int n, const unsigned char* data, AdlibBlasterAudioProcessor *proc) = 0; virtual void loadInstrumentData(int n, const unsigned char* data, AdlibBlasterAudioProcessor *proc) = 0;
virtual String getExtension() = 0; virtual String getExtension() = 0;
virtual ~InstrumentLoader() = default;
}; };

0
Source/IntFloatParameter.cpp Normal file → Executable file
View file

0
Source/IntFloatParameter.h Normal file → Executable file
View file

View file

@ -69,8 +69,8 @@ void PluginGui::updateFromParameters()
fmButton->setToggleState(false, dontSendNotification); fmButton->setToggleState(false, dontSendNotification);
additiveButton->setToggleState(false, dontSendNotification); additiveButton->setToggleState(false, dontSendNotification);
switch (processor->getEnumParameter("Algorithm")) { switch (processor->getEnumParameter("Algorithm")) {
case 0: fmButton->setToggleState(true, dontSendNotification); break; case 0: fmButton->setToggleState(true, dontSendNotification); break;
case 1: additiveButton->setToggleState(true, dontSendNotification); break; case 1: additiveButton->setToggleState(true, dontSendNotification); break;
} }
disablePercussionButton->setToggleState(false, dontSendNotification); disablePercussionButton->setToggleState(false, dontSendNotification);
@ -80,12 +80,12 @@ void PluginGui::updateFromParameters()
cymbalButton->setToggleState(false, dontSendNotification); cymbalButton->setToggleState(false, dontSendNotification);
hiHatButton->setToggleState(false, dontSendNotification); hiHatButton->setToggleState(false, dontSendNotification);
switch (processor->getEnumParameter("Percussion Mode")) { switch (processor->getEnumParameter("Percussion Mode")) {
case 0: disablePercussionButton->setToggleState(true, dontSendNotification); break; case 0: disablePercussionButton->setToggleState(true, dontSendNotification); break;
case 1: bassDrumButton->setToggleState(true, dontSendNotification); break; case 1: bassDrumButton->setToggleState(true, dontSendNotification); break;
case 2: snareDrumButton->setToggleState(true, dontSendNotification); break; case 2: snareDrumButton->setToggleState(true, dontSendNotification); break;
case 3: tomTomButton->setToggleState(true, dontSendNotification); break; case 3: tomTomButton->setToggleState(true, dontSendNotification); break;
case 4: cymbalButton->setToggleState(true, dontSendNotification); break; case 4: cymbalButton->setToggleState(true, dontSendNotification); break;
case 5: hiHatButton->setToggleState(true, dontSendNotification); break; case 5: hiHatButton->setToggleState(true, dontSendNotification); break;
} }
frequencyComboBox->setSelectedItemIndex ( frequencyComboBox->setSelectedItemIndex (
@ -2446,7 +2446,9 @@ void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
//[UserComboBoxCode_frequencyComboBox] -- add your combo box handling code here.. //[UserComboBoxCode_frequencyComboBox] -- add your combo box handling code here..
int id = comboBoxThatHasChanged->getSelectedId(); int id = comboBoxThatHasChanged->getSelectedId();
if (id > 15) id = 0; if (id > 15) id = 0;
processor->beginChangeGesture("Modulator Frequency Multiplier");
processor->setEnumParameter("Modulator Frequency Multiplier", id); processor->setEnumParameter("Modulator Frequency Multiplier", id);
processor->endChangeGesture("Modulator Frequency Multiplier");
//[/UserComboBoxCode_frequencyComboBox] //[/UserComboBoxCode_frequencyComboBox]
} }
else if (comboBoxThatHasChanged == frequencyComboBox2.get()) else if (comboBoxThatHasChanged == frequencyComboBox2.get())
@ -2454,35 +2456,45 @@ void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
//[UserComboBoxCode_frequencyComboBox2] -- add your combo box handling code here.. //[UserComboBoxCode_frequencyComboBox2] -- add your combo box handling code here..
int id = comboBoxThatHasChanged->getSelectedId(); int id = comboBoxThatHasChanged->getSelectedId();
if (id > 15) id = 0; if (id > 15) id = 0;
processor->beginChangeGesture("Carrier Frequency Multiplier");
processor->setEnumParameter("Carrier Frequency Multiplier", id); processor->setEnumParameter("Carrier Frequency Multiplier", id);
processor->endChangeGesture("Carrier Frequency Multiplier");
//[/UserComboBoxCode_frequencyComboBox2] //[/UserComboBoxCode_frequencyComboBox2]
} }
else if (comboBoxThatHasChanged == velocityComboBox.get()) else if (comboBoxThatHasChanged == velocityComboBox.get())
{ {
//[UserComboBoxCode_velocityComboBox] -- add your combo box handling code here.. //[UserComboBoxCode_velocityComboBox] -- add your combo box handling code here..
int id = comboBoxThatHasChanged->getSelectedId() - 1; int id = comboBoxThatHasChanged->getSelectedId() - 1;
processor->beginChangeGesture("Modulator Velocity Sensitivity");
processor->setEnumParameter("Modulator Velocity Sensitivity", id); processor->setEnumParameter("Modulator Velocity Sensitivity", id);
processor->endChangeGesture("Modulator Velocity Sensitivity");
//[/UserComboBoxCode_velocityComboBox] //[/UserComboBoxCode_velocityComboBox]
} }
else if (comboBoxThatHasChanged == velocityComboBox2.get()) else if (comboBoxThatHasChanged == velocityComboBox2.get())
{ {
//[UserComboBoxCode_velocityComboBox2] -- add your combo box handling code here.. //[UserComboBoxCode_velocityComboBox2] -- add your combo box handling code here..
int id = comboBoxThatHasChanged->getSelectedId() - 1; int id = comboBoxThatHasChanged->getSelectedId() - 1;
processor->beginChangeGesture("Carrier Velocity Sensitivity");
processor->setEnumParameter("Carrier Velocity Sensitivity", id); processor->setEnumParameter("Carrier Velocity Sensitivity", id);
processor->endChangeGesture("Carrier Velocity Sensitivity");
//[/UserComboBoxCode_velocityComboBox2] //[/UserComboBoxCode_velocityComboBox2]
} }
else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox2.get()) else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox2.get())
{ {
//[UserComboBoxCode_keyscaleAttenuationComboBox2] -- add your combo box handling code here.. //[UserComboBoxCode_keyscaleAttenuationComboBox2] -- add your combo box handling code here..
int id = comboBoxThatHasChanged->getSelectedId() - 1; int id = comboBoxThatHasChanged->getSelectedId() - 1;
processor->beginChangeGesture("Carrier Keyscale Level");
processor->setEnumParameter("Carrier Keyscale Level", id); processor->setEnumParameter("Carrier Keyscale Level", id);
processor->endChangeGesture("Carrier Keyscale Level");
//[/UserComboBoxCode_keyscaleAttenuationComboBox2] //[/UserComboBoxCode_keyscaleAttenuationComboBox2]
} }
else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox.get()) else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox.get())
{ {
//[UserComboBoxCode_keyscaleAttenuationComboBox] -- add your combo box handling code here.. //[UserComboBoxCode_keyscaleAttenuationComboBox] -- add your combo box handling code here..
int id = comboBoxThatHasChanged->getSelectedId() - 1; int id = comboBoxThatHasChanged->getSelectedId() - 1;
processor->beginChangeGesture("Modulator Keyscale Level");
processor->setEnumParameter("Modulator Keyscale Level", id); processor->setEnumParameter("Modulator Keyscale Level", id);
processor->endChangeGesture("Modulator Keyscale Level");
//[/UserComboBoxCode_keyscaleAttenuationComboBox] //[/UserComboBoxCode_keyscaleAttenuationComboBox]
} }
@ -2608,145 +2620,241 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked)
if (buttonThatWasClicked == sineImageButton.get()) if (buttonThatWasClicked == sineImageButton.get())
{ {
//[UserButtonCode_sineImageButton] -- add your button handler code here.. //[UserButtonCode_sineImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 0); processor->setEnumParameter("Modulator Wave", 0);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_sineImageButton] //[/UserButtonCode_sineImageButton]
} }
else if (buttonThatWasClicked == halfsineImageButton.get()) else if (buttonThatWasClicked == halfsineImageButton.get())
{ {
//[UserButtonCode_halfsineImageButton] -- add your button handler code here.. //[UserButtonCode_halfsineImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 1); processor->setEnumParameter("Modulator Wave", 1);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_halfsineImageButton] //[/UserButtonCode_halfsineImageButton]
} }
else if (buttonThatWasClicked == abssineImageButton.get()) else if (buttonThatWasClicked == abssineImageButton.get())
{ {
//[UserButtonCode_abssineImageButton] -- add your button handler code here.. //[UserButtonCode_abssineImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 2); processor->setEnumParameter("Modulator Wave", 2);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_abssineImageButton] //[/UserButtonCode_abssineImageButton]
} }
else if (buttonThatWasClicked == quartersineImageButton.get()) else if (buttonThatWasClicked == quartersineImageButton.get())
{ {
//[UserButtonCode_quartersineImageButton] -- add your button handler code here.. //[UserButtonCode_quartersineImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 3); processor->setEnumParameter("Modulator Wave", 3);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_quartersineImageButton] //[/UserButtonCode_quartersineImageButton]
} }
else if (buttonThatWasClicked == tremoloButton.get()) else if (buttonThatWasClicked == tremoloButton.get())
{ {
//[UserButtonCode_tremoloButton] -- add your button handler code here.. //[UserButtonCode_tremoloButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Tremolo");
processor->setEnumParameter("Modulator Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Modulator Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Modulator Tremolo");
updateFromHost=true;
//[/UserButtonCode_tremoloButton] //[/UserButtonCode_tremoloButton]
} }
else if (buttonThatWasClicked == vibratoButton.get()) else if (buttonThatWasClicked == vibratoButton.get())
{ {
//[UserButtonCode_vibratoButton] -- add your button handler code here.. //[UserButtonCode_vibratoButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Vibrato");
processor->setEnumParameter("Modulator Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Modulator Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Modulator Vibrato");
updateFromHost=true;
//[/UserButtonCode_vibratoButton] //[/UserButtonCode_vibratoButton]
} }
else if (buttonThatWasClicked == sustainButton.get()) else if (buttonThatWasClicked == sustainButton.get())
{ {
//[UserButtonCode_sustainButton] -- add your button handler code here.. //[UserButtonCode_sustainButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Sustain");
processor->setEnumParameter("Modulator Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Modulator Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Modulator Sustain");
updateFromHost=true;
//[/UserButtonCode_sustainButton] //[/UserButtonCode_sustainButton]
} }
else if (buttonThatWasClicked == keyscaleEnvButton.get()) else if (buttonThatWasClicked == keyscaleEnvButton.get())
{ {
//[UserButtonCode_keyscaleEnvButton] -- add your button handler code here.. //[UserButtonCode_keyscaleEnvButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Keyscale Rate");
processor->setEnumParameter("Modulator Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Modulator Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Modulator Keyscale Rate");
updateFromHost=true;
//[/UserButtonCode_keyscaleEnvButton] //[/UserButtonCode_keyscaleEnvButton]
} }
else if (buttonThatWasClicked == sineImageButton2.get()) else if (buttonThatWasClicked == sineImageButton2.get())
{ {
//[UserButtonCode_sineImageButton2] -- add your button handler code here.. //[UserButtonCode_sineImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 0); processor->setEnumParameter("Carrier Wave", 0);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_sineImageButton2] //[/UserButtonCode_sineImageButton2]
} }
else if (buttonThatWasClicked == halfsineImageButton2.get()) else if (buttonThatWasClicked == halfsineImageButton2.get())
{ {
//[UserButtonCode_halfsineImageButton2] -- add your button handler code here.. //[UserButtonCode_halfsineImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 1); processor->setEnumParameter("Carrier Wave", 1);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_halfsineImageButton2] //[/UserButtonCode_halfsineImageButton2]
} }
else if (buttonThatWasClicked == abssineImageButton2.get()) else if (buttonThatWasClicked == abssineImageButton2.get())
{ {
//[UserButtonCode_abssineImageButton2] -- add your button handler code here.. //[UserButtonCode_abssineImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 2); processor->setEnumParameter("Carrier Wave", 2);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_abssineImageButton2] //[/UserButtonCode_abssineImageButton2]
} }
else if (buttonThatWasClicked == quartersineImageButton2.get()) else if (buttonThatWasClicked == quartersineImageButton2.get())
{ {
//[UserButtonCode_quartersineImageButton2] -- add your button handler code here.. //[UserButtonCode_quartersineImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 3); processor->setEnumParameter("Carrier Wave", 3);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_quartersineImageButton2] //[/UserButtonCode_quartersineImageButton2]
} }
else if (buttonThatWasClicked == tremoloButton2.get()) else if (buttonThatWasClicked == tremoloButton2.get())
{ {
//[UserButtonCode_tremoloButton2] -- add your button handler code here.. //[UserButtonCode_tremoloButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Tremolo");
processor->setEnumParameter("Carrier Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Carrier Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Carrier Tremolo");
updateFromHost=true;
//[/UserButtonCode_tremoloButton2] //[/UserButtonCode_tremoloButton2]
} }
else if (buttonThatWasClicked == vibratoButton2.get()) else if (buttonThatWasClicked == vibratoButton2.get())
{ {
//[UserButtonCode_vibratoButton2] -- add your button handler code here.. //[UserButtonCode_vibratoButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Vibrato");
processor->setEnumParameter("Carrier Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Carrier Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Carrier Vibrato");
updateFromHost=true;
//[/UserButtonCode_vibratoButton2] //[/UserButtonCode_vibratoButton2]
} }
else if (buttonThatWasClicked == sustainButton2.get()) else if (buttonThatWasClicked == sustainButton2.get())
{ {
//[UserButtonCode_sustainButton2] -- add your button handler code here.. //[UserButtonCode_sustainButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Sustain");
processor->setEnumParameter("Carrier Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Carrier Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Carrier Sustain");
updateFromHost=true;
//[/UserButtonCode_sustainButton2] //[/UserButtonCode_sustainButton2]
} }
else if (buttonThatWasClicked == keyscaleEnvButton2.get()) else if (buttonThatWasClicked == keyscaleEnvButton2.get())
{ {
//[UserButtonCode_keyscaleEnvButton2] -- add your button handler code here.. //[UserButtonCode_keyscaleEnvButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Keyscale Rate");
processor->setEnumParameter("Carrier Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); processor->setEnumParameter("Carrier Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0);
processor->endChangeGesture("Carrier Keyscale Rate");
updateFromHost=true;
//[/UserButtonCode_keyscaleEnvButton2] //[/UserButtonCode_keyscaleEnvButton2]
} }
else if (buttonThatWasClicked == alternatingsineImageButton.get()) else if (buttonThatWasClicked == alternatingsineImageButton.get())
{ {
//[UserButtonCode_alternatingsineImageButton] -- add your button handler code here.. //[UserButtonCode_alternatingsineImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 4); processor->setEnumParameter("Modulator Wave", 4);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_alternatingsineImageButton] //[/UserButtonCode_alternatingsineImageButton]
} }
else if (buttonThatWasClicked == camelsineImageButton.get()) else if (buttonThatWasClicked == camelsineImageButton.get())
{ {
//[UserButtonCode_camelsineImageButton] -- add your button handler code here.. //[UserButtonCode_camelsineImageButton] -- add your button handler code here..
processor->setEnumParameter("Modulator Wave", 5); updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 5);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_camelsineImageButton] //[/UserButtonCode_camelsineImageButton]
} }
else if (buttonThatWasClicked == squareImageButton.get()) else if (buttonThatWasClicked == squareImageButton.get())
{ {
//[UserButtonCode_squareImageButton] -- add your button handler code here.. //[UserButtonCode_squareImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 6); processor->setEnumParameter("Modulator Wave", 6);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_squareImageButton] //[/UserButtonCode_squareImageButton]
} }
else if (buttonThatWasClicked == logsawImageButton.get()) else if (buttonThatWasClicked == logsawImageButton.get())
{ {
//[UserButtonCode_logsawImageButton] -- add your button handler code here.. //[UserButtonCode_logsawImageButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Modulator Wave");
processor->setEnumParameter("Modulator Wave", 7); processor->setEnumParameter("Modulator Wave", 7);
processor->endChangeGesture("Modulator Wave");
updateFromHost=true;
//[/UserButtonCode_logsawImageButton] //[/UserButtonCode_logsawImageButton]
} }
else if (buttonThatWasClicked == alternatingsineImageButton2.get()) else if (buttonThatWasClicked == alternatingsineImageButton2.get())
{ {
//[UserButtonCode_alternatingsineImageButton2] -- add your button handler code here.. //[UserButtonCode_alternatingsineImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 4); processor->setEnumParameter("Carrier Wave", 4);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_alternatingsineImageButton2] //[/UserButtonCode_alternatingsineImageButton2]
} }
else if (buttonThatWasClicked == camelsineImageButton2.get()) else if (buttonThatWasClicked == camelsineImageButton2.get())
{ {
//[UserButtonCode_camelsineImageButton2] -- add your button handler code here.. //[UserButtonCode_camelsineImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 5); processor->setEnumParameter("Carrier Wave", 5);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_camelsineImageButton2] //[/UserButtonCode_camelsineImageButton2]
} }
else if (buttonThatWasClicked == squareImageButton2.get()) else if (buttonThatWasClicked == squareImageButton2.get())
{ {
//[UserButtonCode_squareImageButton2] -- add your button handler code here.. //[UserButtonCode_squareImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 6); processor->setEnumParameter("Carrier Wave", 6);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_squareImageButton2] //[/UserButtonCode_squareImageButton2]
} }
else if (buttonThatWasClicked == logsawImageButton2.get()) else if (buttonThatWasClicked == logsawImageButton2.get())
{ {
//[UserButtonCode_logsawImageButton2] -- add your button handler code here.. //[UserButtonCode_logsawImageButton2] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Carrier Wave");
processor->setEnumParameter("Carrier Wave", 7); processor->setEnumParameter("Carrier Wave", 7);
processor->endChangeGesture("Carrier Wave");
updateFromHost=true;
//[/UserButtonCode_logsawImageButton2] //[/UserButtonCode_logsawImageButton2]
} }
else if (buttonThatWasClicked == recordButton.get()) else if (buttonThatWasClicked == recordButton.get())
@ -2917,49 +3025,81 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked)
else if (buttonThatWasClicked == fmButton.get()) else if (buttonThatWasClicked == fmButton.get())
{ {
//[UserButtonCode_fmButton] -- add your button handler code here.. //[UserButtonCode_fmButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Algorithm");
processor->setEnumParameter("Algorithm", 0); processor->setEnumParameter("Algorithm", 0);
processor->endChangeGesture("Algorithm");
updateFromHost=true;
//[/UserButtonCode_fmButton] //[/UserButtonCode_fmButton]
} }
else if (buttonThatWasClicked == additiveButton.get()) else if (buttonThatWasClicked == additiveButton.get())
{ {
//[UserButtonCode_additiveButton] -- add your button handler code here.. //[UserButtonCode_additiveButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Algorithm");
processor->setEnumParameter("Algorithm", 1); processor->setEnumParameter("Algorithm", 1);
processor->endChangeGesture("Algorithm");
updateFromHost=true;
//[/UserButtonCode_additiveButton] //[/UserButtonCode_additiveButton]
} }
else if (buttonThatWasClicked == bassDrumButton.get()) else if (buttonThatWasClicked == bassDrumButton.get())
{ {
//[UserButtonCode_bassDrumButton] -- add your button handler code here.. //[UserButtonCode_bassDrumButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Percussion Mode");
processor->setEnumParameter("Percussion Mode", 1); processor->setEnumParameter("Percussion Mode", 1);
processor->endChangeGesture("Percussion Mode");
updateFromHost=true;
//[/UserButtonCode_bassDrumButton] //[/UserButtonCode_bassDrumButton]
} }
else if (buttonThatWasClicked == snareDrumButton.get()) else if (buttonThatWasClicked == snareDrumButton.get())
{ {
//[UserButtonCode_snareDrumButton] -- add your button handler code here.. //[UserButtonCode_snareDrumButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Percussion Mode");
processor->setEnumParameter("Percussion Mode", 2); processor->setEnumParameter("Percussion Mode", 2);
processor->endChangeGesture("Percussion Mode");
updateFromHost=true;
//[/UserButtonCode_snareDrumButton] //[/UserButtonCode_snareDrumButton]
} }
else if (buttonThatWasClicked == disablePercussionButton.get()) else if (buttonThatWasClicked == disablePercussionButton.get())
{ {
//[UserButtonCode_disablePercussionButton] -- add your button handler code here.. //[UserButtonCode_disablePercussionButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Percussion Mode");
processor->setEnumParameter("Percussion Mode", 0); processor->setEnumParameter("Percussion Mode", 0);
processor->endChangeGesture("Percussion Mode");
updateFromHost=true;
//[/UserButtonCode_disablePercussionButton] //[/UserButtonCode_disablePercussionButton]
} }
else if (buttonThatWasClicked == tomTomButton.get()) else if (buttonThatWasClicked == tomTomButton.get())
{ {
//[UserButtonCode_tomTomButton] -- add your button handler code here.. //[UserButtonCode_tomTomButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Percussion Mode");
processor->setEnumParameter("Percussion Mode", 3); processor->setEnumParameter("Percussion Mode", 3);
processor->endChangeGesture("Percussion Mode");
updateFromHost=true;
//[/UserButtonCode_tomTomButton] //[/UserButtonCode_tomTomButton]
} }
else if (buttonThatWasClicked == cymbalButton.get()) else if (buttonThatWasClicked == cymbalButton.get())
{ {
//[UserButtonCode_cymbalButton] -- add your button handler code here.. //[UserButtonCode_cymbalButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Percussion Mode");
processor->setEnumParameter("Percussion Mode", 4); processor->setEnumParameter("Percussion Mode", 4);
processor->endChangeGesture("Percussion Mode");
updateFromHost=true;
//[/UserButtonCode_cymbalButton] //[/UserButtonCode_cymbalButton]
} }
else if (buttonThatWasClicked == hiHatButton.get()) else if (buttonThatWasClicked == hiHatButton.get())
{ {
//[UserButtonCode_hiHatButton] -- add your button handler code here.. //[UserButtonCode_hiHatButton] -- add your button handler code here..
updateFromHost=false;
processor->beginChangeGesture("Percussion Mode");
processor->setEnumParameter("Percussion Mode", 5); processor->setEnumParameter("Percussion Mode", 5);
processor->endChangeGesture("Percussion Mode");
updateFromHost=true;
//[/UserButtonCode_hiHatButton] //[/UserButtonCode_hiHatButton]
} }
else if (buttonThatWasClicked == previousButton.get()) else if (buttonThatWasClicked == previousButton.get())
@ -2982,6 +3122,193 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked)
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void PluginGui::sliderDragStarted (Slider* sliderThatWasMoved) {
//[UsersliderValueChanged_Pre]
DBG("Slider -> Start");
updateFromHost=false;
//[/UsersliderValueChanged_Pre]
if (sliderThatWasMoved == aSlider.get())
{
//[UserSliderCode_aSlider] -- add your slider handling code here..
processor->beginChangeGesture("Modulator Attack");
//[/UserSliderCode_aSlider]
}
else if (sliderThatWasMoved == dSlider.get())
{
//[UserSliderCode_dSlider] -- add your slider handling code here..
processor->beginChangeGesture("Modulator Decay");
//[/UserSliderCode_dSlider]
}
else if (sliderThatWasMoved == sSlider.get())
{
//[UserSliderCode_sSlider] -- add your slider handling code here..
processor->beginChangeGesture("Modulator Sustain Level");
//[/UserSliderCode_sSlider]
}
else if (sliderThatWasMoved == rSlider.get())
{
//[UserSliderCode_rSlider] -- add your slider handling code here..
processor->beginChangeGesture("Modulator Release");
//[/UserSliderCode_rSlider]
}
else if (sliderThatWasMoved == attenuationSlider.get())
{
//[UserSliderCode_attenuationSlider] -- add your slider handling code here..
processor->beginChangeGesture("Modulator Attenuation");
//[/UserSliderCode_attenuationSlider]
}
else if (sliderThatWasMoved == aSlider2.get())
{
//[UserSliderCode_aSlider2] -- add your slider handling code here..
processor->beginChangeGesture("Carrier Attack");
//[/UserSliderCode_aSlider2]
}
else if (sliderThatWasMoved == dSlider2.get())
{
//[UserSliderCode_dSlider2] -- add your slider handling code here..
processor->beginChangeGesture("Carrier Decay");
//[/UserSliderCode_dSlider2]
}
else if (sliderThatWasMoved == sSlider2.get())
{
//[UserSliderCode_sSlider2] -- add your slider handling code here..
processor->beginChangeGesture("Carrier Sustain Level");
//[/UserSliderCode_sSlider2]
}
else if (sliderThatWasMoved == rSlider2.get())
{
//[UserSliderCode_rSlider2] -- add your slider handling code here..
processor->beginChangeGesture("Carrier Release");
//[/UserSliderCode_rSlider2]
}
else if (sliderThatWasMoved == attenuationSlider2.get())
{
//[UserSliderCode_attenuationSlider2] -- add your slider handling code here..
processor->beginChangeGesture("Carrier Attenuation");
//[/UserSliderCode_attenuationSlider2]
}
else if (sliderThatWasMoved == tremoloSlider.get())
{
//[UserSliderCode_tremoloSlider] -- add your slider handling code here..
processor->beginChangeGesture("Tremolo Depth");
//[/UserSliderCode_tremoloSlider]
}
else if (sliderThatWasMoved == vibratoSlider.get())
{
//[UserSliderCode_vibratoSlider] -- add your slider handling code here..
processor->beginChangeGesture("Vibrato Depth");
//[/UserSliderCode_vibratoSlider]
}
else if (sliderThatWasMoved == feedbackSlider.get())
{
//[UserSliderCode_feedbackSlider] -- add your slider handling code here..
processor->beginChangeGesture("Modulator Feedback");
//[/UserSliderCode_feedbackSlider]
}
else if (sliderThatWasMoved == emulatorSlider.get())
{
//[UserSliderCode_emulatorSlider] -- add your slider handling code here..
//[/UserSliderCode_emulatorSlider]
}
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
}
void PluginGui::sliderDragEnded (Slider* sliderThatWasMoved) {
//[UsersliderValueChanged_Pre]
//[/UsersliderValueChanged_Pre]
if (sliderThatWasMoved == aSlider.get())
{
//[UserSliderCode_aSlider] -- add your slider handling code here..
processor->endChangeGesture("Modulator Attack");
//[/UserSliderCode_aSlider]
}
else if (sliderThatWasMoved == dSlider.get())
{
//[UserSliderCode_dSlider] -- add your slider handling code here..
processor->endChangeGesture("Modulator Decay");
//[/UserSliderCode_dSlider]
}
else if (sliderThatWasMoved == sSlider.get())
{
//[UserSliderCode_sSlider] -- add your slider handling code here..
processor->endChangeGesture("Modulator Sustain Level");
//[/UserSliderCode_sSlider]
}
else if (sliderThatWasMoved == rSlider.get())
{
//[UserSliderCode_rSlider] -- add your slider handling code here..
processor->endChangeGesture("Modulator Release");
//[/UserSliderCode_rSlider]
}
else if (sliderThatWasMoved == attenuationSlider.get())
{
//[UserSliderCode_attenuationSlider] -- add your slider handling code here..
processor->endChangeGesture("Modulator Attenuation");
//[/UserSliderCode_attenuationSlider]
}
else if (sliderThatWasMoved == aSlider2.get())
{
//[UserSliderCode_aSlider2] -- add your slider handling code here..
processor->endChangeGesture("Carrier Attack");
//[/UserSliderCode_aSlider2]
}
else if (sliderThatWasMoved == dSlider2.get())
{
//[UserSliderCode_dSlider2] -- add your slider handling code here..
processor->endChangeGesture("Carrier Decay");
//[/UserSliderCode_dSlider2]
}
else if (sliderThatWasMoved == sSlider2.get())
{
//[UserSliderCode_sSlider2] -- add your slider handling code here..
processor->endChangeGesture("Carrier Sustain Level");
//[/UserSliderCode_sSlider2]
}
else if (sliderThatWasMoved == rSlider2.get())
{
//[UserSliderCode_rSlider2] -- add your slider handling code here..
processor->endChangeGesture("Carrier Release");
//[/UserSliderCode_rSlider2]
}
else if (sliderThatWasMoved == attenuationSlider2.get())
{
//[UserSliderCode_attenuationSlider2] -- add your slider handling code here..
processor->endChangeGesture("Carrier Attenuation");
//[/UserSliderCode_attenuationSlider2]
}
else if (sliderThatWasMoved == tremoloSlider.get())
{
//[UserSliderCode_tremoloSlider] -- add your slider handling code here..
processor->endChangeGesture("Tremolo Depth");
//[/UserSliderCode_tremoloSlider]
}
else if (sliderThatWasMoved == vibratoSlider.get())
{
//[UserSliderCode_vibratoSlider] -- add your slider handling code here..
processor->endChangeGesture("Vibrato Depth");
//[/UserSliderCode_vibratoSlider]
}
else if (sliderThatWasMoved == feedbackSlider.get())
{
//[UserSliderCode_feedbackSlider] -- add your slider handling code here..
processor->endChangeGesture("Modulator Feedback");
//[/UserSliderCode_feedbackSlider]
}
else if (sliderThatWasMoved == emulatorSlider.get())
{
//[UserSliderCode_emulatorSlider] -- add your slider handling code here..
//[/UserSliderCode_emulatorSlider]
}
//[UsersliderValueChanged_Post]
updateFromHost=true;
DBG("Slider -> End");
//[/UsersliderValueChanged_Post]
}
//============================================================================== //==============================================================================
// These methods implement the FileDragAndDropTarget interface, and allow our component // These methods implement the FileDragAndDropTarget interface, and allow our component
// to accept drag-and-drop of files.. // to accept drag-and-drop of files..
@ -3019,6 +3346,7 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked)
for (int i = 0; i < Hiopl::CHANNELS; ++i) { for (int i = 0; i < Hiopl::CHANNELS; ++i) {
channels[i]->setButtonText(processor->getChannelEnvelopeStage(i + 1)); channels[i]->setButtonText(processor->getChannelEnvelopeStage(i + 1));
} }
syncGUI();
} }
void PluginGui::loadPreNextFile(bool pre){ void PluginGui::loadPreNextFile(bool pre){
if (pre){ if (pre){
@ -3102,46 +3430,53 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked)
bool hasFile = false; bool hasFile = false;
instrumentLoadDirectory.findChildFiles(dirs, File::findDirectories, false); instrumentLoadDirectory.findChildFiles(dirs, File::findDirectories, false);
dirs.sort(); dirs.sort();
for (auto dir: dirs){ for (auto dir: dirs)
{
Array<File> files; Array<File> files;
dir.findChildFiles (files, File::findFiles, false, "*.sbi"); dir.findChildFiles (files, File::findFiles, false, "*.sbi");
files.sort(); files.sort();
if (files.size() > 0){ if (files.size() > 0)
{
bool selectedSub = false; bool selectedSub = false;
PopupMenu subMenu; PopupMenu subMenu;
for (auto file : files){ for (auto file : files)
{
allSbiFiles.add(file); allSbiFiles.add(file);
hasFile = true; hasFile = true;
if (processor->lastLoadFile == file.getFullPathName()){ if (processor->lastLoadFile == file.getFullPathName())
{
selectedSub = true; selectedSub = true;
subMenu.addItem(allSbiFiles.size(), file.getFileNameWithoutExtension(), true, true); subMenu.addItem(allSbiFiles.size(), file.getFileNameWithoutExtension(), true, true);
} else {
subMenu.addItem(allSbiFiles.size(), file.getFileNameWithoutExtension());
} }
else
subMenu.addItem(allSbiFiles.size(), file.getFileNameWithoutExtension());
} }
if(selectedSub){ if(selectedSub)
menuLoad.addSubMenu (std::move (dir.getFileName()), std::move (subMenu), true, nullptr, true, 0); menuLoad.addSubMenu (dir.getFileName(), std::move (subMenu), true, nullptr, true, 0);
} else
else{
menuLoad.addSubMenu(dir.getFileName(), subMenu); menuLoad.addSubMenu(dir.getFileName(), subMenu);
}
} }
} }
if(hasFile){ if(hasFile)
{
//int id = menuLoad.show(); //int id = menuLoad.show();
menuLoad.showMenuAsync (PopupMenu::Options().withParentComponent (this->getTopLevelComponent()), [this](int id){ menuLoad.showMenuAsync (PopupMenu::Options().withParentComponent (this->getTopLevelComponent()), [this](int id)
if (id > 0) { {
processor->selectedIdxFile = id -1; if (id > 0)
if (this->allSbiFiles[processor->selectedIdxFile].existsAsFile()){ {
this->loadandUpdateInstrument(allSbiFiles[processor->selectedIdxFile].getFullPathName()); auto fileId = id - 1;
} else { processor->selectedIdxFile = fileId;
this->loadBrowserFile(); auto sbiFile = this->allSbiFiles[fileId];
}
if (sbiFile.existsAsFile())
this->loadandUpdateInstrument(sbiFile.getFullPathName());
else
this->loadBrowserFile();
} }
// No select, return true to ignore the popup menu // No select, return true to ignore the popup menu
else{ else
{
return; return;
} }
}); });
@ -3157,6 +3492,12 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked)
File file(path); File file(path);
loadButton->setButtonText(file.getFileNameWithoutExtension()); loadButton->setButtonText(file.getFileNameWithoutExtension());
} }
void PluginGui::syncGUI(){
if (updateFromHost){
updateFromParameters();
}
}
//[/MiscUserCode] //[/MiscUserCode]

View file

@ -61,6 +61,12 @@ public:
bool showLoadMenu(); bool showLoadMenu();
bool loadBrowserFile(); bool loadBrowserFile();
void loadPreNextFile(bool pre = true); void loadPreNextFile(bool pre = true);
void syncGUI();
void sliderDragStarted (Slider* sliderThatWasMoved) override;
void sliderDragEnded (Slider* sliderThatWasMoved) override;
//[/UserMethods] //[/UserMethods]
void paint (Graphics& g) override; void paint (Graphics& g) override;
@ -130,6 +136,8 @@ public:
private: private:
//[UserVariables] -- You can add your own custom variables in this section. //[UserVariables] -- You can add your own custom variables in this section.
bool updateFromHost = true;
void loadandUpdateInstrument(String path); void loadandUpdateInstrument(String path);
class OPLComboBoxLookAndFeelMethods: class OPLComboBoxLookAndFeelMethods:
public OPLLookAndFeel public OPLLookAndFeel

File diff suppressed because it is too large Load diff

View file

@ -3,15 +3,33 @@
#include "EnumFloatParameter.h" #include "EnumFloatParameter.h"
#include "IntFloatParameter.h" #include "IntFloatParameter.h"
#include "SbiLoader.h" #include "SbiLoader.h"
#include "iOSPluginEditorWrapper/iOSPluginEditorWrapper.h"
#include <iterator> #include <iterator>
const char *AdlibBlasterAudioProcessor::PROGRAM_INDEX = "Program Index"; const char *AdlibBlasterAudioProcessor::PROGRAM_INDEX = "Program Index";
static String doubleToString(double val) { return String(val); }
static double stringToDouble(String s){return std::stod(s.toStdString());}
static String volumeDoubleToString(double val) { return String(val*100); }
static double volumeStringToDouble(String s){return std::stod(s.toStdString())/100.0;}
//static String boolToString(float val) { return (val == 1.0f) ? "active" : "inactive"; }
//static bool stringToBool(String s) { return (s == "active") ? true : false; }
static String intToString(int val) { return String(val); }
static int stringToInt(String s) { return std::stoi(s.toStdString()); }
//============================================================================== //==============================================================================
AdlibBlasterAudioProcessor::AdlibBlasterAudioProcessor() AdlibBlasterAudioProcessor::AdlibBlasterAudioProcessor()
: i_program(-1) : i_program(-1)
{ {
//
undoManager.reset(new UndoManager());
valueTree.reset(new AudioProcessorValueTreeState(*this, undoManager.get()));
using Parameter = AudioProcessorValueTreeState::Parameter;
// Initalize OPL // Initalize OPL
velocity = false; velocity = false;
Opl = new Hiopl(); Opl = new Hiopl();
@ -24,9 +42,33 @@ AdlibBlasterAudioProcessor::AdlibBlasterAudioProcessor()
params.push_back(new EnumFloatParameter("Carrier Wave", params.push_back(new EnumFloatParameter("Carrier Wave",
StringArray(waveforms, sizeof(waveforms)/sizeof(String))) StringArray(waveforms, sizeof(waveforms)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Wave"),
String("Carrier Wave"),
"",
//NormalisableRange<float>(0.0f, sizeof(waveforms)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Wave", params.push_back(new EnumFloatParameter("Modulator Wave",
StringArray(waveforms, sizeof(waveforms)/sizeof(String))) StringArray(waveforms, sizeof(waveforms)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Wave"),
String("Modulator Wave"),
"",
//NormalisableRange<float>(0.0f, sizeof(waveforms)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String frq_multipliers[] = { const String frq_multipliers[] = {
"x0.5", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x10", "x12", "x12", "x15", "x15" "x0.5", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x10", "x12", "x12", "x15", "x15"
@ -34,97 +76,426 @@ AdlibBlasterAudioProcessor::AdlibBlasterAudioProcessor()
params.push_back(new EnumFloatParameter("Carrier Frequency Multiplier", params.push_back(new EnumFloatParameter("Carrier Frequency Multiplier",
StringArray(frq_multipliers, sizeof(frq_multipliers)/sizeof(String))) StringArray(frq_multipliers, sizeof(frq_multipliers)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Frequency Multiplier"),
String("Carrier Frequency Multiplier"),
"",
//NormalisableRange<float>(0.0f, sizeof(frq_multipliers)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Frequency Multiplier", params.push_back(new EnumFloatParameter("Modulator Frequency Multiplier",
StringArray(frq_multipliers, sizeof(frq_multipliers)/sizeof(String))) StringArray(frq_multipliers, sizeof(frq_multipliers)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Frequency Multiplier"),
String("Modulator Frequency Multiplier"),
"",
//NormalisableRange<float>(0.0f, sizeof(frq_multipliers)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String levels[] = {"0.00 dB", "0.75 dB", "1.50 dB", "2.25 dB", "3.00 dB", "3.75 dB", "4.50 dB", "5.25 dB", "6.00 dB", "6.75 dB", "7.50 dB", "8.25 dB", "9.00 dB", "9.75 dB", "10.50 dB", "11.25 dB", "12.00 dB", "12.75 dB", "13.50 dB", "14.25 dB", "15.00 dB", "15.75 dB", "16.50 dB", "17.25 dB", "18.00 dB", "18.75 dB", "19.50 dB", "20.25 dB", "21.00 dB", "21.75 dB", "22.50 dB", "23.25 dB", "24.00 dB", "24.75 dB", "25.50 dB", "26.25 dB", "27.00 dB", "27.75 dB", "28.50 dB", "29.25 dB", "30.00 dB", "30.75 dB", "31.50 dB", "32.25 dB", "33.00 dB", "33.75 dB", "34.50 dB", "35.25 dB", "36.00 dB", "36.75 dB", "37.50 dB", "38.25 dB", "39.00 dB", "39.75 dB", "40.50 dB", "41.25 dB", "42.00 dB", "42.75 dB", "43.50 dB", "44.25 dB", "45.00 dB", "45.75 dB", "46.50 dB", "47.25 dB"}; const String levels[] = {"0.00 dB", "0.75 dB", "1.50 dB", "2.25 dB", "3.00 dB", "3.75 dB", "4.50 dB", "5.25 dB", "6.00 dB", "6.75 dB", "7.50 dB", "8.25 dB", "9.00 dB", "9.75 dB", "10.50 dB", "11.25 dB", "12.00 dB", "12.75 dB", "13.50 dB", "14.25 dB", "15.00 dB", "15.75 dB", "16.50 dB", "17.25 dB", "18.00 dB", "18.75 dB", "19.50 dB", "20.25 dB", "21.00 dB", "21.75 dB", "22.50 dB", "23.25 dB", "24.00 dB", "24.75 dB", "25.50 dB", "26.25 dB", "27.00 dB", "27.75 dB", "28.50 dB", "29.25 dB", "30.00 dB", "30.75 dB", "31.50 dB", "32.25 dB", "33.00 dB", "33.75 dB", "34.50 dB", "35.25 dB", "36.00 dB", "36.75 dB", "37.50 dB", "38.25 dB", "39.00 dB", "39.75 dB", "40.50 dB", "41.25 dB", "42.00 dB", "42.75 dB", "43.50 dB", "44.25 dB", "45.00 dB", "45.75 dB", "46.50 dB", "47.25 dB"};
params.push_back(new EnumFloatParameter("Carrier Attenuation", params.push_back(new EnumFloatParameter("Carrier Attenuation",
StringArray(levels, sizeof(levels)/sizeof(String))) StringArray(levels, sizeof(levels)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Attenuation"),
String("Carrier Attenuation"),
"",
// NormalisableRange<float>(0.0f, sizeof(levels)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Attenuation", params.push_back(new EnumFloatParameter("Modulator Attenuation",
StringArray(levels, sizeof(levels)/sizeof(String))) StringArray(levels, sizeof(levels)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Attenuation"),
String("Modulator Attenuation"),
"",
//NormalisableRange<float>(0.0f, sizeof(levels)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String depth[] = {"Light", "Heavy"}; const String depth[] = {"Light", "Heavy"};
params.push_back(new EnumFloatParameter("Tremolo Depth", params.push_back(new EnumFloatParameter("Tremolo Depth",
StringArray(depth, sizeof(depth)/sizeof(String))) StringArray(depth, sizeof(depth)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Tremolo Depth"),
String("Tremolo Depth"),
"",
//NormalisableRange<float>(0.0f, sizeof(depth)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Vibrato Depth", params.push_back(new EnumFloatParameter("Vibrato Depth",
StringArray(depth, sizeof(depth)/sizeof(String))) StringArray(depth, sizeof(depth)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Vibrato Depth"),
String("Vibrato Depth"),
"",
//NormalisableRange<float>(0.0f, sizeof(depth)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String onoff[] = {"Disable", "Enable"}; const String onoff[] = {"Disable", "Enable"};
params.push_back(new EnumFloatParameter("Carrier Tremolo", params.push_back(new EnumFloatParameter("Carrier Tremolo",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Tremolo"),
String("Carrier Tremolo"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Carrier Vibrato", params.push_back(new EnumFloatParameter("Carrier Vibrato",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Vibrato"),
String("Carrier Vibrato"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Carrier Sustain", params.push_back(new EnumFloatParameter("Carrier Sustain",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Sustain"),
String("Carrier Sustain"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Carrier Keyscale Rate", params.push_back(new EnumFloatParameter("Carrier Keyscale Rate",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Keyscale Rate"),
String("Carrier Keyscale Rate"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Tremolo", params.push_back(new EnumFloatParameter("Modulator Tremolo",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Tremolo"),
String("Modulator Tremolo"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Vibrato", params.push_back(new EnumFloatParameter("Modulator Vibrato",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Vibrato"),
String("Modulator Vibrato"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Sustain", params.push_back(new EnumFloatParameter("Modulator Sustain",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Sustain"),
String("Modulator Sustain"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Keyscale Rate", params.push_back(new EnumFloatParameter("Modulator Keyscale Rate",
StringArray(onoff, sizeof(onoff)/sizeof(String))) StringArray(onoff, sizeof(onoff)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Keyscale Rate"),
String("Modulator Keyscale Rate"),
"",
//NormalisableRange<float>(0.0f, sizeof(onoff)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String ksrs[] = {"None","1.5 dB/8ve","3 dB/8ve","6 dB/8ve"}; const String ksrs[] = {"None","1.5 dB/8ve","3 dB/8ve","6 dB/8ve"};
params.push_back(new EnumFloatParameter("Carrier Keyscale Level", params.push_back(new EnumFloatParameter("Carrier Keyscale Level",
StringArray(ksrs, sizeof(ksrs)/sizeof(String))) StringArray(ksrs, sizeof(ksrs)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Keyscale Level"),
String("Carrier Keyscale Level"),
"",
//NormalisableRange<float>(0.0f, sizeof(ksrs)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Keyscale Level", params.push_back(new EnumFloatParameter("Modulator Keyscale Level",
StringArray(ksrs, sizeof(ksrs)/sizeof(String))) StringArray(ksrs, sizeof(ksrs)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Keyscale Level"),
String("Modulator Keyscale Level"),
"",
//NormalisableRange<float>(0.0f, sizeof(ksrs)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String algos[] = {"Frequency Modulation", "Additive"}; const String algos[] = {"Frequency Modulation", "Additive"};
params.push_back(new EnumFloatParameter("Algorithm", params.push_back(new EnumFloatParameter("Algorithm",
StringArray(algos, sizeof(algos)/sizeof(String))) StringArray(algos, sizeof(algos)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Algorithm"),
String("Algorithm"),
"",
//NormalisableRange<float>(0.0f, sizeof(algos)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Modulator Feedback", 0, 7)); params.push_back(new IntFloatParameter("Modulator Feedback", 0, 7));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Feedback"),
String("Modulator Feedback"),
"",
//NormalisableRange<float>(0.0f, 7.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Carrier Attack", 0, 15)); params.push_back(new IntFloatParameter("Carrier Attack", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Attack"),
String("Carrier Attack"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Carrier Decay", 0, 15)); params.push_back(new IntFloatParameter("Carrier Decay", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Decay"),
String("Carrier Decay"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Carrier Sustain Level", 0, 15)); params.push_back(new IntFloatParameter("Carrier Sustain Level", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Sustain Level"),
String("Carrier Sustain Level"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Carrier Release", 0, 15)); params.push_back(new IntFloatParameter("Carrier Release", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Release"),
String("Carrier Release"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Modulator Attack", 0, 15)); params.push_back(new IntFloatParameter("Modulator Attack", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Attack"),
String("Modulator Attack"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Modulator Decay", 0, 15)); params.push_back(new IntFloatParameter("Modulator Decay", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Decay"),
String("Modulator Decay"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Modulator Sustain Level", 0, 15)); params.push_back(new IntFloatParameter("Modulator Sustain Level", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Sustain Level"),
String("Modulator Sustain Level"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new IntFloatParameter("Modulator Release", 0, 15)); params.push_back(new IntFloatParameter("Modulator Release", 0, 15));
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Release"),
String("Modulator Release"),
"",
//NormalisableRange<float>(0.0f, 15.0f),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String sensitivitySettings[] = {"None", "Low", "High"}; const String sensitivitySettings[] = {"None", "Low", "High"};
params.push_back(new EnumFloatParameter("Carrier Velocity Sensitivity", params.push_back(new EnumFloatParameter("Carrier Velocity Sensitivity",
StringArray(sensitivitySettings, sizeof(sensitivitySettings)/sizeof(String))) StringArray(sensitivitySettings, sizeof(sensitivitySettings)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Carrier Velocity Sensitivity"),
String("Carrier Velocity Sensitivity"),
"",
//NormalisableRange<float>(0.0f, sizeof(sensitivitySettings)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
params.push_back(new EnumFloatParameter("Modulator Velocity Sensitivity", params.push_back(new EnumFloatParameter("Modulator Velocity Sensitivity",
StringArray(sensitivitySettings, sizeof(sensitivitySettings)/sizeof(String))) StringArray(sensitivitySettings, sizeof(sensitivitySettings)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Modulator Velocity Sensitivity"),
String("Modulator Velocity Sensitivity"),
"",
//NormalisableRange<float>(0.0f, sizeof(sensitivitySettings)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String emulators[] = {"DOSBox", "ZDoom"}; const String emulators[] = {"DOSBox", "ZDoom"};
params.push_back(new EnumFloatParameter("Emulator", params.push_back(new EnumFloatParameter("Emulator",
StringArray(emulators, sizeof(emulators)/sizeof(String))) StringArray(emulators, sizeof(emulators)/sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Emulator"),
String("Emulator"),
"",
//NormalisableRange<float>(0.0f, sizeof(emulators)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
const String percussion[] = { "Off", "Bass drum", "Snare", "Tom", "Cymbal", "Hi-hat" }; const String percussion[] = { "Off", "Bass drum", "Snare", "Tom", "Cymbal", "Hi-hat" };
params.push_back(new EnumFloatParameter("Percussion Mode", params.push_back(new EnumFloatParameter("Percussion Mode",
StringArray(percussion, sizeof(percussion) / sizeof(String))) StringArray(percussion, sizeof(percussion) / sizeof(String)))
); );
valueTree->createAndAddParameter(std::make_unique<Parameter> (String("Percussion Mode"),
String("Percussion Mode"),
"",
//NormalisableRange<float>(0.0f, sizeof(percussion)/sizeof(String)),
NormalisableRange<float>(0.0f, 1.0f),
0.0f,
doubleToString,
stringToDouble,
false,
true)
);
for(unsigned int i = 0; i < params.size(); i++) { for(unsigned int i = 0; i < params.size(); i++) {
paramIdxByName[params[i]->getName()] = i; paramIdxByName[params[i]->getName()] = i;
valueTree->addParameterListener (params[i]->getName(), this);
} }
valueTree->state = ValueTree (JucePlugin_Name);
initPrograms(); initPrograms();
for(std::map<String,std::vector<float>>::iterator it = programs.begin(); it != programs.end(); ++it) { for(std::map<String,std::vector<float>>::iterator it = programs.begin(); it != programs.end(); ++it) {
@ -453,7 +824,7 @@ void AdlibBlasterAudioProcessor::setIntParameter (String name, int value)
int i = paramIdxByName[name]; int i = paramIdxByName[name];
IntFloatParameter* p = (IntFloatParameter*)params[i]; IntFloatParameter* p = (IntFloatParameter*)params[i];
p->setParameterValue(value); p->setParameterValue(value);
setParameter(i, p->getParameter()); setParameter(i, p->getParameter(), true);
} }
void AdlibBlasterAudioProcessor::setEnumParameter (String name, int index) void AdlibBlasterAudioProcessor::setEnumParameter (String name, int index)
@ -461,7 +832,7 @@ void AdlibBlasterAudioProcessor::setEnumParameter (String name, int index)
int i = paramIdxByName[name]; int i = paramIdxByName[name];
EnumFloatParameter* p = (EnumFloatParameter*)params[i]; EnumFloatParameter* p = (EnumFloatParameter*)params[i];
p->setParameterIndex(index); p->setParameterIndex(index);
setParameter(i, p->getParameter()); setParameter(i, p->getParameter(), true);
} }
int AdlibBlasterAudioProcessor::getIntParameter (String name) int AdlibBlasterAudioProcessor::getIntParameter (String name)
@ -483,12 +854,33 @@ bool AdlibBlasterAudioProcessor::getBoolParameter(String name)
return 0 != getEnumParameter(name); return 0 != getEnumParameter(name);
} }
void AdlibBlasterAudioProcessor::parameterChanged (const String& parameterID, float newValue) {
int i = paramIdxByName[parameterID];
DBG("Change: "<< parameterID);
setParameter (i, newValue, false, false);
}
void AdlibBlasterAudioProcessor::beginChangeGesture (String name) {
getParameterPointer(name)->beginChangeGesture();
}
void AdlibBlasterAudioProcessor::endChangeGesture (String name) {
getParameterPointer(name)->endChangeGesture();
}
// Parameters which apply directly to the OPL // Parameters which apply directly to the OPL
void AdlibBlasterAudioProcessor::setParameter (int index, float newValue) void AdlibBlasterAudioProcessor::setParameter (int index, float newValue, bool notify, bool updatetoHost)
{ {
FloatParameter* p = params[index]; FloatParameter* p = params[index];
p->setParameter(newValue); p->setParameter(newValue);
String name = p->getName(); String name = p->getName();
if (updatetoHost) {
if (notify) {
valueTree->getParameter(name)->setValueNotifyingHost(newValue);
} else {
valueTree->getParameter(name)->setValue(newValue);
}
}
DBG("Parameter: " << name << " - " << newValue <<" - "<< p->getParameter() <<" Notify: " << String::formatted("%d", notify) << " updatetoHost" << String::formatted("%d", updatetoHost) );
int osc = 2; // Carrier int osc = 2; // Carrier
if (name.startsWith("Modulator")) { if (name.startsWith("Modulator")) {
osc = 1; osc = 1;
@ -672,9 +1064,14 @@ int AdlibBlasterAudioProcessor::getCurrentProgram()
void AdlibBlasterAudioProcessor::updateGuiIfPresent() void AdlibBlasterAudioProcessor::updateGuiIfPresent()
{ {
PluginEditor* gui = (PluginEditor*)getActiveEditor(); if (auto activeEditor = getActiveEditor())
if (gui) { {
gui->updateFromParameters(); #if JUCE_IOS
if (auto editor = dynamic_cast<iOSPluginEditorWrapper*>(activeEditor))
activeEditor = editor->getEditor();
#endif
if (auto editor = dynamic_cast<PluginEditor*>(activeEditor))
editor->updateFromParameters();
} }
} }
@ -832,9 +1229,15 @@ bool AdlibBlasterAudioProcessor::hasEditor() const
AudioProcessorEditor* AdlibBlasterAudioProcessor::createEditor() AudioProcessorEditor* AdlibBlasterAudioProcessor::createEditor()
{ {
PluginEditor* gui = new PluginEditor(this);
gui->updateFromParameters(); AudioProcessorEditor* editor = new PluginEditor(this);
return gui; static_cast<PluginEditor*>(editor)->updateFromParameters();
#if JUCE_IOS
editor = new iOSPluginEditorWrapper(*this, editor);
#endif
return editor;
} }
//============================================================================== //==============================================================================
@ -966,7 +1369,6 @@ const char* AdlibBlasterAudioProcessor::getChannelEnvelopeStage(int idx) const
return isChannelEnabled(idx) ? Opl->GetState(idx) : CHANNEL_DISABLED_STRING; return isChannelEnabled(idx) ? Opl->GetState(idx) : CHANNEL_DISABLED_STRING;
} }
//============================================================================== //==============================================================================
// This creates new instances of the plugin.. // This creates new instances of the plugin..
AudioProcessor* JUCE_CALLTYPE createPluginFilter() AudioProcessor* JUCE_CALLTYPE createPluginFilter()

72
Source/PluginProcessor.h Normal file → Executable file
View file

@ -17,7 +17,7 @@
//============================================================================== //==============================================================================
class AdlibBlasterAudioProcessor : public AudioProcessor class AdlibBlasterAudioProcessor : public AudioProcessor, public AudioProcessorValueTreeState::Listener
{ {
public: public:
//============================================================================== //==============================================================================
@ -27,29 +27,35 @@ public:
~AdlibBlasterAudioProcessor(); ~AdlibBlasterAudioProcessor();
//============================================================================== //==============================================================================
void prepareToPlay (double sampleRate, int samplesPerBlock); void prepareToPlay (double sampleRate, int samplesPerBlock) override;
void releaseResources(); void releaseResources() override;
void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages); void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) override;
//============================================================================== //==============================================================================
AudioProcessorEditor* createEditor(); AudioProcessorEditor* createEditor() override;
bool hasEditor() const; bool hasEditor() const override;
//============================================================================== //==============================================================================
const String getName() const; const String getName() const override;
static const int MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024; static const int MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024;
int getNumParameters(); int getNumParameters() override;
float getParameter (int index); float getParameter (int index) override;
void setParameter (int index, float newValue); void setParameter (int index, float newValue, bool notify = false, bool updatetoHost= true);
void setEnumParameter (String name, int newValue); void setEnumParameter (String name, int newValue);
void setIntParameter (String name, int newValue); void setIntParameter (String name, int newValue);
void beginChangeGesture (String name);
void endChangeGesture (String name);
int getIntParameter (String name); int getIntParameter (String name);
int getEnumParameter (String name); int getEnumParameter (String name);
bool getBoolParameter(String name); bool getBoolParameter(String name);
void loadInstrumentFromFile(String filename); void loadInstrumentFromFile(String filename);
void saveInstrumentToFile(String filename); void saveInstrumentToFile(String filename);
void setParametersByRegister(int register_base, int op, uint8 value); void setParametersByRegister(int register_base, int op, uint8 value);
@ -63,29 +69,31 @@ public:
void updateGuiIfPresent(); void updateGuiIfPresent();
const String getParameterName (int index); const String getParameterName (int index) override;
const String getParameterText (int index); const String getParameterText (int index) override;
const String getInputChannelName (int channelIndex) const override;
const String getInputChannelName (int channelIndex) const; const String getOutputChannelName (int channelIndex) const override;
const String getOutputChannelName (int channelIndex) const; bool isInputChannelStereoPair (int index) const override;
bool isInputChannelStereoPair (int index) const; bool isOutputChannelStereoPair (int index) const override;
bool isOutputChannelStereoPair (int index) const;
bool acceptsMidi() const;
bool producesMidi() const;
bool silenceInProducesSilenceOut() const;
double getTailLengthSeconds() const;
bool acceptsMidi() const override;
bool producesMidi() const override;
bool silenceInProducesSilenceOut() const override;
double getTailLengthSeconds() const override;
//============================================================================== //==============================================================================
int getNumPrograms(); int getNumPrograms() override;
int getCurrentProgram(); int getCurrentProgram() override;
void setCurrentProgram (int index); void setCurrentProgram (int index) override;
const String getProgramName (int index); const String getProgramName (int index) override;
void changeProgramName (int index, const String& newName); void changeProgramName (int index, const String& newName) override;
RangedAudioParameter* getParameterPointer(String parameterId) {
return valueTree->getParameter(parameterId);
}
void parameterChanged (const String& parameterID, float newValue) override;
//============================================================================== //==============================================================================
void getStateInformation (MemoryBlock& destData); void getStateInformation (MemoryBlock& destData) override;
void setStateInformation (const void* data, int sizeInBytes); void setStateInformation (const void* data, int sizeInBytes) override;
public: public:
String lastLoadFile; String lastLoadFile;
@ -105,7 +113,9 @@ private:
std::deque<int> available_channels; // most recently freed at end std::deque<int> available_channels; // most recently freed at end
std::deque<int> used_channels; // most recently used at end std::deque<int> used_channels; // most recently used at end
float currentScaledBend; float currentScaledBend;
std::unique_ptr<UndoManager> undoManager;
std::unique_ptr<AudioProcessorValueTreeState> valueTree;
//============================================================================== //==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AdlibBlasterAudioProcessor) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AdlibBlasterAudioProcessor)
}; };

0
Source/SbiLoader.h Normal file → Executable file
View file

0
Source/adlib.h Normal file → Executable file
View file

0
Source/config.h Normal file → Executable file
View file

0
Source/dbopl.cpp Normal file → Executable file
View file

0
Source/dbopl.h Normal file → Executable file
View file

0
Source/dosbox.h Normal file → Executable file
View file

0
Source/drov1.cpp Normal file → Executable file
View file

0
Source/drov1.h Normal file → Executable file
View file

0
Source/hardware.h Normal file → Executable file
View file

0
Source/hiopl.cpp Normal file → Executable file
View file

0
Source/hiopl.h Normal file → Executable file
View file

View file

@ -0,0 +1,65 @@
/*
==============================================================================
ScrollbarManager.cpp
Created: 1 Jul 2020 2:59:58am
Author: discoDSP
==============================================================================
*/
#include "ScrollbarManager.h"
ScrollbarManager::ScrollbarManager(Viewport& vp) : viewport(vp)
{
viewport.addMouseListener(this, true);
viewport.setScrollBarsShown(false, false, true, false);
scrollEnabled(false);
};
ScrollbarManager::~ScrollbarManager()
{
viewport.removeMouseListener(this);
};
void ScrollbarManager::mouseDown(const MouseEvent& event)
{
jassert(constraints.size() != 0);
auto e = event.getEventRelativeTo(&viewport);
auto position = e.getMouseDownPosition();
for (auto rectangle : constraints)
{
if (rectangle.contains(position))
{
scrollEnabled(true);
break;
}
}
};
void ScrollbarManager::mouseUp(const MouseEvent& event)
{
if (viewport.isScrollOnDragEnabled())
scrollEnabled(false);
};
void ScrollbarManager::addConstraint(int initialX, int initialY, int width, int height)
{
constraints.emplace_back(initialX, initialY, width, height);
};
void ScrollbarManager::removeAllConstraints()
{
if (!constraints.empty())
constraints.clear();
};
void ScrollbarManager::scrollEnabled(bool enabled)
{
viewport.setScrollOnDragEnabled(enabled);
}

View file

@ -0,0 +1,43 @@
/*
=============================================================================
ScrollbarManager.
Created: 1 Jul 2020 2:59:58a
Author: discoDSP
=============================================================================
*/
#pragma once
#include "JuceHeader.h"
/**
* This enables/disables the scrollbar if the user clicks inside the area of a constraint
* */
class ScrollbarManager : public MouseListener
{
public:
ScrollbarManager(Viewport& vp);
~ScrollbarManager();
virtual void mouseDown(const MouseEvent& event) override;
virtual void mouseUp(const MouseEvent& event) override;
void addConstraint(int initialX, int initialY, int width, int height);
void removeAllConstraints();
void scrollEnabled(bool);
private:
Viewport& viewport;
std::vector<Rectangle<int>> constraints;
};

View file

@ -0,0 +1,164 @@
/*
==============================================================================
iOSPluginEditorWrapper.cpp
Created: 2 Sep 2020 8:09:38pm
Author: Javier Andoni Aizpuru Rodríguez
==============================================================================
*/
#include "iOSPluginEditorWrapper.h"
iOSPluginEditorWrapper::iOSPluginEditorWrapper(juce::AudioProcessor& p, juce::AudioProcessorEditor* e) :
AudioProcessorEditor(p)
{
viewport = std::make_unique<Viewport>();
disableViewportDragOnSliderDrag(*e);
viewport->setViewedComponent(e, true);
scrollbarManager = std::make_unique<ScrollbarManager>(*viewport.get());
addAndMakeVisible(viewport.get());
initialW = e->getWidth();
previousW = initialW;
initialH = e->getHeight();
ratio = initialW / initialH;
if (p.wrapperType == juce::AudioProcessor::wrapperType_Standalone || hostType.isGarageBand())
isStandaloneWrapper = true;
auto resizable = !isStandaloneWrapper;
setResizable(resizable, resizable);
e->setResizable(false, false);
setSize(initialW, initialH);
}
iOSPluginEditorWrapper::~iOSPluginEditorWrapper()
{
scrollbarManager.reset();
viewport.reset();
}
void iOSPluginEditorWrapper::paint (juce::Graphics& g)
{
g.fillAll(Colours::black);
};
void iOSPluginEditorWrapper::resized()
{
if (hostType.isGarageBand())
{
auto parent = getParentComponent();
auto parentWidth = parent->getWidth();
if (parentWidth != getWidth())
setSize(parentWidth, getHeight());
};
auto localBounds = getLocalBounds();
viewport->setBounds(localBounds);
auto editorWidth = localBounds.getWidth();
auto calculateHeight = [this, &editorWidth] ()
{
return ceil(static_cast<float>(editorWidth) / ratio);
};
auto editor = viewport->getViewedComponent();
auto factor = editorWidth / initialW;
auto t = juce::AffineTransform::scale(factor);
editor->setTransform(t);
//Set correct scrollbar view position
auto editorHeight = calculateHeight();
auto scrollbarFactor = editorWidth / previousW;
auto t2 = juce::AffineTransform::scale(scrollbarFactor);
auto viewportPosition = viewport->getViewPosition();
viewportPosition.applyTransform(t2);
auto containerHeight = localBounds.getHeight();
if (editorHeight > containerHeight)
{
auto diff = editorHeight - containerHeight;
auto gapProportion = editorHeight * 0.05f;
if (diff < gapProportion)
viewportPosition = juce::Point<int>();
}
viewport->setViewPosition(viewportPosition);
//Adding scrollbar manager constrainers
auto constraintWidth = initialScrollBarWidth * factor;
scrollbarManager->removeAllConstraints();
scrollbarManager->addConstraint(0, 0, constraintWidth, editorHeight);
scrollbarManager->addConstraint(editorWidth - constraintWidth, 0, constraintWidth, editorHeight);
if (isStandaloneWrapper)
{
//Center vertically if editor doesn't cover whole screen area
auto height = getHeight();
if (editorHeight < height)
viewport->setTopLeftPosition(0, (height - editorHeight) / 2);
}
else
{
//Setting window resize limits
auto minW = ceil(initialW * 0.25f);
auto minH = ceil(initialH * 0.25f);
auto maxW = initialW * 4;
if (editorHeight < minH)
editorHeight = minH;
setResizeLimits(minW, minH, maxW, editorHeight);
}
previousW = editorWidth;
};
void iOSPluginEditorWrapper::setInitialScrollbarWidth(int width)
{
initialScrollBarWidth = width;
}
void iOSPluginEditorWrapper::disableViewportDragOnSliderDrag(juce::Component& component)
{
auto sliderList = std::vector<Component*>();
std::function<void(Component&, std::vector<Component*>&)> addSlidersToVector;
addSlidersToVector = [&addSlidersToVector] (Component& c, std::vector<Component*>& v)
{
if (auto slider = dynamic_cast<juce::Slider*>(&c))
v.push_back(slider);
else for (auto child : c.getChildren())
addSlidersToVector(*child, v);
};
addSlidersToVector(component, sliderList);
for (auto slider : sliderList)
slider->setViewportIgnoreDragFlag(true);
}
AudioProcessorEditor* iOSPluginEditorWrapper::getEditor()
{
return static_cast<AudioProcessorEditor*>(viewport->getViewedComponent());
}

View file

@ -0,0 +1,49 @@
/*
==============================================================================
iOSPluginEditorWrapper.h
Created: 2 Sep 2020 6:31:15pm
Author: Javier Andoni Aizpuru Rodríguez
==============================================================================
*/
#pragma once
#include "JuceHeader.h"
#include "ScrollbarManager.h"
class iOSPluginEditorWrapper :
public juce::AudioProcessorEditor
{
public:
iOSPluginEditorWrapper(juce::AudioProcessor& p, juce::AudioProcessorEditor* e);
~iOSPluginEditorWrapper();
void paint (juce::Graphics& g) override;
void resized() override;
void setInitialScrollbarWidth(int);
AudioProcessorEditor* getEditor();
private:
void disableViewportDragOnSliderDrag(juce::Component& c);
double initialW, initialH, ratio, previousW;
int initialScrollBarWidth { 20 };
bool isStandaloneWrapper { false };
std::unique_ptr<juce::Viewport> viewport { nullptr };
std::unique_ptr<ScrollbarManager> scrollbarManager { nullptr };
juce::PluginHostType hostType;
};

0
Source/inout.h Normal file → Executable file
View file

0
Source/itoa.h Normal file → Executable file
View file

0
Source/logging.h Normal file → Executable file
View file

0
Source/nkopl3.cpp Normal file → Executable file
View file

0
Source/nkopl3.h Normal file → Executable file
View file

0
Source/opl.h Normal file → Executable file
View file

0
Source/pic.h Normal file → Executable file
View file

0
Source/setup.h Normal file → Executable file
View file

0
Source/windows.h Normal file → Executable file
View file