But, after checking my work I found that my math was incredibly off.
The song positions in the sequencer are roughly as follows:
Minimum value 0 = song position 1. 1. 1. 0 (.0000)
Maximum value 2147483646 = song position 9999. 4. 4 .239 (.9375)
I say that the above numbers are "roughly" those values because I have tried numerous times to get an accurate measurement of subticks but have not succeeded.
According to this article, each beat (or quarter note if you prefer) has a subtick resolution of 15360.
Since a sixteenth note is one fourth of a quarter note and each sixteenth note has a length of 240 ticks, we can solve for the smallest possible increment in the sequencer using the following simple formula:
To get an accurate measurement of subticks, we must convert this value by diving 1 by 16, resulting in 0.0625 ticks.x = 15360 / 4 / 240
x = 16
Therefor, the smallest increment that is possible in Reason's sequencer must be 0.0625 ticks or 62.5 subticks (assuming a subtick is 1/1000 of a tick).
Going back to the value of a quarter note, a bar written in 4/4 tempo should be equal to 4 * 15360, or 61440 subticks.
If we calculate all of the major subdivisions of time that are used to display a position within the sequencer, we get the following table:
This should mean that we can now perform the following calculation to get the maximum value for Song Position (2147483646 subticks):61440 subticks = 1 bar
15360 subticks = 1/4 note
3840 subticks = 1/16 note
16 subticks = 1 tick
But, I always return the following result:v = 16 subticks * 240 ticks * 4 16th notes * 4 beats * 4 bars * 9999
A big number, but...v = 2457354240
I'm probably missing something here, but I'm not being hard on myself for having goofed when I first posted this.2457354240 != 2147483646, solution does not check
The subdivisions of time are; from smallest to biggest; 1/16, 1/240, 1/4, 1/4, 1/1.
With no clear order to the quantities being generated by those fractions, it's easy to get confused. I've calculated the subtick resolution and I'm still confused.
So, somehow it is possible to multiply the maximum number of bars (9999) by the number of beats (4) by the number of subticks in each beat (15360) by the number of 1/16th notes in each beat (4) by the number of subticks in each 1/16th note (3840) by the number of subticks in each tick (16), and then finally add 239 * 16 + 15 to the result and get the maximum value of 2147483646. I have no idea how to get this, even after trying to use whole numbers and subtract one to account for zero as the starting value.
I believe the problem is not knowing the value of the subticks, but 0.0625 should be correct because it takes 16 subticks to equal 1 tick (and 1/16=0.0625).
Perhaps someone with more mathematical skill than me can figure this out?