Dynamic Background

After my last meeting with Toby, a suggestion was made to fade different colours in the background. The colours being faded into would have some correlation to the sum of the frequencies within a 5 second period and would go on indefinitely while a song was running.

To do this, I first attempted to draw the background but quickly realised this probably was not the way to do it and did some more research, finally finding the lerpColour() function.

To get the desired effect I now sum the readings from the frequency bands over a course of 150 frames which is 150/60 = 2.5 seconds (Processing’s draw method runs at 60 times a second).

Every 2.5 seconds the sum is gathered and the average is found which is then placed in to a variable. Another variable holds the previous 2.5 seconds worth of frequency readings and the lerpColour() function is then used to go between the initial colour and sum and the next colour and sum.

For example, it blends from:

to:

Leave a comment

Design a site like this with WordPress.com
Get started