[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Intercepting midi events

From: Ben Gonzales
Subject: Re: [fluid-dev] Intercepting midi events
Date: Fri, 8 Jun 2018 14:06:15 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Hi Chris.

I've been running my EWI through a RPi for a while now, but it's going to an external synth. The RPi is really just a router. What I found was that using input via USB I was losing note-offs every now an then. I had to add an extra few lines in the router program to add an extra note-off for the previous note-on after each new note-on arrived. Now, this only works for instruments that produce one note at a time (eg wind). I never really diagnosed the cause, but I think it may have to do with trying to send too quickly via the USB. Maybe the buffers aren't big enough. I don't really know, but I thought it might help.


On 08/06/18 13:21, Christopher Leger wrote:
Thanks Tom for realizing my very stupid mistake! I've made some changes and I have got almost everything working how I wanted it to.

However, I have one issue and this problem happens only when I am running Fluidsynth on my Raspberry Pi 3. When I am jamming away on a lot of keys at one time on the keyboard it seems to sometimes miss midi noteon or noteoff events. I know this because when running Fluidsynth (compiled from the original git source code) if I set the midi channel to an organ and I press a lot of keys and I pull away my hands one or two notes will still be sustaining. It also happens that some notes don't turn on sometimes.

I verified this by adding an error printout to my program to detect noteoff events for notes that are already off and noteon events for notes that are already on. Sure enough I get  one of these error printouts when I hear an issue. 

I checked with top and the PI has plenty of memory and cpu power available when running fluidsynth. The only warning fluidsynth prints out is this:

fluidsynth: warning: Requested a period size of 64, got 256 instead

I don't think this would be related to not receiving midi events right??

Any suggestions?

Thanks for the help,

On Mon, Jun 4, 2018 at 12:53 AM Tom M. <address@hidden> wrote:
> #include "fluid_midi.h"
> #include "fluid_sfont.h"

I will never understand why people keep including fluidsynths private headers. And I'm so tired of repeating that this way of programming is undefined behaviour as there is no API / ABI stability guarantee for internal data types and functions. That's why there are accessor functions of all kinds.

> new_fluid_midi_driver(settings, intercept, NULL);

You bascially asked for the synth instance being NULL. Have you read the API doc of new_fluid_midi_driver() ?


Also you are deleting the synth before deleting the midiDriver. This will cause the midiDriver to call a deleted synth instance. You must always cleanup all objects exactly in the reverse order you've created them.

And your `fluid_midi_driver_t* midiDriver` will be uninitialized if any of the `goto cleanup` happens.


fluid-dev mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]