Stand Alone to Plug in

can i change stand alone code into plugin without change the code?
i try to change simple FFT example, into plugin
need help, thanks

Hi, if you haven’t already got a plugin project probably best to create one of those, select the deployment options you want and then copy your existing source into the new project.

I’m guessing that’s what you’re after?

so you mean i just make a new plugin project and copy all the code from SimpleFFTExample project into my new plugin project?

yes. you should then be able to build standalone and a plugin from the same source

should i change this

START_JUCE_APPLICATION (SimpleFFTExampleApplication)

because i found error here,
thank you so much leehu, you’re my hero today :slight_smile:

i’m travelling at the moment so can’t check the finer details, but you should only copy across the main functional logic, not any of the “boiler plate” code which consists of setting up the app, as the new project will already have the appropriate code for handling that in each deployment type

I am just confused to move the code in exampleFFT into the project plugin, some code contained in the header file in the stand alone project is in the cpp file on the plugin :frowning:
example fft has only one header file and one cpp file whereas in the new project the plugin has two headers and two cpp

sorry i am asking a lot, because i am still too new to try, i really need help to convert the FFT sample file to be a plugin

You won’t be able to just copy around the files, you will need to carefully adapt the code from the standalone example app to work in a plugin project…

is there any code in example standalone that can not run in the plugin?

Lots, for example in a plugin you need to have the GUI code in the plugin GUI editor code. The standalone app code mixes the audio and GUI codes. (Which is a very bad design for a plugin, even if the plugin is just a visual analyzer. In a plugin context things must work even if the GUI isn’t always available.)

:frowning: well then i have to try again and again, wish me luck :’(

Hmm, as luck would have it, I’ve actually already done a plugin version of the Juce FFT example because another poster some time ago asked about this exact same thing!

The source codes :

The plugin has not been extensively debugged and tested, just quickly confirmed it does appear to run in Reaper on Windows. The source code is not provided as a finished working solution, just as an example how it could be done in the most basic way.

thank you :slight_smile: i try too test my luck with your help again :slight_smile:

Instead of having luck, you might learn, what the difference between a plugin and an application is.
If you create an Application, you can run it by itself. It will need to implement all communication to the audio devices itself (by using JUCE classes, of course).
If you create a plugin, it is meant to run inside a host (also called DAW). It can not run by its own, but will be fed audio and midi, and sends the processed audio back.
As a helper, the “StandAlonePlugin” is a mini-one-plugin-host. So it will just provide the code, that you can run the plugin.

So when you took the SimpleFFTExampleApplication and tried to copy it into the StandAlonePlugin", you had two applications started, that obviously cannot work.

So first you decide, what you want to do, an Application or a Plugin, then you look at the tutorials, how this is done, and then you can start to copy snippets around and see, what happens…

Good “luck”

N.B. that isn’t meant to shut you off, but to help you analysing your problem. If you have further problems, please ask anytime…

Quote of the day: “If you don’t know, what your program is supposed to do, don’t start programming” - Edsger Dyjkstra :wink:

1 Like

:wink: you guys are the best teacher for me :slight_smile:
thank you for being patient with all my questions,
try is better than give up,trying make me understand the limits of my ability :slight_smile:

1 Like