055.txt
BPM Conversion Formula Defined
for ANY Looped Waveforms
as from the Dance and B&D Expansion boards
All have their Original Tempos triggered by the C4 (Middle C)
key. Use the RPN Controllers for setting the Fine (0/1) and Coarse (0/2)
Tuning.
The following module program function given in Mathematica can be used and be
fairly easy to convert to any other language. I also have a QuickBASIC
version included below it which can be cut and pasted into a "suggested"
filename of "bpmconv.bas" for immediate use.
cf[oldbpm_,newbpm_] := Module[{c,f,t,u},
t = 1200 * Log[newbpm/oldbpm]/Log[2];
u = Quotient[t,100];
c = u + Quotient[t - 100*u + 50, 100];
f = Round[Mod[t - 100*u + 50, 100] - 50];
{c,f}//N]
which returns the required Coarse and Fine Tuning values applied to C4
required to get the proper playback BPM based on the original BPM setting.
It may be added that Quotient[n/m] returns the integer part of n/m
(discarding any fractional result) and Round[m] rounds the value of
m to the nearest integer. The other functions present are usually
available in programming languages.
To calculate the BPM according to given Coarse and Fine Tuning values based on
offsets from C4 (as Middle C), you can use this Mma function (or equivalwent):
bpm[c_,f_] := N[oldbpm * 2^(c/12 + f/1200)]
I am fully indebted to Paulo Mouat (
http://www.geocities.com/Vienna/8804/) on the Mma "mathgroup" mailing list for
these solutions.
-----------------------------------------------------
REM Program: BPM to Coarse/Fine Tuning Conversion
REM Language: QuickBASIC 4.5
REM Date: September 4, 1997
REM Programmer: Benjamin Tubb
REM Comments: based on Paulo Mouat's 'Mathematica' code
CLS
CLEAR
PRINT "This program will print a Chart of OldBPM to desired NewBPM"
PRINT "from 40-200 BPM with the Coarse and Fine Tuning values to"
PRINT "apply to C4 (Middle C) for playing back a looped Waveform"
PRINT "as from the 'Dance' or 'Bass & Drums' Expansion boards."
INPUT "Enter the Original C4 pitched BPM value"; OldBPM
LPRINT "Original B.P.M. "; OldBPM
LPRINT "dst c.t. f.t."
FOR NewBPM = 40 TO 200
LET t = 1200 * LOG(NewBPM / OldBPM) / LOG(2)
LET u = FIX(t / 100)
LET x = t - (100 * u) + 50
LET c = u + FIX(x / 100)
LET f = INT((x MOD 100) - 50)
LPRINT USING "### +### +###"; NewBPM; c; f
NEXT NewBPM
END
-------------------------------
Benjamin Tubb
brtubb@cybertron.com
http://www.cybertron.com/~brtubb/jvxp.html
"Music creates order out of chaos; for rhythm imposes unanimity
upon the divergent, melody imposes continuity upon the disjoin-
ted, and harmony imposes compatibility upon the incongruous."
- Yehudi Menuhin, from "Theme and Variations"