kuma4649 / mml2vgm

GNU General Public License v3.0
105 stars 10 forks source link

サポートアタリSTトリックとYM2149モード #109

Closed ultrasound1372 closed 3 years ago

ultrasound1372 commented 3 years ago

AY 3-8910、アタリの場合は異なるYM2149には、デモシーンで多用されたいくつかの仕掛けがあります。 まず、AYをYM2149モードにする情報フィールドを追加することを提案します。 VGMの仕様では、クロック周波数の特定の位置にフラグを立てることでこれが可能になっていますね。 これにより、ハードウェアエンベロープの動作速度が2倍になり、ベースの製作が容易になるというメリットがあります。 さらに私は、ハードウェアエンベロープから音楽を取り出すための新しいコマンドを提案します。 EHFに続いてノート名とオクターブを入力して周期を設定するか、EHSに続いてオクターブオフセットを入力すると、エンベロープの周期は、その時点でチャンネルで演奏されているノートの周期に追従します。 オクターブ・オフセットは、異なる音色や異なるエンベロープ・シェイプのために必要です。 これは一般的にネガティブなことでしょう。 また、アタリのコンピュータでは、パルス状のソフトウェア・ボリューム・エンベロープを同じ周波数で動作させることで、パルス幅変調を実現するというトリックがよく使われています。 というのも、VGMは高解像度ではないので、うまく同期できないかもしれませんし、設定可能でなければなりません。 LFOが現在の音に追従するような特別なモードがあるのでは? このトリックは、Cerrorをはじめとする多くのSNDHの曲に見られます。 最後に、SN76489用のPCMを追加したので、AY3-8910用のPCMも追加してください。 固定周波数にすべきですが、その固定周波数を決めるのは、もちろん合理的な範囲内で私たちに任せるべきだと思います。 8kHzよりも高い音を出すことができるのです。 これは、SN76489でも可能かもしれません。 AY PCMでは、シングルチャンネルにこだわるべきだと思います。 8ビットの解像度を得るために3つのチャンネルをすべて使用する試みもありますが、マッピングテーブルが必要となり、それらのチャンネルのすべてが中断され、他のプレーをしている間に中断されてしまう可能性があります。 また、余談ですが VGMPlayでは、コマンドP0を使用すると、トーンとノイズが出力されます。 これでPCMが壊れました。 これはmml2vgmのバグで、両方をオフにすると両方をオンにすることができますか? それとも、VGMPlayのそのチップのエミュレーションのバグなのでしょうか?


There are a few tricks on the AY 3-8910, in the case of Atari the YM2149 which is different, that were used heavily in the demoscene. I propose firstly adding an info field that puts the AY into YM2149 mode. I think the VGM spec lets you do this with a flag in a particular position in the clock frequency. One of the benefits of doing this is that the hardware envelope runs twice as fast, which makes making basses with it easier. Furthermore I propose a new command to be used to get music out of the hardware envelope. Either EHF followed by a note name and octave to set the period, or EHS and an octave offset, where then the period of the envelope will track to the period of whatever notes are being played on the channel at the time. The octave offset is needed for different timbres and different envelope shapes. This would generally be negative. Also, there is a common trick on the Atari computers where they achieve pulse-width modulation by running some kind of pulse-shaped software volume envelope at the same frequency. I'm not sure how doable this is, because VGM might not have high enough resolution to synchronize it decently and also it would have to be configurable. Possibly some kind of special mode for the LFO that also follows the current note? This trick can be found in many SNDH tunes by Cerror among others. Finally, since you added PCM for the SN76489, you should add PCM for the AY 3-8910. It should be fixed frequency, but I think you should let us decide what frequency that will be fixed at, up to a reasonable limit of course. It can after all go higher than 8kHz. This might also be possible on the SN76489. I think for AY PCM you should stick to a single channel. While there are some attempts to use all three channels to get 8-bit resolution, they require mapping tables and would interrupt everything on those channels, possibly while they were playing something else. Also just an aside. With VGMPlay, if I use the command P0, I get tone and noise output. This breaks PCM. Is this a bug in mml2vgm where sending both off gives me both on? Or is it a bug in VGMPlay's emulation of that chip?

kuma4649 commented 3 years ago

まずは話題を細かく分けませんか?(^^;; 盛り沢山でそれだけでゲップが出てしまいます...

ultrasound1372 commented 3 years ago

OK