* min_sustain_time is given in msec, and is the time *  it will take to decay a note at maximum volume. 
* min_sustain_time is given in msec, and is the minimum *  time it will take to decay a note to zero. 
int recompute_envelope(int v){	int stage, ch;	double sustain_time;	int32 envelope_width;	Voice *vp = &voice[v];		stage = vp->envelope_stage;	if (stage > EG_GUS_RELEASE3) {		voice_ran_out(v);		return 1;	} else if (stage > EG_GUS_SUSTAIN && vp->envelope_volume <= 0) {		/* Remove silent voice in the release stage */		voice_ran_out(v);		return 1;	}	/* EAW -- Routine to decay the sustain envelope	 *	 * Disabled if !min_sustain_time.	 * min_sustain_time is given in msec, and is the time	 *  it will take to decay a note at maximum volume.	 * 2000-3000 msec seem to be decent values to use.	 *	 * 08/24/00 changed behavior to not begin the decay until	 *  after the sample plays past it's loop start	 *	 */	if (stage == EG_GUS_RELEASE1 && vp->sample->modes & MODES_ENVELOPE			&& vp->status & (VOICE_ON | VOICE_SUSTAINED)) {		ch = vp->channel;		/* Default behavior */		if (min_sustain_time <= 0 && channel[ch].loop_timeout <= 0)			/* Freeze envelope until note turns off */			vp->envelope_increment = 0;		else {			if (min_sustain_time == 1)				/* The sustain stage is ignored. */				return next_stage(v);			if (channel[ch].loop_timeout * 1000 > min_sustain_time) {				sustain_time = min_sustain_time;			} else {				/* timeout (See also "#extension timeout" line in *.cfg file */				sustain_time = channel[ch].loop_timeout * 1000;			}			if (channel[ch].sostenuto == 0) {				sustain_time *= (double)channel[ch].sustain / 127.0f;			}			/* Calculate the release phase speed. */			envelope_width = sustain_time * play_mode->rate				/ (1000.0f * (double)control_ratio);			vp->envelope_increment = -1;			vp->envelope_target = vp->envelope_volume - envelope_width;			if (vp->envelope_target < 0) {vp->envelope_target = 0;}		}		return 0;	}	return next_stage(v);}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/86626c98bd64f8be7730445c93d940fd5f83f18e/mix.c/buggy/timidity/mix.c