Touhou Patch Center:BGM modding/zh-hans: Difference between revisions

From Touhou Patch Center
Jump to navigation Jump to search
No edit summary
No edit summary
Line 55: Line 55:
* TH06: Performance on track switches could be improved a bit.
* TH06: Performance on track switches could be improved a bit.


* TH09(花映冢):确保你修改的标题曲一开始有至少0.3秒的空白。出于某种原因,游戏总是希望在正式切换到关卡对话前前播放一小段标题BGM。:zun:
* TH09(花映冢):确保你修改的标题曲一开始有至少0.3秒的空白。出于某种原因,游戏总是希望在正式切换到关卡对话前播放一小段标题BGM。:zun:


* TH11(地灵殿):同上,但只针对6面道中曲:游戏会在进入6面关卡时播放几毫秒,然后突然暂停,再从曲目时间轴的4.9秒后继续播放曲目。
* TH11(地灵殿):同上,但只针对6面道中曲:游戏会在进入6面关卡时播放几毫秒,然后突然暂停,再从曲目时间轴的4.9秒后继续播放曲目。

Revision as of 14:41, 9 December 2019

对于上海爱丽丝幻乐团制游戏

(以下内容直接抄自Discord)

支持的文件格式

越上面的格式越优先被读取。

  • FLAC (.flac)
    理想情况下,你已经获得了一个无损格式的修改过的BGM,FLAC支持允许你直接向你的玩家提供这种格式。
  • Ogg Vorbis (.ogg)
    目前而言压缩率和音质之间的最佳折衷格式。限制16位。
  • MP3 (.mp3)
    只有当你别无选择,且你修改过的BGM过于冷门或太老以至于它从未以另一种格式发布时才使用该格式。
    此格式最难完成曲目循环,且不可在≥TH07的游戏中被二次补丁。

所有thcrap支持的ZUN制STG(th06~th16.5)均可以使用上述格式。

想要更多的格式支持?请通过Discord告诉我!——Nmlgc

关于补丁叠加

  • 如果应用了多个BGM补丁,在应用下一个补丁之前,BGM补丁的优先级会按照上面的格式顺序重新排列。这意味着即使你把MP3补丁先打上了,也会被原本低优先级的FLAC格式的补丁覆盖。
  • 循环节文件必须和引子文件在同一个补丁包里,并使用相同的文件格式。

文件名格式

Splashman制作的BGM表(谷歌文档)中查找data filename列中查找名称。
也可以在thcrap_log.txt中使用Ctrl+F搜索 flac > ogg > mp3 确保你拿到了对应的名字。

文件层级

你可以把BGM文件放在补丁根目录或者特定游戏的目录。一般情况下是放在补丁目录的。
特别的,对于Player's Score(疮痍曲),在TH10~TH12中应用请命名为 th10_17 ,在≥TH12.8中应用则命名为 th128_08 ,且必须放置于补丁根目录才能覆盖不止一个游戏。当然,如果只想改特定游戏的疮痍曲,可以把文件放置于特定游戏的目录。 even in addition to putting a generic file into the patch root.
Also, for consistency with later games, BGM mods for TH06 don't go into a separate bgm/ subdirectory, contrary to what the original files might suggest.

对于补丁而言,如果你同时提供无损和有损格式的BGM补丁,建议采用如下格式命名和制作补丁:

  • <补丁名>_base: 改过的图和音乐室曲评,只提供MP3全曲,依赖补丁base_tsa
  • <补丁名>: 由无损格式转换出的OGG格式,依赖补丁<补丁名>_base
  • <补丁名>_lossless: 无损格式。依赖补丁<补丁名>_base

循环播放

每一首原曲可以被两个BGM文件替换(补丁)掉:一首引子曲文件,命名和原文件一样;以及一首循环节曲文件,在原来的扩展名前额外加入 .loop
那么,对于TH06的标题曲,如果是OGG文件,这两个文件就是 th06_01.oggth06_01.loop.ogg
循环在程序内部处理,只需在当前播放的文件播放完后倒回去重放即可,thcrap忽略来自游戏本身或循环点MOD的任何循环值。
这意味着你可以省略.loop文件,将整个曲目放入引子文件,这样thcrap将只循环该文件。否则在引子文件播放后讲无限循环.loop文件中的曲子。

如果你有无损的源文件,那么,在将无损转化为两个OGG之前,最好先把该文件切成两个文件,以免最后导出的OGG出现音质损耗。

如果某些情况下你不希望曲子自动循环,曲子应该在一次播放后结束播放,这相当于“循环一段短暂的沉默”。在相应的.loop文件中放入4秒的空缺音频是最有效的选择。

怎样使 MP3 文件也能循环播放

For your first MP3, double-check whether the audio editor you want use for loop cutting actually supports the LAME extension for gapless MP3. (GoldWave v6.35 and Audacity 2.3.0 don't.) To do this, convert the MP3 to a FLAC or WAV using something that does (I used foobar2000 v1.4), and check whether your editor shows the same amount of silence at the beginning of both the FLAC/WAV and the MP3.
If it doesn't, always convert to a FLAC/WAV file to "apply" the removal of the MP3 pre-gap, and use that converted file to determine the loop start/end samples. (After the loop works, you'd just throw away that lossless file.) Then, use pcutmp3 on the command line to perform sample-accurate cutting.

是的,很不幸,你需要Java才能执行这个操作。没有Java,mp3DirectCut将不会工作。好了,还有谁想要用MP3的?

java -jar pcutmp3.jar --crop 1:0-123,1:123-456 "C:\path\to\the\original.mp3" → 123作为循环头,456作为循环尾

注意事项以及ZUN bug

You can purchase fixes for all of those! 如果你感兴趣,请联系Nmlgc!

  • TH06(红魔乡)是唯一的BGM支持任意码率、任意比特深度、任意声道数的游戏。
  • TH06: Performance on track switches could be improved a bit.
  • TH09(花映冢):确保你修改的标题曲一开始有至少0.3秒的空白。出于某种原因,游戏总是希望在正式切换到关卡对话前播放一小段标题BGM。:zun:
  • TH11(地灵殿):同上,但只针对6面道中曲:游戏会在进入6面关卡时播放几毫秒,然后突然暂停,再从曲目时间轴的4.9秒后继续播放曲目。
  • TH13: Performance when switching to the trance tracks and back could be improved a bit.

For Tasofighters (TH13.5, TH14.5, TH15.5)

From VasteelXolotl's AoCF Wiki Page

The above includes example music replacement packs.

Music replacements are fully client-side and do not affect netplay in any way. You also don't actually touch the game's files, as this is a "softmod" through thcrap.

1) Setup

Make a new folder under thcrap's directory. Name it whatever you want, I just went with "bgm155" for simplicity.
In that folder, make another called "th155", then under that one make "data", then "bgm". Go back to the main thcrap folder for now.

Somewhere in there should be a .js file named after your default configuration. If you haven't messed with anything when installing the english patch, it should be "en.js". Copy and paste it. Rename the copy to "bgm155.js". Open it in a text editor of your choice.

The opened file should look similar to this
1.PNG
Add your patch to this. Throw it in after all the other ones to prevent any issues. Make the file look more or less like this and save it.
2.PNG

Now find your th155 thcrap shortcut and once again copy-paste it. Rename it to something convenient. Right click it and click Properties, then go into the Shortcut tab in the window that shows up. At the end of the Target field, change "en.js" to "bgm155.js". Press OK.

You've got everything set up. Neat.

2) Actually replacing music

Each theme has 3 files - two .ogg files (one of which is simply just the music to play in-game, and the other is a 20-second preview for the stage select) and an .sfl file containing loop metadata for the in-game theme.
Rename them to fit AoCF's file names. For convenience, here they are
https://pastebin.com/KaC3s2vV .

Remember all those folders you made? Go down to the "bgm" folder and place the files you want there. Boom, you did it.

3) Changing in-game music titles

So you changed Marisa's theme to the objectively superior one, switched Nitori's theme to Aya's or something else entirely. There's one small problem, though - the music title doesn't match. You wanna fix that? Sure you do, or else it'll keep bugging you for all eternity.

In the "bgm" folder, make a new file called "bgm.csv.jdiff". Open it in a text editor of your choice. Remember the numbers in brackets in the other paste? They'll come in handy now. Open a curly bracket in the first line. In the second line, type in the number of the theme you want to change in quotes, then a colon and another curly bracket, e.g "2": {

In the next line, type in "7": "[track title]"

If you want to change the name of the arranger/composer as well, you can do it as such in the next line: "8": "[composer name]"

Afterwards, close the curly bracket in the next line with }. Repeat the above as many times as necessary, then add another }. You're done. Here's my jdiff file, if you need a reference
jdiff.PNG

4) Custom loop points

Use Egor's sfl-loop tool File:sflloop v2.zip.