2
0
Fork 0

Merge pull request #32 from reales/development

v2.1
This commit is contained in:
reales 2020-08-12 10:36:20 +02:00 committed by GitHub
commit 62989cb12d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 85 additions and 52 deletions

View file

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 9 KiB

View file

@ -25,7 +25,7 @@
#include "ObxdVoice.h"
enum ObxdParameters
{
UNDEFINED = 0,
UNDEFINED,
MIDILEARN,
VOLUME,
VOICE_COUNT,

View file

@ -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;
}
}
};

View file

@ -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;

View file

@ -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;
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -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: " <<x <<" Y: "<<y);
@ -226,7 +232,12 @@ void ObxdAudioProcessorEditor::placeLabel (int x, int y, String text)
ButtonList* ObxdAudioProcessorEditor::addList (int x, int y, int width, int height, ObxdAudioProcessor& filter, int parameter, String /*name*/, Image img)
{
ButtonList *bl = new ButtonList (img, height*2);
#if JUCE_WINDOWS || JUCE_LINUX
ButtonList *bl = new ButtonList (img, height);
#else
ButtonList *bl = new ButtonList (img, height*2);
#endif
buttonListAttachments.add (new ButtonList::ButtonListAttachment (filter.getPluginState(),
filter.getEngineParameterId (parameter),
*bl));
@ -240,7 +251,7 @@ ButtonList* ObxdAudioProcessorEditor::addList (int x, int y, int width, int heig
Knob* ObxdAudioProcessorEditor::addKnob (int x, int y, int d, ObxdAudioProcessor& filter, int parameter, String /*name*/, float defval)
{
#if JUCE_WIN || JUCE_LINUX
#if JUCE_WINDOWS || JUCE_LINUX
Knob* knob = new Knob (ImageCache::getFromFile(skinFolder.getChildFile("knob.png")), 48);
#else
Knob* knob = new Knob (ImageCache::getFromFile(skinFolder.getChildFile("knob@2x.png")), 96);
@ -270,21 +281,23 @@ void ObxdAudioProcessorEditor::clean()
TooglableButton* ObxdAudioProcessorEditor::addButton (int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name)
{
#if JUCE_WIN || JUCE_LINUX
#if JUCE_WINDOWS || JUCE_LINUX
TooglableButton* button = new TooglableButton (ImageCache::getFromFile(skinFolder.getChildFile("button.png")));
#else
TooglableButton* button = new TooglableButton (ImageCache::getFromFile(skinFolder.getChildFile("button@2x.png")));
#endif
toggleAttachments.add (new TooglableButton::ToggleAttachment (filter.getPluginState(),
filter.getEngineParameterId (parameter),
*button));
if (parameter != UNLEARN){
toggleAttachments.add (new AudioProcessorValueTreeState::ButtonAttachment (filter.getPluginState(),
filter.getEngineParameterId (parameter),
*button));
} else {
button->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<TooglableButton*> (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());

View file

@ -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<Knob::KnobAttachment> knobAttachments;
OwnedArray<TooglableButton::ToggleAttachment> toggleAttachments;
OwnedArray<AudioProcessorValueTreeState::ButtonAttachment> toggleAttachments;
OwnedArray<ButtonList::ButtonListAttachment> buttonListAttachments;
OwnedArray<ImageButton> imageButtons;

View file

@ -69,10 +69,10 @@ ObxdAudioProcessor::ObxdAudioProcessor()
options.storageFormat = PropertiesFile::storeAsXML;
options.millisecondsBeforeSaving = 2500;
options.processLock = &configLock;
config = std::unique_ptr<PropertiesFile> (new PropertiesFile (getDocumentFolder().getChildFile ("Settings.xml"), options));
config = std::unique_ptr<PropertiesFile> (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;