Category : Modula II Source Code
Archive   : M2MUSIC.ZIP
Filename : SPEAKER.DEF

 
Output of file : SPEAKER.DEF contained in archive : M2MUSIC.ZIP
DEFINITION MODULE Speaker;
(* Routines turn the speaker on at a given frequency,
to rurn it off again, and to delay processing for a set interval
Written for FST Modula-2 by Robin Roos and Pat Terry, November 1988 *)

CONST (* frequencies starting at Middle C *)
C = 262;
CSharp = 277;
DFlat = CSharp;
D = 294;
DSharp = 311;
Eflat = DSharp;
E = 330;
F = 349;
FSharp = 370;
GFlat = FSharp;
G = 392;
GSharp = 415;
AFlat = GSharp;
A = 440;
ASharp = 466;
BFlat = ASharp;
B = 494;

PROCEDURE Sound (FreqHz : CARDINAL);
(* Turn on speaker at frequency FreqHz *)

PROCEDURE NoSound;
(* Turn off speaker *)

PROCEDURE Delay (Time : CARDINAL);
(* Waste approximately Time milliseconds - based on counting loops *)

PROCEDURE ATDelay (Time : CARDINAL);
(* Waste Time milliseconds - AT specific *)

PROCEDURE Wait (Time : CARDINAL);
(* Wait approximately Time milliseconds - based on time of day *)

PROCEDURE PlayNote (Frequency, Time : CARDINAL);
(* Play a note at frequency for duration time (in milliseconds). *)

END Speaker.


  3 Responses to “Category : Modula II Source Code
Archive   : M2MUSIC.ZIP
Filename : SPEAKER.DEF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/