主题:[转帖]Qbasic音乐编程之play语句
T代表速度,"t140"表示140拍/分钟,但是如果你写"t120",那就和没写一样,因为t120是默认值
O代表音高,"o2"表示中音,"o3"表示高音,但是如果你写"o4",那就和没写一样,理由同上
ML表示演奏ML以后的音的100%长度
MN表示演奏MN以后的音的87.5%长度,是默认值
MS表示演奏MS以后的音的75%长度
举例子PLAY "t140mno3e8e8e8c8o2g4g4o3e8e8e8c8e2g8g8e8c8o2g8g8g4a8b8o3c8e8d2"
t140说的是,一分钟140拍
mn说的是,每个音都演奏87.5%长度,空12.5%
o3说的是音高,如果你想升一个8音度,可以改成o4
e8代表8分音符的咪,e2代表2分音符
如果你想听一个符点2分音符,则要变成e2.,这和音乐里是一样的
下面要把上面的那条语句做一点变动,可以使你更好的理解各个字母的含义
首先变成PLAY "t140mno3e8e8e8c8o2g4g4o3t160e8e8e8c8e2t180g8g8e8c8o2g8g8g4a8b8o3c8e8d2"
感觉如何?basic提供的速度的范围是 32-255
然后变成PLAY "t140mso3e8e8e8c8o2g4g4o3mne8e8e8c8e2mlg8g8e8c8o2g8g8g4a8b8o3c8e8d2"
这就是mn,ms,ml的区别
另外,对于程序中的那一堆8,你是否感觉到很烦人呢?
PLAY "t140mno3e8e8e8c8o2g4g4o3e8e8e8c8e2g8g8e8c8o2g8g8g4a8b8o3c8e8d2"
那么,我把它变成PLAY "t140mnl8o3eeeco2g4g4o3eeece2ggeco2ggg4abo3ced2"
和原来是一样的,这就是L的用法。L的默认值是4
也就是说,原程序可以变成PLAY "t140mno3e8e8e8c8o2ggo3e8e8e8c8e2g8g8e8c8o2g8g8ga8b8o3c8e8d2"
叙述一下mn ms ml的用法,以及每个音的长度等问题,使得乐曲听起来更加圆润
首先说一下P的用法。P代表休止,如P4代表空一拍,P8代表空半拍等等
但要注意,P不受L的限制,P后面必须要跟一个数。例如你想空半拍,写成L8P,是不对的,只能写成P8
还拿上一部分的例子
PLAY "t140mno3e8e8e8c8o2g4g4o3e8e8e8c8e2g8g8e8c8o2g8g8g4a8b8o3c8e8d2"
相信我写成Play"t140o3l8eeecl4o2ggo3l8eeece2ggeco2ggg4abo3ced2"你也能看的懂,和原来一样的
听了之后,发现有些声音太长了,有些声音不够圆滑
于是将其改为:PLAY "t140o3l8eeeco2g4g4o3l8eeece4.p8ggeco2ggg4mlabo3cmned4.p8"
另外有时看曲谱上是顿音记号,可是在听或演奏时,发现用ms还是太长了,那么就应该把o3msc8(举例)改成o3mlc16p16
下面说音长的问题,重点就是每个小节或每个音该有多长,就要写多长,绝对不能多一点少一点
比如前缀音:PLAY "t160mlo3f32mne8f8"
我本意是在e8前加一个f32的前缀,结果这一拍多了个32分音符,那么一定要改成:
PLAY "t160mlo3f32e16e64p64mnf8"
似乎有点吹毛求疵,但即使你听不出来差别,拿给一个耳朵好的人,他听着就会很不爽
CZARDAS舞曲
PLAY "t85p8l8o1mlao2c32o1b-16b-32mna"
PLAY "o2mla2mnaffgmlf64g64f16f32mne"
PLAY "mlb-2mnb-o1b-mlb-mnamlo2c+mneggmlfmnc+"
PLAY "mlemndmld64e64d64p64msl16c+de"
PLAY "mnf8mlo1a8"
PLAY "l8o1mlo2c32o1b-16b-32mna"
PLAY "o2mla2mnaffgmlf64g64f16f32mne"
PLAY "mlb-2mnb-o1b-mlb-mnamlo2dmnc+mlg4.mnemlemnd"
PLAY "mld64e64d16d32c+mnd4p4"
PLAY "t85l24mlo2c4cegb-o3cmneg16.mlf32mne16.d32mlc8mno2b-8"
PLAY "mlb-8mna8mla64b-64a32a8mng+16a4p4"
PLAY "mlo1a4ao2c+egamno3c+e8c+8mla8mno2a8mlo3e8mnd8"
PLAY "mll16d64e64d32c+dmnef4f4"
PLAY "mlf4o2b-4t78l36b-p36o3efed+efel12gfmne"
PLAY "mle8mno2a8mla4mna8l16mlg+mnab-at70mlo3c16.mnt75o2b-32"
PLAY "t78mll16o2b-64o3c64o2b-32aa64b-64a32mng"
PLAY "mlg64a64g32ff64g64f32mne"
PLAY "t76mla4.mnt74e8mlt71e8mnd8mlt67d64e64d32d16mnc+8d4p4"
PLAY "t85l24mlo2c4cegb-o3cmneg16.mlf32mne16.d32mlc8mno2b-8"
PLAY "mlb-8mna8mla64b-64a32a8mng+16a4p4"
PLAY "mlo1a4ao2c+egamno3c+e8c+8mla8mno2a8mlo3e8mnd8"
PLAY "mll16d64e64d32c+dmnef4f4"
PLAY "mlf4o2b-4t78l36b-p36o3efed+efel12gfmne"
PLAY "mle8mno2a8mla4mna8l16mlg+mnab-at70mlo3c16.mnt75o2b-32"
PLAY "t78mll16o2b-64o3c64o2b-32aa64b-64a32mng"
PLAY "mlg64a64g32ff64g64f32mne"
PLAY "t76mla4.mnt74e8mlt71e8mnd8mlt67d64e64d32d16mnc+8d4p4"
PLAY "t170o3msl8do4dp8o3b-p8ap8femnd4msc+mld4mndp8"
PLAY "l16defedefedefedefdmnf8e4msd+8mle4mne8p8"
PLAY "gab-agab-agab-agb-agfgagfgagfgagfagf"
PLAY "o2abo3c+defgab-agfedc+emne8d4msc+8"
PLAY "mnd4p4"
PLAY "t170o3msl8do4dp8o3b-p8ap8femnd4msc+mld4mndp8"
PLAY "l16defedefedefedefdmnf8e4msd+8mle4mne8p8"
PLAY "gab-agab-agab-agb-agfgagfgagfgagfagf"
PLAY "o2abo3c+defgab-agfedc+emne8d4msc+8"
PLAY "mnd4p4"
PLAY "t170mll16o3c64d64c64mso2bo3cegb-ge"
PLAY "mll16o3c64d64c64mso2bo3cegb-ge"
PLAY "o2b-ab-o3cdefgmla4mna8p8"
PLAY "mlo2b-64a32msg+ao3c+egec+"
PLAY "mlo2b-64a32msg+ao3c+egec+"
PLAY "mlo2b-64a32msg+abo3c+dedmlf4mnf8p8"
PLAY "msb-agab-agab-agab-agb-agfgagfgagfgagfa"
PLAY "mno2abo3c+defgab-agfedc+emse8mnd4msc+8mnd4p4"
PLAY "t170mll16o3c64d64c64mso2bo3cegb-ge"
PLAY "mll16o3c64d64c64mso2bo3cegb-ge"
PLAY "o2b-ab-o3cdefgmla4mna8p8"
PLAY "mlo2b-64a32msg+ao3c+egec+"
PLAY "mlo2b-64a32msg+ao3c+egec+"
PLAY "mlo2b-64a32msg+abo3c+dedmlf4mnf8p8"
PLAY "msb-agab-agab-agab-agb-agfgagfgagfgagfa"
PLAY "mno2abo3c+defgab-agfedc+emse8mnd4msc+8mnd4p4"
PLAY "t105mno4l16d4o3a8.a16mlb8mna8mlg8mnf+8"
PLAY "mlf+8mne8t210mle32f+32e64e64e64p64t105mnd+egb2"
PLAY "l8mlb.mnc+16mlc+mno4emle.mno3g16gmsgmlgmnf+"
PLAY "t210mlf+32g32f+64f+64f+64t105mne16d16e16f+2"
PLAY "mno4l16d4o3a8.a16mlb8mna8mlg8mnf+8"
PLAY "mlf+8mne8t210mle32f+32e64e64e64p64t100mnd+egb2"
PLAY "l8o4mld.mno3a16aamlbmnaac+mlemndmld64e64d32d32d64p64msc+mnd4p4"
PLAY "t95o5mnl8d4o4a.a16mlbmnamlgmnf+mlf+mnemlemngb2"
PLAY "b.msa16mnaamlo5c+mno4bmlamngmlgmnf+mlf+mnff+2"
PLAY "o5mnl8d4o4a.a16mlbmnamlgmnf+mlf+mnemlemngb2"
PLAY "o5d4o4a.msa16mlt92bmnamlt90amnc+mlt86emndmldmnc+d2"
PLAY "t170mll16o3c64d64c64mso2bo3cegb-ge"
PLAY "mll16o3c64d64c64mso2bo3cegb-ge"
PLAY "o2b-ab-o3cdefgmla4mna8p8"
PLAY "mlo2b-64a32msg+ao3c+egec+"
PLAY "mlo2b-64a32msg+ao3c+egec+"
PLAY "mlo2b-64a32msg+abo3c+dedmlf4mnf8p8"
PLAY "msb-agab-agab-agab-agb-agfgagfgagfgagfa"
PLAY "o2abo3c+defgab-ag+ag+abo4c+mnd8p8p4p2"
PLAY "t170o3mnd8o4d4o3b4a4f+8mse8mnd4msc+8mld4mnd8p8"
PLAY "l16msdef+edef+edef+edef+dmnf+8e4msd+8mle4mne8p8"
PLAY "msgabagabagabagbagf+gagf+gagf+gagf+gaf+"
PLAY "ef+g+f+ef+g+f+mnef+gf+ef+g+e"
PLAY "a8a4a4a4o2a8"
PLAY "t170o3mnd8o4d4o3b4a4f+8mse8mnd4msc+8mld4mnd8p8"
PLAY "l16msdef+edef+edef+edef+dmnf+8e4msd+8mle4mne8p8"
PLAY "l16gabagabagabagbagf+gagf+gagf+gagf+gaf+ed+ef+gf+ga"
PLAY "mlbmnag+ag+abo4c+o4d4p4o3t160a4p4o2d2"