Open maks opened 3 months ago
Now rebased onto v2.0 branch
@maks Few observations, let me know what you think:
@democloid hmm the code samples the master audio coming out of the audio driver, not individual channels, you can see the left channel code here. It does only take the peak value per sample period (size of the mixbuffer). I wonder if that could be causing the display to be a bit off? I did think about that perhaps I should be getting the RMS power value which is I think what real VU meters try to show but wasn't sure if that would be too heavy calculation doing it per sample?
With clipping, I didn't think following the existing clipping code:
if (v > f_32767) {
v = f_32767;
clipped_ = true;
}
but I guess I can change the colour to match that too, what do you think?
With chains, I'm not showing the chains audio, just the master audio out. All the screens only show master mix out at the moment, as there is no infrastructure to get the per channel audio levels at the moment exposed up to the UI layer, it can be done, it just needs to repeat what I did here for the master mix, but I think that should be a separate PR.
For stopping, yes good point! thats a bug because I must not be clearing the last value on stop event, will fix that.
Doing this on a per sample basis may not be the most accurate way of doing this. What is actually being displayed in that case? given that we update the screen at 50Hz and we have 44100Hz sound, what is actually being displayed? probably the last sample measured before rewriting the screen.
When I mention chains, I mean when you play on the chains screen. In that case, the chain audio IS the master audio. My point is that it doesn't seem like samples from other channels are being represented in the master VU meter. i.e if you check the VU meter for channel 4 you see it's oscillating around ~33% when playing that line I mentioned, but when playing all channels together, VU meter goes to zero often. It could be an artifiact of the sampling I mentioned before.
This adds a VU meter for the the master output, displayed on the far right hand side of the Song, Chain, Phrase and Groove screens (currently no space on the Table screen).
Fixes: #42