diff options
author | Simon Howard | 2009-09-11 16:54:06 +0000 |
---|---|---|
committer | Simon Howard | 2009-09-11 16:54:06 +0000 |
commit | cc0cc9fb0c806f6533dca794b1e829a626323d8b (patch) | |
tree | fa9943563698bc746c728eab10abcd12ba64721d | |
parent | 100b658b470ecaf9ff5e2c3407bfff224e91fb01 (diff) | |
download | chocolate-doom-cc0cc9fb0c806f6533dca794b1e829a626323d8b.tar.gz chocolate-doom-cc0cc9fb0c806f6533dca794b1e829a626323d8b.tar.bz2 chocolate-doom-cc0cc9fb0c806f6533dca794b1e829a626323d8b.zip |
Implement the fine tuning field, based on research.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1664
-rw-r--r-- | src/i_oplmusic.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c index 643f67c5..8cb833a2 100644 --- a/src/i_oplmusic.c +++ b/src/i_oplmusic.c @@ -839,6 +839,14 @@ static unsigned int FrequencyForVoice(opl_voice_t *voice) freq_index = 64 + 32 * voice->note + voice->channel->bend; + // If this is the second voice of a double voice instrument, the + // frequency index can be adjusted by the fine tuning field. + + if (voice->current_instr_voice != 0) + { + freq_index += (voice->current_instr->fine_tuning / 2) - 64; + } + // The first 7 notes use the start of the table, while // consecutive notes loop around the latter part. |