update format

This commit is contained in:
Nico 2022-01-09 13:22:02 +00:00
parent 164e9b1321
commit 34ca2153b5
1 changed files with 4 additions and 3 deletions

View File

@ -20,7 +20,7 @@ A file is overall structured into these parts:
## File Header
The header is 2 bytes. The high nibble of the first byte is used for flags (detailed below). The low nibble is used for the default speed, measured in how many screen vector cycles it takes to advance 1 line in a pattern. The second byte stores the number of patterns in the file.
The header is 3 bytes. The high nibble of the first byte is used for flags (detailed below). The low nibble is used for the default speed, measured in how many screen vector cycles it takes to advance 1 line in a pattern. The second byte stores the number of patterns in the file and the third byte stores the number of instruments in the file.
```
first header byte
@ -47,13 +47,14 @@ a song row is 4 bytes. Each byte is a pattern number, with the first byte being
## Patterns
Patterns contain a short containing the length of the pattern, and 0x10 lines of note data. Patterns are ordered sequentially in the file and there can be up to 255 patterns in a file.
Patterns contain a short containing the size of the pattern in bytes, and 0x10 lines of note data. Patterns are ordered sequentially in the file and there can be up to 255 patterns in a file.
### Pattern lines
A pattern line consists of either 1 or 3 bytes, depending on if the most significant bit of the first byte is high. The 7 remaining bits of the first byte are the note value, with the MSB being set if the line contains an effect and not otherwise. If the line contains an effect, the next two bytes contain an effect and a parameter for that effect.
A pattern line consists of either 1 or 3 bytes, depending on if the most significant bit of the first byte is high. The 7 remaining bits of the first byte are the note value, with the MSB being set if the line contains an effect and not otherwise. If the line contains an effect, the next two bytes contain an effect and a parameter for that effect. No note is represented by the byte 00. 0x7f represents a note off/note stop.
### Effects
(what an effect should be drawn as in an editor is in parenthesis)
More soon probably