Geometry animation in an audio plugin

Hello all,

It’s still my first few days using Juce, so i’m sort of exploring what’s possible with it.

Is it possible to add part of the AnimatedAppComponent functionality to an audio plugin?
In other words, to be able to animate geometry smoothly, be able to have a constant fps rate and so on, in the context of an audio plugin?

I tried to inherit the AnimatedAppComponent class along with AudioProcessorEditor, but apparently that’s not the way to do it. Maybe using repaint() in conjunction with some TimerCallBack might work, but i’m not sure if this would be a good practice (or efficient)

Hope that’s not a rather silly question - I would like to implement a certain VST/AU which will act like some sort of a MIDI sequencer, but it’ll be highly dependant on GUI/graphics events, such object collision.

Thank you

AnimatedAppComponent isn’t really anything but a Component that also inherits Timer to get the timer callback that will call repaint(). So to get what you want, just inherit from Timer for your AudioProcessorEditor. (The AnimatedAppComponent does some extra stuff but not much, as you can see from the source code.)

edit : As mentioned by Daniel below, that doesn’t really solve much of the problems you will be facing with your idea.

1 Like

The actual problem you are facing is, that your plugin’s logic has to work completely without the editor present. You have to model all your events independent from any GUI code.

The second problem is, that you have to be very careful to respect the thread boundaries. Your model simulation must not be updated from a timer, since that is in a different time domain. Your simulation has to be updated in the AudioThread (i.e. processBlock()), and from that you have to be very careful not to block or allocate anything.

I did that once, it is doable, but certainly not entry level. But fun and a lot to learn while trying.


I hear you, i shouldn’t relay on the GUI … i’ll give this some serious thought :blush:
Thank you guys!