Cents/Hz conversion

Ron Nossaman RNossaman@KSCABLE.com
Wed, 29 Mar 2000 07:38:36 -0600


Jim Coleman Sr posted this to the List in February 1997. You're welcome.
Ron N



Greetings again to Richard and all of the others who have requested 
the Basic program which I offered. To save me time I am putting it 
here as an attachment. This program runs under Qbasic which comes with 
DOS 5.0 and upward. If you are in DOS and in the directory where you 
saved the above file, you can give the command:
qbasic cents2hz.bas
When the program loads there will be an opportunity to see the survival 
instructions. Hit ESC to get to the program listing. You can read the 
simple instructions for running the program, then click on RUN or hold 
down the shift key and hit F5.
If you have Win95, I can't help you much, I'm still running win3.1 
If you have some other type Basic, I probably can't help you there 
either. I wrote this program on an 8088 IBM machine in the early 80's in 
IBMBASIC language. Then I converted it to Qbasic and later to QuickBasic. 
After a couple of Hard disk crashes, I don't have all of the previous 
versions any longer.
Jim Coleman, Sr.
PS I'll post the other program: Hz2cents.bas later. My file was corrupted 
when I went to check it out.
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="cents2hz.bas"
Content-ID: <Pine.PCW.3.91.970207113913.5375B@ppp1-10.inre.asu.edu> 
Content-Description: 
10 REM " * * * * THE NAME OF THIS PROGRAM IS CENTS2HZ.BAS * * * *" 
15 ' Written by Jim Coleman, Sr. 1993 
20 CLS 
25 PRINT "THIS PROGRAM WILL COMPUTE THE BEAT RATE OF A SELECTED INTERVAL WHEN" 
26 PRINT "YOU ENTER THE CENTS DEVIATION OF THE UPPER COINCIDENT PARTIAL" 
30 PRINT "FIRST LOCATE THE KEYBOARD POSITION OF THE COINCIDENT PARTIALS OF
THE" 
40 PRINT "INTERVAL IN CONSIDERATION. ENTER THIS NOTE # WHEN CALLED FOR." 
50 PRINT "PLAY THE UPPER NOTE OF THE INTERVAL AND TAKE THE CENTS READING BY" 
60 PRINT "USING THE CENTS BUTTONS TO STOP THE DOT PATTERN. ENTER CENTS
READING" 
70 PRINT "WHEN CALLED FOR IN PROGRAM. THEN PLAY THE LOWER NOTE OF THE
INTERVAL" 
80 PRINT "AND TAKE THE CENTS READING USING THE CENTS UP OR CENTS DOWN
BUTTONS." 
90 PRINT "ENTER THIS READING AND THE CENTS AND BEAT TOTALS WILL BE ON SCREEN" 
100 REM 
110 REM CLS 
120 PRINT 
130 PRINT "A-5 IS THE FIRST COINCIDENT PARTIAL OF F3, A3, & D4. IT IS NOTE 61" 
140 PRINT 
150 INPUT "WHICH NOTE # IS NEAREST YOUR COINCIDENT PARTIALS? "; N: PRINT 
160 PRINT 
170 INPUT "WHAT IS THE CENTS READING OF THE UPPER NOTE OF YOUR INTERVAL? "; A 
180 B = 25.9565563# * 2 ^ (N / 12) 
190 X = A / 1200: A8 = 2 ^ X * B: PRINT A8 
200 INPUT "WHAT IS THE CENTS READING OF THE LOWER NOTE OF YOUR INTERVAL? "; A3 
210 Y = A3 / 1200: A7 = 2 ^ Y: A9 = B / (1 / A7): PRINT A9220 PRINT "THE
CENTS DIFFERENCE IS "; A - A3; " THE BEAT DIFFERENCE IS "; A8 - A9 





Here is the program written in Qbasic which runs on DOS 5.0 or greater.
It is quite simple and runs just like the other program which I sent 
earlier today on Cents2Hz.bas. So now you can have it both ways.
This program is so short that you could edit it easily to run on 
whatever version you wish.
Jim Coleman, Sr. 
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="hz2cents.bas"
Content-ID: <Pine.PCW.3.91.970207134308.5375B@ppp1-15.inre.asu.edu> 
Content-Description: 
REM ************************* HZ2CENTS.BAS *************************** 
REM 
REM 
PRINT "TO COMPUTE THE CENT WIDTH BETWEEN TWO FREQ'S, ENTER AS AN INPUT" 
PRINT "THE HIGHER FREQ FIRST, THEN INPUT THE LOWER FREQUENCY, THE RESULTANT" 
PRINT "CENTS WIDTH WILL BE PRINTED TO THE SCREEN." 
REM 
REM 
10 INPUT "TYPE IN FIRST FREQUENCY "; A 
20 INPUT "TUPE IN SECOND FREQUENCY "; B 
30 CENTS = 1200 * (LOG(A / B) / LOG(2)) 
40 PRINT "CENTS = "; CENTS 
END

Ron N


This PTG archive page provided courtesy of Moy Piano Service, LLC