This article has Japanese translations that need to be checked for correctness and have the Japanese portion removed.

This explains the structure of the SNES Capcom Sequence format / Capcom SPC format. Used by many Capcom games, this document focuses on Mega Man X but older games such as Super Ghouls 'n Ghosts and probably others should be similar if they use the same engine.

Structure

Capcom Sequence Format

; song pointer
ff00: dw $b000
; starting point for each track (8ch,7ch,6ch,...)
b000: dw $c000,$c100,$c200,$c300,$c400,$c500,$c600,$c700
; sequence data / 8ch
c000: ; voice cmds to playback...
  • Capcom Sequence format uses big-endian order, keep this in mind.
  • The most important channel is 8ch, it should be processed first as shown in the figure above.

どんな形で演奏データが表現されるのか、アセンブリで擬似的に示してみました。上記の特徴を除けば、ごくありふれた構造かと思います。曲はどこかに一覧で並んでいるような感じですが、新しいものと古いものでは若干違うようにも見えます。音楽と効果音の区別がどの程度あるのかなど、このあたりに関してはよく調べていません。

Translated:

Will it be played on any form of data representation, assembly reveals a pseudo-I. Apart from the above characteristics, I think a very common structure. It feels like the song list, somewhere along in the old and new seems to be slightly different. Is there such as how to distinguish between music and sound effects, for this area is not well investigated.

Voice Bytes

Mapping

Vbyte Friendly Name Arguments
$00 Toggle Triplet
$01 Toggle Portamento
$02 Set Dot(ted Note)
$03 Toggle 2-Octave Up
$04 Set Triplet / Portamento / 2-Octave Up Directly [xx]
$05 Tempo [xx yy]
$06 Duration Rate [xx]
$07 Volume [xx]
$08 Instrument [xx]
$09 Octave Correction [xx]
$0A Global Transpose [xx]
$0B Per-Voice Transpose [xx]
$0C Tuning [xx]
$0D Portamento Time [xx]
$0E-11 Loop #1-4 [xx yy zz]
$12-15 Loop Break #1-4 [xx yy zz]
$16 Jump [xx yy]
$17 End of Track
$18 Pan [xx]
$19 Main Volume [xx]
$1A LFO Parameter [xx yy]
$1B Echo Parameter [xx yy]
$1C Echo On / Off [xx]
$1D Release Rate [xx]
$1E (Unknown) [xx]
$1F (Unknown) [xx]
$20-FF Note

Note ($20-FF)

  • Vbyte itself means the length and key of the note.
  • • Higher 3-bit is for duration (See the duration table below, also, see $00 and $02 for Triplet and Dotted Note).
  • • Lower 5-bit is for key, means "rest" when it's 0b00000 (to calc actual key for note, see also $03 and $09).
  • • • key = lower5bit + ($03-octUpFlag ? 24 : 0) + ($09-octaveCorrection * 12) + $0a-globalTranspose + $0b-voiceTranspose;
  • "Dotted Note" flag is cleared after it's processed.
  • There's no event just for tie, use portamento vcmd $01 for it.
  • See also $06 for quantize.
1(l64) 2(l32) 3(l16) 4(l8) 5(l4) 6(l2) 7(l1)
Normal 3 6 12 24 48 96 192
Dotted 0 9 18 36 72 144 0
Triplet 2 4 8 10 20 40 80

コマンドバイト自身で音の長さと高さを表します。わかれば綺麗なのですが、知らない人にはちょっと説明のめんどくさいところがあります。ロックマン2の音楽データと似たようなところもあるので、そちらも見るとよいかもしれません。

音の長さは上位3ビットで表します。0b000のときはコマンドなので、音符に用いられるのは1~7の値です。上の表にあるとおり、7が全音符、6が2分音符……1が64分音符です。音符以前に$02コマンドが出現している場合は、付点つきになります(その音符が処理された時点で付点フラグは解除される)。同様に$00で3連符です(こちらは処理後のフラグ解除なし)。その両方が指定される場合は、付点を優先して処理します(おそらくそんなデータは作るべきでないですが)。スタッカートなどのクオンタイズは$06で指定します。

音の高さは下位5ビットで表します。半音ずつ上がる0~31の値で、0のときは休符です。これに$03の2オクターブ補正と、$09のオクターブ補正(とトランスポーズ)を加えたものが、実際の音程になります。

なお、タイ専用のコマンドは用意されておらず、$01のポルタメントコマンドを使って表現することになっています。

Translated:

The length represents the height of the sound itself and the command byte. It's beautiful if you know, strangers are just a little tedious explanation. Mega Man 2 audio data similar to that just because some may want to look this one.

The length of the sound is represented by three bits. Because when 0b000 command, used to note the value of 1 to 7. As stated in the above table, the seven whole notes, half notes ... I have six 64-minute one note. If the notes prior to the emergence of command $02 is the dot with a flag (which is processed at the point with the note is released.) As in the triplet is $00 (which is not clear the flag after processing). If both are specified, the processed first with a point (not that data is not 作Rubeki). Quantization and staccato specified in the $06.

Pitch is represented by the lower 5 bits. Raised one semitone value from 0 to 31, when the rest are 0. It's $03 2 octave correction, $09 octave correction (and transpose) is a plus, you actually pitch.

The command includes not only tie, $01 portamento is meant to express command.

Toggle Triple ($00)

3連符使用フラグを反転します。Note参照。

Translated:

Toggle the triplet flag. See Notes.

Toggle Portamento ($01)

ポルタメント使用フラグを反転します。ポルタメントがonのときに発音された音は発音停止処理をおこないません。また、後続の音は再発音を伴わないピッチ変化のみで鳴らされます。同音間で使用することでタイを表現します。

Translated:

Toggle the portamento flag. The sound was pronounced portamento on the line is encountered when the sound stop process. The subsequent sound is rung only on the pitch without changing the pronunciation again. Tie represents the same sound can be used between.

Set Dot(ted Note) ($02)

付点フラグをonにします(反転ではない)。Note参照。

Translated:

Turns the dotted flag on, but not off. See Notes.

Toggle 2-Octave Up ($03)

2オクターブ上昇フラグを反転します。Note参照。

Translated:

Reverse the flag rose two octaves. See Notes.

Set Triplet / Portamento / 2-Octave Up Directly ($04)

[xx]
  |= $08 - 2-Octave up (vcmd $03)
  |= $20 - Triplet     (vcmd $00)
  |= $40 - Portamento  (vcmd $01)

上記のフラグを一度に設定します。それ以外のビットフラグはマスクされるので反映されないはずです。

Translated:

Set the flags at once. Other flag bits should be masked because it does not reflect.

Tempo ($05)

bpm = $xxyy * 60000000 / 196608000 ?
  196608000 = (timer0) 8ms * 48 * 512 (just a guess)

曲の演奏速度を設定します。値は2バイト値で指定されます。計算式はおおよそ上記のとおりと思われます。

Translated:

Set the speed of the song playing. The value is specified in two-byte value. The formula appears to approximate as described above.

Duration Rate ($06)

 xx/256 = duration rate

クオンタイズ設定です。少ない値にするほど発音時間が短くなります。

Translated:

Quantize setting. The more time is reduced to a value less pronounced.

Volume ($07)

チャンネルの音量を設定します。

Translated:

Set the volume of the channel.

Instrument ($08)

演奏音色を設定します。

Translated:

Set the tone played.

Octave Correction ($09)

xx should be $00-07

オクターブ補正です。Note参照。値は0~7の範囲にとどめるべきかと思います。

Translated:

The octave correction. See Note. I think the value is kept to a range between 0 and 7.

Global Transpose ($0A)

xx = semitones (signed)

全チャンネルの演奏音程をxx上げます(負数も指定可)。

Translated:

[xx] raises the pitch of all channels playing (can also specify a negative number.)

Per-Voice Transpose ($0B)

xx = semitones (signed)

単一チャンネルの演奏音程をxx上げます(負数も指定可)。

Translated:

Increase the pitch plays a single-channel [xx] (can also specify a negative number.)

Tuning ($0C)

xx = signed, make the pitch xx/128 semitones? higher.

音程をわずかに変化させます。たぶん128で半音相当です(負数も指定可)。

Translated:

Slightly alters the pitch. The semitone is equivalent to perhaps 128 (can also specify a negative number.)

Portamento Time ($0D)

ポルタメントにかける時間を指定します。単位は明確ではないですが、値が大きいほど音程変化がゆっくりになります。

Translated:

Specifies the portamento time spent, xx. The unit is not clear, but will slowly change the pitch higher.

Loop #1-4 ($0E, $0F, $10, $11) / Loop Break #1-4 ($12, $13, $14, $15)

xx   = count
yyzz = destination address.
"Loop"       = "jump (loop), for xx times".
"Loop Break" = "jump (break), if it's the last time of the loop".
Loop #1 and Loop Break #1 share the repeat count. Loops #2, #3 and #4 as well.

繰り返しのための命令です。一方は指定回数までジャンプさせるコマンド、一方はループ最終時のみジャンプさせるコマンドです。4種類用意されているのはそれぞれカウンタが独立しているという意味です(チャンネルごと独立ではない)。演奏データを作成しようと思うと一癖ある仕様ですね。

Translated:

Instruction for repetition. One commands to jump to a specified number one command that is only the final loop jump. The four types that are available means that each counter is independent (not independent per channel.) I think I try to create specifications that trait performance data.

Jump ($16)

xxyy = destination address.

無条件ジャンプです。主に楽曲のループに用いられます。

Translated:

The unconditional jump. Used primarily in the loop of music.

End of Track ($17)

単一チャンネルの演奏データ終了を意味します。

Translated:

Means the end of the single channel performance data.

Pan ($18)

xx (signed)

音の左右位置を設定します。負数が左、0が中央、正数が右です。

Translated:

Set the location of the sound side. Negative left, center, with 0 being a positive right.

Main Volume ($19)

楽曲全体の演奏音量を指定します。

Translated:

Specifies the volume of the entire song played.

LFO Parameter ($1A)

xx = type
yy = value
Type Description
$00 Vibrato Depth (Pitch Modulation)
$01 Tremolo Depth (Volume Modulation)
$02 LFO Speed
$03 Reset LFO Per Note (Non-Zero = yes, Zero = no)

LFOの設定をします。ビブラートやトレモロをかけるのに使います。

$03でのフラグ設定は、たとえばロックマンXのシグマ前の音楽で使われています(遅いトレモロをノート独立でなくかけることで、クレッシェンドとデクレシェンドを繰り返す演奏をおこなう)。

Translated:

Sets the LFO. Vibrato or tremolo used to take out.

$03 set in flags, for example, Mega Man X music has been used in previous Sigma (separate note, not by applying a slow tremolo, crescendo and Dekureshendo perform repeat play.)

Echo Parameter ($1B)

xx = ignored?
yy = preset #

主にエコーの設定をします。プリセット番号を指定することで、MVOL、EVOL、ESA、EDL、EFB、FIRが設定されます。とくに指定しない場合、前に演奏されていた曲の状態を引き継ぐように思います。ロックマンXでは本編の音楽にこのコマンドはなく、最初のカプコンのロゴでのみこのコマンドが出現しています。

Translated:

Set the main echo. By specifying a preset number, MVOL, EVOL, ESA, EDL, EFB, FIR is set. If you do not particularly think that the state take over the song had been played before. Mega Man X music of this story, not of this command, the command has only appeared in the first Capcom logo.

Echo Toggle ($1C)

xx = Non-Zero for Echo On, Zero for Echo Off (just works for current channel).

単一チャンネルのエコーの有無を指定します。

Translated:

Specifies whether a single channel echo.

Release Rate ($1D)

xx = $ 00 - $ 1f (GAIN exponential decrease parameter)

発音時間終了後の音の減衰率を指定します。値が小さいほど音が持続します。

Translated:

Specifies the time after the attenuation of sound pronunciation. The lower the sound lasts.

(Unknown) ($1E)

Does nothing in Mega Man X or Super Ghouls 'n Ghosts.

ゲームによっては無意味なコマンドですが、ゲームによってはコードがあるようです。ただし、滅多に使われていないように見えます。

Translated:

The command is meaningless game, the game seems to be code. However, do not seem to rarely used.

(Unknown) ($1F)

Does nothing in Mega Man X or Super Ghouls 'n Ghosts.

ゲームによっては無意味なコマンドですが、ゲームによってはコードがあるようです。ただし、滅多に使われていないように見えます。

Translated:

The command is meaningless game, the game seems to be code. However, do not seem to rarely used.

Translated and expanded upon from http://d.hatena.ne.jp/loveemu/