? aclocal.m4 ? configure ? Makefile.in ? config.log ? config.cache ? libtool ? config.status ? .python-history ? Makefile ? iiwu_voice_noteoff.diff ? src/stamp-h.in ? src/Makefile.in ? src/Makefile ? src/config.h ? src/stamp-h ? src/.deps ? src/.libs ? src/iiwu_synth.lo ? src/iiwu_list.lo ? src/iiwu_cmd.lo ? src/iiwu_defsfont.lo ? src/iiwu_rev.lo ? src/iiwu_chorus.lo ? src/iiwu_voice.lo ? src/iiwu_gen.lo ? src/iiwu_mod.lo ? src/iiwu_chan.lo ? src/iiwu_conv.lo ? src/iiwu_midi.lo ? src/iiwu_sys.lo ? src/iiwu_alsa.lo ? src/iiwu_oss.lo ? src/iiwu_midishare.lo ? src/iiwu_jack.lo ? src/iiwu_aufile.lo ? src/iiwu_ladspa.lo ? src/libiiwusynth.la ? src/iiwusynth ? src/iiwuplay Index: src/iiwu_voice.c =================================================================== RCS file: /cvsroot/iiwusynth/iiwusynth/src/iiwu_voice.c,v retrieving revision 1.23 diff -u -r1.23 iiwu_voice.c --- src/iiwu_voice.c 22 May 2002 15:30:09 -0000 1.23 +++ src/iiwu_voice.c 24 May 2002 11:27:53 -0000 @@ -1333,8 +1333,8 @@ * So convert from linear amplitude to cb. */ if (voice->volenv_val>0){ - iiwu_real_t centibels=100.0*log(voice->volenv_val)/log(10); /* For example: val=0.5 => -60 cB */ - iiwu_real_t env_value=1+(centibels/960.0); /* 1 + (-60/960) */ + iiwu_real_t amp = voice->volenv_val * pow (10., voice->attenuation / -200.); + iiwu_real_t env_value = - ((-200. * log (amp) / log (10.) - voice->attenuation) / 960. - 1); env_value=(env_value < 0.0 ? 0.0 : env_value); env_value=(env_value > 1.0 ? 1.0 : env_value); voice->volenv_val=env_value;