smoothly transitioning from different files

edited April 2015 in How To...

I have a folder with dozens of different visualizations that I've created using basic Processing. They are all similar in that they take in amplitude and frequency data from an incoming audio stream and use the numbers to influence the particular visual style of the file (for example, roller coaster visualization, drawing circles based on fft).

I will be using this for live applications where say the visualization should change every minute or two... or say when I hit a button... or when the difference in amplitude from the audio stream is large enough over any given second.

I just need a way to abstract all of my visualizations and use one master file to switch between them. How hard is something like that to achieve? Any advice? Is it even possible to do smoothly? Right now I have to stop the visualization. Open a new one and hit Play, which of course isn't automatic and isn't smooth. My first reaction is to just abstract every file to a function in one giant document with some logic and it can choose the functions there, but it seems a little difficult to manage...

Let me know how

Answers

  • Answer ✓

    My first reaction is to just abstract every file to a function in one giant document with some logic and it can choose the functions there, but it seems a little difficult to manage...

    Yeah, that's good. Do that.

  • Answer ✓

    That's an often asked question...
    I made a sketch a long time ago to illustrate the technique you guessed.
    It goes a little further, defining sketches in classes with a common interface to make all sketches similar. Maybe not necessary in your case, if they are already similar.

    http://bazaar.launchpad.net/~philho/+junk/Processing/files/head:/_SmallPrograms/DrawingInSequence/

    Note: made before Processing support Java 5 syntax...

Sign In or Register to comment.