shithub: choc

Download patch

ref: 56a6af426972ed2a334ae7001d19854aca964a75
parent: c70eec36650e81025da97b2d716d446943cf5818
author: Simon Howard <[email protected]>
date: Sun Oct 11 17:47:07 EDT 2009

Don't apply base note offset if the instrument is a fixed note
instrument. This should stop the ugly bleeping from the electric snare
on E1M2.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1715

--- a/src/i_oplmusic.c
+++ b/src/i_oplmusic.c
@@ -701,10 +701,15 @@
 
     note = voice->note;
 
-    // Apply note offset:
+    // Apply note offset.
+    // Don't apply offset if the instrument is a fixed note instrument.
 
     gm_voice = &voice->current_instr->voices[voice->current_instr_voice];
-    note += (signed short) SHORT(gm_voice->base_note_offset);
+
+    if ((voice->current_instr->flags & GENMIDI_FLAG_FIXED) == 0)
+    {
+        note += (signed short) SHORT(gm_voice->base_note_offset);
+    }
 
     // Avoid possible overflow due to base note offset: