ONSONG CHARTS AVAILABLE NOW! LEARN MORE HERE

Read The Bleepin’ Manual

MIDI Nerding 101

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. (Because apparently we needed two ways to do this. You're welcome.)

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. (Math! You're gonna love it.)

If no @ symbol is used, the command is sent or received on all channels. (Go big or go home, amirite.)

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. (Fancy speak for "do a thing.")
  • N is a note event (Play some notes, genius.)
  • CC is a control change event. (Tweak ALL the knobs!)
  • NRPN is a non-register parameter number. (Acronym overload—we know.)
  • SS is a song select event. (Pick a song, any song.)
  • START is a start command. (Go go go!)
  • STOP is a stop command. (Halt, hammertime.)
  • CONTINUE is a continue command. (Keep on truckin'.)
  • WAIT waits a specific amount of time before sendin' more events. (Patience, young grasshopper.)
  • F0 prefixes a SysEx message. (Nerd alert—this one's spicy.)
  • @ prefixes a MIDI global tag. (Reference magic. Spoooky.)

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. (Translation: numbers go brrrr.)

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. (Left-brain thinkin', people.)
  • 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. You can also separate multiple values with a hyphen to step through values. For instance, 127-0 will latch the value of 127 between on & off states. (Flippy-floppy time!)
  • 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. You can step through multiple note velocities by separatin' them with a hyphen. (Louder! Softer! LOUDER AGAIN!)

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. (Living dangerously!)

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: (Buckle up, buttercup.)

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. (Spray & pray, baby.)

We can also delay MIDI by addin' a WAIT command. The followin' will delay the MIDI for 2 second as well as 500 ms (half a second). You can specify seconds as 1-10 seconds or in milliseconds. (Patience is a virtue, but also: WAITING IS BORING.)

WAIT2, WAIT500

Last, we can reference MIDI globals which a preconfigured lists of MIDI events that can be referenced. If you have a MIDI global with "on" as the tag (with no quotes), then you can reference that global with the followin': (OOH FANCY.)

@on
OnSong 2026 — Last Refreshed March 11, 2020