Ardour Automix script

It would be interesting to implement this jsfx reaper script https://forum.cockos.com/showthread.php?t=173289 in LUA script for Ardour.
From what I could read, does not it seem difficult, i would like tips to implement this because what I know is programming for web

That’s a nice idea. In particular since this is feature that a normal plugin cannot do since plugins cannot easily share information across tracks.

While it would be possible to do this in realtime as leveler-plugins on individual tracks and communicate between plugins (example) this can be problematic because Ardour processes tracks in parallel. There is no fixed order in which the plugins run. Then again, given a large enough window-size and low-pass filtered gain staging, this may or may not matter.

I think a much better way would be to do this offline in the editor: Automatically write a fader-automation curve for the given tracks. You can read faster than realtime and also have direct context of the individual tracks as well. And it also allows to manually tweak the result.

You can probably piece this together using an example script to read raw Audio data and a script to write fader automation.

Just in passing: this is (sadly) what Melodyne’s ARA API is for (to allow plugins non-realtime access to any of the data for track), and that they have still not made possible to use in a GPL application.

LV2 has a (non standard) extension for this as well, but that is only for a single track where the plugin resides on. It doesn’t provide access to data from other tracks nor share memory with other plugins. Does melodyne’s API facilitate this?

Thanks for the reply.
I use an interface with 6 microphones connected for live use, I wanted this functionality so I did not have to constantly mute microphone.
How do I read the audio volume of each of the 6 microphones connected in the ardour?
Is it in this example read raw Audio?

That sounds like a very different thing than auto-mix, vocal-rider. It sounds like you just an expander/gate. Those work well with pod-casts for example.

I’d expect that would work even better. An expander/gate on each input to get rid of background noise and then a compressor on the master-bus for the sum. Like in the linked Automix script the compressor will attenuate if there’s more than one mic active. – Did you try that?

Digital peak is just the absolute value math.abs(sample), although I expect you rather want RMS or maybe even a mix of both. Peaks for onset, RMS for fall-off.

Ardour doesn’t provide a method to compute those values for arbitrary data, but it’s relatively straight forward. The region-gain example linked above iterates over all samples and calculates digital peak. It’s similar to what the reaper script does that you’ve linked: that script also iterates over all samples.

Thank you again.
The problem is that the PA speakers sound opens the gates and consequently all microphones are left open, the solution is to leave all the microphones muted, except for what is currently in use.

The script I need is even simpler than the example that uses the Dugan algorithm, I just need something to read the volume of the microphones and leaving only what is entering the highest volume is open, the others are mutated.

To clarify terminology:

Automix in a studio context (Vocal Rider etc.) is difference from Automix in a live context (Dugan Automixer). Similar, but not quite the same, one is about limiting the number of open microphones, one is about even levels on a single or multiple inputs.

Just to temper expectations:

Dugan’s algorithm also handles multiple microphones very well for speech, just something to keep in mind that many algorithms do not handle well. In fact out of the professional solutions I have heard, I haven’t heard anything compare to Dugan’s algorithms yet, even though a lot of people have taken the original research he did at Altec Lansing and run with it to create their own ‘variants’ that just don’t hold a candle to what he is currently doing.

Dugan’s automixer isn’t about muting microphones not in use as much as it is about lowering the level of all but the most prominent. So if there is no input signal, all microphones are open waiting for input (And the overall output is lowered to accomodate the number of open microphones). This is why you don’t hear the gate open or shut like you do in some ‘automix’ solutions, and why it is actually superior in the proper cases to running expanders, though truth be told I generally run an expander before the automixer anyways, but generally it opens on the quietest of sound from the input and I let the automixer determine the input that should be most prominent.