iPlug2 / iPlug2

C++ Audio Plug-in Framework for desktop, mobile and web
https://iplug2.github.io
Other
1.9k stars 282 forks source link

IPlug2 instruments crash vst3 Reaper midi learn (all recent versions) #507

Closed gvampgh closed 4 years ago

gvampgh commented 4 years ago

The IPlugInstrument vst3 example (and others) crashes Reaper 5 / 6 on windows 10, regardless of audio output device and reaper version. E.g. CC 16 messages are ok (knobs on my Oxygen keyboard) and learned correctly. Sliders cause crashes, the id AND index of the "virtual iplug2 vst3 midi parameters" are out of bounds. VST2 is ok by the way.

Reproduce:

grafik

grafik

grafik

grafik

olilarkin commented 4 years ago

Have you go the very latest version of reaper? I have tried to reproduce this but I can't make it crash

olilarkin commented 4 years ago

what is the MIDI CC number that causes a crash? you say it works for some and not others?

gvampgh commented 4 years ago

Yes, I have tested an older version 5 of reaper and the newest installed today, both crash. VST2 shows the below CC messages. My 9 sliders have theses CC messages below. I have recognized that the problematic controls have channel numbers > 1. All my knobs have channel number 1 as well and are working correctly.

MIDI Chan 2 CC 7 Crash MIDI Chan 2 CC 8 Crash MIDI Chan 2 CC 10 Crash MIDI Chan 2 CC 91 Crash MIDI Chan 3 CC 7 Crash MIDI Chan 3 CC 8 Crash MIDI Chan 3 CC 10 Crash MIDI Chan 3 CC 91 Crash MIDI Chan 1 CC 7 OK

olilarkin commented 4 years ago

OK makes more sense.

You need to define VST3_NUM_MIDI_IN_CHANS=16 and VST3_NUM_CC_CHANS=16 as pre-processor macros (e.g. in xcconfig or .props file) in order to add enough VST3 MIDI CC parameters to handle all 16 midi channels.

Nevertheless this shouldn't crash, so looking into it.

gvampgh commented 4 years ago

I set both to 16 in IPlug\VST3\IPlugVST3_Defs.h (config.h didn't work, maybe I have to do a complete rebuild) and this instantly fixed it, thank you, Oli ! Maybe consider this to be default settings, I could do the small pr, if you want.

olilarkin commented 4 years ago

No, sorry. I hate having 16 * 128 extra parameters!

you can override the setting via a preprocessor macro in xcconfig or .props file like i said