Folks, can we all get on the same page with music-theory?
Tempo is the basic timing for a tune, it says how often a "beat" happens per second.
A "note length" is just a way of specifying relative (and not absolute) timings for events, so a note, a 1/2 note, a 1/4 note, or the wonderful British names, a semibreve, a minim and a crotchet.
These are further modified by having "dotted" notes that adds another fraction of the note to the lengths.
See
https://en.wikipedia.org/wiki/Note_valueSee
https://en.wikipedia.org/wiki/TempoThe point is ... the note lengths specify time relative to other note lengths, and NOT in terms of absolute fractions of a second.
It is the time-signature and tempo that define the link between the note length and absolute time in beats-per-minute (BPM).
A "beat" is commonly defined as 1/4 note (especially in videogames), but that isn't an absolute rule.
But I'll use that 1/4 note = 1 beat convention for the rest of this.
Once you realize that note length are just a notation for relative time, you can see that changing the tempo (BPM) is just another way of saying that you're changing how long a 1/4 note is.
Here are the common "conventional" timings for running a music-driver on a console/old-computer ...
NTSC
Base Tempo = 5/60s per 1/16th = 20/60s per 1/4 note = 180.0 bpm (60 * 60/20)
Base Tempo = 6/60s per 1/16th = 24/60s per 1/4 note = 150.0 bpm (60 * 60/24)
Base Tempo = 7/60s per 1/16th = 28/60s per 1/4 note = 128.6 bpm (60 * 60/28)
Base Tempo = 8/60s per 1/16th = 32/60s per 1/4 note = 112.5 bpm (60 * 60/32)
Base Tempo = 9/60s per 1/16th = 36/60s per 1/4 note = 100.0 bpm (60 * 60/36)
PAL50
Base Tempo = 4/50s per 1/16th = 16/50s per 1/4 note = 187.5 bpm (60 * 50/16)
Base Tempo = 5/50s per 1/16th = 20/50s per 1/4 note = 150.0 bpm (60 * 50/20)
Base Tempo = 6/50s per 1/16th = 24/50s per 1/4 note = 125.0 bpm (60 * 50/24)
Base Tempo = 7/50s per 1/16th = 28/50s per 1/4 note = 107.1 bpm (60 * 50/28)
Base Tempo = 8/50s per 1/16th = 32/50s per 1/4 note = 93.8 bpm (60 * 50/32)The table above shows that you can achieve a number of different "tempo" settings and still run your music driver in the vsync interrupt.
It also shows that speeding-up a tune (i.e. in a boss-attack) just involves changing the delay-per-quarter-note.
That's how games used to do it ... not by changing the number of times-per-second that the music driver was called!!!
***************************
Now, practically, in videogame music-drivers, the programmer has to make a decision about how to encode the note-lengths.
The simplest choice is just to use the tune's BPM to calculate the length of a note (in terms of 1/60s aka the number of "calls" to the music-driver) when you build the game.
For example, on an NTSC console (i.e. America/Japan and the PC Engine), if your tune is playing back at 128 BPM (which is your closest approximation for 120 BPM), then you'd store the length of a quarter-note as "28", meaning that you call the music-driver 28 times before the next note (see the table above).
That's the fastest-to-process when playing back the music, but it means that you can't
easily change the tempo during playback.
Once the timing is baked into the tune data like that, the only way to change the tempo is to change how often the music-driver itself is called per second.
Now, most games do NOT change the tempo during playback, and so that's a common way to store the note-lengths.
The System Card Player can store tune data in this way, and it calls it the "Direct" length mode.
This
appears to be the method that Arkhan and TheOldMan have chosen to use for Squirrel, and it's why they can't change the tempo of a song without changing how often the Squirrel Player is called per second.
It is
not the only way to encode tune data, and it is not even the only way that the System Card Player supports.
Another way to store the length of a note is to store it in the original terms, for-example the length as a number 1..16 in terms of 1/16th notes, or the number 1..32 in terms of 1/32nd notes.
If you do things this way, then you can trivially change the tempo during playback by changing the length of 1/16th note from being 7/60s (a delay of 7 calls to the music-driver), to 5/60s or 8/60s.
The System Card Player can also store tune data in this way, and it calls it the "Time Base" length mode.
This is how most games work that change the tempo during playback.
This is also
effectively how most trackers work, if they allow the musician to set the delay-time for each row/line in the pattern.
If you consider each row/line as the time of 1/32nd note, then you can get all of those 4, 5, 6, 7, etc 1/60s timings just by changing the delay times of even and odd rows/lines.
Deflemask does this, for example, when you to set the "Speed" to 4 & 3 ticks for the even/odd rows, resulting in 4+3=7 1/60s ticks per 1/16th note ... for 112.5 BPM (close-enough to a nominal 120 BPM).
One issue with using the System Card Player in this way is that it only stores notes in multiples of 1/16th note, which means that it
cannot play 1/32nd notes without resorting to doubling the tempo and calling the driver twice-as-often (i.e. 120 times-per-second).
That's a limitation of the System Card Player's encoding of the tune data ... trackers don't have the same issue.
The System Card Player supports one one final way of storing the tune data, and that is to store the note length in terms of multiples of 1/64th of a note, then multiplied by 3. It calls this the "Tempo Method" length data. For this to work, the System Card Player *must* be called from a timer interrupt where the driver changes the length of the timer depending upon what BPM tempo you want to play back the music at.
The downside of this is that the more times you call the music-driver per second, the more CPU-time you're throwing away.
Hopefully that's all reasonably clear.