if (stage == 1 && channel[ch].env_velf) { tmp *= vel_to_envelope[voice[v].velocity & 0x7f]; }
static inline int next_stage(int v){	int stage, ch;	int32 offset, val, rate;	FLOAT_T tmp;	Voice *vp = &voice[v];		stage = vp->envelope_stage++;	offset = vp->sample->envelope_offset[stage];	if (vp->envelope_volume == offset			|| stage > 2 && vp->envelope_volume < offset)		return recompute_envelope(v);	ch = vp->channel;	tmp = vp->sample->envelope_rate[stage];	if (vp->sample->modes & MODES_ENVELOPE) {		if (ISDRUMCHANNEL(ch))			val = (channel[ch].drums[vp->note] != NULL)					? channel[ch].drums[vp->note]->drum_envelope_rate[stage]					: -1;		else			val = channel[ch].envelope_rate[stage];		if (val != -1)			tmp *= envelope_coef[val & 0x7f];		if (tmp > ((stage < 2) ? 4 : 2) * 0x10000000)			tmp = ((stage < 2) ? 4 : 2) * 0x10000000;	}	rate = tmp;	vp->envelope_increment = rate;	vp->envelope_target = offset;	if (vp->envelope_target < vp->envelope_volume)		vp->envelope_increment = -vp->envelope_increment;	return 0;}