In the Standard MIDI File specification, information stored within a Standard MIDI File that is not supposed to be sent to a synthesizer as MIDI messages is referred to as meta-events. This includes tempo, time signature, key signature, title, and so on. This chapter explains how to specify these.
The tempo is specified as the number of quarter notes per minute using $tempo(number).
If not specified, the default tempo is 125. You can change the tempo at any point during the song.
$tempo(168) [__g+ _g+]***
$tempo(140) {[__c+ _c+] $tempo(168) _g+c+ec+_g+}*/6 {_c+_g+c+ec+_g+}*/6
If you want to gradually change the tempo, such as with ritardandos, please refer to Chapter 11 “Continuous Changes.”
The time signature is specified as $timesig(numerator,denominator). If not specified, it is treated as 4/4 time.
$timesig(3,4) cde $timesig(5,8) {ccccc}/ $timesig(2+3+2,8) {ccccccc}/

The last time signature above can also be written as $timesig(7,8), which is handled identically by Pytakt, but the notation above is helpful to show how the time signature is composed (the staff notation is just a reference and may not be converted as shown).
For pieces with an anacrusis, specify a short time signature in the first measure as shown in the example below. Since standard MIDI files lack specifications for anacrusis, handling of MIDI files containing such time signatures may vary across music software. However, at least in Pytakt and MuseScore, the first measure is automatically recognized as an incomplete measure due to the anacrusis.
$timesig(1,4) {c.c/}/ $timesig(3,4) dcf e~

$timesig(3,8) L8 _bcd $timesig(4,4) e~~deage dc_a~r

To include key signature information in the song data, use $keysig as shown below. This is independent of the automatic sharp/flat addition described in Chapter 2. If you wish to use both features, specify both $keysig and key=.
$keysig("D major") df+af+
$keysig("C# minor") c+eg+e
$keysig("Bb minor") _b-d-fd-

Additionally, you can include the following types of information in the song data.
| MML | Meaning |
|---|---|
$title("My First Song") |
Title of the song |
$title("Composer: Gombei Nanashi") |
Composers, etc. (*1) |
$copyright("Copyright (C) 2103 by X. Yzwjwps") |
Copyright notice |
$trackname("Piano RH") |
Track name |
$instname("MT-32 Fantasy") |
Instrument name (Not often used) |
$lyric("Oops!") |
Lyric |
$marker("A") |
Positional marker |
*1 Interpreting text meta-events starting with “Composer: ” as composers, etc. is a rule specific to Pytakt.