praxis-live / support

Documentation and issue tracking
9 stars 2 forks source link

audio:analysis:level returns nothing #51

Closed unfa closed 6 years ago

unfa commented 6 years ago

The Audio Level Analysis component does never return anything else than zeros. Tested with both audio backends available under Linux (JACK and Java Audio) Audio processing works, but not the analysis.

I am new to PraxisLIVE - am I missing something basic or this is really a bug?

Here's a simple test project I created: Audio-Video Test-01.zip

It captures video from a camera and should make it brighter when the audio level is higher. To prove that audio system is working - it also adds a reverb effect and plays the audio (attenuated output to avoid problems - but make sure you don't have a mic laying under a speaker when you run this patch!).

The problem is - it doesn't work. Can anybody confirm that?

And since I'm in a need for a quick fix (I'd like to get a simple audio visualiser working for an event and my only chance to get that working is tomorrow) - how can I get the audio level measurement in a different way? Is there a custom component or maybe some simple code I can paste into the "Custom" audio component?

Or maybe a different version of PraxisLIVE will work? I used the official stable release in .deb package.

I'm working under Linux Mint 18.2 with KDE5 and KX Studio Repositories. Lowlatency Linux kernel 4.11.

Thank you for this amazing piece of software! :)

neilcsmith-net commented 6 years ago

Hi!

There's a bug in your project, although might not be obvious from the docs - the audio:analysis:level component needs to have the audio flowing through it. If there's nothing connected to the audio out, then there's no audio to calculate.

Connect the audio through the level analysis to the reverb and it works fine.

Check out the custom components repo - there's a normalize component under core - put that between the level anaylsis and the send and it will normalize values into the 0..1 range.

Also try a core:timing:animator between the property and whatever you're controlling in the video patch to help smooth things out.

If you use the JACK backend, you can only connect the audio input to Praxis LIVE if you don't want to send the audio output anywhere.

You can export the FFT component the live coding example if you want an alternative visualiser, although you'll have to drop into code to control things with it.

Hope that helps. Best wishes, Neil

unfa commented 6 years ago

I see! So it's basically the result of PraxisLIVE's optimisation routines. Could this behaviour be noted somewhere in the online manual? I have read almost all of it and I didn't find this information anywhere.

Anyway - I'm going to fix my project now and test this! Thank you!

I'll keep it based on a filter bank - tuned for kicks (100 Hz) snares (200 Hz), mids (500 Hz) and trebles (2kHz). I'll see if I can make use of the stereo information there too. It should already give me a lot sound-actuated motion. Without digging too much into the code (using the FFT is beyond my skillset right now).

unfa commented 6 years ago

Another questions I have : what is the expected value range for audio:analysis:level property output? I could use the scale component to remap the ranges, but I have no idea what to expect.

unfa commented 6 years ago

It's working!

neilcsmith-net commented 6 years ago

It's not an optimisation as such. You need to realise that both audio and video data is pulled from the output, so without something connected to an out (and eventually to the output) to pull the data through, nothing will happen. This should perhaps be made more obvious in the documentation.

There is an optimisation to be aware of - if you have a gain set to a level of zero, then data is also not pulled through.

The analysis is in the 0..1 range, but is unlikely ever to get that high. As mentioned earlier, try the normalisation component in the core category in the custom components - this will expand the range to 0..1.

Glad it's working! 😄

unfa commented 6 years ago

I tried the Normalisation component, but I didn't really understand what it was doing - I used Core:Math:Scale and it did the work great - I can clamp input and ouptput - do gating and clipping, and I can invert the output range. I could get the animator component to smooth out the spikes, I get s lot of flashy images sometimes, I tried easing this slightly of by adding some reverb on the input before analysis. Anyway- it's making psychedelic flashy animations based on the audio, so it's great :D With MIDI CC control over the input level I can change the brightness of the whole thing.