if i could do this for live input (microphone) to recognize the 'beats' that would be especially useful to me, so far in my animation app if i want to sync if with prerecorded or live music then i need to use a separate app (mixxx for prerecorded and a custom pd patch for live).
i see, this levelMeter is not documented in the wiki.
It's not documented because it's not part of the gideros libs: you can find it as a stand alone class in atilim's repository, but in the end it's just a progress bar
On the question of finding the amplitude from a file, at least in a WAV file I believe the amplitude any any given moment would be the highest value of the sample data within a range that covers the wavelength of the lowest audible sound. That is, you could read the header, find the bits per sample and samples per second, then jump past the header and read the individual samples, and then find the highest value over a range of samples covering the length of time you're interested in, but say at least 1/20 of a second since sounds lower than 20Hz are probably not relevant. If it's a 16 bit WAV file, you'd read 2 bytes, convert it to a number and then compare that against the highest encountered so far, and repeat for (samples per second / 20) values. Then the relative amplitude is that highest value divided by the maximum 16 bit value.
I haven't tried it, but I suspect that would work.
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I guess if peakamplitude > than mean_peak it could be a beat
you mean using this data?:
https://wiki.gideros.rocks/index.php/Event.DATA_AVAILABLE
sounds promising indeed.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
levelMeter is just an indicator (https://github.com/gideros/Microphone/blob/master/example/main.lua)
super easy to substitute with imgui progressBar
also this cited example project does not seem to be offered in gideros at startup.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh
I haven't tried it, but I suspect that would work.
Likes: pie
https://github.com/MultiPain/Gideros_examples/tree/master/WAVe visualizer
Likes: keszegh, pie, MoKaLux, PaulH, hgy29
Likes: pie, MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fixed 32 bits FLOAT.
Fixed "bar" visualization
Likes: MoKaLux, pie
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Made simple recording app xD
Recorded file:
Likes: pie, keszegh, PaulH