home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / COMMUNIC / CA24_1.ZIP / SCRIPTS.ZIP / ALARM.CMD next >
Encoding:
Text File  |  1988-09-26  |  6.7 KB  |  190 lines

  1. ; ----- Install a tune as the default alarm
  2. ;    commenced: 8/2/88 R.McG
  3. ;
  4. ;    First, draw a box
  5. ;
  6.     LEGEND " Select an alarm tune"
  7.     ON ESCAPE GOSUB EXIT
  8.     GOTO Start
  9. ;
  10. ;    Subroutine to intercept ESCAPE
  11. ;
  12. Exit:
  13.     RESTORE         ; Restore saved screen area
  14.     EXIT            ; No window foolishness
  15. ;
  16. ;    Start by opening a window
  17. ;
  18. Start:
  19.     GOSUB Window        ; Open a window
  20. ;
  21. ;    Now, look for a keypress
  22. ;
  23. Loop:
  24.     KEYGET S1        ; Read a single key
  25.     SWITCH S1
  26.       CASE "0"              ; Monty Python
  27.         S0 = "t200l8 do3bb16bb-16b o4e4dc o3b16aa-16ab o4c4 p4co3a4aaa-16ao4edco3aa-g-o4cd"
  28.         PLAY S0        ; Play the current selection
  29.       ENDCASE
  30.       CASE "1"              ; First call by Louis M. Sander
  31.         S0 = "T200MNO2G24O3C24E24G8G24G24G24G8E8E24E24E24E8C8E8C8O2G8"
  32.         PLAY S0        ; Play the current selection
  33.       ENDCASE
  34.       CASE "2"              ; William Tell
  35.         S0 = "t220l16o3mnb4p8msbbmnb4p8msbbb8g#8e8g#8b8g#8b8o4e8o3b8g#8e8g#8b8g#8b8o4e8o3mnb4p8msbb"
  36.         PLAY S0        ; Play the current selection
  37.       ENDCASE
  38.       CASE "3"              ; Theme from dragnet
  39.         S0 = "ms t250 o2 c2d8e-cp4 >c2d8e-cp4g-1 p2"
  40.         PLAY S0        ; Play the current selection
  41.       ENDCASE
  42.       CASE "4"              ; Leave it to Beaver
  43.         S0 = "ms t190lO2L8CL4FL8A>C<AFL4GL8B-L4>DL8C<B>CFL4D L8 <B- L4 G.. P16"
  44.         PLAY S0        ; Play the current selection
  45.       ENDCASE
  46.       CASE "5"              ; The TOnight Show
  47.         S0 = "ms t170 L4 A L8 G P16 F P16 L4 E P32 D.. P16.. L8 D.F P16 AG... P4"
  48.         PLAY S0        ; Play the current selection
  49.       ENDCASE
  50.       CASE "6"              ; Beverly Hillbillies
  51.         S0 = "ms t190 o2 L8 CCFCFGAAFF L4 G P32 G P32 C. P16"
  52.         PLAY S0        ; Play the current selection
  53.       ENDCASE
  54.       CASE "7"              ; The FLintstones
  55.         S0 = "ms t170 o3 L8 G.. P64 C P4 >C. P32 <AG.. P64 C P4 G. P64 FEEFG L4 CDC P32."
  56.         PLAY S0        ; Play the current selection
  57.       ENDCASE
  58.       CASE "8"              ; The Adams Family
  59.         S0 = "ms t220 o3 O3 T220 L8 CDEF P4 O0 L4 F P8 F P8 O3L8 DEF#G P4 O1 L4 G P8 G P8O3 L8 DEF#G P4 DEF#G P4 CDEF P4 O1 L4 F P8 F P8"
  60.         PLAY S0        ; Play the current selection
  61.       ENDCASE
  62.       CASE "9"              ; Final Jeapordy
  63.         S0 = "ms t150 o3 DGD <G >DGD P4DGDG MS B P8 MN L8 AGF#EE- L4DGD <G >DGD P4MS G P8"
  64.         PLAY S0        ; Play the current selection
  65.       ENDCASE
  66.  
  67.       CASE "A"              ; Birds
  68.         S0 = "l50 ml t255 o5 f#gf#gp64 f#gf#gp64 f#gf#gp64 f#gf#gp64 aa#ba#aa#ba#a p32 bbbbbb p64 f#gp64 f#gp64 f#gp64 f#gp64 f#g"
  69.         PLAY S0        ; Play the current selection
  70.       ENDCASE
  71.       CASE "B"              ; More birds
  72.         S0 = "l64 ml t255 n64n66n68n70 p64 n66n68n70n72n74n76n78 p64 n66n68n70n72 p64 n64n66n68n70 p64 n70n72n74n76n78n80 p64"
  73.         PLAY S0        ; Play the current selection
  74.       ENDCASE
  75.       CASE "C"              ; Charge
  76.         S0 = "mn t200 L8 CEFG P16 L8 E G8 >C1"
  77.         PLAY S0        ; Play the current selection
  78.       ENDCASE
  79.       CASE "D"              ; Spaceship
  80.         S0 = "l64 mf ml t255 n50n60n52n62n54n64n56n66n54n64n52n62n51n62"
  81.         PLAY S0        ; Play the current selection
  82.       ENDCASE
  83.       CASE "E"              ; More Spaceship
  84.         S0 = "l64 mf ml t255 n40n41n42n43 n50n51n52n53"
  85.         PLAY S0        ; Play the current selection
  86.       ENDCASE
  87.       CASE "F"              ; Alfred Hitchcock
  88.         S0 = "t200 ml o2g ms o3cc8c ml o2bab. ms o3 cd1"
  89.         PLAY S0        ; Play the current selection
  90.       ENDCASE
  91.       CASE "G"              ; Dixie
  92.         S0 = "t200 L16ge L8cc L16cdef L8gggeaaa. L16g a8.gab O4 L16cde4. c O3g O4c4.O3geg4.dec4"
  93.         PLAY S0        ; Play the current selection
  94.       ENDCASE
  95.       CASE "H"              ; Reveille by Louis M Sander
  96.         S0 = "T140O2G8O3MSC8MNE16C16O2G8O3MSE8C8MNE16C16O2G8O3E8C8E16C16O2G8O3E8C2"
  97.         PLAY S0        ; Play the current selection
  98.       ENDCASE
  99.       CASE "I"              ; Swim call by Louis M Sander
  100.         S0 = "T198 MN O2 G8 O3 C8 P8 C8 C8 E8 C8 O2 G8 P8 G8 G8 P8 G8 O3 C8 P8 C8 C8 E8 C8G"
  101.         PLAY S0        ; Play the current selection
  102.       ENDCASE
  103.  
  104.       CASE "P"
  105.         PLAY S0        ; Play the current selection
  106.       ENDCASE
  107.       CASE "X"
  108.         IF NOT NULL S0
  109.            GOTO INSTALL    ; Install it
  110.         ELSE
  111.            SOUND 200 100    ; NOthing yet
  112.            ENDIF
  113.       ENDCASE
  114.  
  115.       default
  116.         SOUND 100 100    ; Not acceptible
  117.       ENDCASE
  118.     ENDSWITCH
  119.     GOTO LOOP
  120. ;
  121. ;    Install the selection as the current tune
  122. ;
  123. INSTALL:
  124.     SET TUNE S0        ; Set for current execution
  125. ;
  126. ;    Construct a file name on the appropriate directory
  127. ;
  128.     ENVIRON S1 "COM-AND="   ; Look for COM-AND= environment var
  129.     IF FOUND        ; If environment variable found
  130.        LENGTH S1 N0     ; Get its length
  131.        N0 = N0-1        ; Point to last char in string
  132.        IF not STRCMP S1(n0:n0) "\"
  133.           N0 = N0+1
  134.           CONCAT S1(n0) "\"
  135.           ENDIF
  136.        ENDIF
  137.     S1 = S1&"COM-AND.TUN"   ; Add the necessary file name
  138. ;
  139. ;    Open the file, write the scting, and close it
  140. ;
  141.     FOPENO S1        ; Open the file name so constructed
  142.     LENGTH S0 N1        ; Find string length
  143.     WRITE S0 N1        ; Write the string
  144.     FCLOSEO         ; Close the file
  145.     MESSAGE "Alarm installed!"
  146.     RESTORE         ; Restore saved screen area
  147.     EXIT            ; And we're done
  148. ;
  149. ;    Open a window and display a menu
  150. ;
  151. Window:
  152.     SAVE  0 10 23 70
  153.     box   0 10 23 70 (default)
  154.     atsay 0 ,12 (default) " COM-AND Select Alarm tune "
  155.     atsay 1 ,11 (default)  " COM-AND version 2.3 allows the alarm 'tune' to be set by  "
  156.     atsay 2 ,11 (default)  " its user.  The alarm tune is set by default through the   "
  157.     atsay 3 ,11 (default)  " file COM-AND.TUN.  It may be changed during COM-AND's     "
  158.     atsay 4 ,11 (default)  " execution through any script using the command 'SET TUNE'."
  159.  
  160.     atsay 6 ,11 (default)  " This script both creates the TUN file and sets the alarm  "
  161.     atsay 7 ,11 (default)  " for the current execution.  ESC exits without installing. "
  162.  
  163.     atsay 8 ,10 (default) "├───────────────────────────────────────────────────────────┤"
  164.     atsay 10 12 (default) "1) First call"
  165.     atsay 11 12 (default) "2) William Tell"
  166.     atsay 12 12 (default) "3) Theme from Dragnet"
  167.     atsay 13 12 (default) "4) Leave it to Beaver"
  168.     atsay 14 12 (default) "5) The Tonight Show"
  169.     atsay 15 12 (default) "6) Beverly Hillbillies"
  170.     atsay 16 12 (default) "7) Flintstones"
  171.     atsay 17 12 (default) "8) The Adams Family"
  172.     atsay 18 12 (default) "9) Final Jeapordy"
  173. ; ***    atsay 19 12 (default) "9) And something completely different"
  174.  
  175.     atsay 10 42 (default) "A) Birds"
  176.     atsay 11 42 (default) "B) Another bird"
  177.     atsay 12 42 (default) "C) Charge!! "
  178.     atsay 13 42 (default) "D) Spaceship"
  179.     atsay 14 42 (default) "E) Another spaceship"
  180.     atsay 15 42 (default) "F) Alfred Hitchcock"
  181.     atsay 16 42 (default) "G) Dixie"
  182.     atsay 17 42 (default) "H) Reveille"
  183.     atsay 18 42 (default) "I) Swim call"
  184.  
  185.     atsay 20 10 (default) "├───────────────────────────────────────────────────────────┤"
  186.     atsay 21 12 (default) "P) Play the selected tune again"
  187.     atsay 22 12 (default) "X) Install the selected tune"
  188.     atsay 23 32 (default) "Press ESC to exit"
  189.     return
  190.