Old 07-14-2014, 02:42 AM   #1
bennetng
Human being with feelings
 
Join Date: Jun 2010
Posts: 264
Default Help parsing MIDI data

I've searched many websites about MIDI specs, one thing I don't understand is the channel messages. For example, all websites I have searched say pitch bend is a 3-byte message, for example e0 7f 7f means pitch bend at channel 1, 7f 7f is a 7-bit encoded message means 16383 in decimal. But when I insert another pitch bend message, I can't find the first byte (E0) anymore. What I get is

00 e0 7f 7f 9e 00 00 48 00 ff 2f 00

00: delta time
e0 7f 7f: pitch bend at ch1, value 16383
9e 00: delta time
00 48 00: pitch bend value 9216, but why the first byte is 00, not e0?
00: delta time
ff 2f 00: end of track

I've attached the midi file, please help, thanks!

Last edited by bennetng; 05-21-2017 at 11:07 AM.
bennetng is offline   Reply With Quote
Old 07-14-2014, 03:03 AM   #2
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

I think that the answer lies in "Running Status":

Quote:
Originally Posted by JG Glatt's MIDI Spec
The MIDI spec allows for a MIDI message to be sent without its Status byte (i.e., just its data bytes are sent) as long as the previous, transmitted message had the same Status. This is referred to as running status.

Running status is simply a clever scheme to maximize the efficiency of MIDI transmission (by removing extraneous Status bytes). The basic philosophy of running status is that a device must always remember the last Status byte that it received (except for Real-Time), and if it doesn't receive a Status byte when expected (on subsequent messages), it should assume that it's dealing with a running status situation.

A device that generates MIDI messages should always remember the last Status byte that it sent (except for Real-Time), and if it needs to send another message with the same Status, the Status byte may be omitted.
Please see the topic here:
http://home.roadrunner.com/~jgglatt/tech/midispec.htm
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 07-14-2014, 06:50 AM   #3
bennetng
Human being with feelings
 
Join Date: Jun 2010
Posts: 264
Default

Thank you very much
bennetng is offline   Reply With Quote
Old 07-15-2014, 01:21 AM   #4
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

You're welcome
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.