Clicking Noise On Some SoundFonts

View: New views
19 Messages — Rating Filter:   Alert me  

Clicking Noise On Some SoundFonts

by A. Kalten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello list,

Timidity usually gives good results, but on some soundfonts it will
produce an annoying clicking sound.  As an example, I have uploaded
an MP3 of a wave file created with Timidity that contains the clicking
noise.  Also uploaded are the MIDI file and the soundfont used (there
is only a single instrument involved).

http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)

http://firstbooks.biz/midi/beatgen.mid

http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330 kB)

Note: This is a microtonal composition, so if the tuning sounds a bit
off it is deliberate.

If I render this file with fluidsynth the clicking noise does not
occur.  Also, if I tweak the attack or decay rates in the Timidity
configuration file, I can mitigate the clicking noise somewhat but
cannot eliminate it entirely.

Could this be a problem with the soundfont or is Timidity just not
able to process SF2 fonts completely?

Regards,

AK


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Aaron Krister Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I can confirm that this happens to me too, and can also confirm that it is indeed annoying!

I've noticed it for all versions of Timidity as far back as I can remember using it, say from 2003....

Best,
AKJ

A. Kalten wrote:
Hello list,

Timidity usually gives good results, but on some soundfonts it will
produce an annoying clicking sound.  As an example, I have uploaded
an MP3 of a wave file created with Timidity that contains the clicking
noise.  Also uploaded are the MIDI file and the soundfont used (there
is only a single instrument involved).

http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)

http://firstbooks.biz/midi/beatgen.mid

http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330 kB)

Note: This is a microtonal composition, so if the tuning sounds a bit
off it is deliberate.

If I render this file with fluidsynth the clicking noise does not
occur.  Also, if I tweak the attack or decay rates in the Timidity
configuration file, I can mitigate the clicking noise somewhat but
cannot eliminate it entirely.

Could this be a problem with the soundfont or is Timidity just not
able to process SF2 fonts completely?

Regards,

AK


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Timidity-talk mailing list
Timidity-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tried the links below to the problematic files, but they don't appear to
work anymore.  Could the original author repost them somewhere else?

-Eric

On Wed, 26 Aug 2009, Aaron Krister Johnson wrote:

> Hi,
>
> I can confirm that this happens to me too, and can also confirm that it is
> indeed annoying!
>
> I've noticed it for all versions of Timidity as far back as I can remember
> using it, say from 2003....
>
> Best,
> AKJ
>
>
> A. Kalten wrote:
> >
> > Hello list,
> >
> > Timidity usually gives good results, but on some soundfonts it will
> > produce an annoying clicking sound.  As an example, I have uploaded
> > an MP3 of a wave file created with Timidity that contains the clicking
> > noise.  Also uploaded are the MIDI file and the soundfont used (there
> > is only a single instrument involved).
> >
> > http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)
> >
> > http://firstbooks.biz/midi/beatgen.mid
> >
> > http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330 kB)
> >
> > Note: This is a microtonal composition, so if the tuning sounds a bit
> > off it is deliberate.
> >
> > If I render this file with fluidsynth the clicking noise does not
> > occur.  Also, if I tweak the attack or decay rates in the Timidity
> > configuration file, I can mitigate the clicking noise somewhat but
> > cannot eliminate it entirely.
> >
> > Could this be a problem with the soundfont or is Timidity just not
> > able to process SF2 fonts completely?
> >
> > Regards,
> >
> > AK
> >
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> > prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> > world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Timidity-talk mailing list
> > Timidity-talk@...
> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25164608.html
> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Timidity-talk mailing list
> Timidity-talk@...
> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Aaron Krister Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eric,

I couldn't find the files either...it looks like a file-sharing site whose links have expired...anyway, are you a developer for Timidity? It would be great to get to the bottom of this issue!

Best,
AKJ

http://www.untwelve.org
http://www.akjmusic.com

Eric Welsh wrote:
I tried the links below to the problematic files, but they don't appear to
work anymore.  Could the original author repost them somewhere else?

-Eric

On Wed, 26 Aug 2009, Aaron Krister Johnson wrote:

> Hi,
>
> I can confirm that this happens to me too, and can also confirm that it is
> indeed annoying!
>
> I've noticed it for all versions of Timidity as far back as I can remember
> using it, say from 2003....
>
> Best,
> AKJ
>
>
> A. Kalten wrote:
> >
> > Hello list,
> >
> > Timidity usually gives good results, but on some soundfonts it will
> > produce an annoying clicking sound.  As an example, I have uploaded
> > an MP3 of a wave file created with Timidity that contains the clicking
> > noise.  Also uploaded are the MIDI file and the soundfont used (there
> > is only a single instrument involved).
> >
> > http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)
> >
> > http://firstbooks.biz/midi/beatgen.mid
> >
> > http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330 kB)
> >
> > Note: This is a microtonal composition, so if the tuning sounds a bit
> > off it is deliberate.
> >
> > If I render this file with fluidsynth the clicking noise does not
> > occur.  Also, if I tweak the attack or decay rates in the Timidity
> > configuration file, I can mitigate the clicking noise somewhat but
> > cannot eliminate it entirely.
> >
> > Could this be a problem with the soundfont or is Timidity just not
> > able to process SF2 fonts completely?
> >
> > Regards,
> >
> > AK
> >
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> > prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> > world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Timidity-talk mailing list
> > Timidity-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25164608.html
> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Timidity-talk mailing list
> Timidity-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 27 Aug 2009, Aaron Krister Johnson wrote:

> I couldn't find the files either...it looks like a file-sharing site whose
> links have expired...anyway, are you a developer for Timidity? It would be
> great to get to the bottom of this issue!
>
> Best,
> AKJ

I'm haven't been active in development recently, but I've done some work
with envelopes and associated click problems in the past.  I'm a little
limited in my SF2 knowledge, but I could probably dig a bit into the code
to see if it is an SF2 specific envelope problem, or if it is an envelope
problem at all.  If you have problematic files of your own, send them my
way and I can start taking a look them.

-Eric

> http://www.untwelve.org
> http://www.akjmusic.com
>
>
> Eric Welsh wrote:
> >
> > I tried the links below to the problematic files, but they don't appear to
> > work anymore.  Could the original author repost them somewhere else?
> >
> > -Eric
> >
> > On Wed, 26 Aug 2009, Aaron Krister Johnson wrote:
> >
> >> Hi,
> >>
> >> I can confirm that this happens to me too, and can also confirm that it
> >> is
> >> indeed annoying!
> >>
> >> I've noticed it for all versions of Timidity as far back as I can
> >> remember
> >> using it, say from 2003....
> >>
> >> Best,
> >> AKJ
> >>
> >>
> >> A. Kalten wrote:
> >> >
> >> > Hello list,
> >> >
> >> > Timidity usually gives good results, but on some soundfonts it will
> >> > produce an annoying clicking sound.  As an example, I have uploaded
> >> > an MP3 of a wave file created with Timidity that contains the clicking
> >> > noise.  Also uploaded are the MIDI file and the soundfont used (there
> >> > is only a single instrument involved).
> >> >
> >> > http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)
> >> >
> >> > http://firstbooks.biz/midi/beatgen.mid
> >> >
> >> > http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330 kB)
> >> >
> >> > Note: This is a microtonal composition, so if the tuning sounds a bit
> >> > off it is deliberate.
> >> >
> >> > If I render this file with fluidsynth the clicking noise does not
> >> > occur.  Also, if I tweak the attack or decay rates in the Timidity
> >> > configuration file, I can mitigate the clicking noise somewhat but
> >> > cannot eliminate it entirely.
> >> >
> >> > Could this be a problem with the soundfont or is Timidity just not
> >> > able to process SF2 fonts completely?
> >> >
> >> > Regards,
> >> >
> >> > AK
> >> >
> >> >
> >> >
> >> -------------------------------------------------------------------------
> >> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> > challenge
> >> > Build the coolest Linux based applications with Moblin SDK & win great
> >> > prizes
> >> > Grand prize is a trip for two to an Open Source event anywhere in the
> >> > world
> >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> > _______________________________________________
> >> > Timidity-talk mailing list
> >> > Timidity-talk@...
> >> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25164608.html
> >> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> >> 30-Day
> >> trial. Simplify your report design, integration and deployment - and
> >> focus on
> >> what you do best, core application coding. Discover what's new with
> >> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> >> _______________________________________________
> >> Timidity-talk mailing list
> >> Timidity-talk@...
> >> https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >>
> >
> > ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> > 30-Day
> > trial. Simplify your report design, integration and deployment - and focus
> > on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > Timidity-talk mailing list
> > Timidity-talk@...
> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25171137.html
> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Timidity-talk mailing list
> Timidity-talk@...
> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Aaron Krister Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Eric,

Attached is a MIDI file of some Medieval music by Machaut that has audible clicks when used with the Personal Copy GM soundfont (using the recorder patch, program 75 in 1-based counting, or 74 in 0-based counting scheme)...

I trust you can track down, or already may have the Personal Copy GM soundfont, but in case you can't here's a link to it that I've uploaded to my site:

http://www.akjmusic.com/PC51d.sf2 (58mb download!!)

Hope this can help Timidity developers track down the click problem! :)

Best,
AKJ

http://www.akjmusic.com
http://www.untwelve.org
machaut-b15-gm.mid
Eric Welsh wrote:
On Thu, 27 Aug 2009, Aaron Krister Johnson wrote:

> I couldn't find the files either...it looks like a file-sharing site whose
> links have expired...anyway, are you a developer for Timidity? It would be
> great to get to the bottom of this issue!
>
> Best,
> AKJ

I'm haven't been active in development recently, but I've done some work
with envelopes and associated click problems in the past.  I'm a little
limited in my SF2 knowledge, but I could probably dig a bit into the code
to see if it is an SF2 specific envelope problem, or if it is an envelope
problem at all.  If you have problematic files of your own, send them my
way and I can start taking a look them.

-Eric

> http://www.untwelve.org
> http://www.akjmusic.com
>
>
> Eric Welsh wrote:
> >
> > I tried the links below to the problematic files, but they don't appear to
> > work anymore.  Could the original author repost them somewhere else?
> >
> > -Eric
> >
> > On Wed, 26 Aug 2009, Aaron Krister Johnson wrote:
> >
> >> Hi,
> >>
> >> I can confirm that this happens to me too, and can also confirm that it
> >> is
> >> indeed annoying!
> >>
> >> I've noticed it for all versions of Timidity as far back as I can
> >> remember
> >> using it, say from 2003....
> >>
> >> Best,
> >> AKJ
> >>
> >>
> >> A. Kalten wrote:
> >> >
> >> > Hello list,
> >> >
> >> > Timidity usually gives good results, but on some soundfonts it will
> >> > produce an annoying clicking sound.  As an example, I have uploaded
> >> > an MP3 of a wave file created with Timidity that contains the clicking
> >> > noise.  Also uploaded are the MIDI file and the soundfont used (there
> >> > is only a single instrument involved).
> >> >
> >> > http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)
> >> >
> >> > http://firstbooks.biz/midi/beatgen.mid
> >> >
> >> > http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330 kB)
> >> >
> >> > Note: This is a microtonal composition, so if the tuning sounds a bit
> >> > off it is deliberate.
> >> >
> >> > If I render this file with fluidsynth the clicking noise does not
> >> > occur.  Also, if I tweak the attack or decay rates in the Timidity
> >> > configuration file, I can mitigate the clicking noise somewhat but
> >> > cannot eliminate it entirely.
> >> >
> >> > Could this be a problem with the soundfont or is Timidity just not
> >> > able to process SF2 fonts completely?
> >> >
> >> > Regards,
> >> >
> >> > AK
> >> >
> >> >
> >> >
> >> -------------------------------------------------------------------------
> >> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> > challenge
> >> > Build the coolest Linux based applications with Moblin SDK & win great
> >> > prizes
> >> > Grand prize is a trip for two to an Open Source event anywhere in the
> >> > world
> >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> > _______________________________________________
> >> > Timidity-talk mailing list
> >> > Timidity-talk@lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25164608.html
> >> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> >> 30-Day
> >> trial. Simplify your report design, integration and deployment - and
> >> focus on
> >> what you do best, core application coding. Discover what's new with
> >> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> >> _______________________________________________
> >> Timidity-talk mailing list
> >> Timidity-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >>
> >
> > ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> > 30-Day
> > trial. Simplify your report design, integration and deployment - and focus
> > on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > Timidity-talk mailing list
> > Timidity-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25171137.html
> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Timidity-talk mailing list
> Timidity-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First thing I tried was to load the sf2 bank up in Awave and resave it as
a PAT.  I could then use the -P flag to force all instruments to be played
using the specified .pat instrument file.  My standard recorder (the one
in FreePats) sounds fine.  The pc51d derived recorder pat file clearly
exhibits the "clicking" noises you described.  This rules out any sf2
specific envelope problems, since the problem is in the Gravis PAT format
as well.

Looking at the recorder envelope, it appears that it has no release
rate at all.  So, when the note ends, the note simply ends abruptly
without any decaying volume ramp.  This is very likely what is causing the
clicking sound.  Any extremely rapid change in volume level, such as going
from a playing note to instantly zero amplitude, will cause an audible
click in your speakers.

Adding a decent release envelope solved the problem.  This is not a
problem with timidity, but a problem with the instrument not having any
kind of sane envelope.  Timidity is behaving as it should and
ending the note immediately upon a NOTEOFF event, since there is no
release decay envelope.  Speaking from my experience of looking at many
many sf2 banks over the years, this is not unusual....  You can fix the
problem by either resaving the sf2 bank after editing the envelope in an
instrument editor, or add flags within the timidity .cfg files you are
using to control that specific instrument's envelope.  Unfortunately, I do
not remember the syntax for how to do this in the .cfg files :(

Maybe someone else can chime in with how to alter SF2 (or even PAT)
envelopes from within timidity .cfg files.

-Eric

On Thu, 27 Aug 2009, Aaron Krister Johnson wrote:

>
>
> Hi Eric,
>
> Attached is a MIDI file of some Medieval music by Machaut that has audible
> clicks when used with the Personal Copy GM soundfont (using the recorder
> patch, program 75 in 1-based counting, or 74 in 0-based counting scheme)...
>
> I trust you can track down, or already may have the Personal Copy GM
> soundfont, but in case you can't here's a link to it that I've uploaded to
> my site:
>
> http://www.akjmusic.com/PC51d.sf2 (58mb download!!)
>
> Hope this can help Timidity developers track down the click problem! :)
>
> Best,
> AKJ
>
> http://www.akjmusic.com
> http://www.untwelve.org
> http://www.nabble.com/file/p25177354/machaut-b15-gm.mid machaut-b15-gm.mid
>
> Eric Welsh wrote:
> >
> > On Thu, 27 Aug 2009, Aaron Krister Johnson wrote:
> >
> >> I couldn't find the files either...it looks like a file-sharing site
> >> whose
> >> links have expired...anyway, are you a developer for Timidity? It would
> >> be
> >> great to get to the bottom of this issue!
> >>
> >> Best,
> >> AKJ
> >
> > I'm haven't been active in development recently, but I've done some work
> > with envelopes and associated click problems in the past.  I'm a little
> > limited in my SF2 knowledge, but I could probably dig a bit into the code
> > to see if it is an SF2 specific envelope problem, or if it is an envelope
> > problem at all.  If you have problematic files of your own, send them my
> > way and I can start taking a look them.
> >
> > -Eric
> >
> >> http://www.untwelve.org
> >> http://www.akjmusic.com
> >>
> >>
> >> Eric Welsh wrote:
> >> >
> >> > I tried the links below to the problematic files, but they don't appear
> >> to
> >> > work anymore.  Could the original author repost them somewhere else?
> >> >
> >> > -Eric
> >> >
> >> > On Wed, 26 Aug 2009, Aaron Krister Johnson wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I can confirm that this happens to me too, and can also confirm that
> >> it
> >> >> is
> >> >> indeed annoying!
> >> >>
> >> >> I've noticed it for all versions of Timidity as far back as I can
> >> >> remember
> >> >> using it, say from 2003....
> >> >>
> >> >> Best,
> >> >> AKJ
> >> >>
> >> >>
> >> >> A. Kalten wrote:
> >> >> >
> >> >> > Hello list,
> >> >> >
> >> >> > Timidity usually gives good results, but on some soundfonts it will
> >> >> > produce an annoying clicking sound.  As an example, I have uploaded
> >> >> > an MP3 of a wave file created with Timidity that contains the
> >> clicking
> >> >> > noise.  Also uploaded are the MIDI file and the soundfont used
> >> (there
> >> >> > is only a single instrument involved).
> >> >> >
> >> >> > http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)
> >> >> >
> >> >> > http://firstbooks.biz/midi/beatgen.mid
> >> >> >
> >> >> > http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330
> >> kB)
> >> >> >
> >> >> > Note: This is a microtonal composition, so if the tuning sounds a
> >> bit
> >> >> > off it is deliberate.
> >> >> >
> >> >> > If I render this file with fluidsynth the clicking noise does not
> >> >> > occur.  Also, if I tweak the attack or decay rates in the Timidity
> >> >> > configuration file, I can mitigate the clicking noise somewhat but
> >> >> > cannot eliminate it entirely.
> >> >> >
> >> >> > Could this be a problem with the soundfont or is Timidity just not
> >> >> > able to process SF2 fonts completely?
> >> >> >
> >> >> > Regards,
> >> >> >
> >> >> > AK
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> -------------------------------------------------------------------------
> >> >> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> >> > challenge
> >> >> > Build the coolest Linux based applications with Moblin SDK & win
> >> great
> >> >> > prizes
> >> >> > Grand prize is a trip for two to an Open Source event anywhere in
> >> the
> >> >> > world
> >> >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> >> > _______________________________________________
> >> >> > Timidity-talk mailing list
> >> >> > Timidity-talk@...
> >> >> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25164608.html
> >> >> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >>
> >> ------------------------------------------------------------------------------
> >> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> >> >> 30-Day
> >> >> trial. Simplify your report design, integration and deployment - and
> >> >> focus on
> >> >> what you do best, core application coding. Discover what's new with
> >> >> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> >> >> _______________________________________________
> >> >> Timidity-talk mailing list
> >> >> Timidity-talk@...
> >> >> https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >> >>
> >> >
> >> >
> >> ------------------------------------------------------------------------------
> >> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> >> > 30-Day
> >> > trial. Simplify your report design, integration and deployment - and
> >> focus
> >> > on
> >> > what you do best, core application coding. Discover what's new with
> >> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> >> > _______________________________________________
> >> > Timidity-talk mailing list
> >> > Timidity-talk@...
> >> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25171137.html
> >> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> >> 30-Day
> >> trial. Simplify your report design, integration and deployment - and
> >> focus on
> >> what you do best, core application coding. Discover what's new with
> >> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> >> _______________________________________________
> >> Timidity-talk mailing list
> >> Timidity-talk@...
> >> https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >>
> >
> > ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> > 30-Day
> > trial. Simplify your report design, integration and deployment - and focus
> > on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > Timidity-talk mailing list
> > Timidity-talk@...
> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25177354.html
> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Timidity-talk mailing list
> Timidity-talk@...
> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Aaron Krister Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Eric,

I was just about to write you to say that I came up with the same solution!!!

I realized that adding a release envelope on the order of 180-200 or
sometimes more did the trick (it was at first confusing, b/c quicker
envelopes get *higher* numbers (like 255 being fastest), not lower...I
wonder if they are denominators of a fraction in some kind of
non-linear time equation??)

Anyway, the syntax is described on the manpage. Here's an example:

bank 0
0 %font MyFontName.sf2 0 0 rate=:::180 strip=tail

I added the 'strip=tail' option b/c it mentions clicking in the
manpage, but it doesn't seem to be the critical piece...the critical
piece is the 'rate=:::180' option.
Since we are just setting release time, the attack, decay & sustain
portions are left default, and are hence empty with their following
colons.

Thanks for looking into this...everything works really well now!

Best,
AKJ

On Thu, Aug 27, 2009 at 10:56 PM, Eric Welsh<ewelsh@...> wrote:

> First thing I tried was to load the sf2 bank up in Awave and resave it as
> a PAT.  I could then use the -P flag to force all instruments to be played
> using the specified .pat instrument file.  My standard recorder (the one
> in FreePats) sounds fine.  The pc51d derived recorder pat file clearly
> exhibits the "clicking" noises you described.  This rules out any sf2
> specific envelope problems, since the problem is in the Gravis PAT format
> as well.
>
> Looking at the recorder envelope, it appears that it has no release
> rate at all.  So, when the note ends, the note simply ends abruptly
> without any decaying volume ramp.  This is very likely what is causing the
> clicking sound.  Any extremely rapid change in volume level, such as going
> from a playing note to instantly zero amplitude, will cause an audible
> click in your speakers.
>
> Adding a decent release envelope solved the problem.  This is not a
> problem with timidity, but a problem with the instrument not having any
> kind of sane envelope.  Timidity is behaving as it should and
> ending the note immediately upon a NOTEOFF event, since there is no
> release decay envelope.  Speaking from my experience of looking at many
> many sf2 banks over the years, this is not unusual....  You can fix the
> problem by either resaving the sf2 bank after editing the envelope in an
> instrument editor, or add flags within the timidity .cfg files you are
> using to control that specific instrument's envelope.  Unfortunately, I do
> not remember the syntax for how to do this in the .cfg files :(
>
> Maybe someone else can chime in with how to alter SF2 (or even PAT)
> envelopes from within timidity .cfg files.
>
> -Eric
>
> On Thu, 27 Aug 2009, Aaron Krister Johnson wrote:
>
>>
>>
>> Hi Eric,
>>
>> Attached is a MIDI file of some Medieval music by Machaut that has audible
>> clicks when used with the Personal Copy GM soundfont (using the recorder
>> patch, program 75 in 1-based counting, or 74 in 0-based counting scheme)...
>>
>> I trust you can track down, or already may have the Personal Copy GM
>> soundfont, but in case you can't here's a link to it that I've uploaded to
>> my site:
>>
>> http://www.akjmusic.com/PC51d.sf2 (58mb download!!)
>>
>> Hope this can help Timidity developers track down the click problem! :)
>>
>> Best,
>> AKJ
>>
>> http://www.akjmusic.com
>> http://www.untwelve.org
>> http://www.nabble.com/file/p25177354/machaut-b15-gm.mid machaut-b15-gm.mid
>>
>> Eric Welsh wrote:
>> >
>> > On Thu, 27 Aug 2009, Aaron Krister Johnson wrote:
>> >
>> >> I couldn't find the files either...it looks like a file-sharing site
>> >> whose
>> >> links have expired...anyway, are you a developer for Timidity? It would
>> >> be
>> >> great to get to the bottom of this issue!
>> >>
>> >> Best,
>> >> AKJ
>> >
>> > I'm haven't been active in development recently, but I've done some work
>> > with envelopes and associated click problems in the past.  I'm a little
>> > limited in my SF2 knowledge, but I could probably dig a bit into the code
>> > to see if it is an SF2 specific envelope problem, or if it is an envelope
>> > problem at all.  If you have problematic files of your own, send them my
>> > way and I can start taking a look them.
>> >
>> > -Eric
>> >
>> >> http://www.untwelve.org
>> >> http://www.akjmusic.com
>> >>
>> >>
>> >> Eric Welsh wrote:
>> >> >
>> >> > I tried the links below to the problematic files, but they don't appear
>> >> to
>> >> > work anymore.  Could the original author repost them somewhere else?
>> >> >
>> >> > -Eric
>> >> >
>> >> > On Wed, 26 Aug 2009, Aaron Krister Johnson wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> I can confirm that this happens to me too, and can also confirm that
>> >> it
>> >> >> is
>> >> >> indeed annoying!
>> >> >>
>> >> >> I've noticed it for all versions of Timidity as far back as I can
>> >> >> remember
>> >> >> using it, say from 2003....
>> >> >>
>> >> >> Best,
>> >> >> AKJ
>> >> >>
>> >> >>
>> >> >> A. Kalten wrote:
>> >> >> >
>> >> >> > Hello list,
>> >> >> >
>> >> >> > Timidity usually gives good results, but on some soundfonts it will
>> >> >> > produce an annoying clicking sound.  As an example, I have uploaded
>> >> >> > an MP3 of a wave file created with Timidity that contains the
>> >> clicking
>> >> >> > noise.  Also uploaded are the MIDI file and the soundfont used
>> >> (there
>> >> >> > is only a single instrument involved).
>> >> >> >
>> >> >> > http://firstbooks.biz/midi/beatgen.mp3   (MP3 file is about 3.4 Mb)
>> >> >> >
>> >> >> > http://firstbooks.biz/midi/beatgen.mid
>> >> >> >
>> >> >> > http://firstbooks.biz/midi/WT_Clarinet.sf2  (SF2 file is about 330
>> >> kB)
>> >> >> >
>> >> >> > Note: This is a microtonal composition, so if the tuning sounds a
>> >> bit
>> >> >> > off it is deliberate.
>> >> >> >
>> >> >> > If I render this file with fluidsynth the clicking noise does not
>> >> >> > occur.  Also, if I tweak the attack or decay rates in the Timidity
>> >> >> > configuration file, I can mitigate the clicking noise somewhat but
>> >> >> > cannot eliminate it entirely.
>> >> >> >
>> >> >> > Could this be a problem with the soundfont or is Timidity just not
>> >> >> > able to process SF2 fonts completely?
>> >> >> >
>> >> >> > Regards,
>> >> >> >
>> >> >> > AK
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >>
>> >> -------------------------------------------------------------------------
>> >> >> > This SF.Net email is sponsored by the Moblin Your Move Developer's
>> >> >> > challenge
>> >> >> > Build the coolest Linux based applications with Moblin SDK & win
>> >> great
>> >> >> > prizes
>> >> >> > Grand prize is a trip for two to an Open Source event anywhere in
>> >> the
>> >> >> > world
>> >> >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> >> >> > _______________________________________________
>> >> >> > Timidity-talk mailing list
>> >> >> > Timidity-talk@...
>> >> >> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >> http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25164608.html
>> >> >> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> >> ------------------------------------------------------------------------------
>> >> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> >> >> 30-Day
>> >> >> trial. Simplify your report design, integration and deployment - and
>> >> >> focus on
>> >> >> what you do best, core application coding. Discover what's new with
>> >> >> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> >> >> _______________________________________________
>> >> >> Timidity-talk mailing list
>> >> >> Timidity-talk@...
>> >> >> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>> >> >>
>> >> >
>> >> >
>> >> ------------------------------------------------------------------------------
>> >> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> >> > 30-Day
>> >> > trial. Simplify your report design, integration and deployment - and
>> >> focus
>> >> > on
>> >> > what you do best, core application coding. Discover what's new with
>> >> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> >> > _______________________________________________
>> >> > Timidity-talk mailing list
>> >> > Timidity-talk@...
>> >> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25171137.html
>> >> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> >> 30-Day
>> >> trial. Simplify your report design, integration and deployment - and
>> >> focus on
>> >> what you do best, core application coding. Discover what's new with
>> >> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> >> _______________________________________________
>> >> Timidity-talk mailing list
>> >> Timidity-talk@...
>> >> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>> >>
>> >
>> > ------------------------------------------------------------------------------
>> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> > 30-Day
>> > trial. Simplify your report design, integration and deployment - and focus
>> > on
>> > what you do best, core application coding. Discover what's new with
>> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> > _______________________________________________
>> > Timidity-talk mailing list
>> > Timidity-talk@...
>> > https://lists.sourceforge.net/lists/listinfo/timidity-talk
>> >
>> >
>>
>> --
>> View this message in context: http://www.nabble.com/Clicking-Noise-On-Some-SoundFonts-tp19123503p25177354.html
>> Sent from the TiMidity++ - General mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Timidity-talk mailing list
>> Timidity-talk@...
>> https://lists.sourceforge.net/lists/listinfo/timidity-talk
>>
>



--

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 27 Aug 2009, Aaron Johnson wrote:

> I realized that adding a release envelope on the order of 180-200 or
> sometimes more did the trick (it was at first confusing, b/c quicker
> envelopes get *higher* numbers (like 255 being fastest), not lower...I
> wonder if they are denominators of a fraction in some kind of
> non-linear time equation??)

> I added the 'strip=tail' option b/c it mentions clicking in the
> manpage, but it doesn't seem to be the critical piece...the critical
> piece is the 'rate=:::180' option.

The strip=tail is an ancient option meant for some ancient GUS pats that
could sometimes contain garbage at the end of the sample.  There are
probably not any instruments still in use today that would benefit from
this.  I have not seen any instruments like this in a long long time.

> Thanks for looking into this...everything works really well now!

> >> >> >> > If I render this file with fluidsynth the clicking noise does not
> >> >> >> > occur.  Also, if I tweak the attack or decay rates in the Timidity
> >> >> >> > configuration file, I can mitigate the clicking noise somewhat but
> >> >> >> > cannot eliminate it entirely.
> >> >> >> >
> >> >> >> > Could this be a problem with the soundfont or is Timidity just not
> >> >> >> > able to process SF2 fonts completely?

I'd be curious to know if WildMidi exhibits this issue too.  If there is
one thing I am sure of, it is that Chris Ison knows his GUS instrument
envelopes!

This may bring up the wider question of what is the "correct" behavior of
timidity in the case where "stupid" envelope parameters are specified.
Should it continue operating as it currently does, and just accept them
as-is, or should it set some minimum release rate that is still very very
short, but would be long enough to prevent clicks?

Sorry, I'm going to go into a historical rant now to overly explain
the issue....  It is my emperical experience that amplitude changes need
to be ramped over a minimum of 0.5 milleseconds from starting amplitude to
new ending amplitude.  Any faster than that and clicks happen.  All notes
playing in timidity have a current internal amplification, a target
amplification, and an increment value that tells it how rapidly to
increase/decrease the amplification.  Envelopes are implemented by
adjusting these internal values on the fly as the different portions of
the envelope are reached in the sample.  Volume pans and Expression levels
are handled in the same routine, it's all done during the mixing stage.
Originally, timidity had clicking problems during rapid Expression level
changes, or during very rapid (instant) far right/left pans during the
middle of a note.  I added a check to adjust the minimum time spent
ramping between initial and target amplitudes to 0.5 msec and the popping
went away.  Any shorter and the volume pops, any longer and the ramp delay
starts to become audible and sound slightly "sluggish".  I deemed this to
be a reasonable compromise between "do what I told you" and "do what I
meant" since the brain will not notice the 0.5 msec delay in the volume
adjustment.

So, why is this code not kicking in when there is no release rate set?
I'm going to guess that timidity pre-calculates that the end of the sample
play time has been reached, and thus ends the note without any additional
mixing (since there is no sample left to mix since it ended the resampling
upstream of the mixing already).  This is just a guess, and I'm too lazy
to go dig into the code to look right now.  Whatever the reason, I don't
think that any additional fixes could be easily made at the mixing level
to check for non-existant release rates.  I think the changes would have
to be implemented during SF2/PAT loading itself, to check for "bad"
envelopes and adjust them to something "not so bad".

If I remember correctly, and my memory is a little hazy on this at the
moment, I think that the standard GUS pat loader will use a default
pre-set envelope if no envelope at all is found in the instrument.  This
is bypassed when the -P option is used, and the envelope is used as-is
directly from the pat (this part I am *sure* of).  This would explain why
the recorder click problem was very bad when I used -P, but was reasonably
mild when I edited my gravis.cfg file to load the pat instead.

If this is being done for the standard GUS loader (I have no idea how the
realtime softsynth handles it), should it be done for SF2 as well?  What
is, philosophically, the best thing to do here?  Should timidity trust the
user and do exactly what the user said to do, because the user knows best?
Or should it set a minimum release rate to protect the user from himself?
Protecting the user from himself is a dangerous path to take, since it is
easy to go too far and deny the user from accomplishing his intentions.
If I tell it 0 release, and timidity auto-fudges this to 0.5 msec release,
would this auto-fudging behavior be "bad" because it isn't doing what I
explicitly told it to do?  I'm hesitant to auto-correct "bad" envelope
settings.

Also, from a purely personal viewpoint, I think the popping noises are
"good", since they alert the user that there is something amiss with the
instrument and that its envelopes should be edited to sound better.
Better to have the user blatantly notice the problem and fix it properly
than to mask over the problem and result in a not-as-great sounding, but
not jarringly bad sound.

-Eric

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Aaron Krister Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Eric,

Good software design in my philosophy is allowing the flexibility and
generality when needed, but, yes, saving the user from themselves!
Given that the clicks were not heard on say FluidSynth, I'd say they
have something like this in place.
And I think something like this would be very good for Timidity.

However I understand your concern for purity and literally 'doing what
the user asks'...so 3 thoughts come to mind:

1) You could have a auto-declicking provision coded in by default, and
have a command line option to disable.
2) You could have a command-line option to *enable* auto-declicking,
where it's off by default
3) You could document the issue. The user searching for solutions now
is in the dark, and is likely to give up on Timidty. Right now, it's
not mentioned but in passing, and adding 'strip=tail' doesn't work.
Google didn't really bring it up except this recent thread, and the
manpage mentioning the 'strip=tail' option. So, if it weren't for
tinkering, I would write off Timidity too.

A lot of people may have already written Timidity off as not being
capable of professional, clean-quality work, b/c it has clicking noise
where other MIDI soundfont software doesn't. They may have said, as I
did, "development isn't active, it's old software, I don't think this
will get fixed", and move on, to get their music done without the
hassle of figuring it out.....I perceive NOT dealing with it clikcing
as a bug, not a feature. My 2¢!!!

All best,
Aaron.


Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org

On Fri, Aug 28, 2009 at 12:16 AM, Eric Welsh<ewelsh@...> wrote:

>
> This may bring up the wider question of what is the "correct" behavior of
> timidity in the case where "stupid" envelope parameters are specified.
> Should it continue operating as it currently does, and just accept them
> as-is, or should it set some minimum release rate that is still very very
> short, but would be long enough to prevent clicks?
>
> Sorry, I'm going to go into a historical rant now to overly explain
> the issue....  It is my emperical experience that amplitude changes need
> to be ramped over a minimum of 0.5 milleseconds from starting amplitude to
> new ending amplitude.  Any faster than that and clicks happen.  All notes
> playing in timidity have a current internal amplification, a target
> amplification, and an increment value that tells it how rapidly to
> increase/decrease the amplification.  Envelopes are implemented by
> adjusting these internal values on the fly as the different portions of
> the envelope are reached in the sample.  Volume pans and Expression levels
> are handled in the same routine, it's all done during the mixing stage.
> Originally, timidity had clicking problems during rapid Expression level
> changes, or during very rapid (instant) far right/left pans during the
> middle of a note.  I added a check to adjust the minimum time spent
> ramping between initial and target amplitudes to 0.5 msec and the popping
> went away.  Any shorter and the volume pops, any longer and the ramp delay
> starts to become audible and sound slightly "sluggish".  I deemed this to
> be a reasonable compromise between "do what I told you" and "do what I
> meant" since the brain will not notice the 0.5 msec delay in the volume
> adjustment.
>
> So, why is this code not kicking in when there is no release rate set?
> I'm going to guess that timidity pre-calculates that the end of the sample
> play time has been reached, and thus ends the note without any additional
> mixing (since there is no sample left to mix since it ended the resampling
> upstream of the mixing already).  This is just a guess, and I'm too lazy
> to go dig into the code to look right now.  Whatever the reason, I don't
> think that any additional fixes could be easily made at the mixing level
> to check for non-existant release rates.  I think the changes would have
> to be implemented during SF2/PAT loading itself, to check for "bad"
> envelopes and adjust them to something "not so bad".
>
> If I remember correctly, and my memory is a little hazy on this at the
> moment, I think that the standard GUS pat loader will use a default
> pre-set envelope if no envelope at all is found in the instrument.  This
> is bypassed when the -P option is used, and the envelope is used as-is
> directly from the pat (this part I am *sure* of).  This would explain why
> the recorder click problem was very bad when I used -P, but was reasonably
> mild when I edited my gravis.cfg file to load the pat instead.
>
> If this is being done for the standard GUS loader (I have no idea how the
> realtime softsynth handles it), should it be done for SF2 as well?  What
> is, philosophically, the best thing to do here?  Should timidity trust the
> user and do exactly what the user said to do, because the user knows best?
> Or should it set a minimum release rate to protect the user from himself?
> Protecting the user from himself is a dangerous path to take, since it is
> easy to go too far and deny the user from accomplishing his intentions.
> If I tell it 0 release, and timidity auto-fudges this to 0.5 msec release,
> would this auto-fudging behavior be "bad" because it isn't doing what I
> explicitly told it to do?  I'm hesitant to auto-correct "bad" envelope
> settings.
>
> Also, from a purely personal viewpoint, I think the popping noises are
> "good", since they alert the user that there is something amiss with the
> instrument and that its envelopes should be edited to sound better.
> Better to have the user blatantly notice the problem and fix it properly
> than to mask over the problem and result in a not-as-great sounding, but
> not jarringly bad sound.
>
> -Eric
>



--

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 28 Aug 2009, Aaron Johnson wrote:

> Good software design in my philosophy is allowing the flexibility and
> generality when needed, but, yes, saving the user from themselves!
> Given that the clicks were not heard on say FluidSynth, I'd say they
> have something like this in place.
> And I think something like this would be very good for Timidity.

> A lot of people may have already written Timidity off as not being
> capable of professional, clean-quality work, b/c it has clicking noise
> where other MIDI soundfont software doesn't. They may have said, as I
> did, "development isn't active, it's old software, I don't think this
> will get fixed", and move on, to get their music done without the
> hassle of figuring it out.....I perceive NOT dealing with it clikcing
> as a bug, not a feature. My 2¢!!!

Yeah, I guess you're right.  Behavior I would want as a "power user"
probably isn't the best thing for the average user....  I'll take a look
over the code and see where I could most easily insert some sort of
release envelope check.  It would default to the minimal time required to
avoid a pop.  It still wouldn't sound all that good, because no (or
super short) release just generally sounds bad, but at least it wouldn't
pop any more.  I'm still a little leery of defaulting to a noticably long
release (which is what most good instruments have), since perhaps the
short release was actually intentional, but perhaps such a longer default
could be added as a --option (we're running out of -? letters).

I'm going to see if I can find a good place to put the check so that it
can be made after all the various different routines that instruments are
read in from.  I don't want to hack separate fixes for the SF2 reader, the
PAT reader, the -P reader, and maybe separate softsynth versions of all of
these.  The softsynth will be the worst, since I am totally unfamiliar
with how instruments get loaded on the fly for that, and I have no way to
easily test it under my home Windows setup.  I hope that I can find an
easy place just upstream of the mixing routines where the envelopes get
translated into internal values.  A check for no release should be easy to
do there, and the minimal pop avoidance value set there for all cases.
Any --option for longer defaults, though, might be a lot more difficult to
add, since that place in the routine has probably lost track of whether
the envelope was missing in the original instrument, or if these values
were what was actually set by the instrument or other overriding
parameters in the .cfg files.

Short answer: I hope to be able to fix the pops for all instrument
sources by adding a minimal super short release time, but changing the
default to be a longer "nice sounding" one may not be so easy and will be
left as a future wish for now.

-Eric

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by bvdp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yeah, I guess you're right.  Behavior I would want as a "power user"
probably isn't the best thing for the average user....  I'll take a look
over the code and see where I could most easily insert some sort of
release envelope check.  It would default to the minimal time required to

Just a thought ... instead of changing anything in what Timidity does, would a warning message be more appropriate? Something like the existing messages about no-such-font, etc. along with a short suggestion on how to fix?

Also, I'm a bit dismayed that no development is being done anymore with this fine package. I find that it is very handy to use timidity for bulk midi-to-wav conversions. I don't know of any other command line programs which do this at all ... maybe if there are some I'd not be quite as dismayed?

--
**** Listen to my CD at http://www.mellowood.ca/music/cedars ****
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bob@...
WWW:   http://www.mellowood.ca

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Parent Message unknown Re: Clicking Noise On Some SoundFonts

by A. Zimmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

The original message about the clicking noise with some SF2 soundfonts
was posted about 8-12 months ago.  Since that time, with no replies,
the links have died.

Here are the files re-posted to a new location.

MP3 example of clicking noise with a Timidity++ rendered midi file.
(Note: This is a microtonal composition, so if the tuning sounds a bit
off it is deliberate.):

http://home.comcast.net/~frank.peters/beatgen.mp3 (MP3 file is about 3.4 Mb)

The midi file:

http://home.comcast.net/~frank.peters/beatgen.mid

The SF2 soundfont used:

http://home.comcast.net/~frank.peters/WT_Clarinet.sf2 (SF2 file is about 330 kB)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts

by A. Zimmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, Aug 27, 2009 at 10:56 PM, Eric Welsh<ewelsh@bi...> wrote:

> Adding a decent release envelope solved the problem.  This is not a
> problem with timidity, but a problem with the instrument not having any
> kind of sane envelope.

I, too, have eliminated the popping sound by altering the timidity.cfg
file to include an envelope release parameter for the soundfont.

But if Timidity++ is not at fault, then how is fluidsynth able to
render without the popping noise using the same soundfont?

http://fluidsynth.resonance.org/trac

Using fluidsynth and the same midi and soundfont does not produce
the popping noise while using Timidity++ does produce the noise.

It seems Timiditiy++ has been written primarily to handle PAT fonts.
A later addition allowed the use of SF2 fonts but there apparently
is some difficulty.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Parent Message unknown Re: Clicking Noise On Some SoundFonts

by A. Zimmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Eric Welsh <ewelsh@bi...> - 2009-08-28 03:56

> Adding a decent release envelope solved the problem. This is not a
> problem with timidity, but a problem with the instrument not having any
> kind of sane envelope.

Using the swami soundfont editor (http://swami.resonance.org/trac) I can
also modify the volume envelope release value and eliminate the clicking
noise.

However, using swami to take a quick survey of the many SF2 soundfonts
that I have gathered from the Web, I discover that perhaps the majority
of them have a near zero release value set.  All these fonts should
therefore cause problems with Timididty++, but as I have indicated
previously, they will not cause problems with the fluidsynth software
synthesizer.  So, is the assessment that these soundfonts lack a
"sane envelope" really a correct one?


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: Clicking Noise On Some SoundFonts (bug fix: patch attached)

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 29 Aug 2009, A. Zimmer wrote:

> From: Eric Welsh <ewelsh@bi...> - 2009-08-28 03:56
>
> > Adding a decent release envelope solved the problem. This is not a
> > problem with timidity, but a problem with the instrument not having any
> > kind of sane envelope.
>
> Using the swami soundfont editor (http://swami.resonance.org/trac) I can
> also modify the volume envelope release value and eliminate the clicking
> noise.

I have attached a reasonably proper (I think) fix for the problem.  Rather
than deal with it during instrument loading, or checking to be sure that
envelope values get set to reasonable parameters in the first place, I
went to the lowest level of the problem and fixed it directly in the
mixing routines.  Now, any envelope ramp (from starting volume to final
ending volume) MUST take place over a minimum of 0.5 msec.  This should
gaurantee that the problem is solved even for unforseen combinations of
envelope settings in the future.  The problematic recorder sounds much
much better now :)

> However, using swami to take a quick survey of the many SF2 soundfonts
> that I have gathered from the Web, I discover that perhaps the majority
> of them have a near zero release value set.  All these fonts should
> therefore cause problems with Timididty++, but as I have indicated
> previously, they will not cause problems with the fluidsynth software
> synthesizer.  So, is the assessment that these soundfonts lack a
> "sane envelope" really a correct one?

TiMidity was originally written to use GUS pats.  There are several
kludges and lots of comments with ?? that deal with specific weirdness in
GUS pats.  I have been using TiMidity since around 1996, since before SF2
files, and have edited many many instrument files from all sorts of
different sources.  My memory is a little fuzzy on pre-PAT formats, such
as instruments from Kurzweil, Roland, and Yamaha synthesizer disks, but I
seem to remember all of them having reasonable release envelopes.  So, up
until SF2 files, most digital instruments had reasonable envelope
parameters.  Then there was a flood of SF2 instruments, many of which had
either no envelopes at all, or really strange envelopes.  From my
(relatively ancient) perspective, these SF2 files have broken envelopes.

While I still maintain that the SF2 files are broken, as several people
have pointed out, TiMidity should still be able to deal with it and at
least avoid generating popping sounds.  I totally agree ... there was just
a large energy barrier to digging back into the TiMidity source code after
several years of inactivity....

The patch was generated off a not-current version of mix.c.  If the patch
offsets are too far off, or the file has changed too much from the current
version (which I think is unlikely), the patch is within the next_stage(int v)
function, and it should be fairly obvious where to insert the new code
given the surrounding code chunks in the patch.



If I could ever get the softsynth to compile and run properly in Windows,
I'd fix some XG SYSEX event handling problems too....  The normal midi
file playing routines already have fixes for the issue, but they never
made it into the realtime synth routines.  Does anybody have any
experience getting the realtime softsynth to compile and run under
Windows?

-Eric
*** mix.c.orig Mon Jan 23 03:07:44 2006
--- mix.c Sun Sep  6 14:41:41 2009
***************
*** 1628,1634 ****
  {
  int stage, ch, eg_stage;
  int32 offset, val;
! FLOAT_T rate;
  Voice *vp = &voice[v];
 
  stage = vp->envelope_stage++;
--- 1628,1634 ----
  {
  int stage, ch, eg_stage;
  int32 offset, val;
! FLOAT_T rate, temp_rate;
  Voice *vp = &voice[v];
 
  stage = vp->envelope_stage++;
***************
*** 1637,1642 ****
--- 1637,1651 ----
  if (vp->envelope_volume == offset
  || (stage > EG_GUS_SUSTAIN && vp->envelope_volume < offset))
  return recompute_envelope(v);
+
+ /* HACK -- force ramps to occur over 0.5 msec windows to avoid pops */
+ temp_rate = labs(vp->envelope_volume - offset) /
+         (play_mode->rate * 0.0005);
+ if (temp_rate < 1)
+    temp_rate = 1;
+ if (temp_rate < rate)
+    rate = temp_rate;
+
  ch = vp->channel;
  /* there is some difference between GUS patch and Soundfont at envelope. */
  eg_stage = get_eg_stage(v, stage);

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

combined diff for various mixing pop-related bug fixes

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

mix.c: next_stage(), compute_mix_smoothing()

   Added new and corrected old volume-ramp related anti-popping measures.
   All volume ramps, whether from pans, expression/volume changes, or
   non-attack envelopes, now occur over a minimum window of 20 msec
   (incorrectly commented as 0.5 msec in previous versions).

Earlier today, I sent a bug fix for instruments with too-short release
envelopes.  In looking over some of the other envelope-related code I had
written in the past, I noticed that I had forgotten to take the
"control_ratio" variable (playback rate / samples per second) into
account.  At -s 44100 and the default 1000 controls per second,
control_ratio = 44.  Thus, all of my previous comments of 0.5 msec were
incorrect, and timidity was actually using an effective amp ramp window of
22 msec.  Worse yet, the window length (in time) would change with
different playback sampling rates.  While it was difficult to measure in
previous examples of pan-related and rapid volume-related popping, the new
release-related popping was easy to visualize and measure in a WAV editor.
What I thought was 0.5 msec in the code before was indeed 22 msec in
reality :(

I also noticed some possible problems with the envelope-related patch I
sent earlier today and fixed them.

I have attached a diff that replaces the diff I sent earlier today, and
fixes the other anti-popping measure I wrote many years ago as well.
Rather than use 22 msec, I shortened it to a nice round 20 msec.  Audibly,
the popping test midi I have sound the same as the prior incorrect
implementation.  Reducing the window to 15 msec causes definate pops, so I
think 20 msec is as short as it can reasonably go.

-Eric
*** mix.c.orig Mon Jan 23 03:07:44 2006
--- mix.c Sun Sep  6 18:49:40 2009
***************
*** 1628,1634 ****
  {
  int stage, ch, eg_stage;
  int32 offset, val;
! FLOAT_T rate;
  Voice *vp = &voice[v];
 
  stage = vp->envelope_stage++;
--- 1628,1634 ----
  {
  int stage, ch, eg_stage;
  int32 offset, val;
! FLOAT_T rate, temp_rate;
  Voice *vp = &voice[v];
 
  stage = vp->envelope_stage++;
***************
*** 1641,1646 ****
--- 1641,1660 ----
  /* there is some difference between GUS patch and Soundfont at envelope. */
  eg_stage = get_eg_stage(v, stage);
 
+ /* HACK -- force ramps to occur over 20 msec windows to avoid pops */
+ /* Do not apply to attack envelope */
+ if (eg_stage > EG_ATTACK)
+ {
+    temp_rate = control_ratio * (labs(vp->envelope_volume - offset) /
+         (play_mode->rate * 0.02));
+    if (temp_rate < 1)
+     temp_rate = 1;
+    if (rate < 0)
+     temp_rate = -temp_rate;
+    if (fabs(temp_rate) < fabs(rate))
+     rate = temp_rate;
+ }
+
  /* envelope generator (see also playmidi.[ch]) */
  if (ISDRUMCHANNEL(ch))
  val = (channel[ch].drums[vp->note] != NULL)
***************
*** 1708,1713 ****
--- 1722,1742 ----
  } else if (rate < 1) {rate =  1;} /* slowest attack */
  }
 
+ /* HACK -- force ramps to occur over 20 msec windows to avoid pops */
+ /* Do not apply to attack envelope */
+ /* Must check again in case the above conditions shortened it */
+ if (eg_stage > EG_ATTACK)
+ {
+    temp_rate = control_ratio * (labs(vp->envelope_volume - offset) /
+         (play_mode->rate * 0.02));
+    if (temp_rate < 1)
+     temp_rate = 1;
+    if (rate < 0)
+     temp_rate = -temp_rate;
+    if (fabs(temp_rate) < fabs(rate))
+     rate = temp_rate;
+ }
+
  vp->envelope_increment = (int32)rate;
  vp->envelope_target = offset;
 
***************
*** 1845,1853 ****
  #endif
  {
  int32 max_win, delta;
!
! /* reduce popping -- ramp the amp over a <= 0.5 msec window */
! max_win = play_mode->rate * 0.0005;
  delta = FROM_FINAL_VOLUME(vp->left_mix) - vp->old_left_mix;
  if (labs(delta) > max_win) {
  vp->left_mix_inc = delta / max_win;
--- 1874,1882 ----
  #endif
  {
  int32 max_win, delta;
!
! /* reduce popping -- ramp the amp over a 20 msec window */
! max_win = (play_mode->rate * 0.02) / control_ratio;
  delta = FROM_FINAL_VOLUME(vp->left_mix) - vp->old_left_mix;
  if (labs(delta) > max_win) {
  vp->left_mix_inc = delta / max_win;

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: combined diff for various mixing pop-related bug fixes

by A. Zimmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 6 Sep 2009 18:57:40 -0500 (CDT)
Eric Welsh <ewelsh@...> wrote:

>
> I have attached a diff that replaces the diff I sent earlier today, and
> fixes the other anti-popping measure I wrote many years ago as well.

Will these changes be going into CVS?  I'd rather download the entire
source from CVS than patch individual files.

Andrew Zimmer


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk

Re: combined diff for various mixing pop-related bug fixes

by Eric Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 6 Sep 2009, A. Zimmer wrote:

> > I have attached a diff that replaces the diff I sent earlier today, and
> > fixes the other anti-popping measure I wrote many years ago as well.
>
> Will these changes be going into CVS?  I'd rather download the entire
> source from CVS than patch individual files.

I don't have CVS access, and since I haven't been active in development in
a while, I don't know who the current maintainer is (or I would send the
patch directly to him/her).

Would whoever usually commits patches to CVS contact me with their email
address, so that I can send them patches directly in the future?

In the meantime, there is only the single mix.c file to patch, so just
'cp -a' it to a backup filename, apply the patch, recompile, and you
should be pop-free until the patch makes it into CVS.

-Eric

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Timidity-talk mailing list
Timidity-talk@...
https://lists.sourceforge.net/lists/listinfo/timidity-talk