fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] rendering to file cuts off last note


From: Peter Bartjens
Subject: Re: [fluid-dev] rendering to file cuts off last note
Date: Sun, 24 May 2009 07:24:31 -0700 (PDT)

Hello all,


Thanks David for the quick response.


In the meantime I did some work that I hope will help in fixing the problem.

First, I made this 4 measure masterpiece (hey, hey, don't laugh, until recently 
the pinnacle of my musical achievement was transposing the first few measures 
of a children's song and playing them on piano) 'Cut-off'  that reproduces the 
problem. See the attached midi file 'cut-off.mid'.

Like the tune that I wanted to convert to mp3 it plays fine from within 
Rosegarden (using fluidsynth through qsynth), timidity playing the Rosegarden 
exported .mid file just fine, but  when rendered to a file using FS the last 
(half) note ends abruptly and does so with an ugly, cracking sound.

I use sox to convert the raw file generated by FS to a wav that I can play or 
convert to mp3 like this:


sox -r 48000 -s -b 16 -c 2 fluidsynth.raw cut-off.wav

The wav file is exacly 44 bytes (the wav header size) longer than the raw file, 
so this pretty much rules out sox as a possible culprit.

Using Audacity to generate a wav file.. well same problem.


Your suggestion that the midi file might have something to do with it led me to 
inspect the raw audio output by FS in Audacity. Now, I don't know squat about 
midi or synthesis but what does meet my eye is that the half rest that ends the 
tune isn't rendered and the last note is does indeed
to be cut off before it has become fully to rest. (originally I
included 2 png screen dumps to illustrate this. Unfortunately that made
the body of my mail exceed 40Kb, htting the moderation wall. So on this
second attempt I did not include them.)  

I also used exmid to inspect the midi file (clueless disclaimer inserted here). 
It looks like an event signifying the end of the tracks immediately follows the 
final note off event. Might this have something to do with it? 
(cut-off-midi.xml)

I tried the -F option and it doesn't help: the resulting file has the same 
problems.


The best I've been able to do is have sox pad a tune with half a second or so 
of silence. That avoids the clicking sound problem, but leaves the problem that 
the last note ends abruptly. Which does sound quite bad.


Any ideas on how this could be fixed are appreciated.


Regards,
Peter



----- Original Message ----
> From: David Henningsson <address@hidden>
> To: Fluid Synth <address@hidden>
> Cc: address@hidden
> Sent: Saturday, May 23, 2009 5:44:10 AM
> Subject: Re: [fluid-dev] rendering to file cuts off last note
> 
> Fluid Synth skrev:
> > Hello all,
> > 
> > 
> > I recently started to use fluidsynth. It seems to be a darn fine piece of 
> > work 
> and working well, except that when I render my midi file to a file (in order 
> to 
> convert it to a mp3 that I can play on my cell phone) the last note is cut 
> off. 
> A problem that is somewhat maddening since it doesn't seem to be necessary: 
> why 
> would it make a difference whether the data produced is sent to an audio 
> device 
> or to a flat file, I wonder.
> > 
> > This happens with both FluidSynth 1.0.8 and the svn trunk version (checked 
> > out 
> yesterday). 
> > 
> > The command I use is:
> > 
> > fluidsynth -i -a file /usr/share/soundfonts/PCLite.sf2 tune.mid
> 
> For the trunk version there is a new option for fast midi-file
> rendering. Can you try to see if that makes any difference?
> 
> fluidsynth -F fluidsynth.raw /usr/share/soundfonts/PCLite.sf2 tune.mid
> 
> There is a related ticket (#24) but your issue is not exactly the same
> if it only happens when you're rendering to file.
> 
> If the fast midi-file rendering does not help, perhaps we could have a
> look at the midi file examine the problem a bit deeper.
> 
> // David



      

Attachment: cut-off.mid
Description: MIDI audio

Attachment: cut-off-midi.xml
Description: Text Data


reply via email to

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