madtom1999
Posts: 54
Joined: Mon Jul 29, 2013 4:37 pm

timidity a2jmidid realtime

Sat Aug 13, 2016 10:28 am

Using a Pi3 to play with music synthesis with jackd.
The sound quality from qsynth/fluidsynth is appalling for some reason.
I can get good sound quality from timidity and using a2jmidid to create the jack connections but a2jmidid complains it cant do realtime on the timidity and while the setup mostly works fine there can be latency problems.
Does anyone know how to get timidity to connect to a2jmidid in with realtime?
Cheers

Yggdrasil
Posts: 138
Joined: Sun Aug 26, 2012 8:45 pm

Re: timidity a2jmidid realtime

Wed Aug 17, 2016 7:22 am

madtom1999 wrote: The sound quality from qsynth/fluidsynth is appalling for some reason.
Hello,

not an answer to your origin question, but did you use fluidsynth with multiple cores? I've got good results on three cpu cores and alsa. My startup command:

Code: Select all

fluidsynth -r 44100 -o synth.cpu-cores=3 -a alsa -m alsa_seq -l -i /usr/share/sounds/sf2/FluidR3_GM.sf2 "[midi file]"


IanS
Posts: 232
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: timidity a2jmidid realtime

Thu Nov 24, 2016 5:45 pm

I have been working on a project that requires sound generation after a button press with as low a latency as possible, and have had good success using fluidsynth and pyfluidsynth even with over 100 sounds (there are lots of buttons!) being triggered simultaneously or staggered but overlapping. I use 2 periods with a period size of 64, and disable the internal reverb and chorus effects.
I have a delay of 60ms from triggering the button to hearing the sound, of which about 80% is fluidsynth. This is not quite real time, but close enough for me. Different peoples' perceptions may vary, but I found through experimentation that I notice a delay if it is at least 100ms. I would like to get it below 50ms, but beyond that does not matter for my purposes.
Fluidsynth does start to sound appalling if I try over about 170 simultaneous sounds, as it does not have time to calculate the buffer contents before the start of the next period.
I found that using multiple cores on an RPi v3 did not help, probably due to the overhead of setting up the parallelisation, but giving fluidsynth a dedicated single core did. I added isolcpus=3 to /boot/cmdline.txt and started fluidsynth through taskset -c 3. The first stops processes running on core 3 unless explicitly put there, and taskset puts it there.
I have also found that the soundfont can make a big difference. Soundfonts work by combining one or more samples and possibly applying some processing to each or the combined total. Using a soundfont that just use a single sample and no processing for each instrument, so that processing is minimal, helps enormously.

Return to “Graphics, sound and multimedia”