src/codecs/timidity/playmidi.c
changeset 1083 7a3b49dbf90f
parent 999 1a87fe70802d
equal deleted inserted replaced
1078:092f7e1f97b9 1083:7a3b49dbf90f
    63       song->channel[i].bank=0; /* tone bank or drum set */
    63       song->channel[i].bank=0; /* tone bank or drum set */
    64     }
    64     }
    65   reset_voices(song);
    65   reset_voices(song);
    66 }
    66 }
    67 
    67 
    68 static void select_sample(MidiSong *song, int v, Instrument *ip, int vel)
    68 static void select_sample(MidiSong *song, int v, Instrument *ip)
    69 {
    69 {
    70   Sint32 f, cdiff, diff;
    70   Sint32 f, cdiff, diff;
    71   int s,i;
    71   int s,i;
    72   Sample *sp, *closest;
    72   Sample *sp, *closest;
    73 
    73 
   266 
   266 
   267       if (ip->sample->note_to_use) /* Fixed-pitch instrument? */
   267       if (ip->sample->note_to_use) /* Fixed-pitch instrument? */
   268 	song->voice[i].orig_frequency = freq_table[(int)(ip->sample->note_to_use)];
   268 	song->voice[i].orig_frequency = freq_table[(int)(ip->sample->note_to_use)];
   269       else
   269       else
   270 	song->voice[i].orig_frequency = freq_table[e->a & 0x7F];
   270 	song->voice[i].orig_frequency = freq_table[e->a & 0x7F];
   271       select_sample(song, i, ip, e->b);
   271       select_sample(song, i, ip);
   272     }
   272     }
   273 
   273 
   274   song->voice[i].status = VOICE_ON;
   274   song->voice[i].status = VOICE_ON;
   275   song->voice[i].channel = e->channel;
   275   song->voice[i].channel = e->channel;
   276   song->voice[i].note = e->a;
   276   song->voice[i].note = e->a;