{ DEMO.PAS - Demo of drum routines for Tandy 1000 and/or PCJr }

uses noiz,drums;

procedure check_key;
var ch: char;
begin
  if keyhit then
  begin
    ch:=upcase(fkey);
    case ch of
      '1': roto1(12,1);
      '2': roto2(6,5);
      '3': roto5(4,1,2);
      '4': snare(10,2);
      '5': tom(10,2);
      '6': lowtom(10,2);
      '7': bass(10,2);
      '8': bass2(10,2);
      '9': sims(10,5);
      'A': sims1(10,5);
      'S': sims2(10,5);
      'D': sims3(10,5);
      'F': echo(50,short);
      'G': echo(50,long);
      'H': echo(100,short);
      'J': echo(100,long);
      'K': lick(1);
      'L': roll(2,2,21);
      'C': begin
             bass2(4,5);
             snare(1,5); lowtom(1,5);
             bass2(4,5);
             snare(2,2);
             roto5(2,0,2); roto5(2,10,2);
             roto5(2,20,3);
             snare(8,2); tom(4,4); lowtom(2,2);
             echo(30,long);
           end;
      'Q',
      #27: begin
             writeln; quiet; halt;
           end;
    end;
  end;
end;

procedure main;
const
  ray: array[1..18] of string[80] =
       ('1)   Roto1(12,1)',
        '2)   Roto2(6,5)',
        '3)   Roto5(8,0,5)',
        '4)   Snare(10,2)',
        '5)   Tom(10,2)',
        '6)   LowTom(10,2)',
        '7)   Bass(10,2)',
        '8)   Bass2(10,2)',
        '9)   Sims(10,5)',
        'A)   Sims1(10,5)',
        'S)   Sims2(10,5)',
        'D)   Sims3(10,5)',
        'F)   Echo(50,Short)',
        'G)   Echo(50,Long)',
        'H)   Echo(100,Short)',
        'J)   Echo(100,Long)',
        'Q),',
        'ESC) Quit');

var i: integer;

  procedure beat;
  begin
    repeat
      check_key;
    until true = false;
  end;

begin
  writeln(#10'    - Drum Menu -'#10);
  for i:=1 to 18 do writeln('    '+ray[i]);
  write(#10' Command [1,2,3,4,5,Q,F]: ');
  beat;
end;

begin
  drums.inturbo:=false; noiz.inturbo:=false;
  main;
end.
