[yoshimi] Re: Potential fix for LV2 envelopes

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Wed, 31 Mar 2021 16:37:54 +0100

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.

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

For standalone as a reference (it's always correct) run this with aplaymidi

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

-- 
Will J Godfrey
http://www.musically.me.uk
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.

Other related posts: