diff --git a/Documents/discoDSP/OB-Xd/MIDI CC.txt b/Documents/discoDSP/OB-Xd/MIDI CC.txt index ba46ce2..e06b7a6 100644 --- a/Documents/discoDSP/OB-Xd/MIDI CC.txt +++ b/Documents/discoDSP/OB-Xd/MIDI CC.txt @@ -1,4 +1,4 @@ -OB-Xd 2.0 default MIDI CC controller table. +OB-Xd default MIDI CC controller table. Modify by clicking LEARN button, moving a GUI element and then sending MIDI CC data. All values can be reset using CLEAN button. @@ -45,13 +45,13 @@ CC# CONTROL 104 MULTIMODE 102 NOISEMIX 17 OCTAVE -100 OSC1MIX +77 OSC1MIX 54 OSC1P 58 OSC1Pul 57 OSC1Saw 43 OSC2_DET 52 OSC2HS -101 OSC2MIX +78 OSC2MIX 55 OSC2P 60 OSC2Pul 59 OSC2Saw diff --git a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/knob.png b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/knob.png index d83ee6a..9d3b6b7 100755 Binary files a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/knob.png and b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/knob.png differ diff --git a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/legato.png b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/legato.png index ccbe90c..9eb3b07 100755 Binary files a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/legato.png and b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/legato.png differ diff --git a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/main.png b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/main.png index 6bf348c..4598deb 100755 Binary files a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/main.png and b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/main.png differ diff --git a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/menu.png b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/menu.png index 2dc9647..2b5e0b6 100755 Binary files a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/menu.png and b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/menu.png differ diff --git a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/voices.png b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/voices.png index 11d13f3..f8126f1 100755 Binary files a/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/voices.png and b/Documents/discoDSP/OB-Xd/Themes/discoDSP Grey/voices.png differ diff --git a/Source/Engine/ParamsEnum.h b/Source/Engine/ParamsEnum.h index fc5f771..9cb3eb0 100755 --- a/Source/Engine/ParamsEnum.h +++ b/Source/Engine/ParamsEnum.h @@ -25,7 +25,7 @@ #include "ObxdVoice.h" enum ObxdParameters { - UNDEFINED = 0, + UNDEFINED, MIDILEARN, VOLUME, VOICE_COUNT, diff --git a/Source/Engine/midiMap.h b/Source/Engine/midiMap.h index 3a5c311..d17396b 100755 --- a/Source/Engine/midiMap.h +++ b/Source/Engine/midiMap.h @@ -159,10 +159,10 @@ public: midicc = 63; controllers[midicc] = controllers_default[midicc] = ENVPITCH; - midicc = 100; + midicc = 77; controllers[midicc] = controllers_default[midicc] = OSC1MIX; - - midicc = 101; + + midicc = 78; controllers[midicc] = controllers_default[midicc] = OSC2MIX; midicc = 102; @@ -275,7 +275,7 @@ public: midicc = 119; controllers[midicc] = controllers_default[midicc] = SELF_OSC_PUSH; - + } @@ -304,5 +304,16 @@ public: controllers[i] = tmp; } + + // Backward keys + if (controllers[100] > 0) { + controllers[77] = controllers_default[77]; + controllers[100] = 0; + } + if ( controllers[101] > 0) { + controllers[78] = controllers_default[78]; + controllers[101] = 0; + } } + }; diff --git a/Source/Gui/Knob.h b/Source/Gui/Knob.h index 6d4663f..4630b49 100755 --- a/Source/Gui/Knob.h +++ b/Source/Gui/Knob.h @@ -68,7 +68,7 @@ public: float val = parameter->getValue(); //sliderToControl->setValue(parameter->convertFrom0to1(val0to1)); sliderToControl->setValue(val, NotificationType::dontSendNotification); - DBG(" Slider: " << sliderToControl->getName() << " " << sliderToControl->getValue() << " Parameter: "<< " " << parameter->getValue()); + DBG(" Slider: " << parameter->name << " " << sliderToControl->getValue() << " Parameter: "<< " " << parameter->getValue()); } virtual ~KnobAttachment() = default; diff --git a/Source/Gui/TooglableButton.h b/Source/Gui/TooglableButton.h index af3f055..1f80d96 100755 --- a/Source/Gui/TooglableButton.h +++ b/Source/Gui/TooglableButton.h @@ -31,7 +31,7 @@ public: { //this->setImages kni = k; - toogled = false; + //toogled = false; width = kni.getWidth(); height = kni.getHeight(); w2 = width; @@ -53,7 +53,7 @@ public: TooglableButton& buttonToControl) : AudioProcessorValueTreeState::ButtonAttachment (stateToControl, parameterID, buttonToControl), buttonToControl(&buttonToControl) { parameter = stateToControl.getParameter (parameterID); - buttonToControl.setParameter (parameter); + //buttonToControl.setParameter (parameter); } /* ToggleAttachment (juce::AudioProcessorValueTreeState& stateToControl, @@ -64,11 +64,12 @@ public: void updateToSlider(){ float val = parameter->getValue(); //buttonToControl->setValue(parameter->convertFrom0to1(val0to1), NotificationType::dontSendNotification); - buttonToControl->setValue(val, NotificationType::dontSendNotification); + DBG("Toggle Parameter: " << parameter->name << " Val: " << val); + buttonToControl->setToggleState(val, NotificationType::dontSendNotification); } virtual ~ToggleAttachment() = default; }; - + /* void setParameter (const AudioProcessorParameter* p) { if (parameter == p) @@ -76,8 +77,8 @@ public: parameter = p; repaint(); - } - + }*/ + /* void clicked() override { toogled = ! toogled; @@ -89,20 +90,21 @@ public: //this->setColour(DrawableButton::ColourIds::backgroundColourId,Colours::lightpink); Button::clicked(); - }; + };*/ void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) override { int offset = 0; - if (toogled) + //if (toogled) + if (getToggleState()) { offset = 1; } g.drawImage(kni, 0, 0, getWidth(), getHeight(), 0, offset * h2, w2, h2); } - + /* void setValue (float state, int notify) { if (state > 0.5) @@ -110,23 +112,23 @@ public: else toogled = false; repaint(); - } + }*/ - float getValue() + /*float getValue() { if (toogled) return 1; else return 0; - } + }*/ //void paint(Graphics& g) //{ // g.drawImageTransformed(kni,AffineTransform::rotation(((getValue() - getMinimum())/(getMaximum() - getMinimum()))*float_Pi - float_Pi*2)); //} - bool toogled; + //bool toogled; private: Image kni; int width, height, w2, h2; - const AudioProcessorParameter* parameter {nullptr}; + //const AudioProcessorParameter* parameter; }; diff --git a/Source/Images/main.png b/Source/Images/main.png index e3c55e1..06fbfee 100644 Binary files a/Source/Images/main.png and b/Source/Images/main.png differ diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index a241c73..7cbef8a 100755 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -25,6 +25,8 @@ ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFil // skinFolder = ownerFilter.getCurrentSkinFolder(); // initialized above loadSkin (processor); repaint(); + + updateFromHost(); } void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter) @@ -155,7 +157,7 @@ void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter) if (name == "voiceSwitch"){ //if (voiceSwitch) voiceSwitch->setVisible(false); -#if JUCE_WIN || JUCE_LINUX +#if JUCE_WINDOWS || JUCE_LINUX voiceSwitch = addList (x, y, w, h, ownerFilter, VOICE_COUNT, "VoiceCount", ImageCache::getFromFile(skinFolder.getChildFile("voices.png"))); } #else voiceSwitch = addList (x, y, w, h, ownerFilter, VOICE_COUNT, "VoiceCount", ImageCache::getFromFile(skinFolder.getChildFile("voices@2x.png"))); } @@ -163,7 +165,7 @@ void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter) if (name == "legatoSwitch"){ //if (legatoSwitch) legatoSwitch->setVisible(false); -#if JUCE_WIN || JUCE_LINUX +#if JUCE_WINDOWS || JUCE_LINUX legatoSwitch = addList (x, y, w, h, ownerFilter, LEGATOMODE, "Legato", ImageCache::getFromFile(skinFolder.getChildFile("legato.png"))); } #else legatoSwitch = addList (x, y, w, h, ownerFilter, LEGATOMODE, "Legato", ImageCache::getFromFile(skinFolder.getChildFile("legato@2x.png"))); } @@ -173,7 +175,11 @@ void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter) if (name == "menu") { addMenuButton (x, y, d, +#if JUCE_WINDOWS || JUCE_LINUX ImageCache::getFromFile (skinFolder.getChildFile ("menu.png"))); +#else + ImageCache::getFromFile (skinFolder.getChildFile ("menu@2x.png"))); +#endif } //DBG(" Name: " << name << " X: " <addListener(this); + } button->setBounds (x, y, w, h); button->setButtonText (name); - button->setValue (filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(), + button->setToggleState(filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(), dontSendNotification); - button->addListener(this); + addAndMakeVisible (button); return button; @@ -442,7 +455,7 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b) auto toggleButton = dynamic_cast (b); if (toggleButton == midiUnlearnButton){ - if (midiUnlearnButton->toogled){ + if (midiUnlearnButton->getToggleState()){ processor.getMidiMap().reset(); processor.getMidiMap().set_default(); processor.sendChangeMessage(); @@ -452,18 +465,17 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b) } //============================================================================== -void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source) -{ - + +void ObxdAudioProcessorEditor::updateFromHost() { for (int i = 0; i < knobAttachments.size(); ++i) { knobAttachments[i]->updateToSlider(); } - + /* for (int i = 0; i < toggleAttachments.size(); ++i) { toggleAttachments[i]->updateToSlider(); - } + }*/ for (int i = 0; i < buttonListAttachments.size(); ++i) { @@ -471,10 +483,16 @@ void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source } // Set to unlearn to false - midiUnlearnButton->setValue(0.0, false); + if ( midiUnlearnButton->getToggleState()) { + midiUnlearnButton->setToggleState(false, NotificationType:: sendNotification); + } repaint(); } +void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source) +{ + updateFromHost(); +} void ObxdAudioProcessorEditor::mouseUp (const MouseEvent& e) { @@ -487,7 +505,7 @@ void ObxdAudioProcessorEditor::mouseUp (const MouseEvent& e) void ObxdAudioProcessorEditor::paint(Graphics& g) { g.fillAll (Colours::black); -#if JUCE_WIN || JUCE_LINUX +#if JUCE_WINDOWS || JUCE_LINUX const File mainFile(skinFolder.getChildFile("main.png")); #else const File mainFile(skinFolder.getChildFile("main@2x.png")); @@ -498,7 +516,7 @@ void ObxdAudioProcessorEditor::paint(Graphics& g) const Image image = ImageCache::getFromFile(mainFile); -#if JUCE_WIN || JUCE_LINUX +#if JUCE_WINDOWS || JUCE_LINUX g.drawImage (image, 0, 0, image.getWidth(), image.getHeight(), 0, 0, image.getWidth(), image.getHeight()); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 7b3b9bb..03879df 100755 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -37,6 +37,8 @@ public: void mouseUp (const MouseEvent& e) override; void paint (Graphics& g) override; + void updateFromHost(); + //============================================================================== void changeListenerCallback (ChangeBroadcaster* source) override; void buttonClicked (Button *) override; @@ -134,7 +136,7 @@ private: //============================================================================== OwnedArray knobAttachments; - OwnedArray toggleAttachments; + OwnedArray toggleAttachments; OwnedArray buttonListAttachments; OwnedArray imageButtons; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 5b1f1f5..230d669 100755 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -69,10 +69,10 @@ ObxdAudioProcessor::ObxdAudioProcessor() options.storageFormat = PropertiesFile::storeAsXML; options.millisecondsBeforeSaving = 2500; options.processLock = &configLock; - config = std::unique_ptr (new PropertiesFile (getDocumentFolder().getChildFile ("Settings.xml"), options)); + config = std::unique_ptr (new PropertiesFile (getDocumentFolder().getChildFile ("Skin.xml"), options)); - currentSkin = config->containsKey("skin") ? config->getValue("skin") : "discoDSP Blue"; - currentBank = "Init"; + currentSkin = config->containsKey("skin") ? config->getValue("skin") : "Ilkka Rosma Dark"; + currentBank = "000 - FMR OB-Xa Patch Book"; scanAndUpdateBanks(); scanAndUpdateSkins(); @@ -102,7 +102,7 @@ void ObxdAudioProcessor::initAllParams() { for (int i = 0; i < PARAM_COUNT; ++i) { - setEngineParameterValue (i, programs.currentProgramPtr->values[i]); + setEngineParameterValue (i, programs.currentProgramPtr->values[i], true); } } @@ -173,7 +173,7 @@ void ObxdAudioProcessor::setCurrentProgram (int index) isHostAutomatedChange = false; for (int i = 0; i < PARAM_COUNT; ++i) - setEngineParameterValue (i, programs.currentProgramPtr->values[i]); + setEngineParameterValue (i, programs.currentProgramPtr->values[i], true); isHostAutomatedChange = true; sendChangeMessage(); @@ -242,9 +242,9 @@ inline void ObxdAudioProcessor::processMidiPerSample (MidiBuffer::Iterator* iter { midiControlledParamSet = true; setEngineParameterValue (bindings[lastMovedController], - midiMsg->getControllerValue() / 127.0f); + midiMsg->getControllerValue() / 127.0f, true); - setEngineParameterValue (MIDILEARN, 0); + setEngineParameterValue (MIDILEARN, 0, true); lastMovedController = 0; lastUsedParameter = 0;