fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Re: Fluidsynth voice stealing


From: Josh Green
Subject: Re: [fluid-dev] Re: Fluidsynth voice stealing
Date: Thu, 13 Oct 2005 20:40:54 -0700

On Fri, 2005-10-14 at 04:24 +0200, Tim Goetze wrote:
> [Josh Green]
> >If you can think of a good way to create a pluggable voice stealing
> >callback, I'm all ears.
> 
> not a callback, but maybe simply specifying weight factors for all 
> voice parameters in consideration. 'oldest' then is simply one 1, all 
> others 0, 'quietest' likewise, etc etc.
> 

Yeah, I agree, a callback is overkill.  I like the idea of being able to
tune these algorithms at runtime too.  Perhaps a new settings node
should be dedicated to this like:

synth.voice-steal.preset = (default, oldest, quietest, or custom)
synth.voice-steal.vol-rating = 0.0 - +1.0
synth.voice-steal.age-rating = ...
synth.voice-steal.drum-rating
synth.voice-steal.sustain-rating
synth.voice-steal.channel-rating        // How about channel priority?

Like you mentioned, there only really needs to be one algorithm, as long
as its tunable.  I think one very important criteria in voice stealing
is volume.  The current voice stealing algorithm uses the current volume
envelope value as a rough estimate.  In reality this isn't a very good
way to determine the volume (many other factors exist, such as the
amplitude of the sample data itself, etc).  It would be nice if the peak
value of all voices was known within a certain time frame.  Not sure how
much overhead this would incur though (every sample would need to be
compared to the last maximum value), but it would likely improve this
algorithm.

> i'd also like to propose putting the channel into consideration. if 
> you have, for example, drums (poly) and bass (mostly mono) playing, 
> you don't want a simple hi-hat to cancel a long-held, barely but still 
> audible bass note.
> 

Currently the channel is indeed taken into account, but the somewhat
opposite effect is implemented.  A drum channel instrument has a higher
priority than other channels when it comes to selecting a voice to kill.
Seems a bit wrong, since a rapid series of percussion with long decays
will kill other instruments if the max polyphony is reached.  It might
be nice to have channel priority though (simply lowest channel = higher
priority?)  If a weight were assigned to this the user could assign
instruments with higher priority to lower channels (perhaps exclude the
DRUM channel from this criteria and have its own).

> cheers, tim
> 

Proposed changes (some stuff still needs to be researched):
- Improve volume level rating (keep track of voice levels?)
- Improve voice age rating (ticks and/or noteID)
- Add settings for selecting voice stealing presets and setting custom
weighted rating values
- Add variables to voice structure for each criteria (ratings get stored
here for statistics)
- Add voice kill log to track what voices got killed and the criteria
ratings of the voice (the reason)

Best regards,
        Josh Green

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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