Hello, I will be very grateful if anyone can help me.
In my plugin, I calculate the white noise level for 30 frequencies. And I want the user to be able to view the values on the GUI (I use IVMeterControl). to display the values I use:
mLastOutputData1.vals[0] = (double)outputs100[0][s];
mRTTextSender1.PushData(mLastOutputData1);
mMeterSender1.ProcessBlock(outputs100, nFrames, kCtrlTagMeter);
but it doesn’t work. I create an output for each frequency as follows: samples** outputs100
Please tell me what I’m doing wrong or if there is a better way to do it
seems a bit strange. Wherever this 63 comes from (i guess you take a fixed 64 frame buffer size into account?). You’re only calculating, storing and sending sample 63.
In addition to what stw said… what memory does the outputs100 double pointer variable point to? it seems un-initialised. You need to allocate some memory for a “scratch” buffer. Here is an example of how I do that using some WDL classes, but you can also do it with, e.g std::vector.
For a 30 channel meter, you could create an IPeakSender member variable in your plug-in class…
IPeakSender<30> mSender;
WDL_TypedBuf<float> mScratchBufferMemory; // see gist for how to resize
WDL_PtrList<float> mScratchBufferPtrs; // see gist for how to assign
Then attach a 30 channel meter in your UI Layout func
exactly, because I need the 64 samples before calculating and displaying the value due level of noise
Ok, but even if this is done correctly you’re storing your value to the output100 buffer only every 64 sample. This buffer is transmitted by your meter sender which is most probably an IPeakSender objetc. In ProcessBlock your values then will be averaged over nFrames, so in your case you’ll get an level/64 output (supposed other buffer values are zero inited?) which might not be what you want.
BTW we already have built in DB<=>Amp conversions: DBToAmp() and AmpToDB()