Command Reference



Standard commands:

The following is a list of all available hex commands that may be used in a song. In all cases, the parameters are listed in the order in which they are to be used after the initial command. If a parameter is a number, then that parameter must be the specified constant instead of being variable.
Command Purpose
Description
Parameters
$DA
Instrument
Sets the instrument for the current channel.
$XX
Instrument to set to. Default limit is $00 to $12.
 
$DB
Pan
Sets the panning for the current channel.
$XX
Panning value. Must be between $00 and $13. $0A is centered. Note that setting the highest two bits will enable surround sound.
 
$DC
Pan fade Fades the pan over time $XX
Duration
$YY
Final panning value
 
$DD Pitch bend
Slides from the currently playing note to the specified note smoothly.
$XX
Delay
$YY Duration
$ZZ Note
 
$DE Vibrato
Turns on vibrato for the current channel
$XX
Delay
$YY
Duration
$ZZ
Amplitude
 
$DF
Vibrato off
Turns off vibrato.
 
$E0 Global volume
Sets the song's global volume
$XX
Volume
 
$E1 Global volume fade
Fades the song's global volume
$XX
Duration
$YY
Volume
 
$E2
Tempo
Sets the tempo to the specified value
$XX
Tempo
 
$E3 Tempo fade Fades the tempo to the specified value $XX
Duration
$YY Value
 
$E4 Global transpose
Transposes all instruments by the value
$XX
Transposition
 
$E5 Tremolo
Enables tremolo for the current channel
$XX
Delay
$YY
Duration
$ZZ
Amplitude
 
$E6 Subloop start
Sets the starting point for a subloop
$00
 
$E6 Subloop end
Sets the ending point for a subloop
$XX
Loop count
 
$E7 Volume
Sets the volume for the current channel
$XX
Volume
 
$E8 Volume fade Fades the volume for the current channel
$XX
Duration
$YY Volume
 
$E9 Loop Normal loop. Do not use manually. $XX
Loop point, low byte
$YY Loop point, high byte
$ZZ
Loop count
 
$EA Vibrato fade
Fades to the amplitude specified by $DE over the specified period of time.
$XX
Duration
 
$EB Pitch envelope (release) Bends all subsequent notes from the current note to the current note + the specified number of semitones (negative values--i.e. values above $80--are allowed). $XX
Delay
$YY Duration
$ZZ
Semitone difference
 
$EC Pitch envelope (attack)
Bends all subsequent notes from the current note + the specified number of semitones to the current note (negative values--i.e. values above $80--are allowed).
$XX
Delay
$YY
Duration
$ZZ
Semitone difference
 
$ED ADSR
Enables a custom ADSR on the current channel. $DA must not be be > $7F. See here for more information.
$DA
Delay (3 bits), attack (7 bits); 0dddaaaa
$SR Sustain (3 bits), Release (5 bits); sssrrrrr
 
$ED GAIN Enables a custom GAIN on the current channel. NOTE: If switching from ADSR to GAIN, instrument GAIN may be enabled before custom GAIN! If Instrument GAIN=$00, notes will cut immediately! $80
$YY GAIN
 
$EE Tune channel
Sets the pitch modifier for this channel.
$XX
Tuning
 
$EF Echo 1
Sets some of the echo parameters for this song.
$XX
Which channels have echo, bitwise (76543210)
$YY
Echo volume, left
$ZZ
Echo volume, right
 
$F0 Echo off
Turns off echo
 
$F1 Echo 2
Sets some of the echo parameters for this song.
$XX
Echo delay. May only be 00 - 0F
$YY
feedback/reverberation
$ZZ
FIR filter to use. See the echofilter tables in main.asm for more details, but for 99% of the userbase, $01 is "unfiltered" and $00 is "low-pass filtered".
 
$F2
Echo fade
Fades the echo volume
$XX
Duration
$YY
Final echo volume for left speaker
$ZZ
Final echo volume for right speaker
 
$F3 Sample load
Starts playing the specified sample. Note that the ("", $) command is highly preferred over this.
$XX
Sample to use
$YY
Multiplication pitch
 
$F4
Yoshi drums
Enables yoshi drums on channel #5
$00
 
$F4 Legato
Toggle legato (notes will be played with no break between. This also means that samples will not be rekeyed, so new notes will not start the sample playing from the beginning). Note that when turning off legato, you must do so in the middle of the last note to use this effect, instead of in between notes. $01
 
$F4 Light staccato Toggle light staccato (notes will be played with less of a delay between). Please be aware that this command is "global"; i.e. it applies to all channels. If you would like to fine-tune the amount of time between notes, you can use the q command. $02
 
$F4
Echo toggle
Toggles the echo for this channel
$03
 
$F4
SNES sync
Sends the current song's position to the output registers.
$05
 
$F4
Yoshi drums
Enables yoshi drums on the current channel
$06
 
$F4
Tempo hike off
Disables the tempo hike caused by the "time is running out!" sound effect. Use this on songs that should never be affected by this, such as the course clear music, game over music, etc.
$07
 
$F4
Velocity table
Switch the velocity table to use. By default, a song will use SMW's velocity table, which is rather quiet. Use this to use the standard n-spc velocity table instead, which is a bit louder. The alternative to this command is "#louder" when using older versions of AddmusicK (older than parser version 2). Otherwise it's enabled by default.
$08
 
$F4
Restore instrument
Restores all the instrument settings for the current channel. It's the same thing as just calling the currently playing instrument. It does work on custom instruments.
$09
 
$F5
FIR filter
Sets the fir filter coefficients.
$X0
Coefficient 1
$X1 Coefficient 2
$X2
Coefficient 3
$X3
Coefficient 4
$X4
Coefficient 5
$X5
Coefficient 6
$X6
Coefficient 7
$X7
Coefficient 8
 
$F6 DSP write
Write a value directly to the DSP
$XX
Register to write to
$YY
Value to write
 
$F8 Enable noise
Enables noise for the current channel. Using an instrument that does not use noise will disable it.
$XX
"Pitch" of the noise.
 
$F9 Data send
Sends two bytes of data to the SNES. See asm/SNES/patch.asm for more info.
$XX
The first byte to send.
$YY
The second byte to send.
 
$FA Pitch modulation
Enables pitch modulation
$00
$XX
Which channels to enable pitch modulation on, bitwise (7654321-). Channel 0 cannot have pitch modulation.
 
$FA GAIN
Enables GAIN on the current channel. NOTE: If switching from ADSR to GAIN, instrument GAIN may be enabled before custom GAIN! If Instrument GAIN=$00, notes will cut immediately!
$01
$XX
The GAIN value to use
 
$FA Semitone tune Tunes the current channel by the specified number of semitones $02
$XX Number of semitones to tune by
 
$FA Amplify
Multiplies the volume of the current channel by this value + 1. 0 will not modify the volume, whereas FF will (just shy of) double it. Be warned of clipping, however, as SMW's engine was not built to assume high volumes. In other words, don't use this to make your song louder; use it if a specific instrument or something is already playing at max volume and still isn't loud enough.
$03
$XX
Value to multiply the volume by
 
$FA Echo buffer reserve
You do not need to use this command manually. In fact, you probably shouldn't. This is inserted at the beginning of every song by the program, and doesn't have much use otherwise. Its sole purpose is to reserve an echo buffer large enough for the song's longest echo delay. This is to prevent the normal echo command from having to do it itself, which is a time-consuming operation that would cause a pause in the middle of the song. Note that if hex command validation is turned off, this command will not be inserted.
$04
$XX
The largest echo buffer you plan to use
 
 
$FB
Arpeggio Specifies an arpeggio. Each note after this will play with a specified pattern. Note that this command and its subcommands are compatible with the $F4 $01 command, and in fact combining the two is recommended for certain circumstances.
$XX Number of notes in the sequence (must be less than $80). If this is 0, then arpeggio is turned off.
$YY
The duration of each note
$...
The sequence of notes. Each byte is the change in pitch from the currently playing note. For example, $FF 00 would alternate between playing one semitone below the current note and the current note itself. A value of $80 at any point indicates a loop point; the sequence will restart there instead of the beginning if one is specified.
 
$FB Trill
A specialized version of the arpeggio command. It implies that you want to alternate between only two notes.
$80
$YY
The duration of each note
$ZZ
The change of pitch between the currently playing note and the trilled note.
 
$FB Glissando
If glissando is turned on, then the current note will be rekeyed at increasingly higher/lower pitches. Analogous to sliding your hand down a keyboard. Unlike the other two subcommands, this one's effect is turned off after one note.
$81
$YY
The duration of each note
$ZZ
The number of semitones to step up or down by for each new note
 
$FC Remote commands See the corresponding entry in the syntax reference section for more information.

For the sake of reference, for songs labeled #amk 1, this command is anticipation gain. It used to cause gain to occur some amount of time before a note ended. It has been replaced entirely with remote commands, and will be converted to that in current versions of AddmusicK.
$WW
Address to jump to, low byte (not used for event type 0)
$XX
Address to jump to, high byte (not used for event type 0)
$YY
The event type
$ZZ How long to wait when using wait types 1 or 2. Note that a value of $00 is treated as $0100
 


Parameter reference

Note

For use with the $DD command. Note that for instrument @2, you must subtract 5 from the value in this table. For @9, add 5. For @15, subtract 8. If you need pitches higher or lower than this, use the multiplier/submultiplier instrument bytes.

Note that you may use a normal note (such as g, f+, o2c, >a-, etc.) instead for this parameter.

c
c+
d
d+
e
f
f+
g
g+
a
a+
b
o1
80
81
82
83
84
85
86
87
88
89
8A
8B
o2
8C
8D
8E
8F
90
91
92
93
94
95
96
97
o3
98
99
9A
9B
9C
9D
9E
9F
A0
A1
A2
A3
o4
A4
A5
A6
A7
A8
A9
AA
AB
AC
AD
AE
AF
o5
B0
B1
B2
B3
B4
B5
B6
B7
B8
B9
BA
BB
o6
BC
BD
BE
BF
C0
C1
C2
C3
C4
C5


Length

For any parameter that requests a length of time (duration, delay, etc.), use this table as reference.

$C0
Whole note
$80
Whole triplet
$60
Half note
$40
Half triplet
$30
Quarter note
$20
Quarter triplet
$18
Eighth note
$10
Eighth triplet
$0C
16th note
$09
16th triplet
$06
32nd note
$04
32nd triplet
$03
64th note
$02
64th triplet

Any value in between these may be used as well. For example, $48 is equal to a quarter note tied to an eighth note.

ADSR

Click on a value in the table to modify the graph.
Value Attack (seconds)
Decay (seconds)
Sustain (% of normal)
Release (seconds)
00
1/8
01 2/8
02 3/8
03 4/8
04 5/8
05 6/8
06 7/8
07 1
08
09
0A
0B
0C
0D
0E
0F 0
10
11
12
13
14
15
16
17
18
19
1A
1B
1C
1D
1E
1F

Your browser does not support canvases. The author recommends actually using a competent browser.
Time (seconds)

Zoom inZoom out


DSP Register Reference

$x0 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 $xA $xB $xC $xD $xE $xF
$0x Right channel volume Left channel volume Pitch (low byte) Pitch (high byte) Sample ADSR 1 ADSR 2 Gain Current envelope value Current sample value
(null)
(null)
$0C rw MVOLL
Left channel master volume
$0D rw EFB
Echo feedback
(null)
$0F rw FIR0
FIR coefficient 0
$1x
(null)
(null)
$1C rw MVOLR
Right channel master volume
(null)
(null)
$1F rw FIR1
FIR coefficient 1
$2x
(null)
(null)
$2C rw EVOLL
Left channel echo
$2D rw PMON
Pitch modulation enable
(null)
$2F rw FIR2
FIR coefficient 2
$3x
(null)
(null)
$3C rw EVOLR
Right channel echo
$3D rw NON
Noise enable
(null)
$3F rw FIR3
FIR coefficient 3
$4x
(null)
(null)
$4C rw KON
Key on for all voices
$4D rw EON
Echo enable
(null)
$4F rw FIR4
FIR coefficient 4
$5x
(null)
(null)
$5C rw KOFF
Key off for all voices
$5D rw DIR
Sample table address
(null)
$5F rw FIR5
FIR coefficient 5
$x6
(null)
(null)
$6C rw FLG
Reset, mute, echo-reset, noise clock
$6D rw ESA
Echo buffer address
(null)
$6F rw FIR6
FIR coefficient 6
$x7
(null)
(null)
$7C rw ENDX
Voice end flags
$7C rw EDL
Echo delay
(null)
$7F rw FIR7
FIR coefficient 7


Return to the main page