Acessing AudioSampleBuffer from the gui

Hi!

Im new to juce and playing around with it a little. I was wondering what the best way is to access the audiosamplebuffer via the audioprocessoreditor.

 i've already tried using a timercallback but i just can't get the audio data fast enough to display it real time.

can anyone give me some example code which shows the best way to read the audiodata to display it in the gui?

 

bests,

8b17

Don't sip from a fire hose ;-)

More serious:  collect analytical info in processBlock, store the results (VU meter data, peaks, RMS, etc etc in variables owned by  the processor class and read the consolidated data from the (very) much slower GUI thread / timercallback).

And first do some maths on how fast processBlock is accessing individual samples. Your GUI only needs to run at some 30 frames per second. You first need a mindset change ;-)

Succes! Starting with this stuff is not easy, but it may surely pay off!

Hahaha, thanks for the fast reply Peter! ;)

I've already tried to implement a ringbuffer with with the AudioSampleBuffer but this crashes the plugin within seconds. I didn't want to implement a whole new AudioBuffer class so i used the existing and tried to store it in an array but accessing the copied data from the AudioProcessorEditor gives me some BAD_ACESS error when i try to read the samples with getSampleData(chan)[i].

Do you think its smarter to create a sample only ringbuffer?

bests

Thank you Peter! i got it finally working :D. 

collect analytical info in processBlock, store the results (VU meter data, peaks, RMS, etc etc in variables owned by  the processor class

did the job.

 

bests