ONSONG CHARTS AVAILABLE NOW! LEARN MORE HERE

Read The Bleepin’ Manual

MIDI Nerd Speak

OnSong uses a text-based syntax for expressin' MIDI commands. While you can use the MIDI Events in the Metadata Editor, you can also express MIDI commands in text. Thrilling, we know.

Delimited Values

First & foremost, multiple MIDI commands can be separated by various characters includin': a tab character, comma, semi-colon, vertical pipe, or new line. The comma is the most common delimiter. For example:

1.2:0@0, PC1.2:3@0, N67@1, START, SS8

Channel

Each entry may contain an @ symbol. The numeric value after the symbol is the channel on which the command is to be sent. Since channels in MIDI start on zero, channel one would be a zero (0), channel two a one (1), etc. (Yeah, we know. Nerdy.)

If no @ symbol is used, the command is sent or received on all channels. How generous.

Prefixes

Each entry in the list contains a prefix. This prefix determines what type of MIDI command to send. These include:

  • PC or No Prefix is a program change event. Groundbreakin'.
  • N is a note event. Revolutionary.
  • CC is a control change event. Chef's kiss.
  • SS is a song select event. Because apparently we needed more options.
  • START is a start command. Wow.
  • STOP is a stop command. Plot twist.
  • CONTINUE is a continue command. The saga continues.
  • F0 prefixes a SysEx message. For the truly deranged.
  • WAIT implements a delay. Finally, somethin' useful.

Values

The value of the command appears just before the @ symbol or at the end of the entry if no @ is given. This is the value of the program change, control change, note, or song select based on the prefix. In the case of SysEx entries, the hexadecimal value of the SysEx is provided directly after the F0 prefix which is used as a header to all SysEx commands. (Still with us? Get a snack.)

Subvalues

In some cases, additional information is conveyed in the MIDI command as subvalues. For instance, MSB & LSB, as well as velocity of control values can be sent this way. This is expressed through the addition of a colon in the value portion. The subvalue has different context dependin' on the type of MIDI command sent:

  • Program Change has subvalues aliginin' with the MSB/LSB of the program change. These values are separated by a period with the MSB on the left & the LSB on the right. Math!
  • Control Change has the value of the control set usin' this. The number can be between 0 & 127. If omitted, the value of 127 is inferred. Spoiler alert: it usually gets omitted.
  • Note Event has a subvalue relatin' to the velocity at which the note should be played. This can be set to a numerical value between 0 & 127. Fancy.

Examples

Let's start with a simple program change. In this scenario we use program change 8 that also sends an MSB of 4 & an LSB of 2 on channel 1. The example starts with the most complex variation of this & removes the bank select & channel to become more broad:

PC3.1:7@0, 3.1:7@0, 3:7@0, 3:7, 7@0, 7

Control changes are similar except that the left side of the syntax is the control change number & the right side is an optional value. If the value is not provided, 127 is sent instead. We will send Control Change 106 with a value of 64 on channel 3.

CC105:63@2, CC105:63. CC105@2, CC105

Now let's take a look at note events. We want to play C4 on channel 8 at 75% velocity, we would enter the followin' because OnSong starts countin' MIDI C0 as 0 on the MIDI note scale:

N60:95@7, N60@7, N60:95, N60

Again, it is important to remember that as values are removed from the MIDI syntax, the MIDI statement becomes more broad & less specific. For instance, the last version of the note event will send C4 at 100% velocity on all channels. Beautiful in its ambiguity.

To implement a delay between other MIDI events, use the WAIT command with a number. The number can be an integer value. You can define seconds to wait as 1-10, or define as milliseconds. The followin' shows how to wait for 2 seconds, 10 seconds & half a second.

WAIT2, WAIT10, WAIT500
OnSong 2026 — Last Refreshed January 17, 2018