Rpp Midi Format Draft

From CockosWiki

Revision as of 19:07, 31 January 2010 by AudiOishi (Talk | contribs)
Jump to: navigation, search

In RPP files and text returned by function calls to RPR GetSetItemState and RPR GetSetTrackState, midi messages are encoded in lines of text. With the exception of System Exclusive MIDI messages, each line contains 5 to 8 fields delimited by spaces, and is terminated by a return character.

The first character of field 1 (the "state field") indicates the format of the following fields to expect on the current line.


First Character in a Line = 'e' or 'E'

All lines beginning with e or E will be in the format:

state tick_offset hex1 hex2 hex3 [prequantized_offset]
Field Function
state The state field indicates if the midi message is selected and/or muted in the reaper midi editor.
  • e - MIDI message
  • E - MIDI message, selected in the MIDI editor
  • em or Em - muted note midi message (lower case if event is selected) (can non-note midi events be muted?)
tick_offset Number of midi ticks(AddLink) between this midi message and the previous midi message in the current item.
hex1, hex2, hex3 Each hex field is the two character hexcode for the a bytes of the midi message according to the Midi Spec. hex3 will be '00' for midi messages with only two bytes(verify).
tick_offset Number of MIDI Ticks between this midi message and the previous midi message in the current item.
[prequantized_offset] Optional field only exists for midi events that have been quantized. It is the difference between the note's position and where its position was before it was quantized


First Character in a Line = 'x' or 'X'

If the tick_offset or prequantized_offset would be larger than 2^32 (about 4 billion ticks), then an alternate format is used:

state tick_offset1 tick_offset2 hex1 hex1 hex3 [prequantized_offset1 prequantized_offset2]
Field Function
state
  • X = Extended message
  • x = Extended message, selected in the MIDI editor
  • xm or Xm = muted extended note (lower case if event is selected)
tick_offset1, tick_offset2 When the first character of a line is an X or x, the number of midi ticks between this midi event and the previous midi event are encoded as the sum of tick_offset1 and tick_offset2
prequantized_offset1, prequantized_offset2 When the first character of a line is an X or x, the difference between the note's position and where its position was before it was quantized is encoded as the sum of prequantized_offset1 and prequantized_offset2
Personal tools