foxygit / doom Log in
commit 628ba41ead3e50fe71581131fd2fa22c50739df6
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Aug 30 22:47:47 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Aug 30 22:47:47 2009 +0000

    Use the pedal speed value for the volume. This sounds better, but it's
    still not right.

    Subversion-branch: /branches/opl-branch
    Subversion-revision: 1646
---
 src/i_oplmusic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c
index d844fd7b..db7e0ffc 100644
--- a/src/i_oplmusic.c
+++ b/src/i_oplmusic.c
@@ -660,6 +660,7 @@ static void NoteOnEvent(opl_track_data_t *track, midi_event_t *event)
     opl_voice_t *voice;
     opl_channel_data_t *channel;
     unsigned int note;
+    unsigned int volume;

     printf("note on: channel %i, %i, %i\n",
            event->data.channel.channel,
@@ -670,6 +671,7 @@ static void NoteOnEvent(opl_track_data_t *track, midi_event_t *event)

     channel = &track->channels[event->data.channel.channel];
     note = event->data.channel.param1;
+    volume = event->data.channel.param2;

     // Percussion channel (10) is treated differently to normal notes.

@@ -703,7 +705,7 @@ static void NoteOnEvent(opl_track_data_t *track, midi_event_t *event)
     // TODO: Set the volume level.

     WriteRegister(OPL_REGS_LEVEL + voice->op2,
-                  volume_mapping_table[channel->volume]);
+                  volume_mapping_table[volume]);

     // Play the note.