nokia用的是rttttl格式 midi format: 标准的MIDI文件格式就像奇异的兽。总体看来,它是那样的让你无法抗拒。当然,你怎样看它无关紧要,可是用足够多的描述符描述一段音乐并使它能够重现,可不是很少的工作就可以完成的。然而,它虽然复杂,但是真正理解之后,MIDI文件格式的结构还是很直观明了的。 在这里我必须放弃一些东西,因为毕竟我不是MIDI也不是MIDI文件专家!最近我为我的PC准备了一块Gravis 超音频音效卡,利用它听完几段MIDI文件(.mid)之后,想:“呵,我要是能够制作自己的MIDI(.mid)文件该多好啊!”嗯,经过烦人的几个小时之后,我发现,那些并不是没有价值的工作。但是,我是不会让一个冗长的文件格式就能够阻止的(此外,我告诉过我的妻子,计算机不是很难用的,而且我十分憎恨当一个伪君子)。那么,在这篇文章中如果发现什么错误,请让我知道,我会修改它的。同时,这份文档的范围并没有提供所有类型的MIDI命令和任何可能的文件配置!这篇基本指南将使读者能够(以中等的时间投资)制作出MIDI类型的文件。 1.概述: 一个MIDI文件基本上由两个部分组成,头块和轨道块。第二节讲述头块,第三节讲述轨道块。一个MIDI文件有一个头块用来描述文件的格式、许多的轨道块等内容。一个轨道可以想象为像一个大型多音轨录音机那样,你可以为某种声音、某种乐谱、某种乐器或者你需要的任何东西分配一个轨道。 2.头块: 头块出现在文件的开头,有三种方式来描述文件。头块看起来一直是这样的: 前4个字节等同于ASCII码MThd,接着MThd之后的4个字节是头的大小。它将一直是00 00 00 00 06,因为现行的头信息将一直是6字节。 ff ff是文件的格式,有3种格式: 单轨,很显然就只有一个轨道。同步多轨意味着所有轨道都是垂直同步的,或者其他的措辞为他们都在同一时间开始,并且可以表现一首歌的不同部分。异步多轨没有必要同时开始,而且可以完全的不同步。 nn nn 是MIDI文件中的轨道数。 3.轨道块: 头块之后剩下的文件部分是轨道块。每一个轨道包含一个头,并且可以包含你所希望的许多MIDI命令。轨道头与文件头及其相似: 4D 54 72 6B xx xx xx xx 与头一致,前4个字节是ASCII吗,这个是MTrk,紧跟MTrk的4个字节给出了以字节为单位的轨道的长度(不包括轨道头)。 在头之下是MIDI事件,这些事件同现行的可以被带有累加的MIDI合成器端口接受和发送的数据是相同的。一个MIDI 事件先于一个delta-time。一个delta-time是一个MIDI事件被执行后的节奏数,每个四分之一音符的节奏数先前已经定义在了文件的头块中。这个delta-time是一个可变长度的编码值。这种格式虽然混乱,可是允许根据需要利用多位表示较大的数值,这不会因为需求小的数值情况下以添零的方式浪费掉一些字节!数值被转换为7位的字节,并且除了最后一个字节以最高有效位是0外,各个字节最有意义的一位是1,。这就允许一个数值被一次一个字节地读取,你如果发现最高有效位是0,则这就是这个数值的最后一位(意义比较小)。依照MIDI说明,全部delta-time的长度最多超过4字节。 delta-time 之后就是MIDI事件,每个MIDI事件(除了正在运行的事件外)带有一个最高有效位总是1的命令字节(值将>128)。大部分命令的列表在附录A中。每个命令都有不同的参数和长度,但是接下来的数据将是最高有效位为零(值将<128)。这里有个例外就是meta-event,最高有效位可以是1。然而,meta-events需要一个长的参数以区分。 微小失误就可以导致混乱的是运行模式,这是现行MIDI命令所忽略的地方,并且最终发行的MIDI命令是假定的。这就意味这如果包含了命令,那么MIDI事件就是由delta-time与参数组成而转换的。 4.综述: 如果这份说明仅仅是使问题更加混乱,那么以下提供的例子可能有助于澄清问题!同时,两个公用程序和一个图解文件包含在这个文档里面: DEC.EXE——这个公共程序是将二进制文件(比如.MID)转换成以十进制表示的对应每个字节的有标记界限的文本文件。 REC.EXE——这个公共程序是将有标记界限的十进制数文本文件对应的每一字节转换成二进制文件。 MIDINOTE.PS——这是一个对应键盘和五线谱的音符数字附录页。 1.MIDI事件命令 每个命令字节有两部分,左nybble(4位)包含现行的命令,右nybble包含将被执行的命令的通道号,这里有16各MIDI通道8个MIDI命令(命令nybble必须最高有效位是1的)。在下表中,X表示MIDI通道号。所有的音符即数据字节都<128(最高有效位是0)。 十六进制 二进制 数据 描述 8x 1000xxxx nn vv 音符关闭 (释放键盘) 9x 1001xxxx nn vv 音符打开 (按下键盘) Ax 1010xxxx nn vv 触摸键盘以后 Bx 1011xxxx cc vv 调换控制 Cx 1100xxxx pp 改变程序(片断) Dx 1101xxxx cc 在通道后接触 Ex 1110xxxx bb tt 改变互相咬和的齿轮 (2000H 表明缺省或没有改变)(什么意思搞不懂:) FF xx nn dd 所有的 meta-events 是以 FF 开头的命令 (xx),长度,或者含在数据的字节数(nn),现行的数据(dd) 十六进制 二进制 数据 描述 01 00000001 nn tt .. 你需要的所有文本事件 02 00000010 nn tt .. 同文本的事件, 但是用于版权信息 03 00000011 nn tt .. 序列或者轨道名 04 00000100 nn tt .. 轨道乐器名 05 00000101 nn tt .. 歌词 06 00000110 nn tt .. 标签 07 00000111 nn tt .. 浮点音符 2F 00101111 00 这个事件一定在每个轨道的结尾出现 51 01010001 03 tttttt 设定拍子 58 01011000 04 nn dd cc bb 拍子记号 59 01011001 02 sf mi 音调符号 7F 01111111 xx dd .. 音序器的详细信息 下表列出了控制整个系统的系统消息。这里没有MIDI通道数 (这些一般仅应用于MIDI键盘等.) 十六进制 二进制 数据 描述 F8 11111000 同步所必须的计时器 下表列出的是与音符相对应的命令标记。 参考资料: **** table 1 - general midi instrument patch map **** prog# instrument prog# instrument (1-8 piano) (9-16 chrom percussion) (17-24 organ) (25-32 guitar) (33-40 bass) (41-48 strings) (49-56 ensemble) (57-64 brass) (65-72 reed) (73-80 pipe) (81-88 synth lead) (89-96 synth pad) (97-104 synth effects) (105-112 ethnic) (113-120 percussive) (121-128 sound effects) midi drum sound midi drum sound 35 acoustic bass drum 59 ride cymbal 2 voices: channe": instruments: note on/note off: controllers: registered description additional channel messages: power-up defaults: /* file dec.cpp by Dustin Caldwell (dustin@gse.utah.edu) */ void helpdoc(); main() unsigned char ch, c; if((fp=fopen(_argv[1], "rb"))==NULL) /* open file to read */ c=0; while(!feof(fp)) /* loop for whole file */ ch=fgetc(fp); fclose(fp); /* close up */ void helpdoc() /* print help message */ printf("\n Syntax: dec binary_file_name\n\n"); printf("by Dustin Caldwell (dustin@gse.utah.edu)\n\n"); ---------------------------- REC.CPP ---------------------------------- /* File rec.cpp #include <dos.h> void helpdoc(); main() unsigned char ch, c; if((rfp=fopen(_argv[1], "r"))==NULL) /* open the read file */ if((wfp=fopen(_argv[2], "wb"))==NULL) /* open the write file */ c=0; ch=fgetc(rfp); while(!feof(rfp)) /* loop for whole file */ if(isalnum(ch)) /* only 'see' valid ascii chars */ fputc(atoi(s), wfp);/* write the binary equivalent to file */ } ch=fgetc(rfp); /* loop until next number starts */ fclose(rfp); /* close up */ printf("\n Syntax: rec text_file_name binary_file_name\n\n"); printf("by Dustin Caldwell (dustin@gse.utah.edu)\n\n");
前一段時間在csdn上问了许多问题,无人解答,高手都不愿意教我,真是郁闷。现在终于
有所收获,现将我个人收藏发布如下,希望各位高手能象我一样 :)
最近在做一个erricsson,nokia铃声的编辑程序,程序中主要麻烦的是发送和试听,试听我是先把文本格式转化成midi,再实现播放。现将其中我收集的铃声格式和midi格式发布如下:
ericsson:
有2种,早期的都是emelody,据我所知,现在只有i68i支持imelody,不过我不知道其余型号
的手机可不可以通过升级软件来支持imelody.
-------------------------------------------------------------------------------------------
eMelody Object
.
eMelody Format
Description: This is a definition of the eMelody object. This object is used when a user-defined
melody is exchanged
Syntax: <emelody-object>
ieBEGIN:EMELODYle<CR><LF>
ieNAME:lE<name><CR><LF>
ilCOMPOSER:l> <composer><CR><LF>
ieVERSION:l> <version><CR><LF>
ivMELODY:lC<melody><CR><LF>
ivEND:EMELODYll
File extension: emy
Example filename mymelody.emy
Parameters:
<version>: "1.0"
<name>: Alphanumeric string
<composer>: Alphanumeric string
<melody>: {<pause>|<tone>}
<pause>: "p"
<tone>: {[<octave_prefix>]<basic_tone>}
<basic_short_tone>: "c"|"d"|"e"|"f"|"g"|"a"|"b"
<ess_short_tone>: "(b)d"|"(b)e"|"(b)g"|"(b)a"|"(b)b"
<iss_short_tone>: "#d"|"#e"|'"#g"|"#a"|"#b"
<basic_long_tone>: "C"|"D"|"E"|"F"|"G"|"A"|"B"
<ess_long_tone>: "(b)D"|"(b)E"|"(b)G"|"(b)A"|"(b)B"
<iss_long_tone>: "#D"|"#E"|"#G"|"#A"|"#B"
<basic_tone>: <basic_short_tone>|<ess_short_tone>|<iss_short_tone>|<basic_long_tone>
|<ess_long_tone>|<iss_long_tone>
<octave_high_prefix>: "+"
Maximum number of
tones:
40
Maximum numbers of
characters in melody:
120
Example: BEGIN:EMELODY
VERSION:1.0
NAME:Test melody 1
COMPOSER:John Smith
MELODY:
+f+a+fa(b)bdcC+GA+d+#c+dfg+daea+d+#c+e+f+e+fa(b)bdC+EA+
d+#c+dfgba+d+#C
END:EMELODY
-------------------------------------------------------------------------------------------
iMelody V1.2 Approved
1. Overview
The iMelody format is a minimal set of tones that can be used to transfer melodies between devices. The definition can
be extended by defining new formats for MIDI/WAV, DTMF, polyphonic etc. The FORMAT field is mandatory, as it is
used to specify the format of the following data.
In all cases, a letter designating a note, style, volume, etc will precede a number.
Example applications include ring tones, alarm tones and power-on melodies.
2. BNF Definition
<imelody -object>::=
"BEGIN:IMELODY"<cr><line- feed>
"VERSION:"<version><cr><line- feed>
"FORMAT:"<format><cr><line- feed>
["NAME:"<characters-not - lf><cr><line- feed>]
["COMPOSER:"<characters-not - lf><cr><line-feed>]
["BEAT:"<beat><cr><line-feed>]
["STYLE:"<style><cr><line- feed>]
["VOLUME:"<volume><cr><line-feed>]
"MELODY:"<melody><cr><line- feed>
"END:IMELODY"<cr><line-feed>
<version>::="1.2"
<format>::"CLASS1.0" | “ CLASS2.0”
<beat>::="25" | "26" | "27" | ... | "899" | "900"
<style>::= "S0" | "S1" | "S2"
<volume- modifier>::=”V+”|”V-“ (changes volume + or – from current volume)
<volume>::="V0" | "V1" | ... | "V15" |<volume- modifier>
<basic- note>::="c" | "d" | "e" | "f" | "g" | "a" | "b"
<ess-note >::="&d" | "&e" | "&g" | "&a" | "&b" (flat notes)
<iss-note >::="#c" | "#d" | "#f" | "#g" | "#a" (sharp notes)
<basic- ess-iss- note >::=<basic-note> | <ess- note> | <iss- note>
<octave-prefix>::=”*0” | "*1" | … | "*8" (A=55Hz) | (A=110Hz) | … | (A=14080 Hz)
<duration>::="0" | "1" | "2" | "3" | "4" | "5"
<duration- specifier>::="." | ":" | “;”
<rest>::="r"
<led>::="ledoff" | "ledon"
<vibe>::="vibeon" | "vibeoff"
<backlight>::=”backon” | “backoff”
<note>::=[<octave-prefix>]<basic-ess- iss-note><duration>[<duration-specifier ]
<silence>::=<rest ><duration>[<duration-specifier]
<repeat>::= “(“{<silence>|<note>|<led>|<vib>|volume>|<backlight>}+ “@”<repeat - count>[<volume- modifier>]”)”
<repeat -count>::="0" | "1" | "2" | … (0 is repeat forever)
<melody>::={<silence>|<note>|<led>|<vib>|<repeat>|<volume>|<backlight>}+
<characters- not -lf >::= 'Any character in the ASCII character-set except <line-feed>.'
Note : no <repeat> block within <repeat> block!(The repeat blocks cannot be nested in this simple CLASS1.0 definition)
Default octave-prefix is *4. I,e, A=880Hz
The volume can optionally be adjusted up, or down, within a repeat block, by including a V+/V- character anywhere
within the repeat block. i.e (#d1r3d2e2@3V+).
The volume changes within a repeat loop continue after the loop is exited.
The default character set is UTF-8.
The file extension is imy. For example “ringring.imy”
The field name (text before the colon) is not case sensitive.
The field value (text after the colon) is case sensitive.
iMelody V1.2 Approved
A maximum length for the melody has not been defined. For interoperability, the length should be kept as short as
possible. Receiving devices must be able to truncate iMelody messages longer than the device's allocated receiving
buffer.
The beat is a decimal representation of the tempo in beats per minute. i.e. a bpm of 63 gives a length of a ¼ note as 0.95
sec. The beat rate has been restricted to values between 25bpm and 900bpm, to place realistic requirements on the
receiving device. A default value of 120 bpm should be used if a beat is not specified.
Lines of text in the iMelody, SHOULD NOT be longer than 75 octets, excluding the line break. Long content lines
SHOULD be split into a multiple line representations, using a line folding technique. That is, a long line can be split
between any two characters, by inserting a CRLF immediately followed by a single linear white space character (i.e.,
SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9).
Duration
Value Duration
0 Full-note
1 1/2-note
2 1/4-note
3 1/8-note
4 1/16- note
5 1/32- note
Duration Specifier
Symbol Duration
No special duration
. Dotted note
: Double dotted note
; 2/3 length
Style
Value Style Ratio of note to rest period
S0 Natural Style (rest between notes), default 20:1
S1 Continuous Style (no rest between notes) No rest
S2 Staccato Style (shorter notes and longer rest period) 1:1
Volume
iMelody V1.2 Approved
Value Volume
V0 tone- off
V1 level-1
V2 level-2
V3 level-3
V4 level-4
V5 level-5
V6 level-6
V7 level-7, default
V8 level-8
V9 level-9
V10 level-10
V11 level-11
V12 level-12
V13 level-13
V14 level-14
V15 level-15
3. Example of a “CLASS1.0” iMelody object
BEGIN:IMELODY
VERSION:1.2
FORMAT:CLASS1.0
Required Header Info
NAME:Melody1
COMPOSER:Moz art
Optional Header info
BEAT:120
STYLE:S1
VOLUME:V7
Optional iMelody modifiers
MELODY:V7&b2#c3V- c2*4g3d3V+#d1r3d2e2:d1V+f2f3. Required iMelody
END:IMELODY Required footer info
Note that in the V1.0 of the iMelody specification, the example omitted the letter V in the VOLUME modifier and S in
the STYLE. Implementations should be capable of receiving the volume with, and without the letter V.
Implementations should transmit with the letter V. Similarly implementations should be capable of receiving the style
with, and without the letter S, but always send with an S.
Spezifikation des RTTTL-Formats
An RTX file is a text file, containing the ringtone name, a control section and a section containing a comma
separated sequence of ring tone commands. The RTX ringtone description format is designed to be
backward compatible with RTTTL, but offers extensions in line with the Nokia Smart Messaging standard.
White space must be ignored by any reader application.
Example:
Alert:B715:32C,32P,32D,32P,32E,32P,32F,32P,32G,32P
This file describes a ringtone whose name is 'Alert'. The control section sets the beats per second at 715,
and the note definitions describe a series of 5 notes and 5 pauses of length 1/32 of a full note.
<RTX file> := <name> ":" [<control section>] ":" <tone-commands>
<name> := <char>+ ; maximum name length 10 characters
<control-section> := <control-pair> ["," <control-section>]
<control-pair> := <control-name> ["="] <control-value>
<control-name> := "o" | "d" | "b" | "s"
; Valid in control section: o=default scale, d=default duration, b=default beats per minute, s=style
; Valid in tone section: o, b, s
<control-value> := <char>+ ; dependent on control-name
; if not specified, defaults are 4=duration, 6=scale, 63=beats-per-minute
; styles are S=Staccato, N=Natural, C=Continuous
; any unknown control-names must be ignored
<tone-commands> := <tone-command> ["," <tone-commands>]
<tone-command> :=<note> | <control-pair>
<note> := [<duration>] <note> [<scale>] [<special-duration>] <delimiter>
<duration> := "1" | "2" | "4" | "8" | "16" | "32" ; duration is divider of full note duration,
eg. 4 represents a quarter note
<note> := "P" | "C" | "C#" | "D" | "D#" | "E" | "F" | "F#" | "G" | "G#" | "A" | "A#" | "H"
<scale> :="4" | "5" | "6" | "7"
; Note that octave 4: A=440Hz, 5: A=880Hz, 6: A=1.76 kHz, 7: A=3.52 kHz
; The lowest note on the Nokia 61xx is A4, the highest is B7
<special-duration> := "." ; Dotted note
; End of specification
标准MIDI文件格式
4D 54 68 64 00 00 00 06 ff ff nn nn dd dd
0-单轨
1-多规,同步
2-多规,异步
dd dd 是每个4分音符delta-time节奏数(这之后将做详细介绍)。
附录A
nn=音符号
vv=速度
nn=音符号
vv=速度
nn=音符号
vv=速度
cc=控制号
vv=新值
pp=新的程序号
cc=管道号
bb=值的低7位(least sig)
tt=值的高7位 (most sig)
下表是没有通道的 meta-events列表 ,他们的格式是:
00 00000000 nn ssss 设定轨道的序号
nn=02 (两字节长度的序号)
ssss=序号
nn=以字节为单位的文本长度
tt=文本字符
nn tt=同文本事件
nn tt=同文本事件
nn tt=同文本事件
nn tt=同文本事件
nn tt=同文本事件
nn tt=同文本事件
tttttt=微秒/四分音符
nn=拍子记号分子
dd=拍子记号分母2=四分之一
3=8分拍, 等等.
cc=节拍器的节奏
bb=对四分之一音符标注的第32号数字
sf=升调/降调(-7=7 降调, 0=基准C调,7=7 升调)
mi=大调/小调(0=大调, 1=小调)
xx=被发送的字节数
dd=数据
FA 11111010 开始当前的队列
FB 11111011 从停止的地方继续一个队列
FC 11111100 停止一个队列
八度音阶¦¦ 音符号
# ¦¦
¦¦ C ¦ C# ¦ D ¦ D# ¦ E ¦ F ¦ F# ¦ G ¦ G# ¦ A ¦ A# ¦ B
-----------------------------------------------------------------------------
0 ¦¦ 0 ¦ 1 ¦ 2 ¦ 3 ¦ 4 ¦ 5 ¦ 6 ¦ 7 ¦ 8 ¦ 9 ¦ 10 ¦ 11
1 ¦¦ 12 ¦ 13 ¦ 14 ¦ 15 ¦ 16 ¦ 17 ¦ 18 ¦ 19 ¦ 20 ¦ 21 ¦ 22 ¦ 23
2 ¦¦ 24 ¦ 25 ¦ 26 ¦ 27 ¦ 28 ¦ 29 ¦ 30 ¦ 31 ¦ 32 ¦ 33 ¦ 34 ¦ 35
3 ¦¦ 36 ¦ 37 ¦ 38 ¦ 39 ¦ 40 ¦ 41 ¦ 42 ¦ 43 ¦ 44 ¦ 45 ¦ 46 ¦ 47
4 ¦¦ 48 ¦ 49 ¦ 50 ¦ 51 ¦ 52 ¦ 53 ¦ 54 ¦ 55 ¦ 56 ¦ 57 ¦ 58 ¦ 59
5 ¦¦ 60 ¦ 61 ¦ 62 ¦ 63 ¦ 64 ¦ 65 ¦ 66 ¦ 67 ¦ 68 ¦ 69 ¦ 70 ¦ 71
6 ¦¦ 72 ¦ 73 ¦ 74 ¦ 75 ¦ 76 ¦ 77 ¦ 78 ¦ 79 ¦ 80 ¦ 81 ¦ 82 ¦ 83
7 ¦¦ 84 ¦ 85 ¦ 86 ¦ 87 ¦ 88 ¦ 89 ¦ 90 ¦ 91 ¦ 92 ¦ 93 ¦ 94 ¦ 95
8 ¦¦ 96 ¦ 97 ¦ 98 ¦ 99 ¦ 100 ¦ 101 ¦ 102 ¦ 103 ¦ 104 ¦ 105 ¦ 106 ¦ 107
9 ¦¦ 108 ¦ 109 ¦ 110 ¦ 111 ¦ 112 ¦ 113 ¦ 114 ¦ 115 ¦ 116 ¦ 117 ¦ 118 ¦ 119
10 ¦¦ 120 ¦ 121 ¦ 122 ¦ 123 ¦ 124 ¦ 125 ¦ 126 ¦ 127 ¦
"MIDI Systems and Control" Francis Rumsey 1990 Focal Press
"MIDI and Sound Book for the Atari ST" Bernd Enders and Wolfgang Klem 1989 M&T Publishing, Inc.
MIDI file specs and general MIDI specs were a"o obtained by sending e-mail to LISTSERV@AUVM.AMERICAN.EDU with the phrase GET MIDISPEC PACKAGE in the message.
(groups sounds into sixteen families, w/8 instruments in each family)
1 acoustic grand 9 celesta
2 bright acoustic 10 glockenspiel
3 electric grand 11 music box
4 honky-tonk 12 vibraphone
5 electric piano 1 13 marimba
6 electric piano 2 14 xylophone
7 harpsichord 15 tubular bel"
8 clav 16 dulcimer
17 drawbar organ 25 acoustic guitar(nylon)
18 percussive organ 26 acoustic guitar(steel)
19 rock organ 27 electric guitar(jazz)
20 church organ 28 electric guitar(clean)
21 reed organ 29 electric guitar(muted)
22 accoridan 30 overdriven guitar
23 harmonica 31 distortion guitar
24 tango accordian 32 guitar harmonics
33 acoustic bass 41 violin
34 electric bass(finger) 42 viola
35 electric bass(pick) 43 cello
36 fretless bass 44 contrabass
37 slap bass 1 45 tremolo strings
38 slap bass 2 46 pizzicato strings
39 synth bass 1 47 orchestral strings
40 synth bass 2 48 timpani
49 string ensemble 1 57 trumpet
50 string ensemble 2 58 trombone
51 synthstrings 1 59 tuba
52 synthstrings 2 60 muted trumpet
53 choir aahs 61 french horn
54 voice oohs 62 brass section
55 synth voice 63 synthbrass 1
56 orchestra hit 64 synthbrass 2
65 soprano sax 73 piccolo
66 alto sax 74 flute
67 tenor sax 75 recorder
68 baritone sax 76 pan flute
69 oboe 77 blown bottle
70 english horn 78 skakuhachi
71 bassoon 79 whistle
72 clarinet 80 ocarina
81 lead 1 (square) 89 pad 1 (new age)
82 lead 2 (sawtooth) 90 pad 2 (warm)
83 lead 3 (calliope) 91 pad 3 (polysynth)
84 lead 4 (chiff) 92 pad 4 (choir)
85 lead 5 (charang) 93 pad 5 (bowed)
86 lead 6 (voice) 94 pad 6 (metallic)
87 lead 7 (fifths) 95 pad 7 (halo)
88 lead 8 (bass+lead) 96 pad 8 (sweep)
97 fx 1 (rain) 105 sitar
98 fx 2 (soundtrack) 106 banjo
99 fx 3 (crystal) 107 shamisen
100 fx 4 (atmosphere) 108 koto
101 fx 5 (brightness) 109 kalimba
102 fx 6 (goblins) 110 bagpipe
103 fx 7 (echoes) 111 fiddle
104 fx 8 (sci-fi) 112 shanai
113 tinkle bell 121 guitar fret noise
114 agogo 122 breath noise
115 steel drums 123 seashore
116 woodblock 124 bird tweet
117 taiko drum 125 telephone ring
118 melodic tom 126 helicopter
119 synth drum 127 applause
120 reverse cymbal 128 gunshot
**** table 2 - general midi percussion key map ****
(assigns drum sounds to note numbers. midi channel 10 is for percussion)
key key
36 bass drum 1 60 hi bongo
37 side stick 61 low bongo
38 acoustic snare 62 mute hi conga
39 hand clap 63 open hi conga
40 electric snare 64 low conga
41 low floor tom 65 high timbale
42 closed hi-hat 66 low timbale
43 high floor tom 67 high agogo
44 pedal hi-hat 68 low agogo
45 low tom 69 cabasa
46 open hi-hat 70 maracas
47 low-mid tom 71 short whistle
48 hi-mid tom 72 long whistle
49 crash cymbal 1 73 short guiro
50 high tom 74 long guiro
51 ride cymbal 1 75 claves
52 chinese cymbal 76 hi wood block
53 ride bell 77 low wood block
54 tambourine 78 mute cuica
55 splash cymbal 79 open cuica
56 cowbell 80 mute triangle
57 crash cymbal 2 81 open triangle
58 vibraslap
**** table 3 - general midi minimum sound module specs ****
a minimum of either 24 fully dynamically allocated voices
available simultaneously for both melodic and percussive sounds or 16
dynamically allocated voices for melody plus eight for percussion.
general midi mode supports all sixteen midi channe". each channel can
play a variable number of voices (polyphony). each channel can play a
different instrument (timbre). keybased percussion is always on
channel 10.
a minimum of sixteen different timbres playing various instrument
sounds. a minimum of 128 preset for intruments (midi program numbers).
octabe registration: middle c(c3) = midi key 60. all voices including
percussion respond to velocity.
controller # description
1 modulation
7 main volume
10 pan
11 expression
64 sustain
121 reset all controllers
123 all notes off
parameter #
0 pitch bend sensitivity
1 fine tuning
2 coarse tuning
channel pressure (aftertouch)
pitch bend
pitch bend amount = 0
pitch bend sensitivity = +-2 semitones
volume = 90
all other controllers = reset
(after electronic musician, 8/91 issue)
------------------------------ DEC.CPP ------------------------------------
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
{
FILE *fp;
{
printf("cannot open file %s\n",_argv[1]);
helpdoc();
exit(-1);
}
ch=fgetc(fp);
{
printf("%u\t", ch); /* print every byte's decimal equiv. */
c++;
if(c>8) /* print 8 numbers to a line */
{
c=0;
printf("\n");
}
}
}
{
printf("\n Binary File Decoder\n\n");
printf("This is a filter program that reads a binary file\n");
printf("and prints the decimal equivalent of each byte\n");
printf("tab-separated. This is mostly useful when piped \n");
printf("into another file to be edited manually. eg:\n\n");
printf("c:\>dec sonata3.mid > son3.txt\n\n");
printf("This will create a file called son3.txt which can\n");
printf("be edited with any ascii editor. \n\n");
printf("(rec.exe may a"o be useful, as it reencodes the \n");
printf("ascii text file).\n\n");
printf("Have Fun!!\n");
}
by Dustin Caldwell (dustin@gse.utah.edu)
*/
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
{
FILE *rfp, *wfp;
char s[20];
{
printf("cannot open file %s \n",_argv[1]);
helpdoc();
exit(-1);
}
{
printf("cannot open file %s \n",_argv[1]);
helpdoc();
exit(-1);
}
{
{
c=0;
while(isdigit(ch)) /* only use decimal digits (0-9) */
{
s[c]=ch; /* build a string containing the number */
c++;
ch=fgetc(rfp);
}
s[c]=NULL; /* must have NULL terminator */
}
fclose(wfp);
}
void helpdoc() /* print help message */
{
printf("\n Text File Encoder\n\n");
printf("This is a program that reads an ascii tab-\n");
printf("delimited file and builds a binary file where\n");
printf("each byte of the binary file is one of the decimal\n");
printf("digits in the text file.\n");
printf(" eg:\n\n");
printf("c:\>rec son3.txt son3.mid\n\n");
printf("(This will create a file called son3.mid which is\n");
printf("a valid binary file)\n\n");
printf("(dec.exe may a"o be useful, as it decodes binary files)\n\n");
printf("Have Fun!!\n");
}
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073