Re: [LAD] [LAU] Ardour MIDI tracer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-dev@...>
Date: Monday, August 18, 2014 - 10:17 am

On Sun, Aug 17, 2014 at 06:34:25PM -0700, Len Ovens wrote:

> I would think ((Gain+54)/64)*7f uses a lot less CPU time than a real

In the equation you mention, 'gain' is in dB, it doesn't make any
sense otherwise. So after applying the inverse of that equation
you need to convert from dB to a linear gain value.

If M is the value sent by the controller (0..127) and G the gain
in db then

G = (64 * M / 127) - 54

which will be in the range -54..+10 dB. M = 0 is probably interpreted
as 'off' instead of -54 dB as a special case. Step size is 64 / 127
dB or 0.504 dB.

A slightly better mapping would be 80 step of 0.5 dB for the
range +10...-30, then smoothly increase the step size to arrive
at a minimum gain of -70 dB or so. Even for this the calculations
are trivial.

There is no problem with CPU use. On the sender side you transmit
0..127 which is just 7 bits of an ADC measuring the voltage from a
linear fader or pot, there is no mapping at all.

On the receiver side, the conversion needs to be done just once
per 25 ms or so and only when the gain changes. Then interpolate
linearly in between, or not at all if the value hasn't changed.
The resulting CPU load is absolutely irrelevant compared to what
has to be done anyway.

As an example, my 4-band EQ LADSPA does this sort of calculations
for each of its 13 parameters. And calculating the internal filter
parameters is a bit more complicated than dB to linear. It makes
no difference at all in CPU use which is dominated by the per-sample
processing.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [LAD] [LAU] Ardour MIDI tracer, Len Ovens, (Mon Aug 18, 1:35 am)
Re: [LAD] [LAU] Ardour MIDI tracer, Fons Adriaensen, (Mon Aug 18, 10:17 am)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Len Ovens, (Wed Aug 20, 2:39 pm)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Fons Adriaensen, (Thu Aug 21, 9:14 am)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Len Ovens, (Fri Aug 22, 3:13 pm)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Fons Adriaensen, (Fri Aug 22, 4:53 pm)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Len Ovens, (Thu Aug 21, 3:32 pm)
[LAD] Half-OT: Fader mapping - was - Ardour MIDI tracer, Ralf Mardorf, (Thu Aug 21, 10:39 am)
Re: [LAD] Half-OT: Fader mapping - was - Ardour MIDI tracer, Fons Adriaensen, (Fri Aug 22, 12:05 pm)
Re: [LAD] Half-OT: Fader mapping - was - Ardour MIDI tracer, Fons Adriaensen, (Fri Aug 22, 9:46 am)
Re: [LAD] Half-OT: Fader mapping - was - Ardour MIDI tracer, Clemens Ladisch, (Thu Aug 21, 5:02 pm)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Ralf Mardorf, (Wed Aug 20, 8:42 pm)
Re: [LAD] Fader mapping - was - Ardour MIDI tracer, Paul Davis, (Wed Aug 20, 4:54 pm)