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

_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to