BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sing a song by delphi

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia
View previous topic :: View next topic  
Author Message
Teo C Y
Guest





PostPosted: Fri Jul 30, 2004 2:15 am    Post subject: Sing a song by delphi Reply with quote



I have old turbo Pascal code(listed below) to sound the speaker for a user specified song by using the following sing procedure.
Please advise what is the equivalent in Delphi6.
Thank you.
Teo C Y

procedure sing(tone,beat:integer);
begin
sound(tone);
delay(beat);
nosound;
end;
case dorami[I] of
'0' : FREQ[I]:=0;
'1' : FREQ[I]:=round(32.625*High);
'2' : FREQ[I]:=round(High*32.625*k(1.059463094,2));
'3' : FREQ[I]:=round(High*32.625*k(1.059463094,4));
'4' : FREQ[I]:=round(High*32.625*k(1.059463094,5));
'5' : FREQ[I]:=round(High*32.625*k(1.059463094,7));
'6' : FREQ[I]:=round(High*32.625*k(1.059463094,9));
'7' : FREQ[I]:=round(high*32.625*k(1.059463094,11));
end;

case Duration[I] of
'1' : Dut [I]:= 1000;
'2' : Dut [I]:= 2000;
'3' : Dut [I]:= 3000;
'4' : Dut [I]:= 4000;
'H' : Dut [I]:= 500;
'Q' : Dut [I]:= 250;
'F' : Dut [I]:= 1500;
'A' : Dut [I]:= 2500;
'S' : Dut [I]:= 125;
else Dut[I]:=0;
end;
.......

for I:=1 to 24 do begin
// gotoxy(10,10); write(i:4,freq[i]:5,dut[i]:5);
sing(freq[i],dut[i]) (*readln;*)
end;


Back to top
vmars
Guest





PostPosted: Wed Aug 04, 2004 5:10 am    Post subject: Re: Sing a song by delphi Reply with quote



David Taylor has quite a few of sound components available
http://www.david-taylor.pwp.blueyonder.co.uk/software/audio.html

--
....Vern
PpGuard = KidSafe Internet
www.ParentPresent.org
"Teo C Y" <cyteo (AT) ntu (DOT) edu.sg> wrote

Quote:

I have old turbo Pascal code(listed below) to sound the speaker for a user
specified song by using the following sing procedure.
Please advise what is the equivalent in Delphi6.
Thank you.
Teo C Y

procedure sing(tone,beat:integer);
begin
sound(tone);
delay(beat);
nosound;
end;
case dorami[I] of
'0' : FREQ[I]:=0;
'1' : FREQ[I]:=round(32.625*High);
'2' : FREQ[I]:=round(High*32.625*k(1.059463094,2));
'3' : FREQ[I]:=round(High*32.625*k(1.059463094,4));
'4' : FREQ[I]:=round(High*32.625*k(1.059463094,5));
'5' : FREQ[I]:=round(High*32.625*k(1.059463094,7));
'6' : FREQ[I]:=round(High*32.625*k(1.059463094,9));
'7' : FREQ[I]:=round(high*32.625*k(1.059463094,11));
end;

case Duration[I] of
'1' : Dut [I]:= 1000;
'2' : Dut [I]:= 2000;
'3' : Dut [I]:= 3000;
'4' : Dut [I]:= 4000;
'H' : Dut [I]:= 500;
'Q' : Dut [I]:= 250;
'F' : Dut [I]:= 1500;
'A' : Dut [I]:= 2500;
'S' : Dut [I]:= 125;
else Dut[I]:=0;
end;
......

for I:=1 to 24 do begin
// gotoxy(10,10); write(i:4,freq[i]:5,dut[i]:5);
sing(freq[i],dut[i]) (*readln;*)
end;





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.