diff -u -r1.17 fluid_voice.c
--- fluid_voice.c       10 Dec 2006 16:02:04 -0000      1.17
+++ fluid_voice.c       3 Mar 2007 21:20:12 -0000
@@ -587,11 +587,17 @@
    * through the original waveform with each step in the output
    * buffer. It is the ratio between the frequencies of original
    * waveform and output waveform.*/
-  incr = fluid_ct2hz_real(voice->pitch
+  if (voice->gen[GEN_SCALETUNE].val == 0) {
+    incr = fluid_ct2hz_real(voice->pitch + fluid_hz2ct(voice->root_pitch)
                    + voice->modlfo_val * voice->modlfo_to_pitch
                    + voice->viblfo_val * voice->viblfo_to_pitch
                    + voice->modenv_val * voice->modenv_to_pitch) / voice->root_pitch;
-
+  } else {
+    incr = fluid_ct2hz_real(voice->pitch
+                   + voice->modlfo_val * voice->modlfo_to_pitch
+                   + voice->viblfo_val * voice->viblfo_to_pitch
+                   + voice->modenv_val * voice->modenv_to_pitch) / voice->root_pitch;
+  }
   /* Transfer the phase from the voice into the dsp loop parameter
      dsp_phase */
   fluid_phase_set(dsp_phase, voice->phase);
@@ -990,15 +996,19 @@
    * to _GEN(voice, GEN_SCALETUNE) When the scale tuning is varied,
    * one key remains fixed. Here C3 (MIDI number 60) is used.
    */
-  if (fluid_channel_has_tuning(voice->channel)) {
-    /* pitch(60) + scale * (pitch(key) - pitch(60)) */
-    #define __pitch(_k) fluid_tuning_get_pitch(tuning, _k)
-    fluid_tuning_t* tuning = fluid_channel_get_tuning(voice->channel);
-    voice->gen[GEN_PITCH].val = (__pitch(60) + (voice->gen[GEN_SCALETUNE].val / 100.0f *
+  if (voice->gen[GEN_SCALETUNE].val != 0) {
+    if (fluid_channel_has_tuning(voice->channel)) {
+      /* pitch(60) + scale * (pitch(key) - pitch(60)) */
+      #define __pitch(_k) fluid_tuning_get_pitch(tuning, _k)
+      fluid_tuning_t* tuning = fluid_channel_get_tuning(voice->channel);
+      voice->gen[GEN_PITCH].val = (__pitch(60) + (voice->gen[GEN_SCALETUNE].val / 100.0f *
                                           (__pitch(voice->key) - __pitch(60))));
-  } else {
-    voice->gen[GEN_PITCH].val = (voice->gen[GEN_SCALETUNE].val * (voice->key - 60.0f)
+    } else {
+      voice->gen[GEN_PITCH].val = (voice->gen[GEN_SCALETUNE].val * (voice->key - 60.0f)
                                 + 100.0f * 60.0f);
+    }
+  } else {
+    voice->gen[GEN_PITCH].val = 0;
   }

   /* Now the generators are initialized, nominal and modulation value.
@@ -1172,9 +1182,7 @@
       voice->root_pitch = voice->sample->origpitch * 100.0f - voice->sample->pitchadj;
     }
     voice->root_pitch = fluid_ct2hz(voice->root_pitch);
-    if (voice->sample != NULL) {
-      voice->root_pitch *= (fluid_real_t) voice->output_rate / voice->sample->samplerate;
-    }
+    voice->root_pitch *= (fluid_real_t) voice->output_rate / voice->sample->samplerate;
     break;

   case GEN_FILTERFC:
