set_delay(buf0, 9600);
set_delay(buf0, (int32)(9600.0f * play_mode->rate / 44100.0f));
void do_hexa_chorus(int32 *buf, int32 count, EffectList *ef){	InfoHexaChorus *info = (InfoHexaChorus *)ef->info;	lfo *lfo = &(info->lfo0);	delay *buf0 = &(info->buf0);	int32 *ebuf = buf0->buf, size = buf0->size, index = buf0->index;	int32 spt0 = info->spt0, spt1 = info->spt1, spt2 = info->spt2,		spt3 = info->spt3, spt4 = info->spt4, spt5 = info->spt5,		hist0 = info->hist0, hist1 = info->hist1, hist2 = info->hist2,		hist3 = info->hist3, hist4 = info->hist4, hist5 = info->hist5;	int32 dryi = info->dryi, weti = info->weti;	int32 pan0 = info->pan0, pan1 = info->pan1, pan2 = info->pan2,		pan3 = info->pan3, pan4 = info->pan4, pan5 = info->pan5;	int32 depth0 = info->depth0, depth1 = info->depth1, depth2 = info->depth2,		depth3 = info->depth3, depth4 = info->depth4, depth5 = info->depth5,		pdelay0 = info->pdelay0, pdelay1 = info->pdelay1, pdelay2 = info->pdelay2,		pdelay3 = info->pdelay3, pdelay4 = info->pdelay4, pdelay5 = info->pdelay5;	int32 i, lfo_val,		v0, v1, v2, v3, v4, v5, f0, f1, f2, f3, f4, f5;	if(count == MAGIC_INIT_EFFECT_INFO) {		set_delay(buf0, 9600);		init_lfo(lfo, lfo->freq, LFO_TRIANGULAR);		info->dryi = TIM_FSCALE(info->level * info->dry, 24);		info->weti = TIM_FSCALE(info->level * info->wet * HEXA_CHORUS_WET_LEVEL, 24);		v0 = info->depth * ((double)info->depth_dev * HEXA_CHORUS_DEPTH_DEV);		info->depth0 = info->depth - v0;		info->depth1 = info->depth;		info->depth2 = info->depth + v0;		info->depth3 = info->depth + v0;		info->depth4 = info->depth;		info->depth5 = info->depth - v0;		v0 = info->pdelay * ((double)info->pdelay_dev * HEXA_CHORUS_DELAY_DEV);		info->pdelay0 = info->pdelay + v0;		info->pdelay1 = info->pdelay + v0 * 2;		info->pdelay2 = info->pdelay + v0 * 3;		info->pdelay3 = info->pdelay + v0 * 3;		info->pdelay4 = info->pdelay + v0 * 2;		info->pdelay5 = info->pdelay + v0;		/* in this part, validation check may be necessary. */		info->pan0 = 64 - info->pan_dev * 3;		info->pan1 = 64 - info->pan_dev * 2;		info->pan2 = 64 - info->pan_dev;		info->pan3 = 64 + info->pan_dev;		info->pan4 = 64 + info->pan_dev * 2;		info->pan5 = 64 + info->pan_dev * 3;		info->hist0 = info->hist1 = info->hist2			= info->hist3 = info->hist4 = info->hist5 = 0;		info->spt0 = info->spt1 = info->spt2			= info->spt3 = info->spt4 = info->spt5 = 0;		return;	} else if(count == MAGIC_FREE_EFFECT_INFO) {		free_delay(buf0);		return;	}	/* LFO */	lfo_val = lfo->buf[imuldiv24(lfo->count, lfo->icycle)];	f0 = imuldiv24(lfo_val, depth0);	spt0 = index - pdelay0 - (f0 >> 8);	/* integral part of delay */	if(spt0 < 0) {spt0 += size;}	f1 = imuldiv24(lfo_val, depth1);	spt1 = index - pdelay1 - (f1 >> 8);	/* integral part of delay */	if(spt1 < 0) {spt1 += size;}	f2 = imuldiv24(lfo_val, depth2);	spt2 = index - pdelay2 - (f2 >> 8);	/* integral part of delay */	if(spt2 < 0) {spt2 += size;}	f3 = imuldiv24(lfo_val, depth3);	spt3 = index - pdelay3 - (f3 >> 8);	/* integral part of delay */	if(spt3 < 0) {spt3 += size;}	f4 = imuldiv24(lfo_val, depth4);	spt4 = index - pdelay4 - (f4 >> 8);	/* integral part of delay */	if(spt4 < 0) {spt4 += size;}	f5 = imuldiv24(lfo_val, depth5);	spt5 = index - pdelay5 - (f5 >> 8);	/* integral part of delay */	if(spt5 < 0) {spt5 += size;}	for(i = 0; i < count; i++) {		v0 = ebuf[spt0], v1 = ebuf[spt1], v2 = ebuf[spt2],		v3 = ebuf[spt3], v4 = ebuf[spt4], v5 = ebuf[spt5];		/* LFO */		if(++index == size) {index = 0;}		lfo_val = do_lfo(lfo);		f0 = imuldiv24(lfo_val, depth0);		spt0 = index - pdelay0 - (f0 >> 8);	/* integral part of delay */		f0 = 0xFF - (f0 & 0xFF);	/* (1 - frac) * 256 */		if(spt0 < 0) {spt0 += size;}		f1 = imuldiv24(lfo_val, depth1);		spt1 = index - pdelay1 - (f1 >> 8);	/* integral part of delay */		f1 = 0xFF - (f1 & 0xFF);	/* (1 - frac) * 256 */		if(spt1 < 0) {spt1 += size;}		f2 = imuldiv24(lfo_val, depth2);		spt2 = index - pdelay2 - (f2 >> 8);	/* integral part of delay */		f2 = 0xFF - (f2 & 0xFF);	/* (1 - frac) * 256 */		if(spt2 < 0) {spt2 += size;}		f3 = imuldiv24(lfo_val, depth3);		spt3 = index - pdelay3 - (f3 >> 8);	/* integral part of delay */		f3 = 0xFF - (f3 & 0xFF);	/* (1 - frac) * 256 */		if(spt3 < 0) {spt3 += size;}		f4 = imuldiv24(lfo_val, depth4);		spt4 = index - pdelay4 - (f4 >> 8);	/* integral part of delay */		f4 = 0xFF - (f4 & 0xFF);	/* (1 - frac) * 256 */		if(spt4 < 0) {spt4 += size;}		f5 = imuldiv24(lfo_val, depth5);		spt5 = index - pdelay5 - (f5 >> 8);	/* integral part of delay */		f5 = 0xFF - (f5 & 0xFF);	/* (1 - frac) * 256 */		if(spt5 < 0) {spt5 += size;}		/* chorus effect */		/* all-pass interpolation */		hist0 = v0 + imuldiv8(ebuf[spt0] - hist0, f0);		hist1 = v1 + imuldiv8(ebuf[spt1] - hist1, f1);		hist2 = v2 + imuldiv8(ebuf[spt2] - hist2, f2);		hist3 = v3 + imuldiv8(ebuf[spt3] - hist3, f3);		hist4 = v4 + imuldiv8(ebuf[spt4] - hist4, f4);		hist5 = v5 + imuldiv8(ebuf[spt5] - hist5, f5);		ebuf[index] = imuldiv24(buf[i] + buf[i + 1], weti);		/* mixing */		buf[i] = do_left_panning(hist0, pan0) + do_left_panning(hist1, pan1)			+ do_left_panning(hist2, pan2) + do_left_panning(hist3, pan3)			+ do_left_panning(hist4, pan4) + do_left_panning(hist5, pan5)			+ imuldiv24(buf[i], dryi);		buf[i + 1] = do_right_panning(hist0, pan0) + do_right_panning(hist1, pan1)			+ do_right_panning(hist2, pan2) + do_right_panning(hist3, pan3)			+ do_right_panning(hist4, pan4) + do_right_panning(hist5, pan5)			+ imuldiv24(buf[i + 1], dryi);		++i;	}	buf0->size = size, buf0->index = index;	info->spt0 = spt0, info->spt1 = spt1, info->spt2 = spt2,	info->spt3 = spt3, info->spt4 = spt4, info->spt5 = spt5,	info->hist0 = hist0, info->hist1 = hist1, info->hist2 = hist2,	info->hist3 = hist3, info->hist4 = hist4, info->hist5 = hist5;}