[yoshimi] Re: Potential fix for LV2 envelopes

  • From: Kristian Amlie <kristian@xxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Wed, 31 Mar 2021 18:44:56 +0200

On 31.03.2021 17:37, Will Godfrey wrote:

On Tue, 30 Mar 2021 16:44:15 -0500
"Art Horan" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "art.horan" for
DMARC) wrote:

On 3/30/21 4:14 PM, Kristian Amlie wrote:
On 30.03.2021 23:03, Art Horan (Redacted sender art.horan for DMARC) wrote: 
 
On 3/30/21 2:38 PM, Will Godfrey wrote:  
On Tue, 30 Mar 2021 21:02:51 +0200
Kristian Amlie <kristian@xxxxxxxxxx> wrote:
 
Can anyone on this list reproduce the problem where Envelopes sometimes
have wrong timings when used under LV2?

I may have a potential fix for it, but I'm not able to verify that it
solves the problem.
 
I have a couple of Ardour tracks that show this up.
 
I haven't noticed a problem with envelopes using the lv2 in Qtractor or
Reaper.

What should I be looking for? Is it subtle or obvious? What versions?  
It's heavily host dependent. And the problem is exactly that I don't
know which hosts trigger it and under what circumstances. I have
certainly seen the problem myself, but it's inconsistent, and now that I
needed to test it, of course the host was acting nicely.

I know exactly what the underlying reason is: It's because some hosts
will sometimes pass in shorter block sizes than the full block size.
This is allowed by the LV2 spec, and even expected in some cases.
However, it's hard to tell exactly when hosts will do it.
 
I'll look for problems then and report if I notice any. I also sometimes 
use Carla as an lv2 host too, but I never took to Ardour.

I have a test MIDI file that shows this up to the extreme. Kristian's patch
fixes most of it but there is still some funky stuff going on :(

It's very much dependent on buffer size. Less that 256 frames, and there is no
noticeable problem. By the time to get to 1024 frames it's really bad. But 
that
has to be be *both* Yoshimi's internal buffer size and the Jack buffer size.

By this you mean that you also set Yoshimi's buffer size (in
configuration) to 1024 and higher? Did my patch introduce that problem,
or was it always like that?

You could also try with the updated patch in the PR. As discussed
privately there was a small... ahem.. mistake, in the first patch! With
the debug prints it was adding this could have adverse effects on the
real time performance. Though I would expect this problem to be worse at
lower buffer sizes, not higher...

Admittedly there was one part of the existing algorithm I did not quite
understand, but I suspect it is related to big buffer sizes. I thought
my patch didn't change that, but I can dig deeper into this if my patch
is causing problems in this area.

I've attached the file here if you want to give it a try.
It makes bank and program changes so you have to do the following for it to
match:
Disable bank root change.
In the current bank Will_Godfrey_Collection must be bank 105
and Will_Godfrey_Companion must be bank 110

Which host were you running, Ardour?

Carla definitely uses variable buffer sizes a lot, so I expect it would show 
up
on that too.

Yes, and Carla is the one I use all the time. But the thing is that I
think Carla only mirrors what the actual host uses (I host Yoshimi
inside Carla hosted inside Renoise), and for some reason I can't
reproduce it anymore, even though I could before.

-- 
Kristian
Yoshimi source code is available from either: 
https://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: