CPU Speed

Hello everyone!

So after achieving my goal of creating music-reactive visuals, I know want to improve the performance of my sketches by optimizing the processing speed of the output images. Any ideas how to do this? Is processing capable of creating images based on music realtime without lag?

Answers

  • edited May 2015

    Hello !

    What is your code right now ?

    It's definitly possible to create music-realtime-stuff with Processing

  • Hi there and thanks for the quick reply. So right now, I use ESS R2 audio processing library to pull fft data from a track and I have simple functions that draw 3D shapes based on the bass, mid and treble frequencies.

    For example, I have a pyramid closer to the screen whose size changes based on the amount of bass, it rotates based on the amount of mid frequencies and I have cubes in the background that rotate based on the treble frequencies.

    The way I determine if there is enough of a frequency to cause changes is by comparing the level of that frequency to a certain threshold (determined by trial and error).

    So everything works great but its really laggy and takes long to create videos. Not sure if the code could be more optimal as its already really simple. I have 6 GB of RAM which I think is the problem.

    I'm considering switching to raspberry pi 2. Any tips / advice on how to make things perform faster would be greatly appreciated.

    Thanks!

  • Hello again ! Sorry but it would be really hard to help you without any line of code... I'm almost sure you can do all these stuff with 6 GB ram.

  • does it have to be realtime?

    the classic approach is to do the fft in realtime, saving the results to a file. then a second sketch that reads those results to render non-realtime frames that you then make a video out of.

  • Hi guys,

    My code is a bit too long to post, but I have a feeling that if I use noloop() and do all the processing in setup(), it will be ok since ESS R2 lets you access the fft of a given time in the audio. I'll update on how this goes.

Sign In or Register to comment.