Super Mario World Music Format / SMW音楽フォーマット

本家に出てくるコマンドはすべて調べがついたように思うので公開します。某Wikiの方々、こっそり情報提供してくれた某界隈の方々、ありがとうございます。どこぞへの掲載などはご自由にどうぞ。ただ、情報の間違いにはご注意ください :P

Translated:

I think that all the commands that appear in the head family have been investigated, so I will publish them. Thank you to the people on a certain Wiki and the people in a certain neighborhood who secretly provided information. Feel free to post it anywhere. However, please be careful about incorrect information 😛

Basic / 基本

  • 以下、アドレスはARAM内のアドレス
  • $1360 から曲データへのアドレス(2バイト)が連なる
  • 曲データは主に演奏ブロックへのアドレス(2バイト)が連なる
    • $00 $00 は終了コード
    • CC $00 RRRR は繰り返し
      • CC: 繰り返し回数-1(非0、$81 以上なら無限ループ)
      • RRRR: 繰り返し部分のはじめのアドレス、基本ネスト不可
  • 演奏ブロックは演奏データへのアドレス(2バイト)が8ch分連なる
    • 使わないチャンネルは $0000

以下、演奏データについて説明します(私にはほとんど演奏データの知識しかないです)

Translated:

  • Below, the address is the address in ARAM
  • Addresses (2 bytes) from $1360 to song data are connected
  • The song data is mainly composed of addresses (2 bytes) to the performance block
    • $00 $00 is the exit code
    • CC $00 RRRR repeats
      • CC: Number of iterations-1 (non-zero, infinite loop for $81 and above)
      • RRRR: First address of repeating part, basic nesting not possible
  • In the performance block, the address (2 bytes) to the performance data is continuous for 8 channels
    • $0000 for unused channels

The performance data is explained below (I have almost no knowledge of performance data).

End / Return ($00)

  • 演奏ブロックの終了
    • 普通はch0にのみ入れる
    • どれかのチャンネルで終了すれば次のブロックへと移る
  • E9 によるループの終了にも使われる

Translated:

  • End of performance block
    • Normally put only in channel 0
    • If you finish on any channel, you will move to the next block
  • Also used to end the loop with E9

Note Info ($01 - $7F)

  • コマンドバイトで音の長さを指定
    • 分解能48、つまり48($30)で4分音符に相当
  • 後続のバイトが $80 未満であれば、それは引数
    • 上位4ビット(実質3ビット)でクオンタイズの割合を指定
      • 割合の元になるテーブルは $1268 にある(表参照)
    • 下位4ビット(実質3ビット)でベロシティ(音量)の割合を指定
      • 割合の元になるテーブルは $1270 にある(表参照)

Translated:

  • Specify the sound length with the command byte
    • Equivalent to a quarter note with a resolution of 48, or 48 ($30)
  • If the following byte is less than $80, it is an argument
    • Specify the quantize ratio in the upper 4 bits (effectively 3 bits)
      • The table from which the percentages are based is at $1268 (see table)
    • Specify the velocity (volume) ratio with the lower 4 bits (effectively 3 bits)
      • The table from which the percentages are based is at $1270 (see table)

Quantize Percentage / クオンタイズの割合 ($1268)

0 1 2 3 4 5 6 7
20% 40% 50% 60% 70% 80% 90% 100%
51 102 128 153 179 204 230 255
$33 $66 $80 $99 $B3 $CC $E6 $FF

Velocity Percentage / ベロシティの割合 ($1270)

0 1 2 3 4 5 6 7 8 9 A B C D E F
8 18 27 36 44 53 62 71 81 90 98 107 125 143 161 179
$08 $12 $1B $24 $2C $35 $3E $47 $51 $5A $62 $6B $7D $8F $A1 $B3

Note ($80 - $C5)

  • コマンドバイトで音の高さを指定
    • 音程は基本的には $80 をドとして半音ずつ上がっていく
      • 例外として基準音がドではない音色がいくつか存在する

Translated:

  • Specify the pitch with the command byte
    • The pitch basically starts at $80 and goes up by a semitone.
      • As an exception, there are some tones whose reference tone is not do.

Tie ($C6)

  • タイ、直前の音を伸ばして長い音の演奏を可能にする
    • 例: $08 $80$04 $80 $C6 はおそらく同じ音になる

Translated:

  • Tie stretches the last note and enables long notes to be played
    • Example: $08 $80 and $04 $80 $C6 will probably sound the same

Rest ($C7)

  • 休符、発音を止め、指定タイミングで待つ

Translated:

  • Stop rests and pronunciation, and wait at the specified timing

Unused (Rest?) ($C8 - $CF)

  • 未使用。機能はおそらくC7と同じ

Translated:

  • Unused. Function is probably the same as $C7, Rest.

Percussion Note ($D0 - $D9)

  • リズム楽器など、音程を持たないパーカッションを配置
  • 音色が変更されるので、メロディ音色に戻すときは DA を入れるべきかも

Translated:

  • Place percussion without pitch, such as rhythm instruments (🥁)
  • Since the tone will be changed, it may be necessary to insert DA when returning to the melody tone.

Set Patch (XX) ($DA XX)

  • XX で音色を指定、値の範囲は通常 $00-$12

Translated:

  • Specify the tone with XX, the range of values is usually $00 - $12

Pan (XX) ($DB)

  • 音源の左右位置を設定
  • 以下、 XX=[lr0a aaaa] として説明
    • lr は左右位相反転サラウンドフラグ
    • aaaaa は音源の位置(左 $14<->$00 右)

Translated:

  • Set the left and right position of the sound source
  • Below, it is explained as XX = [lr0a aaaa]
    • lr is the left-right phase inversion surround flag
    • aaaaa is the position of the sound source (left $14 <-> $00 right)

Volume Balance Ratio / 音量バランスの割合 ($1280)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 1 3 7 13 21 30 41 52 66 81 94 103 110 115 119 122 124 125 126 127
$00 $01 $03 $07 $0D $15 $1E $29 $34 $42 $51 $5E $67 $6E $73 $77 $7A $7C $7D $7E $7F

Pan Fade (XX YY) ($DC)

  • 音源の位置のフェード。XX 時間かけて位置をYYにする
  • YY に20以上を指定するとおそらくバグる

Translated:

  • Fade the position of the sound source. Set the position to YY over XX time
  • Probably buggy if you specify 20 or more for YY

Pitch Slide (XX YY ZZ) ($DD)

  • なぜか処理テーブル($0F90)にない妙なコマンド($10EA?
  • XX 時間後からYY時間かけて音程をZZにする
    • 音程はノートコマンドの値で表現される

Translated:

  • A strange command ($10EA?) that is not in the processing table ($0F90) for some reason
  • Set the pitch to ZZ from XX time to YY time
    • The pitch is represented by the value of the note command

Vibrato (XX YY ZZ) ($DE)

  • ビブラートの設定
  • 発音から XX 時間後に、 YY の早さで ZZ の大きさのビブラートがかかるよう設定
    • 俗に言う、Vibrato Delay、Vibrato Rate、Vibrato Depthである

Translated:

  • Vibrato settings
  • Set to apply ZZ-sized vibrato at YY speed XX time after pronunciation
    • The so-called Vibrato Delay, Vibrato Rate, and Vibrato Depth.

Vibrato Off ($DF)

  • ビブラートを無効にする
    • 具体的にはVibrato Depthを0にしている

Translated:

  • Disable vibrato
    • Specifically, Vibrato Depth is set to 0.

Main Volume (XX) ($E0)

  • 楽曲全体の音量をXXに設定。初期値は $C0

Translated:

  • Set the volume of the entire song to XX. The initial value is $C0

Main Volume Fade (XX YY) ($E1)

  • 楽曲全体の音量のフェード
  • XX 時間かけて音量を YY にする

Translated:

  • Fade the volume of the entire song
  • Set the volume to YY over XX time

Tempo (XX) ($E2)

  • 演奏テンポの設定
  • SMFや楽譜でのテンポは60Mμs(1分)あたりの拍数だが、SMWの音楽は24Mμs基準
    • つまり、設定したいテンポ(bpm)を24/60倍した値を書けばよい
  • ゲーム中にタイムが100を切ったとき、テンポは10上昇する

Translated:

  • Setting the playing tempo
  • The tempo in SMF and sheet music is the number of beats per 60Mμs (1 minute), but SMW music is based on 24 Mμs.
    • In other words, write a value that is 24/60 times the tempo (bpm) you want to set.
  • When the time drops below 100 during the game, the tempo increases by 10.

Tempo Fade (XX YY) ($E3)

  • 演奏テンポのフェード。XX 時間かけてテンポを YY にする

Translated:

  • Performance tempo fade. Set tempo to YY over XX time

Global Transpose (XX) ($E4)

  • 移調します。演奏音程を XX 上げます(XX を負数にすると音程が下がる)
  • 効果音含めて音程が下がってしまうため、通常は使用しない

Translated:

  • Transpose. Raise the playing pitch by XX (set XX to a negative number to lower the pitch)
  • It is not normally used because the pitch including sound effects will be lowered.

Crescendo (XX YY ZZ) ($E5)

  • 音量が上がったり下がったりします
  • ただし、1パートにしか使えません(他パートに休符で回避可能)
    • XX:変化させない時間
    • YY:周期
    • ZZ:振幅
  • 他のパートの音が鳴ると即解除されます
  • 2パート以上に設置しても、音が変になるだけで、正しく使うには1パートのみの発音の時に限られます

http://mario.cold-web.net/view.cgi/1198136239/ の >>51 の資料より引用。

Translated:

  • The volume goes up and down
  • However, it can be used only for one part (it can be avoided by resting on other parts)
    • XX: Time not to change
    • YY: Cycle
    • ZZ: Amplitude
  • It will be canceled immediately when the sound of other parts sounds
  • Even if you install it in two or more parts, the sound will only change, and you can use it correctly only when only one part is pronounced.

Quoted from http://mario.cold-web.net/view.cgi/1198136239/

Cancel Crescendo ($E6)

  • $E5 を解除します
  • $E5 は他のパートで音が鳴ると勝手に解除されるので、このコマンドはあまり設置する必要はありません

http://mario.cold-web.net/view.cgi/1198136239/ の >>51 の資料より引用。

Translated:

  • Release $E5
  • This command doesn't need to be used much because $E5 will be canceled automatically when the sound is heard in other parts.

Volume (XX) ($E7)

  • チャンネルの音量を設定。初期値は $FF (最大)

Translated:

  • Set the volume of the channel. The initial value is $FF (maximum)

Volume Fade (XX YY) ($E8)

  • チャンネル音量のフェード。 XX 時間かけて音量を YY にする

Translated:

  • Channel volume fade. Set the volume to YY over XX time

Call Subroutine (XX YY ZZ) ($E9)

  • YYXX の演奏データを ZZ+1 回繰り返す
  • ジャンプ先の演奏データからは00で戻る
  • ネストすることは避ける

Translated:

  • Repeat YYXX performance data ZZ + 1 times
  • Return by 00 from the performance data of the jump destination
  • Avoid nesting

Vibrato Parameter (XX) ($EA)

  • ビブラートの微調節をします
    • $XX:最初の周期
  • XX で指定した値から、pの1つ目や $DEYY で指定した値に徐々に変化していきます

http://mario.cold-web.net/view.cgi/1198136239/ の >>51 の資料より引用。

Translated:

  • Make fine adjustments to the vibrato
    • $XX: First cycle
  • The value specified by XX gradually changes to the value specified by the first p and YY of $DE

Quoted from http://mario.cold-web.net/view.cgi/1198136239/

Release (XX YY ZZ) ($EB:$EG)

  • 一定時間後に音程がスライドするよう設定

  • 発音から XX 時間後に、 YY 時間かけて ZZ だけ音程が変化するよう設定

  • EC とは併用できない(同じ領域を使用しているため)

  • 元に戻すには $EB $00 $00 $00 を使うと思われる

  • 効果音がこの効果を打ち消すことがある模様(ジャンプ音、別チャンネルであっても $0300+X が消される)

  • ピッチを徐々に変更します

    • $XX:変更しない時間
    • $YY:変更に掛ける時間
    • $ZZ:音程補正

って書いてたんですけど違うような感じがするので例によって以下 http://mario.cold-web.net/view.cgi/1198136239/ の >>51 の資料より引用。

Translated:

  • Set the pitch to slide after a certain period of time

  • Set to change the pitch by ZZ over YY time after XX time from pronunciation

  • Cannot be used with EC (because it uses the same area)

  • It seems to use $EB $00 $00 $00 to undo

  • It seems that the sound effect may cancel this effect (jump sound, $0300 + X is erased even if it is another channel)

  • Gradually change the pitch

    • $XX: Time not to change
    • $YY: Time to change
    • $ZZ: Pitch correction

I wrote that, but it feels different, so as usual, I quoted from the material of http://mario.cold-web.net/view.cgi/1198136239/.

Attack (XX YY ZZ) ($EC:$EG)

  • 一定時間後に音程がスライドするよう設定

  • ZZ 低い(高い)音が発音から XX 時間後に、 YY 時間かけて通常音程になるよう設定

  • EB とは併用できない(同じ領域を使用しているため)

  • 元に戻すには $EC $00 $00 $00 を使うと思われる

  • 効果音がこの効果を打ち消すことがある模様(ジャンプ音、別チャンネルであっても $0300+X が消される)

  • ピッチを徐々に変更します。こちらは $EB とは違い、後の音にも適用されます。

    • $XX:変更しない時間
    • $YY:変更に掛ける時間
    • $ZZ:音程補正

って書いてたんですけど違うような感じがするので例によって以下 http://mario.cold-web.net/view.cgi/1198136239/ の >>51 の資料より引用。

Translated:

  • Set the pitch to slide after a certain period of time

  • ZZ Set so that the low (high) sound becomes the normal pitch over YY time after XX time from the sound.

  • Cannot be used with EB (because it uses the same area)

  • I think I'll use $EC $00 $00 $00 to get it back

  • It seems that the sound effect may cancel this effect (jump sound, $0300 + X is erased even if it is another channel)

  • Gradually change the pitch. This is different from $EB and applies to later sounds.

    • $XX: Time not to change
    • $YY: Time to change
    • $ZZ: Pitch correction

I wrote that, but it feels different, so as usual, I quoted from the material of http://mario.cold-web.net/view.cgi/1198136239/.

Undefined ($ED)

  • 未定義。処理テーブルには $0000 が指定されている。 $DD と違って例外的な処理もない。
  • 処理テーブルに基づいてジャンプするので、使うとAPUが止まる。絶対に使ってはならない。

Translated:

  • Undefined. $0000 is specified in the processing table. Unlike $DD, there is no exceptional processing.
  • Jumps based on the processing table, so APU will stop when used. Never use it.

Tuning (XX) ($EE)

  • 音程をわずかに変化させる。 XX=$100 でほぼ半音(値の範囲は $00-$FF
  • 音程はおそらく上方向にしか変化しない。なのでDetuneとは言いにくい

Translated:

  • Slightly change the pitch. XX = $100, almost a semitone (value range is $00- $FF)
  • The pitch probably changes only upwards. So it's hard to say Detune

Set Echo vbits, Volume (XX YY ZZ) ($EF)

  • エコーをかける。エコーレジスタに値をコピーするコマンド
  • XX のビットフラグで対象チャンネルを設定(下位ビットからチャンネル番号の若い順)
  • YY ZZ はエコーのLR音量。値を大きくするほど残響音が大きくなる
  • チャンネルによってはエコーが効果音にも影響するので注意

Translated:

  • Echo. Command to copy value to echo register
  • Set the target channel with the bit flag of XX (from the least significant bit to the lowest channel number)
  • YY ZZ is the LR volume of the echo. The higher the value, the louder the reverberation.
  • Note that echo affects sound effects depending on the channel.

Disable Echo ($F0)

  • エコーをOFFに設定
  • エコー関連の初期値はおそらくFeedbackが0、それ以外は初期化されない
    • つまり初期状態ではエコー設定がされている場合があるが、実質残響はない

Translated:

  • Set echo to OFF
  • Echo-related initial values ​​are probably 0 for Feedback, otherwise they are not initialized
    • In other words, echo may be set in the initial state, but there is virtually no reverberation

Set Echo Delay, Feedback, Filter (XX YY ZZ) ($F1)

  • エコーに関する設定をおこなう。先に EF でエコーを有効にすること
  • XX がディレイ、 YY がフィードバック、 ZZ がFIRフィルタ設定(0か1)

Translated:

  • Make settings related to echo. Enable echo with ʻEF` first
  • XX is delay, YY is feedback, ZZ is FIR filter setting (0 or 1)
Value FIR Note
0 FF 08 17 24 24 17 08 FF FIR読めないです :( たぶん低域・中域の強調 / FIR cannot be read 😞 Maybe low / mid range emphasis
1 7F 00 00 00 00 00 00 00 フィルタ無し残響 / Reverberation without filter

Echo Volume Fade ($F2)

  • エコー音量のフェード。 XX 時間かけてエコーのLR音量をそれぞれ YY ZZ にする

Translated:

  • Echo volume fade. XX Set the echo LR volume to YY ZZ over time.

Undefined ($F3-$FF)

  • 処理テーブルの範囲外。おそらく使うと盛大にバグる

Translated:

  • Out of range of processing table. Probably a big bug when used

Originally posted to http://d.hatena.ne.jp/GOCHA/20070428/smwmusicspec by GOCHA but now offline, and it cites http://mario.cold-web.net/view.cgi/1198136239/ which is sadly also offline.