⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mid1.htm

📁 各种文件格式说明及程序描述
💻 HTM
📖 第 1 页 / 共 2 页
字号:
    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&#12;<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>
    &quot;midi systems and control&quot; francis rumsey 1990 focal press<br>
    <br>
    &quot;midi and sound book for the atari st&quot; bernd enders and wolfgang klemme<br>
    1989 m&amp;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 &lt;dos.h&gt;<br>
    #include &lt;stdio.h&gt;<br>
    #include &lt;stdlib.h&gt;<br>
    <br>
    void helpdoc();<br>
    <br>
    main()<br>
    {<br>
    file *fp;<br>
    <br>
    unsigned char ch, c;<br>
    <br>
    if((fp=fopen(_argv[1], &quot;rb&quot;))==null) /* open file to read */<br>
    {<br>
    printf(&quot;cannot open file %s\n&quot;,_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(&quot;%u\t&quot;, ch); /* print every byte's decimal equiv. */<br>
    c++;<br>
    if(c&gt;8) /* print 8 numbers to a line */<br>
    {<br>
    c=0;<br>
    printf(&quot;\n&quot;);<br>
    }<br>
    <br>
    ch=fgetc(fp);<br>
    }<br>
    <br>
    fclose(fp); /* close up */<br>
    }<br>
    <br>
    void helpdoc() /* print help message */<br>
    {<br>
    printf(&quot;\n binary file decoder\n\n&quot;);<br>
    <br>
    printf(&quot;\n syntax: dec binary_file_name\n\n&quot;);<br>
    <br>
    printf(&quot;by dustin caldwell (dustin@gse.utah.edu)\n\n&quot;);<br>
    printf(&quot;this is a filter program that reads a binary file\n&quot;);<br>
    printf(&quot;and prints the decimal equivalent of each byte\n&quot;);<br>
    printf(&quot;tab-separated. this is mostly useful when piped \n&quot;);<br>
    printf(&quot;into another file to be edited manually. eg:\n\n&quot;);<br>
    printf(&quot;c:\&gt;dec sonata3.mid &gt; son3.txt\n\n&quot;);<br>
    printf(&quot;this will create a file called son3.txt which can\n&quot;);<br>
    printf(&quot;be edited with any ascii editor. \n\n&quot;);<br>
    printf(&quot;(rec.exe may also be useful, as it reencodes the \n&quot;);<br>
    printf(&quot;ascii text file).\n\n&quot;);<br>
    printf(&quot;have fun!!\n&quot;);<br>
    }<br>
    <br>
    ---------------------------- rec.cpp ----------------------------------<br>
    <br>
    /* file rec.cpp<br>
    by dustin caldwell (dustin@gse.utah.edu)<br>
    */<br>
    <br>
    #include &lt;dos.h&gt;<br>
    #include &lt;stdio.h&gt;<br>
    #include &lt;ctype.h&gt;<br>
    #include &lt;stdlib.h&gt;<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], &quot;r&quot;))==null) /* open the read file */<br>
    {<br>
    printf(&quot;cannot open file %s \n&quot;,_argv[1]);<br>
    helpdoc();<br>
    exit(-1);<br>
    }<br>
    <br>
    if((wfp=fopen(_argv[2], &quot;wb&quot;))==null) /* open the write file */<br>
    {<br>
    printf(&quot;cannot open file %s \n&quot;,_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(&quot;\n text file encoder\n\n&quot;);<br>
    <br>
    printf(&quot;\n syntax: rec text_file_name binary_file_name\n\n&quot;);<br>
    <br>
    printf(&quot;by dustin caldwell (dustin@gse.utah.edu)\n\n&quot;);<br>
    printf(&quot;this is a program that reads an ascii tab-\n&quot;);<br>
    printf(&quot;delimited file and builds a binary file where\n&quot;);<br>
    printf(&quot;each byte of the binary file is one of the decimal\n&quot;);<br>
    printf(&quot;digits in the text file.\n&quot;);<br>
    printf(&quot; eg:\n\n&quot;);<br>
    printf(&quot;c:\&gt;rec son3.txt son3.mid\n\n&quot;);<br>
    printf(&quot;(this will create a file called son3.mid which is\n&quot;);<br>
    printf(&quot;a valid binary file)\n\n&quot;);<br>
    printf(&quot;(dec.exe may also be useful, as it decodes binary files)\n\n&quot;);<br>
    printf(&quot;have fun!!\n&quot;);<br>
    }</td>
  </tr>
</table>
</center></div>

<p align="center"><a href="../index.htm">返回</a></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -