Cockos Incorporated Forums

Cockos Incorporated Forums (https://forum.cockos.com/index.php)
-   WDL users forum (https://forum.cockos.com/forumdisplay.php?f=32)
-   -   WDL plugin won't listen to Midi CC Data (https://forum.cockos.com/showthread.php?t=194909)

david90036 08-11-2017 12:35 PM

WDL plugin won't listen to Midi CC Data
 
Hello, everyone. I'm hoping to find someone who has been able to get WDL-OL to react to MIDI Controller changes such as ModWheel and PitchWheel. I have done much searching on this forum and on the KVR forum, and I find people claiming to have accomplished this, but none whom have shared clear examples of working code. Please note that I've created a VST3 plugin using WDL downloaded as of early 2017, in a Windows 8.1 environment with MS Visual Studio 2013 as my IDE.

To troubleshoot my problem, I created an extremely simplistic plugin that does nothing but pass mData1 and mData2 (regardless of StatusMsg() value) from the IMidiMsg into variables that are then written out to a text file for logging/testing purposes. I can see clearly that when a Note On or Note Off are sent from Cubase to the plugin, I get a line item in my text file that shows the status (8 for NoteOff and 9 for NoteOn) and then the value of the note (data1) and the value of the velocity (data2). However, when any PitchWheel or ControlChange messages are sent from Cubase to the plugin, there are no line entries in the text file whatsoever.

Here is my code for ProcessMidiMsg:

[code]
void TPlugMidiCC::ProcessMidiMsg(IMidiMsg* pMsg)
{
IMidiMsg::EStatusMsg status = pMsg->StatusMsg();
int data1 = (int)pMsg->mData1;
int data2 = (int)pMsg->mData2;
output
<< status
<< " "
<< data1
<< " "
<< data2
<< " "
<< "\n"
;
mMidiQueue.Add(pMsg);
return;
}
[\code]

At first I was trying to get the MidiQueue working from within ProcessDoubleReplacing, but I've now bypassed that altogether to simplify the code in the hopes of getting to the bottom of this problem.

Nevertheless, here is the code from ProcessDoubleReplacing for those who want to see it:

[code]
void TPlugMidiCC::ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames)
{
// Mutex is already locked for us.
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
double peakL = 0.0, peakR = 0.0;

GetTime(&mTimeInfo);

for (int offset = 0; offset < nFrames; ++offset, ++in1, ++in2, ++out1, ++out2)
{
while (!mMidiQueue.Empty())
{
IMidiMsg* pMsg = mMidiQueue.Peek();
if (pMsg->mOffset > offset) break;
mMidiQueue.Remove();
}
*out1 = 0.;
*out2 = 0.;
}
mMidiQueue.Flush(nFrames);

_chdir("C:\\Program Files\\AsiData\\Transcribe");
outputfile.open("TPlugMidiCCOutput.txt");
outputfile << output.str();
outputfile.close();
}
[\code]

Again, I know my code is correct, because my text file has line items showing the raw Midi data and status messages as they come in from Cubase. It's just that WDL is ignoring any data that isn't NoteOn/NoteOff or somehow Cubase isn't sending it to the plugin. I'm inclined to believe the former, since I can send controller data to any of my commercially produced VSTi plugins.

There must be some extra step to stop IMidiMsg from filtering out PitchWheel and ControlChange that may have to be written into the underlying library files. It's nothing to do with the switch(status) cases, because I've removed those completely.

Maybe this only happens with Windows 8.1 / VS2013 / Cubase 6? Or am I missing something that needs to be added to the code?

Thanks in advance for any and all assistance.

Xenakios 08-11-2017 01:20 PM

Tried building and testing as a VST2 plugin? (I am not sure if you actually even get any benefits when building VST3 with WDL-OL/IPlug...) Is your WDL-OL a current version, where did you get it from?

david90036 08-11-2017 03:47 PM

SOLVED: VST2 Works, VST3 Doesn't Work
 
Xenakios, my friend, you're a genius! I compiled it as x64 VST2 and now it works marvelously with Cubase 6. To answer your other question, I downloaded the WDL-OL from Oli Larkin's github. This was several months ago, however. Do you have reason to believe the problem with VST3 has been solved since then?

Edit: Now I see your remark about the lack of benefits when compiling as VST3 with WDL. I guess it's a moot issue then. I'll be making VST2 plugins from here on out, until maybe I 'upgrade' to a VST3 compatible platform.

A thousand thank-you's for your help!!!


All times are GMT -7. The time now is 10:59 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.