home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
pcmag
/
vol9n03.arc
/
HERTZ.FNC
< prev
next >
Wrap
Text File
|
1990-01-03
|
550b
|
30 lines
HERTZ function
VAR
Oct_Val : ARRAY[5..12] OF Real;
Freq_Val : ARRAY[0..12] OF Real;
PROCEDURE Set_Frequencies;
VAR N : Byte;
BEGIN
Freq_Val[1] := 1;
Freq_Val[2] := 1.0594630944;
FOR N := 3 TO 12 DO
Freq_Val[N] := Freq_Val[N - 1] * Freq_Val[2];
Freq_Val[0] := 1/Freq_Val[2];
Oct_Val[5] := 32.70319566;
FOR N := 6 TO 12 DO
Oct_Val[N] := Oct_Val[N - 1] * 2;
END;
FUNCTION Hertz(oct, nt : byte) : Word;
BEGIN
Hertz := Round(Oct_Val[oct]*Freq_Val[nt]);
END;