Re: [yoshimi-user] MIDI control

  • From: Kristian Amlie <kristian@xxxxxxxxxx>
  • To: yoshimi-user@xxxxxxxxxxxxxxxxxxxxx
  • Date: Sat, 29 Mar 2014 10:42:21 +0100

On 28/03/14 19:56, Will Godfrey wrote:

I'm wondering if there isn't something there already though. I mean, one
GUI update that is easily overlooked is the sound amplitude bars at the
bottom of Yoshimi. The data there clearly comes from DSP thread, yet it
is being rendered in the GUI without performance problems. You might
want to check what it does to achieve that.

That had me puzzled too. I haven't worked out how it gets there but I'm
wodering if, as it's a high priority thread sending quite a small amount of
data to a low priority one it's just taking a chance that the graphics won't
be
significantly disturbed at the *exact* time a write is taking place. Even if
it
was, presumably it would just result in one wrong position on the bargraph.

Yes, that's also possible. It's an approximation after all, so even if
the data is slightly off, it should have no serious effects.

For this to work I think we need a unified point after all adjustments have
been
made to the incoming MIDI data. At that point we write two rings with the
same
data but for different clients.

I'm not familiar enough with the code to know exactly what's required,
but I do know that sharing data between threads is a huge source of bugs
and difficult to get right, so my advice is: Keep it simple!

Yes I intend to. First I'll have a closer look at how Zyn does it. The other
thing is that as far as I know jack midi and alsa midi threads are never both
running, so there should be no contention on the write side of the buffer....
I think.

No, they shouldn't be running simultaneously (I assume you cannot both
specify -j and -a, though I haven't tried). Ring buffers don't generally
support more than one reader/writer at either end, so this is quite
important.

--
Kristian


Other related posts: