333ccc3c 发表于 2008-1-23 01:29:42

"你知道我在等你吗"音乐脚本

习惯潜水.透口气先.也贡献点东东了.
研究了下音符对应的频率值.顺便.做了个"你知道我在等你吗"音乐脚本.虚拟机上测试通过.
音符对应的频率值
低音1至高音1所对应的频率(Hz)依次是:
音符1   2    3    4    5   6    7+ 1    2    3    4   5    6   7 + 1
频率131、147、165、175、196、220、247、262、294、330、349、392、440、494、523
频率值乘以二就提升该声音一个八度音阶,减半则降一个八度

启动时自动执行某脚本的命令:
add name="bootmusic1" on-event=music start-time=startup
将上面的music改成音乐脚本名.控制台中执行.当开机音乐吧hhh

脚本:
:set f "349,330,262,262,196,262,392,349,330,294,262,247,220,262,294,330,294,220,294,440,349,330,294,262,262,247,247,262,294,262,196,196,196,175,165,175,196,165,165,165,165,330,294,262,262,220,349,349,220,349,349,220,262,294,0,196,330,330,330,330,294,330,196,330,196,294,294,294,262,262,247,165,220,220,349,349,349,330,349,349,349,330,349,220,262,294,25,196,330,330,330,330,294,330,196,330,196,294,294,294,262,262,247,165,220,220,349,349,349,330,349,349,349,330,349,220,262,294,330,294,294,196,196,196,175,165,175,196,165,165,165,165,330,294,262,262,220,349,349,220,349,349,349,330,294,262,262,25,196,294,262,262";:set d "3s,1s,4s,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,2s,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,500ms,2s,4s,750ms,250ms,250ms,250ms,250ms,250ms,2s,500ms,250ms,250ms,250ms,500ms,250ms,1s,500ms,500ms,500ms,500ms,1s,500ms,500ms,500ms,500ms,2s,1s,250ms,250ms,250ms,250ms,250ms,250ms,250ms,500ms,1750ms,250ms,250ms,250ms,250ms,250ms,250ms,250ms,500ms,1750ms,250ms,250ms,250ms,250ms,250ms,750ms,250ms,250ms,250ms,500ms,500ms,500ms,3s,750ms,250ms,250ms,250ms,250ms,250ms,250ms,250ms,500ms,1750ms,250ms,250ms,250ms,250ms,250ms,250ms,250ms,500ms,1750ms,250ms,250ms,250ms,250ms,250ms,750ms,250ms,250ms,250ms,500ms,500ms,500ms,500ms,250ms,250ms,3s,750ms,250ms,250ms,250ms,250ms,250ms,2s,500ms,250ms,250ms,250ms,500ms,250ms,1s,500ms,500ms,500ms,500ms,1s,500ms,500ms,500ms,500ms,250ms,250ms,2s,750ms,250ms,250ms,250ms,3s";:set i 0 ; :while ($i<166) do={:beep freq=([:pick $f $i ($i+1)]*2) len=[:pick $d $i ($i+1)];:delay [:pick $d $i ($i+1)];:set i ($i+1)}

[ 本帖最后由 333ccc3c 于 2008-1-24 09:56 编辑 ]

naboo 发表于 2008-1-23 09:20:55

很黄,很暴力。。。

哈哈,太厉害了!我对音乐怎么就没有天赋呢。。。

winepo 发表于 2008-1-23 09:59:51

。。。。。ros成乐器了

gmhejob1 发表于 2008-1-23 10:32:14

你真是个天才!

9939781 发表于 2008-1-23 11:11:44

:L LZ太强了。。

payne 发表于 2008-1-23 11:15:37

很牛很强大

wbyz20 发表于 2008-1-23 11:28:18

汗,太牛了

hcb 发表于 2008-1-23 12:01:17

顶,在娱乐的同时,学到了一个语法[:pick $d $i ($i+1)], $i是第几个成员,之前我只会用$i是第几个字符

音阶的频率:
低    L1   131   L2   147   L3   165   L4   175   L5   196   L6   220   L7   247
中    N1   262   N2   296   N3   330   N4   349   N5   392   N6   440   N7   494
高    H1   523   H2   587   H3   659   H4   698   H5   784   H6   880   H7   988
更高I1   1047    I2   1175    I3   1319    I4   1397    I5   1568    I6   1760    I7   1976
一个节拍延时   2400ms    1/2节拍,1/4节拍,1/8节拍,依次除以2
有兴趣的,可以根据这一原理写出更通用的音乐程序来

[ 本帖最后由 hcb 于 2008-1-23 12:05 编辑 ]

kljepq721 发表于 2008-1-23 12:42:21

你还是人吗。真的不是人我看来。是天才。这样的东西都能搞出来。还做贡献。好人哪

yadmin 发表于 2008-1-23 19:17:11

2008年ros最佳应用

yadmin 发表于 2008-1-23 19:17:22

2008年ros最佳创意

网络-浪子 发表于 2008-1-23 23:49:25

天啦,申请某某纪录吧!

syc1985 发表于 2008-1-24 00:17:32

楼主,实在佩服!!!
:funk: :funk: :funk: :funk: :funk: :funk: :funk:

yironghe 发表于 2008-1-24 10:28:43

呵呵,和以前玩DOS的差不多,不过还要有音乐细胞的人才能搞出这些东西

波比 发表于 2008-1-24 13:49:14

哈哈,楼主真是强人。
页: [1] 2 3 4
查看完整版本: "你知道我在等你吗"音乐脚本