主题:高手请进
lzl1403
[专家分:1670] 发布于 2005-08-02 17:22:00
怎样用pascal播放mid音乐?
回复列表 (共16个回复)
板凳
stuart920106 [专家分:730] 发布于 2005-08-02 22:22:00
什么是mid音乐?(不好意思)
3 楼
cangtian [专家分:40] 发布于 2005-08-03 11:05:00
program testsys(output);
uses crt,dos;
var i:integer;
procedure pause;
begin
textbackground(black);
textcolor(white);
writeln('Press anykey to continue...');
readkey();
end;
procedure txttst;
begin
textmode(c80);
textbackground(blue);
textcolor(red);
writeln('text mode test..');
end;
procedure flashtst;
begin
textbackground(green);
textcolor(blink+yellow);
writeln('flash test...');
end;
procedure sndtst;
var i:integer;
h:boolean;
begin
writeln('Sound test....');
h:=false;
gotoxy(5,wherey);
write ('Hz...');
for i:=100 to 900 do
begin
if keypressed then
begin
nosound;
h:=true;
break;
end;
sound(i);
gotoxy(1,wherey);
write (i);
delay(10);
end;
nosound;
delline;
gotoxy(1,wherey);
if not(h) then writeln('Sound test complete.')
else begin writeln('Sound test break!');readkey();end
end;
begin
txttst;
pause;
flashtst;
pause;
sndtst;
pause
end.
4 楼
MagicG [专家分:650] 发布于 2005-08-03 19:57:00
?
5 楼
口口and枕头 [专家分:1550] 发布于 2005-08-03 20:41:00
不懂
6 楼
bunny [专家分:10] 发布于 2005-08-04 19:25:00
在书上见过,不过不太懂乐理,不会用
7 楼
阿Ben [专家分:2200] 发布于 2005-08-04 21:59:00
3楼这是播放mid音乐吗?这只是用主板的喇叭模拟汽车马达声而已。这种程序我也会写。
但是,用Pascal播放mid,好像……不太可能吧??
8 楼
口口and枕头 [专家分:1550] 发布于 2005-08-04 23:45:00
pascal是用来编程的不是播放工具的说~
呵呵~~
9 楼
MagicG [专家分:650] 发布于 2005-08-05 10:54:00
我建议楼主应该试试能不能用winamp编程,我想那个会比较适合他吧``
10 楼
stuart920106 [专家分:730] 发布于 2005-08-06 11:44:00
unit music;
interface
uses crt;
procedure play (octave,note,duration:integer);
implementation
procedure play;
const
base=32.625;
var
x:real;
i:integer;
begin
if note=0 then delay(duration)
else begin
x:=base;
for i:=1 to octave do
x:=x+2;
for i:=1 to note-1 do
x:=x*1.059463994;
sound(round(x));
delay(duration);
nosound;
end;
end;
end.
我来回复