summaryrefslogtreecommitdiff
path: root/docs/music_commands.md
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2018-01-22 01:06:48 -0500
committerGitHub <noreply@github.com>2018-01-22 01:06:48 -0500
commitc60f1331fef22b886adf3472d2b4f348832cfaf7 (patch)
tree5a471fad61e406f5b3ca1aba67ced0186de01c52 /docs/music_commands.md
parentf27f79488a460f0a89670f3611e1e9e175baf5d6 (diff)
parent7fba864883732ccecb1221ae7ff97492d112362a (diff)
Merge pull request #456 from Rangi42/master
OAM data documentation; move more content into data/; move palettes into gfx/; more code+script constants; consistent map naming
Diffstat (limited to 'docs/music_commands.md')
-rw-r--r--docs/music_commands.md110
1 files changed, 76 insertions, 34 deletions
diff --git a/docs/music_commands.md b/docs/music_commands.md
index 7f7bd8b32..3329f8df1 100644
--- a/docs/music_commands.md
+++ b/docs/music_commands.md
@@ -5,27 +5,32 @@ Defined in [macros/scripts/audio.asm](/macros/scripts/audio.asm) and [audio/engi
*See also: [Sound Engine Commands](https://github.com/pret/pokecrystal/wiki/Sound-Engine-Commands)*
-## `musicheader` *n*, *index*, *address*
+## <code>musicheader <i>n</i>, <i>index</i>, <i>address</i></code>
-## `note` *pitch*, *length*
+
+## <code>note <i>pitch</i>, <i>length</i></code>
(Used on all channels)
The high nibble is the note to play. 0 is rest, 1 is `C_`, 2 is `C#`, etc; `$C` is `B_`.
The low nibble is the length of the note. 1 gets added to this, so 0 still has a length.
-## `sound` *pitch*, *octave*, *intensity*, *frequency*
-## `noise` *pitch*, *duration*, *intensity*, *frequency*
+## <code>sound <i>pitch</i>, <i>octave</i>, <i>intensity</i>, <i>frequency</i></code>
+
+
+## <code>noise <i>pitch</i>, <i>duration</i>, <i>intensity</i>, <i>frequency</i></code>
-## `$D0`−`$D7`: `octave` *n*
+
+## `$D0`−`$D7`: <code>octave <i>n</i></code>
(Used in channels 1-3)
Sets the octave for the notes played on the channel.
`$D7` is the lowest octave, whereas `$D0` is the highest.
-## `$D8`: `notetype` *length*[, *intensity*]
+
+## `$D8`: <code>notetype <i>length</i>[, <i>intensity</i>]</code>
(Used in channels 1-4) (When using in channel 4, the *intensity* byte is not needed)
@@ -34,7 +39,8 @@ The first byte only reads the lower 4 bits, and multiplies it by the note length
The second byte is identical to the first byte in the `intensity` command.
-## `$D9`: `pitchoffset` *octave*, *key*
+
+## `$D9`: <code>pitchoffset <i>octave</i>, <i>key</i></code>
(Used in channels 1-3)
@@ -42,7 +48,8 @@ Transposes all notes played on the channel by a value.
The high nibble determins how many octaves to subtract, while the low nibble is how many note values to add.
Ex: Setting a value of `$13` would make a `C_`4 play as a `D#`3.
-## `$DA`: `tempo` *tempo*
+
+## `$DA`: <code>tempo <i>tempo</i></code>
(Used in channel 1)
@@ -53,7 +60,8 @@ This formula also works backwards to convert BPM to tempo: Tempo = 19200 / BPM
Only set or change this value when all playing channels are triggering a note or rest at the same time, otherwise desyncs may happen.
-## `$DB`: `dutycycle` *duty_cycle*
+
+## `$DB`: <code>dutycycle <i>duty_cycle</i></code>
(Used on channels 1&2)
@@ -64,7 +72,8 @@ Sets the square duty (sound) for the current channel. To change the sound for ch
- 2 = 50% waveform: `____¯¯¯¯`
- 3 = 75% waveform: `__¯¯¯¯¯¯` (sounds the same as 25%)
-## `$DC`: `intensity` *intensity*
+
+## `$DC`: <code>intensity <i>intensity</i></code>
(Used on channels 1-3) (Used to set instrument on channel 3)
@@ -74,9 +83,11 @@ This sets the volume and fade of the notes. The high nibble is the starting volu
For channel 3:
The high nibble sets the volume of channel 3. Only 4 values are accepted (0=Mute, 1=100% volume, 2=50% volume, 3=25% volume). The low nibble sets the instrument/waveform for channel 3 to play. Crystal natively has 10 instruments, values 0-9.
-## `$DD`: `soundinput` *input*
-## `$DE`: `sound_duty` *a*, *b*, *c*, *d*
+## `$DD`: <code>soundinput <i>input</i></code>
+
+
+## `$DE`: <code>sound_duty <i>a</i>, <i>b</i>, <i>c</i>, <i>d</i></code>
(Used on channels 1&2)
@@ -84,9 +95,11 @@ This cycles the channel through 4 duty definitions, one per frame.
Each pair of bits defines a duty, same as the `dutycycle` command.
This is mostly only used in cries, SFX, and Jigglypuff's song in RBY.
+
## `$DF`: `togglesfx`
-## `$E0`: `slidepitchto` *duration*, *octave*, *pitch*
+
+## `$E0`: <code>slidepitchto <i>duration</i>, <i>octave</i>, <i>pitch</i></code>
(Used on channel 1)
@@ -95,7 +108,8 @@ The first byte tells how many frames to play the destination note for, before th
The high nibble of the second byte is the octave of the destination note.
The low nibble of the second byte is the destination note. If rest is used as the destination note, then the whole destination pitch becomes `$0000` (the lowest pitch).
-## `$E1`: `vibrato` *delay*, *extent*
+
+## `$E1`: <code>vibrato <i>delay</i>, <i>extent</i></code>
(Used on channels 1-3)
@@ -105,20 +119,23 @@ Second byte, high nibble is the speed timer. It will decrement by one each frame
Second byte, low nibble is the pitch depth. Half of this value will alternate between adding to the pitch, and subtracting from the pitch each time speed timer resets. When this is an odd number, the value added to the pitch will be greater than the value subtracted from the pitch.
Ex: normal pitch of 405, if pitch depth = 3, it will alternate between 407 and 404. Speed timer does NOT reset when a new note is played. only when the song stops or changes. (Also, because a timer counts 0, a timer of 5 will take 6 frames to change.)
-## `$E2`: `unknownmusic0xe2` *unknown*
-## `$E3`: `togglenoise` *id*
+## `$E2`: <code>unknownmusic0xe2 <i>unknown</i></code>
+
+
+## `$E3`: <code>togglenoise <i>id</i></code>
(Used on channel 4)
Sets the "drum kit" to be used. This needs to be called before channel 4 can make any noise.
Calling it more than once in a song will mute the channel. (Keep it out of loops!)
-## `$E4`: `panning` *tracks*
-## `$E5`: `volume` *volume*
+## `$E4`: <code>panning <i>tracks</i></code>
-## `$E6`: `tone` *tone*
+## `$E5`: <code>volume <i>volume</i></code>
+
+## `$E6`: <code>tone <i>tone</i></code>
(Used on channel 1-3)
@@ -126,52 +143,77 @@ This modifies the pitch of the notes (fine tuning).
It makes notes sound better if multiple channels play the same note simultaneously.
A lot of GSC songs set the main melody channel with a value of 1, and the secondary channel (not bass) as 2.
-## `$E7`: `unknownmusic0xe7` *unknown*
-## `$E8`: `unknownmusic0xe8` *unknown*
+## `$E7`: <code>unknownmusic0xe7 <i>unknown</i></code>
+
+
+## `$E8`: <code>unknownmusic0xe8 <i>unknown</i></code>
+
+
+## `$E9`: <code>tempo_relative <i>value</i></code>
-## `$E9`: `tempo_relative` *value*
-## `$EA`: `restartchannel` *address*
+## `$EA`: <code>restartchannel <i>address</i></code>
-## `$EB`: `newsong` *id*
-## `$EC`: `sfxpriorityon`
+## `$EB`: <code>newsong <i>id</i></code>
-## `$ED`: `sfxpriorityoff`
-## `$EE`: `unknownmusic0xee` *address*
+## `$EC`: <code>sfxpriorityon</i></code>
-## `$EF`: `stereopanning` *tracks*
-## `$F0`: `sfxtogglenoise` *id*
+## `$ED`: <code>sfxpriorityoff</i></code>
+
+
+## `$EE`: <code>unknownmusic0xee <i>address</i></code>
+
+
+## `$EF`: <code>stereopanning <i>tracks</i></code>
+
+
+## `$F0`: <code>sfxtogglenoise <i>id</i></code>
+
## `$F1`: `music0xf1`
+
## `$F2`: `music0xf2`
+
## `$F3`: `music0xf3`
+
## `$F4`: `music0xf4`
+
## `$F5`: `music0xf5`
+
## `$F6`: `music0xf6`
+
## `$F7`: `music0xf7`
+
## `$F8`: `music0xf8`
+
## `$F9`: `unknownmusic0xf9`
-## `$FA`: `setcondition` *condition*
-## `$FB`: `jumpif` *condition*, *address*
+## `$FA`: <code>setcondition <i>condition</i></code>
+
+
+## `$FB`: <code>jumpif <i>condition</i>, <i>address</i></code>
+
+
+## `$FC`: <code>jumpchannel <i>address</i></code>
+
+
+## `$FD`: <code>loopchannel <i>count</i>, <i>address</i></code>
-## `$FC`: `jumpchannel` *address*
-## `$FD`: `loopchannel` *count*, *address*
+## `$FE`: <code>callchannel <i>address</i></code>
-## `$FE`: `callchannel` *address*
## `$FF`: `endchannel`