if (! (IS_SET_CHANNELMASK(channel[orig_ch].channel_layer, j) && layered) && j != orig_ch) 
if (! layered && j) 
static void play_midi_prescan(MidiEvent *ev){    int i, j, ch, orig_ch, layered;        if(opt_amp_compensation) {mainvolume_max = 0;}    else {mainvolume_max = 0x7f;}    compensation_ratio = 1.0;    prescanning_flag = 1;    change_system_mode(DEFAULT_SYSTEM_MODE);    reset_midi(0);    resamp_cache_reset();	while (ev->type != ME_EOT) {#ifndef SUPPRESS_CHANNEL_LAYER		orig_ch = ev->channel;		layered = ! IS_SYSEX_EVENT_TYPE(ev->type);		for (j = 0; j < MAX_CHANNELS; j++) {			if (! (IS_SET_CHANNELMASK(channel[orig_ch].channel_layer, j)					&& layered) && j != orig_ch)				continue;			ev->channel = j;#endif	ch = ev->channel;	switch(ev->type)	{	  case ME_NOTEON:	    if((channel[ch].portamento_time_msb |		channel[ch].portamento_time_lsb) == 0 ||	       channel[ch].portamento == 0)	    {		int nv;		int vlist[32];		Voice *vp;		nv = find_samples(ev, vlist);		for(i = 0; i < nv; i++)		{		    vp = voice + vlist[i];		    start_note(ev, vlist[i], 0, nv - i - 1);		    resamp_cache_refer_on(vp, ev->time);		    vp->status = VOICE_FREE;		    vp->temper_instant = 0;		}	    }	    break;	  case ME_NOTEOFF:	    resamp_cache_refer_off(ch, MIDI_EVENT_NOTE(ev), ev->time);	    break;	  case ME_PORTAMENTO_TIME_MSB:	    channel[ch].portamento_time_msb = ev->a;	    break;	  case ME_PORTAMENTO_TIME_LSB:	    channel[ch].portamento_time_lsb = ev->a;	    break;	  case ME_PORTAMENTO:	    channel[ch].portamento = (ev->a >= 64);	  case ME_RESET_CONTROLLERS:	    reset_controllers(ch);	    resamp_cache_refer_alloff(ch, ev->time);	    break;	  case ME_PROGRAM:	    midi_program_change(ch, ev->a);	    break;	  case ME_TONE_BANK_MSB:	    channel[ch].bank_msb = ev->a;	    break;	  case ME_TONE_BANK_LSB:	    channel[ch].bank_lsb = ev->a;	    break;	  case ME_RESET:	    change_system_mode(ev->a);	    reset_midi(0);	    break;	  case ME_PITCHWHEEL:	  case ME_ALL_NOTES_OFF:	  case ME_ALL_SOUNDS_OFF:	  case ME_MONO:	  case ME_POLY:	    resamp_cache_refer_alloff(ch, ev->time);	    break;	  case ME_DRUMPART:	    if(midi_drumpart_change(ch, ev->a))		midi_program_change(ch, channel[ch].program);	    break;	  case ME_KEYSHIFT:	    resamp_cache_refer_alloff(ch, ev->time);	    channel[ch].key_shift = (int)ev->a - 0x40;	    break;	  case ME_SCALE_TUNING:		resamp_cache_refer_alloff(ch, ev->time);		channel[ch].scale_tuning[ev->a] = ev->b;		break;	  case ME_MAINVOLUME:	    if (ev->a > mainvolume_max) {	      mainvolume_max = ev->a;	      ctl->cmsg(CMSG_INFO,VERB_DEBUG,"ME_MAINVOLUME/max (CH:%d VAL:%#x)",ev->channel,ev->a);	    }	    break;	}#ifndef SUPPRESS_CHANNEL_LAYER	}	ev->channel = orig_ch;#endif	ev++;    }    /* calculate compensation ratio */    if (0 < mainvolume_max && mainvolume_max < 0x7f) {      compensation_ratio = pow((double)0x7f/(double)mainvolume_max, 4);      ctl->cmsg(CMSG_INFO,VERB_DEBUG,"Compensation ratio:%lf",compensation_ratio);    }    for(i = 0; i < MAX_CHANNELS; i++)	resamp_cache_refer_alloff(i, ev->time);    resamp_cache_create();    prescanning_flag = 0;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/58d7d909e50c09f106f97efbc629e127eaae1206/playmidi.c/clean/timidity/playmidi.c