Stand Alone to Plug in


#1

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


#2

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?


#3

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


#4

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


#5

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:


#6

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


#7

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


#8

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…


#9

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


#10

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.)


#11

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


#12

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 :
https://drive.google.com/open?id=1GW-2QomAaHQxR079GSlRhJV591Bgys9T

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.


#13

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


#14

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:


#15

: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: