/* scale tuning */ vp->v.scale_tuning = (int)tbl->val[SF_scaleTuning]; 
/* scale freq */ vp->v.scale_freq = tbl->val[SF_keyTuning]; /* scale factor */ vp->v.scale_factor = 1024 * (double) tbl->val[SF_scaleTuning] / 100 + 0.5; 
static void set_rootkey(SFInfo *sf, SampleList *vp, LayerTable *tbl){    SFSampleInfo *sp = &sf->sample[tbl->val[SF_sampleId]];	int val, temp;    /* scale tuning */	vp->v.scale_tuning = (int)tbl->val[SF_scaleTuning];    /* set initial root key & fine tune */    if(sf->version == 1 && tbl->set[SF_samplePitch])    {	/* set from sample pitch */	vp->root = (int)tbl->val[SF_samplePitch] / 100;	vp->tune = -(int)tbl->val[SF_samplePitch] % 100;	if(vp->tune <= -50)	{	    vp->root++;	    vp->tune = 100 + vp->tune;	}    }    else    {	/* from sample info */	vp->root = sp->originalPitch;	vp->tune = sp->pitchCorrection;	if (vp->tune >= 0x80)		vp->tune -= 0x100; /* correct sign */    }    /* orverride root key */    if(tbl->set[SF_rootKey]) {		vp->root = (int)tbl->val[SF_rootKey];	} else if(vp->bank == 128 && vp->v.scale_tuning != 0) {		vp->tune += (vp->keynote - sp->originalPitch) * vp->v.scale_tuning;	}	vp->tune += (int)tbl->val[SF_coarseTune] * 100 +	(int)tbl->val[SF_fineTune];    /* correct too high pitch */    if(vp->root >= vp->high + 60)      vp->root -= 60;	vp->v.tremolo_to_pitch = vp->v.tremolo_to_fc = 	vp->v.modenv_to_pitch = vp->v.modenv_to_fc = 0;	if(tbl->set[SF_lfo1ToPitch])		vp->v.tremolo_to_pitch = (int)tbl->val[SF_lfo1ToPitch];	if(tbl->set[SF_lfo1ToFilterFc])		vp->v.tremolo_to_fc = (int)tbl->val[SF_lfo1ToFilterFc];	if(tbl->set[SF_env1ToPitch]) {		vp->v.modenv_to_pitch = (int)tbl->val[SF_env1ToPitch];		if (vp->v.modenv_to_pitch > 1200) {vp->v.modenv_to_pitch = 1200;}		/* correct tune with the sustain level of modulation envelope */		temp = ((int)vp->v.modenv_to_pitch * (1000 - (int)tbl->val[SF_sustainEnv1])) / 1000;		vp->tune += temp;		vp->v.modenv_to_pitch -= temp;	}	if(tbl->set[SF_env1ToFilterFc])		vp->v.modenv_to_fc = (int)tbl->val[SF_env1ToFilterFc];}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/c4ea9ade6f8009d3640b65e6b308e39ac63871d0/sndfont.c/buggy/timidity/sndfont.c