Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: FAQ: BPM/SPD/Rows/Ticks etc  (Read 33977 times)

0 Members and 1 Guest are viewing this topic.

Deltafire

  • Milkytracker Moderator
  • Rising Star
  • *
  • Offline Offline
  • Posts: 196
    • View Profile
FAQ: BPM/SPD/Rows/Ticks etc
« on: March 07, 2010, 10:48:04 »

People are often asking how these 4 are related, so I thought I'd type up a quick forum post to explain:

In ye olde days back on the Amiga, trackers used the VBL interrupt for timing (the Vertical BLank is the time in which a CRT has finished drawing the image and is resetting the beam position back to the top-left of the screen).  In Europe, the VBL interrupt was effectively a nice stable 50Hz timer.

So, a player routine would use this 50Hz timer to update the values in the Amiga's sound chip (named Paula): frequency, sample address & volume.  This was the shortest amount of time in which these parameters could be modified and was known as a 'tick'.  On the Amiga, a tick occurs at 50Hz and therefore has a duration of 20ms.

Obviously this is much too fast to playback a song (50Hz = 3000bpm!) so it had to be subdivided.  This is where the SPD (speed) parameter comes in, this controls the number of ticks that occur before the pattern advances to the next row.  Typically this is set to 6, meaning that 6 ticks will occur for every row of a pattern.  Using 4 rows per beat, this equates to 4 X 6 = 24 ticks per beat.  We know that the standard tick duration is 20ms (for a 50Hz timer), so 24 X 20 = 480ms per beat, translating this to Beats Per Minute:

60 / 0.480 = 125BPM

Which coincidently, is the default BPM setting of Milkytracker :)

Later versions of Amiga trackers added an option to use the Amiga's CIA timer interrupt instead of the VBL, this could be programmed to different frequencies enabling the tick duration to be altered.  Altering the tick duration allows the BPM to be set to user defined values instead of being fixed at 125BPM, therefore the BPM setting was added.  The Fasttracker II manual explains it thus:

The BPM setting defines how fast (ticks/second) the music player will run. 125 BPM<-> 50 Hz. Number of player ticks/second = BPM*2/5

Converting this value to a duration is easy:  Tick duration (ms) = 2500/BPM.

Notes:

In Europe, Amiga's were designed for the PAL TV standard which updates at 50Hz.  In America, the NTSC standard was used at 60Hz.

Milkytracker does not use a fixed timer interrupt like the Amiga players do, instead it updates the tick value every x samples (where x is a calculated value that corresponds to the equivalent timer frequency).  Due to the granularity of both timer interrupts and sample speeds, the BPM value is almost never 100% accurate; there is usually an error of <1BPM.  This can cause problems when using trackers with other music software which may have a true BPM setting.
Logged

haschischtasche

  • New User
  • Offline Offline
  • Posts: 24
    • View Profile
    • My YouTube channel
Re: FAQ: BPM/SPD/Rows/Ticks etc
« Reply #1 on: March 12, 2010, 12:03:44 »

as i was one of the people who asked: nice faq and always good to know as plenty of commands rely on tick and ticklength.
Logged
Insert signature here...

leo_amiga

  • New User
  • Offline Offline
  • Posts: 1
    • View Profile
Re: FAQ: BPM/SPD/Rows/Ticks etc
« Reply #2 on: August 21, 2018, 19:35:46 »

Thanks for the nice explanation.

However there is something I don't understand:

Quote
Typically this is set to 6, meaning that 6 ticks will occur for every row of a pattern.  Using 4 rows per beat, this equates to 4 X 6 = 24 ticks per beat.
Where does the "4" comes from and what's a "beat"?
Logged

Saga Musix

  • TMA Moderator
  • Top Poster
  • ****
  • Offline Offline
  • Posts: 2571
  • I love OpenMPT! And Modules! And TMA! And Pie! :>
    • View Profile
    • Saga Musix - free module music and more!
Re: FAQ: BPM/SPD/Rows/Ticks etc
« Reply #3 on: August 22, 2018, 15:15:18 »

A beat is a quarter note, and using 4 (or 8) rows per beat is pretty much a convention in the whole module world.
Logged
» My TMA artist profile
» Visit my music site: https://sagamusix.de/ [de, en]
» Visit my programming website: https://sagagames.de/ [de]
» Open ModPlug Tracker

BlackCatBlackBrid

  • New User
  • Offline Offline
  • Posts: 2
    • View Profile
Re: FAQ: BPM/SPD/Rows/Ticks etc
« Reply #4 on: April 17, 2019, 05:41:03 »

I read this topic.

Then, is the following correct?


The BPM value in MILKYTRACKER is not necessarily "BPM of how many quarter notes come out per minute" generally referred to, but it is a property value that controls the speed of one line of the pattern.

When setting the BPM of the actual song as 110 in Milkytracker, it is necessary to adjust the speed of one line by the BPM value or tick / row. In other words, the BPM value is determined as a parameter to achieve the target BPM.

Find the BPM value as T.

As the pattern speed x
Song BPM 110 = 60 / x
0.545 = x
The speed of the pattern is 545 ms

M = ticks / row
timepertick = 2500 / T;
timeperrow = 2500 / T * M;

In the case of 16 Rows in one measure, Beat = 4th note is 16/4, so
545 ms = timeperrow * 16/4
136.25 = timeperrow
136.25 = 2500 / T * M

Let M be 5
T = 91.7431193

If BPM value is 91.7431193, BPM of Song will be 110.

And if one pattern consists of 13 Rows, then Beat = 1/4 note becomes 13/4
545 ms = timeperrow * 13/4
167.692308 = timeperrow
T 7 74.5412843

If BPM value is 74.5412843, BPM of Song will be 110.
Logged

BlackCatBlackBrid

  • New User
  • Offline Offline
  • Posts: 2
    • View Profile
Re: FAQ: BPM/SPD/Rows/Ticks etc
« Reply #5 on: April 17, 2019, 09:44:00 »

Here is test Comparison Spd 6 / Spd 5

https://youtu.be/2uDxra6O3VM

Milkytracker
Time signature 4/4 BPM `value` = 125

Comparison Spd 6 / Spd 5

check tool :Sonic Visualiser / Vamp plugin Tempo and Beat Tracker
https://vamp-plugins.org/plugin-doc/qm-vamp-plugins.html

Spd 6 ... BPM 126,05
Spd 5 ... BPM 152,00

formula;

Case Spd =5

Song BPM 152 = 60 / x
x = 0.3947368421052632
The speed of the pattern is 395 ms

T = tempo ... BPM `value` on Milkytracker
M = ticks / row
timepertick = 2500 / T;
timeperrow = 2500 / T * M;

timepertick = 2500 / 125
timepertick = 20 ms

timeperrow = 2500 / 125 * 5;
timeperrow = 100 ms

395ms = timeperrow * 16/4
Logged
Pages: [1]   Go Up