私は実験してきましたFM合成オーディオファイルの作成と使用ADSR結果のサウンドを形作るエンベロープ。 FMは周波数変調を意味します。ADSRとは、アタック、ディケイ、サステイン、リリースを意味します。 ADSR は、キーを押したときのノートのボリュームの増加 (アタック) と減少 (ディケイ) の速さ、キーを押したときの持続するボリューム、およびキーを離したときにノートのボリュームがフェードする方法を決定する曲線を表します。 ADSR 曲線の典型的な図には、4 つの直線があります。
A, D, R are time; S is a levelA, D, R are time; S is a levelA, D, R are time; S is a levelA, D, R are time; S is a levelA、D、R は時間です。 Sはレベル
以下の波形には変調がありません (すべての山と谷が等間隔になっています)。
グラフの最初のサイクルの上部を見ると、小さな不具合が見られます。 私はコードを書いていたので、間違いを犯したと思っていました。ズームすると、サウンドに少し影響を与える可能性のある重大なエラーのように見えます。
Actually, two glitchesActually, two glitchesActually, two glitchesActually, two glitches実は不具合が2つ
アタックは 0.001 秒、ディケイは 0.003 秒に設定されました。毎秒 44,100 サンプルでは、アタックはサンプル 44 で終了し、ディケイはサンプル 176 あたりで終了します。 単純化したバージョンを作成するためにデータ テーブルを作成したところ、ADSR 曲線の鋭い角が原因でグリッチが発生していることに最終的に気付きました。 それを修正するために、ADSR 曲線にスプラインを当てはめます。 スプラインの張力が十分に高い限り、グリッチは微妙すぎて気づきません。 (これは単純化されたデータであり、上と下で聞いたデータではありません。)
The orange spline-based curves are hiding behind the purple curves; at this zoom they are nearly identical.The orange spline-based curves are hiding behind the purple curves; at this zoom they are nearly identical.The orange spline-based curves are hiding behind the purple curves; at this zoom they are nearly identical.The orange spline-based curves are hiding behind the purple curves; at this zoom they are nearly identical.オレンジ色のスプライン ベースの曲線は紫色の曲線の後ろに隠れています。このズームでは、それらはほぼ同じです。
ディケイ カーブとサステイン カーブの間のコーナーを少し拡大します。
The solid sine curve is rising, but slowing. The dotted purple decay curve is falling, but about to become flat (sustain.)The solid sine curve is rising, but slowing. The dotted purple decay curve is falling, but about to become flat (sustain.)The solid sine curve is rising, but slowing. The dotted purple decay curve is falling, but about to become flat (sustain.)The solid sine curve is rising, but slowing. The dotted purple decay curve is falling, but about to become flat (sustain.)堅実な正弦曲線は上昇していますが、減速しています。 点線の紫色の減衰曲線は下降していますが、ほぼフラットになります (持続)。
点線のオレンジ色の曲線は、点線の紫色の曲線内の点のスプライン補間です。 実線のオレンジ色の曲線は、元のサイン波にオレンジ色のエンベロープを乗算して縮小したものです。 紫色の曲線の誤差は、1000 分の 1 程度のようです。それが聞こえるかどうかはわかりません。 ウェーブ ファイル データの +/- 32767 の範囲では、それは約 32、2^5、おそらく 16 ビット数の 5 番目のビットで、おそらく 60 dB 低下します。 良い機材と若い耳なら聞こえるはずです。
拡大するとこんな感じきれいに歪んだ正弦波。
The glitch is gone. The leading part of the sine wave is flattened by the rising gain of the attack.The glitch is gone. The leading part of the sine wave is flattened by the rising gain of the attack.The glitch is gone. The leading part of the sine wave is flattened by the rising gain of the attack.The glitch is gone. The leading part of the sine wave is flattened by the rising gain of the attack.グリッチはなくなりました。 サイン波の先頭部分は、アタックの上昇ゲインによって平坦化されます。
ファイルが添付された。 Windows では、マルチメディア DLL で PlaySound を使用します。 上部にいくつかスイッチがあります。 FMコードを一切使用しておらず、考えれば考えるほど、周波数変調ではなく位相変調を実装している可能性があります。 このデモ以上の準備はできていません。