[LAD] Re: Update of zita-at1

2024-04-24 Thread Fons Adriaensen
On Thu, Apr 25, 2024 at 12:52:07AM +0200, Robin Gareus wrote:
 
> Correct, yet the effective signal delay (which can be measured)
> needs to be reported to the host to align the signal.

And that should be the average value, not the minimum which can be
achieved only during a small fraction of the time (or for unvoiced
signals by forcing them to have a different delay than the average
voiced ones).

> No claim is made that the pitch is corrected within that time.

Indeed, but that is not what I refer to.

Assume for a moment that you are retuning 'up'. That means
that the input is consumed faster than the output sample rate. 

So at some point, since you can't read past the end of input,
you will have to skip back by at least one cycle of the
fundamental frequency, which means the latency will increase
by the same time.

Latency is in fact changing all the time while retuning, and
the only meaningful value is the average one.

For a constant retuning ratio, the latency as a function of
time will be a rising or falling 'sawtooth'. 

The fundamental difference between at1-0.8.1 and previous
versions is that it will try to remain as close as possible
to a well-defined average delay, i.e. minimise the delay
jitter.

> That delay has to be reported to the host.

Of course. But that should be real value. Not some fake one
dreamt up to look good.

-- 
FA



___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-24 Thread Robin Gareus

On 2024-04-25 00:10, Fons Adriaensen wrote:

The way 'fast mode' works in the x42 plugin could give you
a momentary latency of 2 ms, but the average value will be
quite a bit higher and depend on signal content. 


Correct, yet the effective signal delay (which can be measured) needs to 
be reported to the host to align the signal.


No claim is made that the pitch is corrected within that time. The time 
until pitch correction kicks in is obviously [much] longer. For the case 
at hand (live usage) the audible onset is relevant.


If zita-at2 can get that delay down to 10ms, it is likely sufficient.

> Using the same misleading definition of 'latency' I could
> claim whatever I like for zita-at1-0.8.1, even down to zero.

Well, not quite. Calling Retuner::process (), even without any pitch 
correction delays the signal. That delay has to be reported to the host.


This all pertains to how long it takes for the first non-zero sample at 
the input to reach the output of the plugin. The plugin's fast-mode 
decreases that latency for practical purposes.


--
robin


OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-24 Thread Fons Adriaensen
On Wed, Apr 24, 2024 at 10:02:01PM +0200, Robin Gareus wrote:

> > > Except the latency in zita-at1 0.8.1 is still around ~20ms,
> > 
> > It will be 10 ms when selecting low latency mode.
> 
> At 48kHz sample-rate, Retuner::set_lowlat(true) sets Retuner::_latency to
> 1024.

1024 samples at 96 kHz (the signal is upsampled) is 10.67 ms.
And it will maintain that +/- half a cycle of the retuned
frequency. The worst case would be at 75 Hz, +/- 6.7 ms.
At higher pitch the variation will be less. The average
value will always be 10.67 ms.

The way 'fast mode' works in the x42 plugin could give you
a momentary latency of 2 ms, but the average value will be
quite a bit higher and depend on signal content. So that
2 ms is just snake oil. 

Using the same misleading definition of 'latency' I could
claim whatever I like for zita-at1-0.8.1, even down to zero. 

Anyway, I'll make sure that no such false claims will be
made of at2. Even if that means I just can't release it
under a license that allows modifications. There's more
than enough people who are prepared to accept a more
restrictive license, and even pay for it. 

Ciao,

-- 
FA

___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-24 Thread Robin Gareus

On 2024-04-24 21:39, Fons Adriaensen wrote:

On Tue, Apr 23, 2024 at 09:24:20PM +0200, Robin Gareus wrote:

On 2024-04-20 16:41, Fons Adriaensen wrote:


With the new logic deciding on forward / backward jumps, the
low latency mode just came for free


Except the latency in zita-at1 0.8.1 is still around ~20ms,


It will be 10 ms when selecting low latency mode.


At 48kHz sample-rate, Retuner::set_lowlat(true) sets Retuner::_latency 
to 1024.



compared 2ms when using the current plugin's "fast mode".


That must be BS. A typical male voice frequency is 125 Hz,
8 ms. So when the algorithm has to skip a cycle, will the
latency change to -6 ms ??

Did anyone ever verify this ? I did a few minutes ago, by
observing in and out on a scope.


Yes, and the documentation and tool-tip of the "fast" control reads
"Reduces latency by allowing initially uncorrected signal."

Probably not what you expect, but it is a nice hack that works well in 
real world live situations.


--
robin


OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-24 Thread Fons Adriaensen
On Tue, Apr 23, 2024 at 09:24:20PM +0200, Robin Gareus wrote:
> On 2024-04-20 16:41, Fons Adriaensen wrote:
> 
> > With the new logic deciding on forward / backward jumps, the
> > low latency mode just came for free
> 
> Except the latency in zita-at1 0.8.1 is still around ~20ms,

It will be 10 ms when selecting low latency mode.

> compared 2ms when using the current plugin's "fast mode".

That must be BS. A typical male voice frequency is 125 Hz,
8 ms. So when the algorithm has to skip a cycle, will the
latency change to -6 ms ??

Did anyone ever verify this ? I did a few minutes ago, by
observing in and out on a scope.

Normaly latency for the x42-autotune seems to be around 20
ms. Selecting 'fast' doens't seem to make any difference.
Using the thingy in the left upper corner, I get latencies
up to more than half a second, even when this is set to
a few ms.

Sorry, but I've lost all confidence in whoever has been
dabbling with something that he/she clearly doesn't 
understand. If this is the standard of quality of Linux
audio, I'll just stop releasing anything.

Ciao,

-- 
FA

___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-23 Thread Robin Gareus

On 2024-04-20 16:41, Fons Adriaensen wrote:


With the new logic deciding on forward / backward jumps, the
low latency mode just came for free


Except the latency in zita-at1 0.8.1 is still around ~20ms, compared 2ms 
when using the current plugin's "fast mode".



Re. microtuning individual notes: I don't think the retuning
is ever accurate enough for this to be of any use. Or maybe
I misunderstand what you refer to.


It allows one to detune individual notes, and it is sufficiency accurate 
(not unlike changing the reference pitch or notebias).


Those controls are not exposed in the custom plugin UI. They are control 
ports that show up as automation lines in Ardour, or when editing the 
plugin with a generic control UI.


I think it is best to leave the current plugin as-is. Doing so will not 
break existing sessions using the plugin.



I have started a new project without all the custom patches made to the 
AT1 DSP, and without the variants of the current plugin. The new plugin 
will closely follow the upcoming zita-AT2.




What would be great (in particular for zita-at2) would be
a mode were you can e.g. select a region in Ardour, have it
analysed, present the result graphically so it can be edited,
and finally apply the edited version to the region...


It's highly unlikely that we'll reinvent Melodyne. The hard and time 
consuming part is not the DSP, but the the GUI. It is a full time 
project by itself.


But you never know, someone might step up and file a pull request out of 
the blue. Things like this happened before.


--
robin


OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-20 Thread Fons Adriaensen
On Sat, Apr 20, 2024 at 03:47:20PM +0200, Robin Gareus wrote:
 
> Either I have to backport your bug-fixes, or add the missing features to
> your new version.

With the new logic deciding on forward / backward jumps, the 
low latency mode just came for free - all it takes is just
changing the value of one variable. BTW, the 'correct' latency,
the one that would perfectly align the pitch detection with the
signal, would be 5/8, not 1/2 of the input size. But I kept
1/2 in order to match the latency of the original version.
For low latency, I use 1/4, around 10 ms.

The standard 'bugs' were not in the Retuner class, so they
won't affect the plugin code.

Re. microtuning individual notes: I don't think the retuning
is ever accurate enough for this to be of any use. Or maybe
I misunderstand what you refer to.

What would be great (in particular for zita-at2) would be
a mode were you can e.g. select a region in Ardour, have it
analysed, present the result graphically so it can be edited,
and finally apply the edited version to the region...

It would require separating the pitch detection, the logic
that decides on the amound of correction, and the actual
processing of the signal as separately usable components.
I'll keep this in mind when designing zita-at2.

Ciao,

-- 
FA

___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


[LAD] Re: Update of zita-at1

2024-04-20 Thread Robin Gareus

Hi Fons,

it's great to see you have not lot your edge! :)

On 2024-04-20 11:50, Fons Adriaensen wrote:

> The new Retuner class can probably be used without changes
> in the x42-autotuner plugin.
I had a quick look and and sadly it's not that simple. The plugin 
already has a low latency mode, and supports for per note microtuning.


Either I have to backport your bug-fixes, or add the missing features to 
your new version. Then I will have to check that the behavior of 0.8.2 
does not alter the sound of existing sessions using the plugin.


Can you elaborate on the bug fixes that you made?

I'm already looking forward to zita-at2! That will have to be a new 
plugin. So perhaps there is also an option to wait for that to drop.


Thanks for your hard work on this.

--
robin


OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org