aroffringa / glight

DMX controller software for live control of stage lighting
GNU General Public License v3.0
31 stars 3 forks source link

[Question] Beatfinder audioLevelAccumulator/audioLevel purpose? #357

Closed Leojet86 closed 1 year ago

Leojet86 commented 1 year ago

Hello,

I was reading your code, espacially the part for the beat finder, and was wondering why you calculate the RMS value of the audio signal. I see you are calculating an audio level with it. But it also seems the while loop that does the beat detection never uses _audioLevelAccumulator, nor _audioLevel.

Am I wrong, or did you use it elsewhere and I don't understood the code ?

Thanks and have a nice day!

aroffringa commented 1 year ago

Hi @Leojet86 , the beat finder exposes the audio level (which is indeed calculated from _audioLevelAccumulator) through its function GetAudioLevel(). The function is called in Management::getChannelValues(), which uses it to initialize the Timing object. The audio level is used by the AudioLevelEffect class, which allows setting an output value to the current audio level (basically let a fixture flicker on the music), as well as more advanced things like the VU meter that can be made with the design wizard.

Leojet86 commented 1 year ago

Haha wow I am blind, I didn't even see the getter ! Thanks for the quick answer, much appreciated !