From alsa-devel-owner@alsa.jcu.cz  Wed Jul 29 21:28:33 1998
Received: from altrade.nijmegen.inter.nl.net (altrade.nijmegen.inter.nl.net [193.67.237.6])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id VAA01942
	for <alsa-devel@jcu.cz>; Wed, 29 Jul 1998 21:28:00 +0200
Received: from obelix.fvdpol.inter.nl.net by altrade.nijmegen.inter.nl.net
	via bd99-18.Breda.NL.net [193.79.246.243] with ESMTP for <alsa-devel@jcu.cz>
	id VAA28546 (8.8.8/3.28); Wed, 29 Jul 1998 21:27:58 +0200 (MET DST)
Received: (from frank@localhost) by obelix.fvdpol.inter.nl.net (8.8.7/8.7.3) id VAA13315; Wed, 29 Jul 1998 21:25:00 +0200
From: Frank van de Pol <F.K.W.van.de.Pol@inter.nl.net>
Message-Id: <199807291925.VAA13315@obelix.fvdpol.inter.nl.net>
Subject: MIDI Syntax in BNF
To: alsa-devel@jcu.cz (alsa), alsa-devel@jcu.cz (Jaroslav Kysela)
Date: Wed, 29 Jul 1998 21:25:00 +0200 (MET DST)
Content-Type: text
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


Thinking about the percieved MIDI input trouble, perhaps this next copy of
the MIDI spec in Backus-Naur form (BNF) might be handy. I don't know the
exact source, it's on my machine for "ages". If you already have it
somewhere or don't need it just trash it :-)

Regards,
Frank.



The latest issue of the IMA bulletin had an article on BNF for MIDI.  The
article points out that this syntax is what can be TRANSMITTED and the
actual RECEIVER implementation may differ slightly from this grammer. This
may allow greater error tolerance. The example given is that of tranmitting
a system exclusive message without the termination byte <eox> F7. A channel
status byte could also be used to terminate a system exclusive in the event
the eox byte is lost due to error or power down etc...

Definitions 3-17 define running status and realtime data insertion as well as
the various channel messages.

1.  <MIDI Stream> ::=           <MIDI msg> < MIDI Stream>
2.  <MIDI msg> ::=              <sys msg> | <chan msg>
3.  <chan msg> ::=              <chan 1byte msg> |
                                | <chan 2byte msg>
4.  <chan 1byte msg> ::=        <chan stat1 byte> <data singlet>
                                  <running singlets>
5.  <chan 2byte msg> ::=        <chan stat2 byte> <data pair>
                                  <running pairs>
6.  <chan stat1 byte> ::=       <chan voice stat1 nibble>
                                  <hex nibble>
7.  <chan stat2 byte> ::=       <chan voice stat2 nibble>
                                  <hex nibble>
8.  <chan voice stat1 nyble>::= C | D
9.  <chan voice stat2 nyble>::= 8 | 9 | A | B | E
10. <hex nyble> ::=             0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
                                | 8 | 9 | A | B | C | D | E | F
11. <data pair> ::=             <data singlet> <data singlet>
12. <data singlet> ::=          <realtime byte> <data singlet> |
                                | <data byte>
13. <running pairs> ::=         <empty> | <data pair> <running pairs>
14. <running singlets> ::=      <empty> |
                                | <data singlet> <running singlets>
15. <data byte> ::=             <data MSD> <hex nyble>
16. <data MSD> ::=              0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
17. <realtime byte> ::=         F8 | FA | FB | FC | FE | FF
18. <sys msg> ::=               <sys common msg> |
                                | <sysex msg> |
                                | <sys realtime msg>
19. <sys realtime msg> ::=      <realtime byte>
20. <sysex msg> ::=             <sysex data byte>
                                  <data singlet> <running singlets>
                                  <eox byte>
21. <sysex stat byte> ::=       F0
22. <eox byte> ::=              F7
23. <sys common msg> ::=        <song position msg> |
                                | <song select msg> |
                                | <tune request>
24. <tune request> ::=          F6
25. <song position msg> ::=     <song position stat byte>
                                  <data pair>
26. <song select msg> ::=       <song select stat byte>
                                  <data singlet>
27. <song position stat byte>::=F2
28. <song select stat byte> ::= F3


+---- --- -- -  -   -    - 
|Frank van de Pol                  -o)
|F.K.W.van.de.Pol@inter.NL.net     /\\
|                                 _\_v
|Linux - Why use Windows, since there is a door?
|
|ALSA Sequencer: http://www.inter.nl.net/users/F.K.W.van.de.Pol/alsa/

