Page 1 of 1

IMidiMapping and SingleComponentEffect

Posted: Wed Jan 29, 2020 2:35 pm
by olilarkin
I have got IMidiMapping working with distributed VST3, but for some reason I cannot get it to work with a plugin derived from SingleComponentEffect. If I make the following changes to AGainSimple, the getMidiControllerAssignmentmethod doesn't get called, even though VST3TestHost reports that the plugin implements IMidiMapping. Anyone know what could be the problem? It has a MIDI input bus. The result is no assigned CCs to params.

thanks,

oli

Code: Select all

diff --git a/samples/vst/again/source/againsimple.h b/samples/vst/again/source/againsimple.h
index 3552a44e70944ae33b24e801b024bde4ea4c96cd..60c718f7d83f91ae9a32d3692698308c612e7a40 100644
--- a/samples/vst/again/source/againsimple.h
+++ b/samples/vst/again/source/againsimple.h
@@ -55,7 +55,7 @@ class AGainUIMessageController;
 //------------------------------------------------------------------------
 // AGain as combined processor and controller
 //------------------------------------------------------------------------
-class AGainSimple : public SingleComponentEffect, public VSTGUI::VST3EditorDelegate
+class AGainSimple : public SingleComponentEffect, public VSTGUI::VST3EditorDelegate, public IMidiMapping
 {
 public:
 //------------------------------------------------------------------------
@@ -100,6 +100,16 @@ public:
 	void setDefaultMessageText (String128 text);
 	TChar* getDefaultMessageText ();
 
+	tresult PLUGIN_API getMidiControllerAssignment(int32 busIndex, int16 channel,
+		CtrlNumber midiControllerNumber,
+		ParamID& id /*out*/) SMTG_OVERRIDE
+	{
+              // NEVER GETS HIT
+		return kResultFalse;
+	}
 
 	//------------------------------------------------------------------------
 	template <typename SampleType>
@@ -131,6 +141,12 @@ public:
 		return vuPPM;
 	}
 
+	OBJ_METHODS(AGainSimple, SingleComponentEffect)
+	DEFINE_INTERFACES
+		DEF_INTERFACE(IMidiMapping)
+	END_DEFINE_INTERFACES(SingleComponentEffect)
+	REFCOUNT_METHODS(SingleComponentEffect)
+
 //------------------------------------------------------------------------
 private:
 	// our model values


Re: IMidiMapping and SingleComponentEffect

Posted: Wed Jan 29, 2020 4:44 pm
by olilarkin
I believe there is a bug with VST3TestHost that means it doesn't properly respect IMidiMapping for SingleComponentEffect plugins. The MIDI mapping works in Reaper and Cubase.

Re: IMidiMapping and SingleComponentEffect

Posted: Wed Feb 05, 2020 3:10 pm
by willpirkle
IMidiMapping is working fine for me and SingleComponentEffect.

Re: IMidiMapping and SingleComponentEffect

Posted: Wed Feb 05, 2020 3:10 pm
by willpirkle
IMidiMapping is working fine for me and SingleComponentEffect.

Re: IMidiMapping and SingleComponentEffect

Posted: Wed Feb 05, 2020 3:10 pm
by willpirkle
IMidiMapping is working fine for me and SingleComponentEffect.

Re: IMidiMapping and SingleComponentEffect

Posted: Wed Feb 05, 2020 8:55 pm
by olilarkin
in VST3TestHost?

Re: IMidiMapping and SingleComponentEffect

Posted: Thu Feb 06, 2020 2:06 pm
by willpirkle
Not the test host.

What I was trying to state was that nothing appears to have been broken between the last SDK and this one, regarding that combination. Apologies for the vague post.