home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG013.ARC
/
GENSND.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
4KB
|
175 lines
program GENSND;
{ Demonstration sound effects program in
Turbo Pascal for the MicroBee, developed
by Bob Burt from his gensnd program on
page 41 of Wildcards Volume 2, written
in MicroWorld BASIC }
const
space20 = ' ';
title = '*** Sound Generator Routines ***';
var
count,interval : integer;
set_tone,up_down,duration,duration2 : byte;
one_many,value,timbre,compare,counter : byte;
{$I gensnd.pro}
{$I initsnd.pro}
procedure scale;
begin
set_tone := count; initsnd; gensnd;
set_tone := count + 2; initsnd; gensnd;
set_tone := count + 8; initsnd; gensnd;
set_tone := count + 6; initsnd; gensnd;
set_tone := count + 4; initsnd; gensnd;
count := count + interval
end; {procedure scale}
procedure rand_notes;
begin
for count := 1 to 60 do
begin
value := random(200) + 55;
set_tone := value;
delay(50);
initsnd;
gensnd
end
end; {procedure rand_notes}
begin {main}
clrscr;
write(space20);
writeln(title);
writeln;
write('Gensound '); gensnd;
write('Routine '); gensnd;
write('commences at '); gensnd;
write('memory '); gensnd;
write('location '); gensnd;
writeln(addr(gensnd)); gensnd;
writeln;
delay(1000);
set_tone := 240; {initialise procedure initsnd}
up_down := 5;
duration := 4;
duration2 := 0;
one_many := 32;
timbre := 65;
compare := 0;
writeln('Ascending Slide ..........');
initsnd; gensnd;
delay(1000);
writeln('Descending Slide .........');
set_tone := 32;
up_down := 4;
initsnd; gensnd;
delay(1000);
writeln('Siren ....................');
duration := 5;
for count := 1 to 2 do
begin
set_tone := 247;
up_down := 5;
initsnd; gensnd;
set_tone := 8;
up_down := 4;
initsnd; gensnd
end;
delay(1000);
writeln('Single Note ..............');
duration2 := 6;
set_tone := 25;
one_many := 40;
initsnd; gensnd;
delay(1000);
writeln('Musical Scale of Sorts ...');
duration := 110;
duration2 := 0;
count := 30; interval := -2;
while count > 1 do
scale;
count := 4; interval := 2;
while count < 33 do
scale;
delay(1000);
writeln('Random Notes .............');
duration := 8;
rand_notes;
delay(1000);
writeln('Chipmunk Chatter .........');
duration := 6;
timbre := 69;
rand_notes;
timbre := 65; {restore balance}
delay(1000);
writeln('Attention ! ..............');
up_down := 5;
compare := 1;
one_many := 32; {restore multiple notes}
for count := 1 to 20 do
begin
set_tone := (count)*2 + 5;
duration := 20 - (count div 2);
initsnd; gensnd;
delay(15)
end;
delay(1000);
writeln('Gobbled Up ! .............');
set_tone := 60;
duration := 1;
for count := 1 to 3 do
begin
initsnd; gensnd;
delay(200)
end;
delay(1000);
writeln('Rapid Fire ! .............');
for count := 1 to 50 do
begin
initsnd; gensnd;
end;
delay(1000);
writeln('Closing In ...............');
timbre := 69;
for count := 80 downto 30 do
begin
set_tone := (count)*3 - 25;
initsnd; gensnd
end;
timbre := 65;
delay(1000);
writeln('You are Surrounded ! .....');
count := 28; interval := -2;
while count > 1 do
scale;
count := 4; interval := 2;
while count < 31 do
scale;
delay(1000);
writeln('Random Laser Fire ........');
duration := 4;
for count := 1 to 30 do
begin
if (count mod 2) = 0 then
timbre := 65
else
timbre := 69;
set_tone := random(60) + 10;
initsnd; gensnd
end;
delay(1000);
writeln('Bird Warble ..............');
counter := 26;
duration := 12;
for count := 1 to 30 do
begin
if counter = 41 then counter := 26;
set_tone := counter;
initsnd; gensnd;
counter := counter + 1
end
end. {main}