From cc0cc9fb0c806f6533dca794b1e829a626323d8b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 11 Sep 2009 16:54:06 +0000 Subject: Implement the fine tuning field, based on research. Subversion-branch: /branches/opl-branch Subversion-revision: 1664 --- src/i_oplmusic.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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. -- cgit v1.2.3