if(nv == 0) { cdiff = 0x7FFFFFFF; closest = sp = splist; for(i = 0; i < nsp; i++, sp++) { diff = sp->root_freq - fs; if(diff < 0) diff = -diff; if(diff < cdiff) { cdiff = diff; closest = sp; } } j = vlist[nv] = find_voice(e); voice[j].orig_frequency = f; voice[j].sample = closest; voice[j].status = VOICE_ON; nv++; } return nv; 
return nv; 
static int select_play_sample(Sample *splist, int nsp,			      int note, int *vlist, MidiEvent *e){    int32 f, fs, cdiff, diff;    int8 tt = channel[e->channel].temper_type;    Sample *sp, *closest;    int i, j, nv, vel;	if (opt_pure_intonation) {		if (current_keysig < 8)			f = freq_table_pureint[current_freq_table][note];		else			f = freq_table_pureint[current_freq_table + 12][note];	} else		switch (tt) {		case 0:			f = freq_table_tuning[0][note];			break;		case 1:			f = freq_table_pytha[current_freq_table][note];			break;		case 2:			if (current_temper_keysig < 8)				f = freq_table_meantone[current_freq_table][note];			else				f = freq_table_meantone[current_freq_table + 12][note];			break;		case 3:			if (current_temper_keysig < 8)				f = freq_table_pureint[current_freq_table][note];			else				f = freq_table_pureint[current_freq_table + 12][note];			break;		default:	/* user-defined temperaments */			if ((tt -= 0x40) >= 0 && tt < 4) {				if (current_temper_keysig < 8)					f = freq_table_user[tt][current_freq_table][note];				else					f = freq_table_user[tt][current_freq_table + 12][note];			} else				f = freq_table_tuning[0][note];			break;		}	fs = freq_table[note];    if(nsp == 1)    {	j = vlist[0] = find_voice(e);	voice[j].orig_frequency = f;	MYCHECK(voice[j].orig_frequency);	voice[j].sample = splist;	voice[j].status = VOICE_ON;	return 1;    }    vel = e->b;    nv = 0;    for(i = 0, sp = splist; i < nsp; i++, sp++)	if(sp->low_vel <= vel && sp->high_vel >= vel &&	   sp->low_freq <= fs && sp->high_freq >= fs)	{	    j = vlist[nv] = find_voice(e);	    voice[j].orig_frequency = f;	    MYCHECK(voice[j].orig_frequency);	    voice[j].sample = sp;	    voice[j].status = VOICE_ON;	    nv++;	}    if(nv == 0)    {	cdiff = 0x7FFFFFFF;	closest = sp = splist;	for(i = 0; i < nsp; i++, sp++)	{	    diff = sp->root_freq - fs;	    if(diff < 0) diff = -diff;	    if(diff < cdiff)	    {		cdiff = diff;		closest = sp;	    }	}	j = vlist[nv] = find_voice(e);	voice[j].orig_frequency = f;	voice[j].sample = closest;	voice[j].status = VOICE_ON;	nv++;    }    return nv;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/63788a67b485065d81e0254553d0709ceb540707/playmidi.c/buggy/timidity/playmidi.c