diff options
author | Simon Howard | 2009-10-11 21:47:07 +0000 |
---|---|---|
committer | Simon Howard | 2009-10-11 21:47:07 +0000 |
commit | 56a6af426972ed2a334ae7001d19854aca964a75 (patch) | |
tree | f6bebe6de818c0956328656861fc639dc3e10731 /src | |
parent | c70eec36650e81025da97b2d716d446943cf5818 (diff) | |
download | chocolate-doom-56a6af426972ed2a334ae7001d19854aca964a75.tar.gz chocolate-doom-56a6af426972ed2a334ae7001d19854aca964a75.tar.bz2 chocolate-doom-56a6af426972ed2a334ae7001d19854aca964a75.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/i_oplmusic.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c index cd331897..d32a163e 100644 --- a/src/i_oplmusic.c +++ b/src/i_oplmusic.c @@ -701,10 +701,15 @@ static unsigned int FrequencyForVoice(opl_voice_t *voice) 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: |