diff --git a/resources/surge-shared/oscspecification.html b/resources/surge-shared/oscspecification.html index 4d0beaa1c41..3a9065dec2a 100644 --- a/resources/surge-shared/oscspecification.html +++ b/resources/surge-shared/oscspecification.html @@ -168,12 +168,10 @@ not how messages are to be formatted for OSC).

- OSC Output: All parameter, patch, tuning and modulation mapping changes made on Surge - XT are reported to - OSC out, if OSC output is enabled. - Parameters are reported in the ranges given under "Appropriate Values" (0.0 - 1.0 for - 'float' parameters), followed by a - displayable string. + OSC Output: Parameter, patch, tuning and modulation mapping changes + made on Surge XT are reported to OSC out, if OSC output is enabled. + Parameters are reported in the ranges given under "Appropriate Values" + (0.0 - 1.0 for 'float' parameters), followed by a displayable string. Errors are reported (when feasible) to "/error".

@@ -1537,6 +1535,7 @@

Sent to OSC client whenever a parameter is queried using '/q/param' or /doc/<parameter address> description + type minimum value maximum value diff --git a/src/surge-xt/SurgeSynthEditor.cpp b/src/surge-xt/SurgeSynthEditor.cpp index c3353ffa0b0..07cfd22b40c 100644 --- a/src/surge-xt/SurgeSynthEditor.cpp +++ b/src/surge-xt/SurgeSynthEditor.cpp @@ -601,7 +601,8 @@ void SurgeSynthEditor::endParameterEdit(Parameter *p) auto par = processor.paramsByID[processor.surge->idForParameter(p)]; par->inEditGesture = false; par->endChangeGesture(); - processor.paramChangeToListeners(p); + if (fireListenersOnEndEdit) + processor.paramChangeToListeners(p); } void SurgeSynthEditor::beginMacroEdit(long macroNum) diff --git a/src/surge-xt/SurgeSynthEditor.h b/src/surge-xt/SurgeSynthEditor.h index d05192497df..783f7507a17 100644 --- a/src/surge-xt/SurgeSynthEditor.h +++ b/src/surge-xt/SurgeSynthEditor.h @@ -99,6 +99,8 @@ class SurgeSynthEditor : public juce::AudioProcessorEditor, int midiKeyboardOctave{5}; float midiKeyboardVelocity{127.f / 127.f}; // see issue #6409 + bool fireListenersOnEndEdit{true}; + std::unique_ptr pitchwheel, modwheel, suspedal; std::unique_ptr keyboard; std::unique_ptr tempoLabel, sustainLabel; diff --git a/src/surge-xt/SurgeSynthProcessor.cpp b/src/surge-xt/SurgeSynthProcessor.cpp index d8d359a7261..48022503a7d 100644 --- a/src/surge-xt/SurgeSynthProcessor.cpp +++ b/src/surge-xt/SurgeSynthProcessor.cpp @@ -357,7 +357,7 @@ void SurgeSynthProcessor::paramChangeToListeners(Parameter *p, bool isSpecialCas int diff = (int)f0 ^ (int)f1; if (diff != 0) // should always be true { - unsigned i = 1, pos = 1; + unsigned i = 1, pos = 0; while (pos <= n_fx_slots) { if (i & diff) @@ -878,22 +878,20 @@ void SurgeSynthProcessor::processBlockOSC() { float pval = om.fval; if (om.param->valtype == vt_int) - pval = Parameter::intScaledToFloat(pval, om.param->val_max.i, om.param->val_min.i); + pval = + Parameter::intScaledToFloat(om.fval, om.param->val_max.i, om.param->val_min.i); - if (pval != om.param->val.f) - { - surge->setParameter01(surge->idForParameter(om.param), pval, true); - surge->storage.getPatch().isDirty = true; + surge->setParameter01(surge->idForParameter(om.param), pval, true); + surge->storage.getPatch().isDirty = true; - // Special cases: A few control types require a rebuild and - // SGE Value Callbacks would do it as would the VST3 param handler - // so put them here for now. Bit of a hack... - auto ct = om.param->ctrltype; - if (ct == ct_bool_solo || ct == ct_bool_mute || ct == ct_scenesel) - surge->refresh_editor = true; - else - surge->queueForRefresh(om.param->id); - } + // Special cases: A few control types require a rebuild and + // SGE Value Callbacks would do it as would the VST3 param handler + // so put them here for now. Bit of a hack... + auto ct = om.param->ctrltype; + if (ct == ct_bool_solo || ct == ct_bool_mute || ct == ct_scenesel) + surge->refresh_editor = true; + else + surge->queueForRefresh(om.param->id); } break; @@ -940,16 +938,12 @@ void SurgeSynthProcessor::processBlockOSC() newDisabledMask = curmask & msk; } else // set selected bit to one - { newDisabledMask = curmask | msk; - } + surge->storage.getPatch().fx_disable.val.i = newDisabledMask; - if (surge->fx_suspend_bitmask != newDisabledMask) - { - surge->fx_suspend_bitmask = newDisabledMask; - surge->storage.getPatch().isDirty = true; - surge->queueForRefresh(om.param->id); - } + surge->fx_suspend_bitmask = newDisabledMask; + surge->storage.getPatch().isDirty = true; + surge->refresh_editor = true; } break; @@ -1709,8 +1703,7 @@ void SurgeParamToJuceParamAdapter::setValue(float f) if (!matches && !inEditGesture) { s->setParameter01(s->idForParameter(p), f, true); - // Probably OSC needs this - // ssp->paramChangeToListeners(p); + ssp->paramChangeToListeners(p); } } diff --git a/src/surge-xt/SurgeSynthProcessor.h b/src/surge-xt/SurgeSynthProcessor.h index 4c90c3258bb..38e5d396674 100644 --- a/src/surge-xt/SurgeSynthProcessor.h +++ b/src/surge-xt/SurgeSynthProcessor.h @@ -358,6 +358,13 @@ class SurgeSynthProcessor : public juce::AudioProcessor, int scene{0}, index{0}; oscToAudio() {} + explicit oscToAudio(oscToAudio_type omtype, Parameter *p, float f, int i, char c0, char c1, + bool on, int32_t noteid, int scene, int index) + : type(omtype), param(p), fval(f), ival(i), char0(c0), char1(c1), on(on), + noteid(noteid), scene(scene), index(index) + { + } + oscToAudio(oscToAudio_type omtype, char c0, char c1, int i) : type(omtype), char0(c0), char1(c1), ival(i) { diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp index 3bfdeb199f5..6eeb800d7e7 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.cpp +++ b/src/surge-xt/gui/SurgeGUIEditor.cpp @@ -1285,6 +1285,7 @@ void SurgeGUIEditor::idle() } } + juceEditor->fireListenersOnEndEdit = false; for (int s = 0; s < n_scenes; ++s) { for (int o = 0; o < n_oscs; ++o) @@ -1317,6 +1318,7 @@ void SurgeGUIEditor::idle() juceEditor->endParameterEdit(&par); } } + juceEditor->fireListenersOnEndEdit = true; } void SurgeGUIEditor::toggle_mod_editing() diff --git a/src/surge-xt/osc/OpenSoundControl.cpp b/src/surge-xt/osc/OpenSoundControl.cpp index fd0d68d4226..e70e2ffd33d 100644 --- a/src/surge-xt/osc/OpenSoundControl.cpp +++ b/src/surge-xt/osc/OpenSoundControl.cpp @@ -699,7 +699,6 @@ void OpenSoundControl::oscMessageReceived(const juce::OSCMessage &message) fxslot = std::distance(std::begin(fxslot_shortoscname), found); int selected_mask = 1 << fxslot; - if (querying) { int deac_mask = synth->storage.getPatch().fx_disable.val.i; @@ -729,7 +728,9 @@ void OpenSoundControl::oscMessageReceived(const juce::OSCMessage &message) } // Send packet to audio thread - sspPtr->oscRingBuf.push(SurgeSynthProcessor::oscToAudio(selected_mask, onoff)); + sspPtr->oscRingBuf.push( + SurgeSynthProcessor::oscToAudio(SurgeSynthProcessor::FX_DISABLE, nullptr, 0.0, + selected_mask, 0, 0, onoff > 0, 0, 0, 0)); } }