LV. 8
GP 0

【其它】[C++版]白色相簿2 的主題曲

樓主 桂木桂馬 fansgod
GP5 BP-
當初看完白色相簿2後
聽完這首歌覺得挺喜歡的

因此最近就把這首歌用C++的BEEP音創作


連結網址
https://www.youtube.com/watch?v=SRDww0uFmoU




以下是程式碼(這個不太需要什麼特別的技巧,只不過把樂譜打進來需要大量的時間和眼力XD)
#include<iostream>
#include<stdlib.h>
#include <windows.h>
#define l7 494
#define m0 0
#define am1 554
#define m1 523
#define m2 587
#define am2 622
#define m3 659
#define am4 740
#define m4 698
#define m5 784
#define am5 830
#define m6 880
#define m7 988
#define h1 1060
#define ah1 1108
#define h2 1185
#define h3 1330
#define h4 1396
#define h5 1568
#define h6 1760
/*這個mn是可以修改的,看這首歌的音符數量即可*/
#define mn 163
/*1表示半拍,2表示一拍,4表示兩拍,以此類推,可是考慮到BEEP音拉長很吵,所以基本上不超過6*/
/*I表示低音,m表示中音,h表示高音,m或h前面加a表示是升音*/
int main(void)
{
using namespace std ;
int m,o,n;
float x;
/*控制音調*/
int voice[mn]={
m3,am2,l7,am1,0, am1,am2,m3, m3,m3,am4,am2,0,0,0,
m3,am2,l7,am1,0, m3,am4,am5,0, m6,am5,am4,0,0,
m3,am2,l7,am1,0, am1,am2,m3, m3,m3,am4,am2,0,0,
m3,am2,l7,am1,0, m3,am4,0,am5,0, m6,am5,am4,0,
m3,am2,m3,am2,l7,0, am4,am2,am4,am4,m3,m3,0,0,
am4,am4,am5,m6,0, m6,am5,am4,am5,0,0,0,0,0,
am4,am5,m3,am4,am5,m7,am4, am2,l7,am2,m3,am4,m3,0,
m3,am4,am5,0, m3,am4,0, am5,m7,am4, m3,am2,m3,0,
am1,am2,m3,am1,am4,am5,m3,am4,0,am5,m7,am4,0,0,
am2,l7,am2,m3,am4,m3,0,0,0,0,0,0,0,0,
m3,am2,m3,am4,am5,m7,am4,am5,0,0,0,0,0,0,
m3,am2,m3,am4,0,m3,am2,am1
} ;
/*控制節奏*/
int tempo[mn]={
2,2,2,3,1, 2,2,3, 3,2,2,2,1,0,0,
2,2,2,2,1, 2,2,3,1, 2,2,3,2,0,
2,2,2,3,1, 2,2,3, 3,2,2,2,1,0,
2,2,2,2,1, 2,2,0,3,1, 2,2,3,3,
2,2,2,4,4,2, 2,2,2,3,1,3,1,0,
1,2,1,2,0, 3,3,2,6,2,0,0,0,0,
3,3,2, 3,3,2,1, 2, 1,1,1,1,3,2,
1,3,3,1, 2,3,1, 3,2,6, 1,1,2,1,
3,2,2,2,3,3,2,3,1, 3,2,6,0,0,
1,1,1,1,1,3,0,0,0,0,0,0,0,0,
3,1,1,6,4,2,3,3,1,0,0,0,0,0,
3,1,1,6,0,1,1,8
};
cout<<"無法傳達的愛戀(白色相簿OP2),第一段字幕試做版,由於全曲5分多鐘做起來實在有點累,因此就先試第一段,"<<endl<<endl;
cout<<"請輸入想要的倍數,原版是1左右,數字越高表示越慢,數字越低表示越快"<<endl ;
cin>>x;
cout<<"請問是否上字幕?上字幕請按1,不要就隨便按巴"<<endl;
cin>>o;
if(o==1)
{
cout<<"請問字幕要幾個字換一行?(建議14個)"<<endl;
cin>>n;
}
/*上字幕*/
char sing[][4]=
{"ko","do","ku","na","", "fu","ri","wo ", "shi","te","ru","no","","","",
"na","ze","da","ro","", "u ","ki","ni","" ,"na","tei","ta","","",
"ki","zu","ke","ba","", "i ","tsu","no","ma ","n ","i ","ka","","",
"da","re","yo","ri","", "hi","ka","","re","" ,"te","i  ","ta","",
"do","u ","su","re","ba","", "ko","no","ko","ko","ro","wa","","",
"ka","ga","mi","ni"  ,"","u","tsu","ru","no","","","","","",
"to","do","ka", "na","i ","ko","i ", "wo" ,"shi","te","i","te","mo","",
"u", "tsu","shi","", "da","su",""," hi","ga","ku" ,"ru","ka","na","",
"bo","ya","ke","ta", "ko","ta","e","ga"," ","mi", "e","ha","","",
"ji","me","ru","ma","de","wa","","","","","","","","",
"i","ma","mo","ko","no","ko","i","wa","","","","","","",
"u","go","ki","da",""," se","na","i-"
 
};
/*把字幕寫在音調後,可確保一個音出一個字*/
for(m=0;m<mn;m++)
{
if (o==1)
{
cout<<sing[m]<<" ";
if(m%n==0&&m!=0)
{cout<<endl;}
Beep(voice[m],tempo[m]*300*x);
}
else
{Beep(voice[m],tempo[m]*300*x);}
}
system("pause");
return 0 ;
}

https://www.youtube.com/watch?v=SRDww0uFmoU
5
-
板務人員:歡迎申請板主

精華區有 187 筆文章
目前無人維護,申請組長


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】