<--- Turn the page     (contents page)     Turn the page --->


Pascal

Sound in Pascal




The following code will produce a vibrato sound:

  for n:= 1 to 50 do
  begin
    Sound(840);    { Play the note }
    Delay(30);
    Sound(850);    { Play the note a little sharper }
    Delay(30);
  end;
  NoSound;
How about
  Freq := 0;
  for n:= 1 to 90 do
  begin
    Sound(Freq);
    Delay(50);
    Freq := Freq + 15;
  end;
  NoSound;
Remember, the sound commands use the CRT library. ¥


<--- Turn the page     (contents page)     Turn the page --->

Page 12