// Effectus auto-generated Mad Pascal source code listing
program soundsPrg;

uses
  Crt, StringUtils, Graph;

var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Sound demo
// (using Sound and SndRst procedures)
var
  CH : byte absolute 764;  // CH_byte_array
  COL : byte absolute 710;  // COL_byte_array

procedure WAITFORKEYProc;
begin
 WHILE CH=255 do begin
  end;
  CH := 255;
end;

procedure SPACEKEYProc;
begin
 WHILE CH<>33 do begin
  end;
  CH := 255;
end;

procedure MAINProc;
begin
  Write(Chr(125));
  Poke(82, 0);
  Poke(708 + 2,  0*16 +  0);
  eff_string := '';
  Write('Effectus example:');  // Print 1
  Writeln;
  eff_string := '';
  Write('Sound demonstration');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '';
  Write('Press space for first s. channel!');  // Print 1
  Writeln;
  SPACEKEYProc;
  COL := 50;
  Sound(0, 100, 10, 10);
  eff_string := '';
  Write('Press space for second s. channel!');  // Print 1
  Writeln;
  SPACEKEYProc;
  COL := 100;
  Sound(1, 140, 12, 12);
  eff_string := '';
  Write('Press space for third s. channel!');  // Print 1
  Writeln;
  SPACEKEYProc;
  COL := 150;
  Sound(2, 200, 14, 6);
  eff_string := '';
  Write('Press space for fourth s. channel!');  // Print 1
  Writeln;
  SPACEKEYProc;
  COL := 180;
  Sound(3, 70, 10, 4);
  Writeln('');
  eff_string := '';
  Write('**************+*********************');  // Print 1
  Writeln;
  eff_string := '';
  Write('Press any key to shut off the sound!');  // Print 1
  Writeln;
  eff_string := '';
  Write('***************+********************');  // Print 1
  Writeln;
  WAITFORKEYProc;
  COL := 240;
  Sound(0, 0, 0, 0);
  Sound(1, 0, 0, 0);
  Sound(2, 0, 0, 0);
  Sound(3, 0, 0, 0);
end;

begin
  MAINProc;
end.
