众所周知,在Window 7 及更高版本的系统上,在RM内播放MIDI音乐会出现明显的卡顿。每次重开工程或游戏,第一次播放MIDI都会造成数秒的假死。
我觉得通过重写RM的Audio模块来解决这个问题或许可行,于是搜寻到了以下两种音频模块: MCI Audio Player [RMXP] 扩展音频模块 v1.03
前者重写了Game_System和Audio模块的方法,使得通过事件指令播放的BGM也通过MCI来播放;后者只能通过脚本调用。
经过测试,发现两个脚本都有共同的问题:无法正确设置MIDI的音量,会导致所有MIDI音乐的淡入淡出失效。
紫苏的扩展音频模块提供了 AudioEx.setVolume() 方法,但实际测试发现它对MIDI不起任何作用。
MCI Audio Player 的作者给出了这样的解释:
Due to vast differences in how the format is handled, some of this player's features do not work with MIDI, most notably volume control, which also
effects fading. I have created alternate controls to control MIDI volume, but they can only work with the sacrifice of many other functions, and the volume
applies to ALL playing MIDIs, not just the one the volume is applied to. I decided this was not worth it, so I omitted volume control. If you are willing to make
them sacrifices, you can enable this mode by setting MIDI_MODE to true. If you your game relies heavily on MIDI, but you still would like to use this script,
there are conversion programs available, which I can assist you with if need be.