Meta Event
Format
Binary
$FF $[type] $[length] $[data]
Data | Type | Value |
type | Hexadecimal | 00, 01, ... 7F |
length | Binary | 00, 01, ... |
data | Binary | 00, 01, ... |
Text
$FF $[type] "[text]"
Data | Type | Value |
type | Hexadecimal | 00, 01, ... 7F |
text | Strings | a, aa, aaa, ... |
Set Tempo
$FF $51 $03 @[BPM]
Data | Type | Value |
BPM | decimal | 4, 5, 6, ... 60000000 |
Time Signature
$FF $58 $04 [numerator]/[denomirator] $[click][quarter note / 32nd note]
Data | Type | Value |
numerator | decimal | 1, 2, ... |
denomirator | decimal | 1, 2, 4, 8, ... |
click | Hexadecimal | 00, 01, ... |
quarter note / 32nd note | Hexadecimal | (usualy)08 |
Key Signature
$FF $59 02 [number of sharps or flats] [minor or major]
Data | Type | Value |
number of sharps or flats | decimal | ... -2, -1, 0, 1, 2, ... |
minor or major | decimal | (minor)1, (major)0 |
Example
;; TPQN : 480
0 1 0 : $FF $01 "hello world" ;Text Event
: $FF $03 "Track Name" ;Track Name
: $FF $04 "Instrument Name" ;Instrument Name
: $FF $51 $03 @120 ;BPM=120
: $FF $58 $04 4/4 $1808 ;Time Signature=4/4
: $FF $59 $02 1 2 ;B minor
3 1 0 : $FF $2F $00 ;End of Track