📄 midiformat.htm
字号:
lists meta-events which have no midi channel number. they<BR>are of the
format:<BR><BR>ff xx nn dd<BR><BR>all meta-events start with ff followed
by the command (xx), the length, or<BR>number of bytes that will contain
data (nn), and the actual data (dd).<BR><BR>hex binary data
description<BR>00 00000000 nn ssss sets the track's sequence
number.<BR>nn=02 (length of 2-byte sequence number)<BR>ssss=sequence
number<BR><BR>01 00000001 nn tt .. text event- any text you
want.<BR>nn=length in bytes of text<BR>tt=text characters<BR><BR>02
00000010 nn tt .. same as text event, but used for<BR>copyright
info.<BR>nn tt=same as text event<BR><BR>03 00000011 nn tt .. sequence or
track name<BR>nn tt=same as text event<BR><BR>04 00000100 nn tt .. track
instrument name<BR>nn tt=same as text event<BR><BR>05 00000101 nn tt ..
lyric<BR>nn tt=same as text event<BR><BR>06 00000110 nn tt .. marker<BR>nn
tt=same as text event<BR><BR>07 00000111 nn tt .. cue point<BR>nn tt=same
as text event<BR><BR>2f 00101111 00 this event must come at the end of
each<BR>track<BR><BR>51 01010001 03 tttttt set
tempo<BR>tttttt=microseconds/quarter note<BR><BR>58 01011000 04 nn dd ccbb
time signature<BR>nn=numerator of time sig.<BR>dd=denominator of time sig.
2=quarter<BR>3=eighth, etc.<BR>cc=number of ticks in metronome
click<BR>bb=number of 32nd notes to the quarter<BR>note<BR><BR>59 01011001
02 sf mi key signature<BR>sf=sharps/flats (-7=7 flats, 0=key of c,<BR>7=7
sharps)<BR>mi=major/minor (0=major, 1=minor)<BR><BR>7f 01111111 xx dd ..
sequencer specific information<BR>xx=number of bytes to be sent<BR>dd=data
<BR>the following table lists system messages which control the entire
system.<BR>these have no midi channel number. (these will generally only
apply to<BR>controlling a midi keyboard, etc.)<BR><BR>hex binary data
description<BR>f8 11111000 timing clock used when synchronization
is<BR>required.<BR><BR>fa 11111010 start current sequence<BR><BR>fb
11111011 continue a stopped sequence where left<BR>off<BR><BR>fc 11111100
stop a sequence<BR><BR><BR>the following table lists the numbers
corresponding to notes for use in note <BR>on and note off
commands.<BR><BR><BR>octave|| note numbers<BR># ||<BR>|| c | c# | d | d# |
e | f | f# | g | g# | a | a# |
b<BR>-----------------------------------------------------------------------------<BR>0
|| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11<BR>1 || 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23<BR>2 || 24 | 25 | 26 | 27 | 28
| 29 | 30 | 31 | 32 | 33 | 34 | 35<BR>3 || 36 | 37 | 38 | 39 | 40 | 41 |
42 | 43 | 44 | 45 | 46 | 47<BR>4 || 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55
| 56 | 57 | 58 | 59<BR>5 || 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
69 | 70 | 71<BR>6 || 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82
| 83<BR>7 || 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
95<BR>8 || 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 |
107<BR>9 || 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 |
118 | 119<BR>10 || 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127
|<BR><BR><BR>bibliography<BR><BR>"midi systems and control" francis rumsey
1990 focal press<BR><BR>"midi and sound book for the atari st" bernd
enders and wolfgang klemme<BR>1989 m&t publishing, inc.<BR><BR>midi
file specs and general midi specs were also obtained by sending
e-mail<BR>to listserv@auvm.american.edu with the phrase get midispec
package<BR>in the message.<BR><BR><BR>-------------------------------
dec.cpp ------------------------------------<BR><BR>/* file
dec.cpp<BR><BR>by dustin caldwell
(dustin@gse.utah.edu)<BR><BR>*/<BR><BR><BR>#include
<dos.h><BR>#include <stdio.h><BR>#include
<stdlib.h><BR><BR>void helpdoc();<BR><BR>main()<BR>{<BR>file
*fp;<BR><BR>unsigned char ch, c;<BR><BR>if((fp=fopen(_argv[1],
"rb"))==null) /* open file to read */<BR>{<BR>printf("cannot open file
%s\n",_argv[1]);<BR>helpdoc();<BR>exit(-1);<BR>}<BR><BR>c=0;<BR>ch=fgetc(fp);<BR><BR>while(!feof(fp))
/* loop for whole file */<BR>{<BR>printf("%u\t", ch); /* print every
byte's decimal equiv. */<BR>c++;<BR>if(c>8) /* print 8 numbers to a
line
*/<BR>{<BR>c=0;<BR>printf("\n");<BR>}<BR><BR>ch=fgetc(fp);<BR>}<BR><BR>fclose(fp);
/* close up */<BR>}<BR><BR>void helpdoc() /* print help message
*/<BR>{<BR>printf("\n binary file decoder\n\n");<BR><BR>printf("\n syntax:
dec binary_file_name\n\n");<BR><BR>printf("by dustin caldwell
(dustin@gse.utah.edu)\n\n");<BR>printf("this is a filter program that
reads a binary file\n");<BR>printf("and prints the decimal equivalent of
each byte\n");<BR>printf("tab-separated. this is mostly useful when piped
\n");<BR>printf("into another file to be edited manually.
eg:\n\n");<BR>printf("c:\>dec sonata3.mid >
son3.txt\n\n");<BR>printf("this will create a file called son3.txt which
can\n");<BR>printf("be edited with any ascii editor.
\n\n");<BR>printf("(rec.exe may also be useful, as it reencodes the
\n");<BR>printf("ascii text file).\n\n");<BR>printf("have
fun!!\n");<BR>}<BR><BR>---------------------------- rec.cpp
----------------------------------<BR><BR>/* file rec.cpp<BR>by dustin
caldwell (dustin@gse.utah.edu)<BR>*/<BR><BR>#include
<dos.h><BR>#include <stdio.h><BR>#include
<ctype.h><BR>#include <stdlib.h><BR><BR>void
helpdoc();<BR><BR>main()<BR>{<BR>file *rfp, *wfp;<BR><BR>unsigned char ch,
c;<BR>char s[20];<BR><BR>if((rfp=fopen(_argv[1], "r"))==null) /* open the
read file */<BR>{<BR>printf("cannot open file %s
\n",_argv[1]);<BR>helpdoc();<BR>exit(-1);<BR>}<BR><BR>if((wfp=fopen(_argv[2],
"wb"))==null) /* open the write file */<BR>{<BR>printf("cannot open file
%s
\n",_argv[1]);<BR>helpdoc();<BR>exit(-1);<BR>}<BR><BR>c=0;<BR><BR>ch=fgetc(rfp);<BR><BR>while(!feof(rfp))
/* loop for whole file */<BR>{<BR><BR>if(isalnum(ch)) /* only 'see' valid
ascii chars */<BR>{<BR>c=0;<BR>while(isdigit(ch)) /* only use decimal
digits (0-9) */<BR>{<BR>s[c]=ch; /* build a string containing the number
*/<BR>c++;<BR>ch=fgetc(rfp);<BR>}<BR>s[c]=null; /* must have null
terminator */<BR><BR>fputc(atoi(s), wfp);/* write the binary equivalent to
file */<BR><BR>}<BR><BR>ch=fgetc(rfp); /* loop until next number starts
*/<BR><BR><BR>}<BR><BR>fclose(rfp); /* close up
*/<BR>fclose(wfp);<BR>}<BR><BR><BR>void helpdoc() /* print help message
*/<BR>{<BR>printf("\n text file encoder\n\n");<BR><BR>printf("\n syntax:
rec text_file_name binary_file_name\n\n");<BR><BR>printf("by dustin
caldwell (dustin@gse.utah.edu)\n\n");<BR>printf("this is a program that
reads an ascii tab-\n");<BR>printf("delimited file and builds a binary
file where\n");<BR>printf("each byte of the binary file is one of the
decimal\n");<BR>printf("digits in the text file.\n");<BR>printf("
eg:\n\n");<BR>printf("c:\>rec son3.txt son3.mid\n\n");<BR>printf("(this
will create a file called son3.mid which is\n");<BR>printf("a valid binary
file)\n\n");<BR>printf("(dec.exe may also be useful, as it decodes binary
files)\n\n");<BR>printf("have
fun!!\n");<BR>}</TD></TR></TBODY></TABLE></CENTER></DIV>
<P align=center><A
href="http://thns.tsinghua.edu.cn/thnsebooks/Program%20Technology/File%20Format%20Specification/Etc/file_format/index.htm">返回</A></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -