summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/i_oplmusic.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c
index 53d4ffe3..aa6a7a6d 100644
--- a/src/i_oplmusic.c
+++ b/src/i_oplmusic.c
@@ -778,6 +778,7 @@ static void UpdateVoiceFrequency(opl_voice_t *voice)
static void VoiceKeyOn(opl_channel_data_t *channel,
genmidi_instr_t *instrument,
unsigned int instrument_voice,
+ unsigned int note,
unsigned int key,
unsigned int volume)
{
@@ -804,7 +805,7 @@ static void VoiceKeyOn(opl_channel_data_t *channel,
}
else
{
- voice->note = key;
+ voice->note = note;
}
// Program the voice with the instrument data:
@@ -825,6 +826,7 @@ static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event)
{
genmidi_instr_t *instrument;
opl_channel_data_t *channel;
+ unsigned int note;
unsigned int key;
unsigned int volume;
@@ -835,6 +837,7 @@ static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event)
event->data.channel.param2);
*/
+ note = event->data.channel.param1;
key = event->data.channel.param1;
volume = event->data.channel.param2;
@@ -863,6 +866,7 @@ static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event)
last_perc[last_perc_count] = key;
last_perc_count = (last_perc_count + 1) % PERCUSSION_LOG_LEN;
+ note = 60;
}
else
{
@@ -877,11 +881,11 @@ static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event)
// Find and program a voice for this instrument. If this
// is a double voice instrument, we must do this twice.
- VoiceKeyOn(channel, instrument, 0, key, volume);
+ VoiceKeyOn(channel, instrument, 0, note, key, volume);
if ((SHORT(instrument->flags) & GENMIDI_FLAG_2VOICE) != 0)
{
- VoiceKeyOn(channel, instrument, 1, key, volume);
+ VoiceKeyOn(channel, instrument, 1, note, key, volume);
}
}