本方法尚在测试中,不保证稳定性。
Bemuse官网 :https://bemuse.ninja
参考:How to Host a Music Server (Legacy Method) · Bemuse
Demo:https://music4.bemuse.ninja/songs/%5Bfrums%5Dcredits/bemuse-song.json
1.请确保服务器已开启CROS和Https
其它服务器开启CROS的方法参考enable cross-origin resource sharing (enable-cors.org)
Apache服务器请在配置文件(.htaccess)中添加以下内容以开启CROS。
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
Nginx服务器请在配置文件中添加以下内容:
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
}
2.进入Bemuse song workshop将BMS文件转换为BMS-ON
Bemuse song workshop:Song Workshop (bemuse.ninja)
转换后的BMS-ON将保存在原BMS文件夹中。
建议转换结束后清理原文件夹中的.wav文件。
3.将BMSON上传至服务器
4.发布链接
在https://bemuse.ninja/?server=后加上bemuse-song.json文件所在网址。
例如:https://bemuse.ninja/?server=https://music4.bemuse.ninja/songs/
5(可选步骤).服务器中添加多个乐曲
在Bemuse song workshop中的Server Manager添加每个bemuse-song.json文件所在网址,生成index.json
在https://bemuse.ninja/?server=后加上index.json文件所在网址。