# \[Open\]Altering "JUCE VST Demo Host" to become a VST plugin

**URL:** <https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076>\
**Category:** General JUCE discussion\
**Created:** [December 25, 2013, 1:48pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076 "2013-12-25T13:48:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [December 25, 2013, 1:48pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/1 "2013-12-25T13:48:38Z")

</div>

Hello JUCE community,

&nbsp;

First of all:&nbsp;

![heart](http://www.juce.com/sites/all/libraries/ckeditor/plugins/smiley/images/heart.gif "heart") A merry christmas and a happy new year to you all! ![heart](http://www.juce.com/sites/all/libraries/ckeditor/plugins/smiley/images/heart.gif "heart")

&nbsp;

Here is my problem:

I want to make a VST version of the "JUCE Host Demo".

So basically the demo host will than be no more standalone but a vst plugin.

A host in a host if you like to put it another way.

&nbsp;

Question:

How can I do the changes that it does not compile to a standalone but a VST plugin ?

Does anybody did this before? Are there any open source projects that did this ?

Any help would be appreciated and source code examples would be even better.

&nbsp;

best

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [December 25, 2013, 1:54pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/2 "2013-12-25T13:54:11Z")

</div>

You can try by building a plugin that utilises an AudioProcessorGraph, which is how the demo host works. Rather than hack the demo host to make it a VST I would work the other way around. I'd start with&nbsp;a basic VST and then start adding things from the host. Someone one the list did ask about this some time back, but I've not been able to find the thread. Maybe you'll have better luck. &nbsp;

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [December 25, 2013, 1:55pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/3 "2013-12-25T13:55:00Z")

</div>

Sorry, double posted by accident. (How can I delete a post?!)

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [December 25, 2013, 2:02pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/4 "2013-12-25T14:02:02Z")

</div>

I'm doing quite the same thing and I'm working as was suggested by Rory.

Here is my topic about it:&nbsp;http://www.juce.com/forum/topic/modular-plugin-getting-started

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [December 25, 2013, 3:26pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/5 "2013-12-25T15:26:53Z")

</div>

Thank you guys.

There is of course allways the possibility to build up from scratch,

but actually if some example has 99% of the functionality that you would need,&nbsp;

than altering the 1% can also be a option.

Especially when it is for internal and non commertial use.

Because the host demo actually has everything I would need except the fact that it builds as a standalone.

I would still look for a answer to the original question:

Is there a way to alter the host demo to build a vst version ?

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [December 29, 2013, 2:59pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/6 "2013-12-29T14:59:00Z")

</div>

Wrapping host demo&nbsp;relevant&nbsp;code in AudioProcessor (instead of JUCEApplication standalone) is the way to go.&nbsp;

At least that is what I'm trying to do.

But I can mistake. :)

Maybe it will be a good idea to someone to&nbsp;upload that sort of plugin template project&nbsp;into git or somewhere else? So from there it can be impoved and fully adapted by more competent people.&nbsp;(I can upload my work in progress project but it's very messy and I'm far from JUCE expert)&nbsp;I believe that many people will be interested in that project, especially those who want to build kind of modular plugin!

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 2, 2014, 12:40pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/7 "2014-01-02T12:40:57Z")

</div>

Hey Mikeg,

&nbsp;

I made a 2-3 hours quick and dirty hack and monkeypatched the host demo to be a plugin.

Main issue I ran into was:

Around FilterGraph were methods with critical sections (mutexes) that were invoked in audio thread, where audio thread needs to be non-blocking.

This crashed Live7 but runs ok with EnergyXT.

&nbsp;

Once I figure out what to do with this, I can write a few lines with instructions what I did :-)

&nbsp;

best

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [January 5, 2014, 12:02pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/8 "2014-01-05T12:02:21Z")

</div>

Hey General MIDI,

Maybe you can upload your project, once you are ready, so others (like me:-))&nbsp;could use it as a starting point (and to patch/improve&nbsp;it further) ?

Anyway good luck to you!&nbsp;&nbsp; ![smiley](http://www.juce.com/sites/all/libraries/ckeditor/plugins/smiley/images/regular_smile.gif "smiley")

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 6, 2014, 12:16pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/9 "2014-01-06T12:16:00Z")

</div>

It is running already, but from a reputational point of view its tooooo hacky to put public for my taste.

&nbsp;

So we can do one of two things:

&nbsp;

a) (Fast\<1 week) Instructions how to do this.

&nbsp;

b) (Slow\>1 month) Wait until I find time to clean up everything and so forth and upload a demo project.

&nbsp;

What do you want ?

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [January 6, 2014, 1:09pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/11 "2014-01-06T13:09:47Z")

</div>

Good to hear that you have made progess!

Maybe you can upload it but with private access?

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 6, 2014, 2:24pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/12 "2014-01-06T14:24:00Z")

</div>

I am too busy right now.

So my apologies but&nbsp; I have to be economic with my time.

Plus I want to give back something to the community and not only you Mikeg :-)

&nbsp;

So please choose one of the two options.

&nbsp;

BTW: Instructions would be detailed enough to reproduce in a day ;-)

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [January 7, 2014, 7:51am UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/13 "2014-01-07T07:51:47Z")

</div>

Drop the instructions. :)))

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 7, 2014, 1:01pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/14 "2014-01-07T13:01:00Z")

</div>

As you wish :-)

I will post it right here the next days.

&nbsp;

Do you have time to take charge of the DEMO project afterwards ?

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [January 7, 2014, 1:29pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/15 "2014-01-07T13:29:24Z")

</div>

Can't give any guarenties :)

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 7, 2014, 3:48pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/16 "2014-01-07T15:48:00Z")

</div>

My JUCE distribution is 3 months old and I am compiling with Windows.

I am also interested&nbsp;to be a VST plugin and to be able to host VST plugins.

I am using VS2012.

But this should also work with all other combinations of platforms/IDEs/plugins that are supported by JUCE with a minimum of tweaking.

&nbsp;

To make Rory happy. Lets start with the demo plugin:

&nbsp;

So first go to your JUCE distribution/extras folder and make a copy of the example plugin project "audio plugin demo".

Its a nice the little synth with sine OSCs and delay effect.

Rename it to "VSTMetaHost" of similar and load it into your IDE.

Make sure it compiles in "debug" and "release" and the outputted VSTi loads into your host and makes some sine noise.

&nbsp;

Wait for Step 2

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 7, 2014, 9:31pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/17 "2014-01-07T21:31:42Z")

</div>

Open PluginEditor.h / PluginEditor.cpp

and delete the attributes

gainSlider, delaySlider, infoLabel, gainLabel, delayLabel

delete the methods

displayPositionInfo,&nbsp; ppqToBarsBeatsString, timeToTimecodeString, sliderValueChanged, timerCallback

do not inherit from Timer, SliderListener

in class JuceDemoPluginAudioProcessorEditor

Compile PluginEditor.cpp and you get some errors.

Use this error list to get rid of every reference to the deleted attributes by simply deleting the lines with errors.

Do this ower and ower again until it compiles.

Compile project, load into host and you should get the same VSTi as before but with less GUI (only keyboard).

&nbsp;

Wait for Step 3

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [January 8, 2014, 6:13am UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/18 "2014-01-08T06:13:00Z")

</div>

> I am also interested&nbsp;to be a VST plugin and to be able to host VST plugins.

You're interested in a&nbsp;slightly different thing than I.

I'm interested in a VST plugin but without hosting external VST plugins, only to work with internal processors.

I actually trying to achieve&nbsp;modular plugin rather than a VST host in a VST host.

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 8, 2014, 11:59am UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/19 "2014-01-08T11:59:00Z")

</div>

I see:

So this is a totally different scenario.

It actually makes no sense for you to port the host demo into a vst.

&nbsp;

Now as a logical consequence I can quit posting stuff and save a lot of time ;-)

---

<div class="post-metadata">

**Author:** ![mikeg](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikeg](https://forum.juce.com/u/mikeg)\
**Post date:** [January 8, 2014, 12:48pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/20 "2014-01-08T12:48:25Z")

</div>

I'm happy helping you save some time.&nbsp; ![smiley](http://www.juce.com/sites/all/libraries/ckeditor/plugins/smiley/images/regular_smile.gif "smiley")

> It actually makes no sense for you to port the host demo into a vst.

It actually does and it's what I'm doing as there is a lot of same logic in host demo that can be reused. (I hope)

---

<div class="post-metadata">

**Author:** ![General\_MIDI](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@General\_MIDI](https://forum.juce.com/u/General_MIDI)\
**Post date:** [January 8, 2014, 1:58pm UTC](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076/21 "2014-01-08T13:58:32Z")

</div>

Can you please explain what same logic you mean in detail ?

[Next page](https://forum.juce.com/t/open-altering-juce-vst-demo-host-to-become-a-vst-plugin/12076.md?page=2)
