fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] SF2.01 section 8.1.3 # 37


From: David Henningsson
Subject: Re: [fluid-dev] SF2.01 section 8.1.3 # 37
Date: Sun, 14 Apr 2013 13:05:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 04/04/2013 10:34 AM, *simple* wrote:
Hi,
In fluid 1.1.6, fluid_voice.c, line 1010,
   case GEN_VOLENVDECAY:               /* SF2.01 section 8.1.3 # 36 */
   case GEN_VOLENVSUSTAIN:             /* SF2.01 section 8.1.3 # 37 */
   case GEN_KEYTOVOLENVDECAY:          /* SF2.01 section 8.1.3 # 40 */
     y = 1.0f - 0.001f * _GEN(voice, GEN_VOLENVSUSTAIN);
     fluid_clip(y, 0.0f, 1.0f);
     count = calculate_hold_decay_buffers(voice, GEN_VOLENVDECAY,
GEN_KEYTOVOLENVDECAY, 1); /* 1 for decay */
     fluid_voice_update_volenv(voice, FLUID_VOICE_ENVDECAY,
                             count, 1.0f, count ? -1.0f / count : 0.0f,
y, 2.0f);
     break;
 From the souce code, the sustain level is directly read out from GEN as
a float cofficient. But according to the SF2.01 spec section 8.1.3, the
value stored in GEN#37 is in unit of centibels.
Could anyone please check if this is a bug here, or my
mis-understanding? Thanks

Hi,

I've never studied this code in detail, but from fluid_rvoice_calc_amp (in fluid_rvoice.c) it looks like the entire envelope is in centibels. Thus it's probably correct as it is.

    target_amp = fluid_atten2amp (voice->dsp.attenuation)
* fluid_cb2amp (960.0f * (1.0f - fluid_adsr_env_get_val(&voice->envlfo.volenv)) + fluid_lfo_get_val(&voice->envlfo.modlfo) * -voice->envlfo.modlfo_to_vol);

// David



reply via email to

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