if(ip->sample->note_to_use) note = ip->sample->note_to_use; 
if(ip->sample->note_to_use) {note = ip->sample->note_to_use;} 
static int find_samples(MidiEvent *e, int *vlist){	Instrument *ip;	int i, nv, note, ch, prog, bk;	ch = e->channel;	if(channel[ch].special_sample > 0)	{	    SpecialPatch *s;	    s = special_patch[channel[ch].special_sample];	    if(s == NULL)	    {		ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,			  "Strange: Special patch %d is not installed",			  channel[ch].special_sample);		return 0;	    }	    note = e->a + channel[ch].key_shift + note_key_offset + key_adjust;	    if(note < 0)		note = 0;	    else if(note > 127)		note = 127;	    return select_play_sample(s->sample, s->samples, note, vlist, e);	}	bk = channel[ch].bank;	if(ISDRUMCHANNEL(ch))	{	    note = e->a & 0x7F;	    instrument_map(channel[ch].mapID, &bk, &note);	    if(!(ip = play_midi_load_instrument(1, bk, note)))		return 0;	/* No instrument? Then we can't play. */		if(ip->type == INST_GUS && ip->samples != 1)		ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,			  "Strange: percussion instrument with %d samples!",			  ip->samples);		if(ip->sample->note_to_use)		note = ip->sample->note_to_use;		if(ip->type == INST_SF2) {			nv = select_play_sample(ip->sample, ip->samples, note, vlist, e);			/* Replace the sample if the sample is cached. */			if(!prescanning_flag)			{				if(ip->sample->note_to_use)				note = MIDI_EVENT_NOTE(e);				for(i = 0; i < nv; i++)				{				int j;				j = vlist[i];				if(!opt_realtime_playing && allocate_cache_size > 0 &&				   !channel[ch].portamento)				{					voice[j].cache = resamp_cache_fetch(voice[j].sample, note);					if(voice[j].cache) /* cache hit */					voice[j].sample = voice[j].cache->resampled;				}				else					voice[j].cache = NULL;				}			}			return nv;		} else {			i = vlist[0] = find_voice(e);			voice[i].orig_frequency = freq_table[note];			voice[i].sample = ip->sample;			voice[i].status = VOICE_ON;			return 1;		}	}	prog = channel[ch].program;	if(prog == SPECIAL_PROGRAM)	    ip = default_instrument;	else	{	    instrument_map(channel[ch].mapID, &bk, &prog);	    if(!(ip = play_midi_load_instrument(0, bk, prog)))		return 0;	/* No instrument? Then we can't play. */	}	if(ip->sample->note_to_use)	    note = ip->sample->note_to_use + channel[ch].key_shift + note_key_offset + key_adjust;	else	    note = e->a + channel[ch].key_shift + note_key_offset + key_adjust;	if(note < 0)	    note = 0;	else if(note > 127)	    note = 127;	nv = select_play_sample(ip->sample, ip->samples, note, vlist, e);	/* Replace the sample if the sample is cached. */	if(!prescanning_flag)	{	    if(ip->sample->note_to_use)		note = MIDI_EVENT_NOTE(e);	    for(i = 0; i < nv; i++)	    {		int j;		j = vlist[i];		if(!opt_realtime_playing && allocate_cache_size > 0 &&		   !channel[ch].portamento)		{		    voice[j].cache = resamp_cache_fetch(voice[j].sample, note);		    if(voice[j].cache) /* cache hit */			voice[j].sample = voice[j].cache->resampled;		}		else		    voice[j].cache = NULL;	    }	}	return nv;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/5fb3c7a4d11f8dba45a369ca131e397bd0845e87/playmidi.c/buggy/timidity/playmidi.c