Protracker finetunes

Tracker 4.44

## 8.4: The finetune concept

Finetune is a weird invention of protracker. Since it is used very often, we can't avoid it.

It must be decoded as follows: [1]

      Value:    0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
      Finetune: 0 +1 +2 +3 +4 +5 +6 +7 -8 -7 -6 -5 -4 -3 -2 -1

Its interpretation is as follows: an instrument with a current finetune of f should be played offset by f/8 halftones up. In the end, to find the correct pitch to play a note at, you take the note period as stored in the table for f=0, convert it to a note value, and then offset it to finetune f, compute the correct pitch [look it up] and play the note. Loading a sample (as in sample number != 0) will obviously update the finetune for the corresponding channel. There is also an extended command to change a sample finetune without loading a new sample (see module ``crystal_rain`' for instance). See Set finetune.

In a module, the stored pitch always use the base table and never takes finetune into account. So, to play a Protracker note you need to

- decode the note from the pitch value using the base pitch table.
- look up the new pitch according to the current finetune for that channel.
- play the note at the corrected frequency.

[1] This is actually a two-complement value, but over a nibble, which is a bit unusual.