Old 02-14-2021, 11:20 AM   #1
Aleksey Vaneev
Human being with feelings
 
Join Date: May 2010
Posts: 28
Default Reaper VST FX embedding API

I've noticed that VST plugins like ReaEQ can be embedded in track panels in Reaper. I'd like to introduce the same feature in Voxengo SPAN plug-in, but I do not know the required custom Reaper API calls to allow for such integration. Our plug-in framework allows to display independent views for the same underlying "model", so I think that should be doable.
Aleksey Vaneev is offline   Reply With Quote
Old 02-14-2021, 11:51 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

You can set it in statechunks, in the FXChain's entry WAK.

You either do some string-replacement or you use my Ultraschall-API, which has some features for managing that stuff.

Here's the explanation-chapters on how to get and set FXStateChunks, which are the part of an statechunk that stores the FXChain:
https://mespotin.uber.space/Ultrasch...X_Introduction

When you have an FXStateChunk, you can use this function on it:

Get the WAK-entry-settings: https://mespotin.uber.space/Ultrasch...k_FXStateChunk

Set the WAK-entry-settings: https://mespotin.uber.space/Ultrasch...k_FXStateChunk

and put the altered FXStateChunk back into the source-statechunk.

If you need more help on working with statechunks, just ask.

Edit: embedding fx is only possible with themes supporting this feature.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-14-2021, 11:54 AM   #3
ramses
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,231
Default

Voxengo makes really quality plugins. Having some of them available in track panels would be awesome!
ramses is offline   Reply With Quote
Old 02-14-2021, 12:20 PM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

I wonder, if any plugin can actually be embedded or if it's only limited to certain plugins compatible with it.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-14-2021, 01:34 PM   #5
Aleksey Vaneev
Human being with feelings
 
Join Date: May 2010
Posts: 28
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
You can set it in statechunks, in the FXChain's entry WAK.
Well, I'm from C++ world, so your suggestion is not applicable. I need vanilla VST API description. ReaEQ is a VST yet it manages to have an embedded GUI somehow.
Aleksey Vaneev is offline   Reply With Quote
Old 02-14-2021, 01:44 PM   #6
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

This would be awesome!

There's some documentation here:

https://github.com/justinfrankel/rea..._plugin.h#L423

(VST2-only at the moment but we'll definitely extend this to VST3). I'll send you an email to discuss this directly too.
Justin is offline   Reply With Quote
Old 02-14-2021, 01:58 PM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,814
Default

Awesome indeed!

For reference, here is some lightly edited code from one of our own plugin implementations:

Code:
VstIntPtr OurPlugin::Dispatcher(AEffect *effect, VstInt32 opCode,
  VstInt32 index, VstIntPtr value, void *ptr, float opt)
{
  switch (opCode)
  {
    case effCanDo:
      if (ptr && !strcmp((char*)ptr, "hasCockosEmbeddedUI")) return 0xbeef0000;
    break;

    case effVendorSpecific:
      if (index == effEditDraw) return (VstIntPtr)InlineEditor((int)opt, (void*)value, ptr);
    break;
  }
  return 0;
}


INT_PTR OurPlugin::InlineEditor(int msg, void *p1, void *p2)
{
  switch (msg)
  {
    case 0:
    return 1;

    case WM_GETMINMAXINFO:
      if (p2)
      {
        MINMAXINFO *mmi=(MINMAXINFO*)p2;
        mmi->ptMinTrackSize.x=20;
      }
    return 1;

    case WM_LBUTTONDBLCLK:
    case WM_LBUTTONDOWN:
    case WM_LBUTTONUP:
    case WM_RBUTTONDOWN:
    case WM_RBUTTONUP:
    case WM_MOUSEMOVE:
      if (p2)
      {
        REAPER_inline_positioninfo *inf=(REAPER_inline_positioninfo*)p2;
        POINT pt={inf->mouse_x, inf->mouse_y};
        int w=inf->width, h=inf->height;

        if (msg == WM_LBUTTONDOWN) OnMouseDown(pt, w, h);
        else if (msg == WM_LBUTTONUP) OnMouseUp(pt, w, h);
        else if (msg == WM_MOUSEMOVE) OnMouseMove(pt, w, h);
        else if (msg == WM_LBUTTONDBLCLK) OnMouseDblClk(pt, w, h);
        else if (msg == WM_RBUTTONDOWN) OnRMouseDown(pt, w, h);
        else if (msg == WM_RBUTTONUP) OnRMouseUp(pt, w, h);
      }
    return 1;

    case WM_PAINT:
      if (p1 && p2)
      {
        LICE_IBitmap *bmp=(LICE_IBitmap*)p1;
        REAPER_inline_positioninfo *inf=(REAPER_inline_positioninfo*)p2;
        int inf_flags=(int)(INT_PTR)inf->extraParms[0];

        if ((inf_flags&1) && !m_ui_dirty) return 0;

        DrawUI(bmp);
        return 1;
      }
    return 0;
  }

  return 0;
}
schwa is offline   Reply With Quote
Old 02-14-2021, 02:05 PM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Ok, I'll link this thread in the Reaper-Internals thread for future reference.
Could be interesting for future coders as well.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-14-2021, 02:50 PM   #9
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Edit: here's the new development API for embedding:

https://github.com/justinfrankel/rea...gin_fx_embed.h

Last edited by Justin; 02-15-2021 at 10:34 AM.
Justin is offline   Reply With Quote
Old 02-14-2021, 05:33 PM   #10
todd_r
Human being with feelings
 
todd_r's Avatar
 
Join Date: Nov 2006
Posts: 858
Default

Super news!
todd_r is offline   Reply With Quote
Old 02-14-2021, 11:56 PM   #11
Aleksey Vaneev
Human being with feelings
 
Join Date: May 2010
Posts: 28
Default

Thanks for your replies, I'll delve into this soon. Will require refactoring on our side, so won't be a quick implementation - we'll need to abstract our "UI window" from OS-oriented logic first.
Aleksey Vaneev is offline   Reply With Quote
Old 02-15-2021, 01:50 PM   #12
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,458
Default

Aleksey, Justin and Schwa thank you for this!
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 02-15-2021, 04:26 PM   #13
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

That's real cool.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-03-2021, 12:47 PM   #14
daverich
Human being with feelings
 
daverich's Avatar
 
Join Date: Jul 2006
Posts: 1,809
Default

wow my favourite dev wants to integrate with my favourite daw - it's a good day
daverich is offline   Reply With Quote
Old 04-07-2021, 09:20 AM   #15
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Hi all,
I have spent half a day today to code an example with embedding a JUCE plugin GUI in Reaper and made good progress!.
Thanks Schwa, your code example has been invaluable.

Now I hit a road block unfortunately.
I want to set the MCP view to a larger height, but I have run out of options.
I have tried to set height everywhere, but to no avail (in MINMAXINFO, in REAPER_FXEMBED_DrawInfo, in the components...) the height is displayed correctly in the floating plugin window, and also the TCP view, but not the MCP (see image). Can height be set for MCP view, and if so, how? I noticed the JS VU Meter is larger in height than my test plugin, so I guess it must be possible somehow.

Thanks and best,
Christian
Attached Images
File Type: png EmbedGUI.png (14.2 KB, 274 views)
Gertius is offline   Reply With Quote
Old 04-07-2021, 01:23 PM   #16
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,814
Default

I'm not sure I'm understanding the question exactly, but plugins can't control the aspect ratio of the embedded UI. If your plugin display needs to be taller than it is wide, and you definitely want the entire height displayed regardless of what size the user sets the embedded UI area to, you'll need to mask the sides of the bitmap you return.
schwa is offline   Reply With Quote
Old 04-07-2021, 01:33 PM   #17
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Thank you for the reply, schwa!

I actually just found the solution 5 minutes ago after taking a break.
I had totally overlooked the resize(int w, int h) function of the REAPER_FXEMBED_IBitmap.

With that I was able to set the display height in the MCP to the desired value.

Thanks again!

EDIT: I later found out, that you also need to adapt
REAPER_FXEMBED_SizeHints.preferred_aspect and
REAPER_FXEMBED_SizeHints.minimum_aspect
to make resize the actual plugin box (and not only the bmp) in MCP view.

Last edited by Gertius; 04-12-2021 at 02:28 PM.
Gertius is offline   Reply With Quote
Old 04-07-2021, 01:39 PM   #18
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Does this include attaching to the (complete) Reaper API from within the plugin ?

Thanks,
-Michael
mschnell is online now   Reply With Quote
Old 04-08-2021, 02:18 AM   #19
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Hi Michael,
I did not have to include "reaper_plugin.h".
It was sufficient to include "reaper_plugin_fx_embed.h"

I hope this answers your question.

Best,
Christian
Gertius is offline   Reply With Quote
Old 04-08-2021, 02:28 AM   #20
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

I just found out, that by resizing the IBitmap (as explained above), the area to draw into is indeed bigger and allows me to display the complete size of the GUI component (80x240) in MCP view. But unfortunately, the underlying embedding box is still only 80x80. So when I instantiate another plugin below the embedded one, it´s hidden by the embedded UI.

Would anyone know of a way to set the size of the embedded UI in the MCP view?

Thanks!

EDIT: I later found out, that you also need to adapt
REAPER_FXEMBED_SizeHints.preferred_aspect and
REAPER_FXEMBED_SizeHints.minimum_aspect
to make resize the actual plugin box (and not only the bmp) in MCP view.

Last edited by Gertius; 04-12-2021 at 02:29 PM.
Gertius is offline   Reply With Quote
Old 04-08-2021, 02:17 PM   #21
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

I want to document here what I did to get an embedded GUI (so far only for output, not for user input) working with JUCE, in case anybody else is looking for the information. This has been derived from schwa´s code example above. All in all I was pleasantly surprised how easy this was.
I have been delaying the project for over a year, because I thought this would be out of my league, but it really only took 2 days now thanks to schwa.

Here goes:

- I used an old version of JUCE, where I had to go into juce_VST_wrapper.cpp and add the following code to handleCanPlugInDo

Code:
if (matches("hasCockosExtensions"))
  return 0xbeef0000;
if (matches("hasCockosEmbeddedUI"))
  return 0xbeef0000;
Apparently in the newest JUCE version you get a handle to do this by reimplementing VSTCallbackHandler (handleVstPluginCanDo)

- I reimplemented the other handle (handleVstManufacturerSpecific), which was already available in my JUCE version. I made my Audioprocessor also a VSTCallbackHandler and added the following function:
Code:
pointer_sized_int PluginJuceAudioProcessor::handleVstManufacturerSpecific(int32 index, pointer_sized_int value, void* ptr, float opt)
{
	if (index == plugInOpcodeDrawEditor)
	{
		switch ((int)opt)
		{
		case 0:
			return 1;

		case WM_GETMINMAXINFO:
			if (ptr)
			{
				REAPER_FXEMBED_SizeHints *mmi = (REAPER_FXEMBED_SizeHints*)ptr;
				mmi->min_width = 80;
				mmi->max_width = 80;

				mmi->min_height = 240;
				mmi->max_height = 240;
				mmi->minimum_aspect = 22016;
				mmi->preferred_aspect = 22016; /* roughly 1:3, for 80x240px */
			}
			return 1;
			/*
			case WM_LBUTTONDBLCLK:
			case WM_LBUTTONDOWN:
			case WM_LBUTTONUP:
			case WM_RBUTTONDOWN:
			case WM_RBUTTONUP:
			case WM_MOUSEMOVE:
			if (ptr)
			{
			REAPER_FXEMBED_DrawInfo *inf = (REAPER_FXEMBED_DrawInfo*)ptr;
			POINT pt = { inf->mouse_x, inf->mouse_y };
			int w = inf->width, h = inf->height;

			if ((int)opt == WM_LBUTTONDOWN) OnMouseDown(pt, w, h);
			else if ((int)opt == WM_LBUTTONUP) OnMouseUp(pt, w, h);
			else if ((int)opt == WM_MOUSEMOVE) OnMouseMove(pt, w, h);
			else if ((int)opt == WM_LBUTTONDBLCLK) OnMouseDblClk(pt, w, h);
			else if ((int)opt == WM_RBUTTONDOWN) OnRMouseDown(pt, w, h);
			else if ((int)opt == WM_RBUTTONUP) OnRMouseUp(pt, w, h);

			}
			return 1;
			*/
		case WM_PAINT:
			if ((void*)value && ptr)
			{
				REAPER_FXEMBED_IBitmap *bmp = (REAPER_FXEMBED_IBitmap*)(void*)value;
				REAPER_FXEMBED_DrawInfo *inf = (REAPER_FXEMBED_DrawInfo*)ptr;
				
				bmp->resize(80, 240);
				int inf_flags = (int)(INT_PTR)inf->flags;

				//if ((inf_flags & 1) && !m_ui_dirty) return 0;
				//if (inf_flags & 1) return 0;


				Image img(juce::Image::PixelFormat::ARGB, bmp->getWidth(), bmp->getHeight(), true);
				Graphics g(img);

				embedComponent->paintEntireComponent(g, false);


				//copy img->bmp;
				unsigned int* px = bmp->getBits();

				for (int x = 0; x < bmp->getWidth(); x++)
					for (int y = 0; y < bmp->getHeight(); y++)
					{
						px[y * bmp->getRowSpan() + x] = (img.getPixelAt(x, y)).getARGB();
					}


				return 1;
			}
			return 0;
		}

		return 0;
	}
};
Some explanation:
embedComponent is a seperate UI component I created exclusively for the MCP embedding. This is my embedded UI. It has the correct size and all the controls. It is a member of the processor and not the editor. I found out that JUCE destroys the editor every time the plugin window is closed, so it made sense to have another component independent of the editor. Both my main plugin GUI and my embedded GUI connect to the same parameter of the processor via e.g.

Code:
	mLineAttachment = new AudioProcessorValueTreeState::SliderAttachment(myProcessor->getValueTreeState(), ConvolutionPluginJuceAudioProcessor::lineInParam, *sliderLineIn);

Somehow I needed to write into the provided bmp.
I only found a clunky way of copying the img, where my component updates the GUI (through a graphics object), pixel for pixel into the bmp.

I had to add the following includes to make it work:
#include "windows.h"
#include "reaper_plugin_fx_embed.h"
#include "juce_audio_processors/format_types/juce_VSTInterface.h"

I am in a state now where I can really work with it, as I only needed the embedded GUI for displaying plugin parameters. It still would be nice to have user input as well.

Hope this may be of help to someone!

Last edited by Gertius; 04-12-2021 at 02:30 PM.
Gertius is offline   Reply With Quote
Old 04-08-2021, 02:38 PM   #22
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

I've added this thread to the tutorials-list in the Reaper Internals thread, so people can find this again.

https://forum.cockos.com/showthread.php?t=207635
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-08-2021, 09:40 PM   #23
gxray
Human being with feelings
 
Join Date: Dec 2020
Location: Miami, FL USA
Posts: 396
Default

@Gertius thank you for posting this
__________________
Seasoned codemonkey
Dunno a thing about making music (here to learn!)
gxray is offline   Reply With Quote
Old 04-09-2021, 04:08 AM   #24
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

AFAIU, embedding a VST im the MCP means that the VST needs to be informed about the size of the window it is supposed to show its GUI in. (I already used this in some JSFX plugins I did.)
Now when trying to do a VST with JUCE, I found that a VST3 perfectly scales with the window provided by the DAW (just like a desktop application in it's own window), whereas compiling the same code to a VST2, the GUI sits "behind" the window provided by the DAW and can be scrolled by what seems to be provided by Reaper, and not filling the Window if same is larger than the programmed size of the VST's GUI.

Hence my question is if the API discussed here might be suitable to automatically resize the GUI of a VST2 in order to fill the window provided by Reaper.

BTW: there seem to be VST2s that do automatically scale appropriately (ReaEQ, but also (SMA_)MidiToReaControlPath and (PIZ-) midiAudioToCC, and other that don't (e.g. ReaLearn and (Vember Audio) Surge).

Thanks,
-Michael

Last edited by mschnell; 04-09-2021 at 04:22 AM.
mschnell is online now   Reply With Quote
Old 04-09-2021, 04:29 AM   #25
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Quote:
Originally Posted by Gertius View Post
I hope this answers your question.
Thanks !
In fact I am just trying to attach to the Reaper API by my JUCE (newest version) based VST test project with no success as of now,

Can you show me the code how to do that ?

But maybe the code you provided already is sufficient, but in fact I don't know yet how to do "reimplementing VSTCallbackHandler (handleVstPluginCanDo) "
In fact I was not able to add a reference to "VSTCallbackHandler" to my "AudioPluginAudioProcessor" class.

trying
class AudioPluginAudioProcessor : public juce::AudioProcessor, public juce::VSTCallbackHandler
does not compile

see -> https://forum.cockos.com/showthread.php?t=250482&page=3

Thanks again,
-Michael

Last edited by mschnell; 04-09-2021 at 04:37 AM.
mschnell is online now   Reply With Quote
Old 04-09-2021, 07:42 AM   #26
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Hi guys, thanks for your replies!
I have now also uploaded the source code of my example project to here:
https://sourceforge.net/projects/juc...example/files/
The more devs include this feature, the better, because it´s really awesome!

Michael, I checked the thread you linked.
The only thing that comes to mind, have you set the VST Plugin property in the Jucer?

In my code the line also looks like this:
Code:
class ReaperGuiembed_testAudioProcessor  : public AudioProcessor, public AudioProcessorValueTreeState::Listener, public VSTCallbackHandler
Also, I did include "juce_audio_processors/format_types/juce_VSTInterface.h" in the processor cpp file.
My JUCE Version is 5.1.2 btw.
Gertius is offline   Reply With Quote
Old 04-10-2021, 06:47 AM   #27
lerian
Human being with feelings
 
Join Date: Oct 2011
Posts: 442
Default

So looking forward to this. I just came to this forum to learn how can i customize the look/colors of the js analyzer in the tcp, just to see i could embed SPAN? Awesome!

Sorry for hijacking the thread, i just wanted to thank you all for doing this.
lerian is offline   Reply With Quote
Old 04-10-2021, 12:56 PM   #28
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Quote:
Originally Posted by Gertius View Post
In my code the line also looks like this:
Code:
class ReaperGuiembed_testAudioProcessor  : public AudioProcessor, public AudioProcessorValueTreeState::Listener, public VSTCallbackHandler
I modified this to

Code:
class AudioPluginAudioProcessor  : public juce::AudioProcessor, public juce::AudioProcessorValueTreeState::Listener, public juce::VSTCallbackHandler
and when compiling to "VST" or "VST3" get the error message (VSTCallbackHandler) "no member of juce" or when dropping "juce:: ": (VSTCallbackHandler) "No Class or struct name".
Quote:
Originally Posted by Gertius View Post

Also, I did include "juce_audio_processors/format_types/juce_VSTInterface.h" in the processor cpp file.
this results in "Cant open "juce_audio_processors/format_types/juce_VSTInterface.h" "
The definition of juce_VSTCallbackHandler is in
"juce_audio_plugin_client/VST/juce_VSTCallbackHandler.h"
but when I #include that file (and don't use "juce::" before VSTCallbackHandler), I get the error message "Type redefinition" in that file for the struct VSTCallbackHandler and (VSTCallbackHandler) undefined type used in my file.

Quote:
Originally Posted by Gertius View Post
In my code the line also looks like this:My JUCE Version is 5.1.2 btw.
I (supposedly) use the newest one. How to find the version ID ?

I did not use "producer", as I was told the more appropriate way nowadays is using cmake. And for my code it actually seems to work fine so far.
In fact in the cmakelusts.txt file there is a line
FORMATS VST3 Standalone # The formats to build. Other valid formats are: AAX Unity VST AU AUv3
Optionally I modified is to
FORMATS VST Standalone
to be able to select VST (2) instead of VST3 as a built target in VS Code.

-Michael

Last edited by mschnell; 04-10-2021 at 01:20 PM.
mschnell is online now   Reply With Quote
Old 04-10-2021, 02:10 PM   #29
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Quote:
Originally Posted by Gertius View Post
Hi guys, thanks for your replies!
I have now also uploaded the source code of my example project to here:
https://sourceforge.net/projects/juc...example/files/
The more devs include this feature, the better, because it´s really awesome!
I downloaded the files and tried to cmake and compile them with the JUCE folder I have.
in VS Code, I get the same error message as when trying to follow your suggestion with my code:

"Cant open "juce_audio_processors/format_types/juce_VSTInterface.h" "

And in fact in the folder "format types" there is no file "juce_VSTInterface.h" (or similar)

How to get your example compiled ?

Thanks,
-Michael
mschnell is online now   Reply With Quote
Old 04-10-2021, 03:36 PM   #30
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

It would make sense that my example does not compile directly with the newest JUCE version, as the class interfaces may vary quite a bit between versions.
The version number could for example be seen in the file "BREAKING-CHANGES.txt" or "Changelist.txt" in the main JUCE folder. Newest version seems to be 6.0.8.
Wow, my version is really old unfortunately.

This seems to be a tricky one.
One thing I could still think of, but not sure if this fits exactly to your error message:
when deriving classes from other classes with pure virtual functions (that's when it says =0 at the end of the declaration), you'd have to give an implementation for each pure virtual function for it to compile, or else the class is not complete.
In the VSTCallbackHandler this only seems to be the case for handleVstManufacturerSpecific().
Do you already have an implementation for this in place when trying to compile?

As I said, not sure if it's connected to your problem, but if I can remember correctly, the error message might sound similar.
P.S.: can you please copy/paste your exact error messages?

Last edited by Gertius; 04-10-2021 at 03:50 PM.
Gertius is offline   Reply With Quote
Old 04-10-2021, 10:12 PM   #31
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Yep, The version I installed is 6.0.8
Unfortunately VS Code installed a German version without asking (any idea how to change to English ?)
The error message is:

Basierend auf den von der configurationProvider-Einstellung bereitgestellten Informationen wurden #include-Fehler festgestellt. Wellenlinien sind für diese Übersetzungseinheit deaktiviert (C:\Users\Michael Schnell\JUCE_3\test_1\PluginProcessor.cpp).C/C++(1696)

In your code in the line
#include "juce_audio_processors/format_types/juce_VSTInterface.h"

Thanks a lot for your help !

-Michael
mschnell is online now   Reply With Quote
Old 04-11-2021, 12:03 AM   #32
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Hi Michael,
when googling for "compiler error code 1696", I find the error that the include path is missing from your project. This seems a bit weird to me, as JUCE should handle the include paths of it's submodules, but it's something you could try: please try and add the directory "juce_audio_plugin_client/VST/" to your project's include path. This could be done in the makefile, or in VS directly, but I guess it is cleaner to do it in the makefile.
Gertius is offline   Reply With Quote
Old 04-11-2021, 01:14 AM   #33
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Thanks, but that will not help as the file juce_VSTInterface.h does not exist at all in the JUCE library version 6.

It would be great if you would find the time to upgrade your project to the current JUCE libray

Thanks a lot
-Michael
mschnell is online now   Reply With Quote
Old 04-11-2021, 02:14 AM   #34
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Ah I think there was a misunderstanding. I did not mean you should include the path to juce_VSTInterface.h, but rather to the file juce_VSTCallbackHandler.h, where the VSTCallbackHandler is declared.

I also wish I would update JUCE, but I think it won't be anytime soon. I expect a lot of work in updating my existing projects, and this is time I do not have at the moment unfortunately.
Gertius is offline   Reply With Quote
Old 04-11-2021, 03:35 AM   #35
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

Of course I already did try this :

Code:
#include "juce_audio_plugin_client\VST\juce_VSTCallbackHandler.h"
now the #include is compiled and the line

Code:
class ReaperGuiembed_testAudioProcessor  : public AudioProcessor, public AudioProcessorValueTreeState::Listener, public VSTCallbackHandler
does compile.

But now I get

"plugInOpcodeDrawEditor": nichtdeklarierter Bezeichner [C:\Users\Michael Schnell\JUCE_3\test_1\build\AudioPluginExample.vcx proj]MSVC(C2065)
with the line
Code:
    if (index == plugInOpcodeDrawEditor)
and a bunch of warnings.

That symbol does not seem to be anywhere in JUCE

I opened a discussion in the JUCE forum on that issue....

-Michael

Last edited by mschnell; 04-11-2021 at 03:52 AM.
mschnell is online now   Reply With Quote
Old 04-11-2021, 07:27 AM   #36
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

With help from the JUCE forum I was able to get it compiled.

I needed top replace
#include "juce_audio_processors/format_types/juce_VSTInterface.h"
by
#include "juce_audio_processors/format_types/juce_audio_plugin_client.h"
and fix the cmake control file.
But still I have no idea about "plugInOpcodeDrawEditor"

And I get a ton of compiler warnings.
Nonetheless it seems to work at least reaper can load it just fine and I can turmn the knob.

Finally ! using JUCE 6.0.8

But it does not allow for being shown in the TCP Header or MCP.

Seemingly this is what plugInOpcodeDrawEditor thingy means ?!?!?!

-Michael

Last edited by mschnell; 04-11-2021 at 07:38 AM.
mschnell is online now   Reply With Quote
Old 04-11-2021, 09:50 AM   #37
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Hi Michael,

congratulations!

I checked again, and in my JUCE version the opcode is indeed in the missing file "juce_VSTInterface.h". In the latest version it seems that you are supposed to include a seperate VST2 SDK. This is taken from the latest JUCE version

JUCE/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp

Code:
namespace Vst2
{
// If the following files cannot be found then you are probably trying to host
// VST2 plug-ins. To do this you must have a VST2 SDK in your header search
// paths or use the "VST (Legacy) SDK Folder" field in the Projucer. The VST2
// SDK can be obtained from the vstsdk3610_11_06_2018_build_37 (or older) VST3
// SDK or JUCE version 5.3.2.
#include <pluginterfaces/vst2.x/aeffect.h>
#include <pluginterfaces/vst2.x/aeffectx.h>
}
You could also try this quick and dirty hack:
plugInOpcodeDrawEditor is defined in an enum as number 16.
You could try to replace the name plugInOpcodeDrawEditor with the number 16 in your code and see if the "show embedded UI in MCP/TCP" switch is then activated in Reaper.
Gertius is offline   Reply With Quote
Old 04-11-2021, 02:12 PM   #38
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

I tried it but it does not define the symbol . I don't know what I did wrong...
Moreover the symbol seems do be depreciated in the SDK.

I counted and verified that the value of the symbol seems to be 16. So I just typed 16 in that line. But nonetheless the "embed" lines in the right click options still are grayed.

-Michael
mschnell is online now   Reply With Quote
Old 04-12-2021, 10:39 AM   #39
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

I found that in the Steinberg SDK the (former) JUCE symbol plugInOpcodeDrawEditor is named effEditDraw.
But even there it is depreciated and hence a way to access it is replacing

Code:
    if (index == plugInOpcodeDrawEditor)
by
Code:
    switch  ((enum AEffectOpcodes)index) 
      case __effEditDrawDeprecated:
And to access the Steinberg VST2 SDK, but nontheless allow for compiling to a VST3 or a standalone if the SDK is not available, we can add
Code:
#ifdef JUCE_PLUGINHOST_VST
  #include <pluginterfaces/vst2.x/aeffect.h>
#endif
@Gertius: could you try that modification
(and replacing
Code:
#include "juce_audio_processors/format_types/juce_VSTInterface.h"
by
Code:
#include "juce_audio_processors/format_types/juce_audio_plugin_client.h"
)
with your JUCE 5.x installation ?
-Michael
mschnell is online now   Reply With Quote
Old 04-12-2021, 10:47 AM   #40
Gertius
Human being with feelings
 
Join Date: Nov 2012
Posts: 47
Default

Ok... for me to better understand, are you now trying to compile my example, or your own code?
If my example, I had to add some code to the JUCE lib, as I've described above, which you wouldn't have if you downloaded my files.

I needed to add
Code:
if (matches("hasCockosExtensions"))
  return 0xbeef0000;
if (matches("hasCockosEmbeddedUI"))
  return 0xbeef0000;
to handleCanPlugInDo() in juce_VST_wrapper.cpp.

For the newest JUCE version, this is handled differently and you would have to add this code by reimplementing handleVstPluginCanDo() of the VSTCallbackHandler class, similar to what you already did with handleVstManufacturerSpecific().
Have you already tried that?
Gertius is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:24 AM.


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