MIDI2TXT.DOC
资源名称:midi2txt.rar [点击查看]
上传用户:sun1865
上传日期:2008-12-23
资源大小:59k
文件大小:9k
源码类别:
midi
开发平台:
Visual C++
- ******************************
- MIDI2TXT v1.14
- midi binaries to text mnemonic
- by Guenter Nagler
- 1995
- (info@gnmidi.com)
- ******************************
- [1] BACKGROUND
- My first intention writing this program was getting knowledge about
- midi. After writing the pendant TXT2MIDI program I used it to sequence
- some music titles. When I bought my music workstation (including a more
- powerful sequencer) my use of MIDI2TXT/TXT2MIDI changed into an
- updating environment to make less compatible midi files full compatible.
- Another use possibility came up when I copied some excellent midi
- binaries from news://alt.binaries.sounds.midi . I converted one with
- MIDI2TXT into text, commented all commands that played notes in leading
- track and converted it back into another midi file (TXT2MIDI). The new
- midi file played the full background of the music while I was able to
- learn playing the lead voice for my own pleasure.
- [2] FILES DESCRIPTION
- MIDI2TXT.EXE.........converter program
- MIDI2TXT.DOC.........this file, showing usage of MIDI2TXT.EXE
- only MIDI2TXT.EXE is required to run program
- [3] COPYRIGHT
- MIDI2TXT (c) 1995 was created by Guenter Nagler.
- MIDI2TXT is free and may be used as you wish with this one exception:
- You may NOT charge any fee or derive any profit for distribution
- of MIDI2TXT. Thus, you may NOT sell or bundle MIDI2TXT with any
- product in a retail environment (shareware disk distribution, CD-ROM,
- etc.) without permission of the author.
- You may give MIDI2TXT to your friends, upload it to a BBS, or ftp it to
- another internet site, as long as you don't charge anything for it.
- Distributing modified programs or own programs that use parts of this
- program requires permission of author!
- [4] DISCLAIMER
- MIDI2TXT was designed to handle 100% compatible midi files.
- It was tested with 600 different midi files but I can not say if
- each 100% midi compatible midi file can be correctly converted.
- So I give no guarantees of the results, especially with non 100%
- compatible midi files.
- If you find a midi file that you think to be 100% compatible midi
- that is not correctly converted, please send a sample file to
- info@gnmidi.com .
- Use MIDI2TXT at your own risk. Anything you do with MIDI2TXT is your
- responsibility, and not the author's. Any damage caused to any person,
- computer, software, hardware, company, or business by running MIDI2TXT
- is your responsibility, and the author will not be liable.
- If you don't understand these terms, or are not sure of something, or
- are afraid something bad might come of using MIDI2TXT, don't use it!
- You are here forewarned.
- [5] INSTALLATION
- [MSDOS]
- Simply copy MIDI2TXT.EXE in a directory that is in your path.
- When you start the program without arguments
- C:> MIDI2TXT
- you should get the usage text (see next section)
- [6] USAGE
- usage: midi2txt [-error][-chunk][-short][-info][-lyric][-tact][-units][-ms][-dec] file.mid [file.txt]
- options:
- -error checks file only. Produces only error report
- -chunk prints structure of midi file (header, tracks)
- -short prints short info about text, tracknames, programs
- -info prints info about text, tracknames, programs, controls
- -lyric prints lyrics only
- -tact marks end of tact bars with .
- -units prints position of all events in midi units.
- -ms prints position of all events in milliseconds.
- -dec print decimal values instead of notes, channels, programs,pauses...
- The parts in brackets [...] are optional.
- The text output is normally written to screen but can be relinked
- to a file (> filename.txt) or a printer (> prn). See your MS-DOS
- manual for usage of > and >> operators.
- The program MIDI2TXT allows some options:
- -error checks midifile for errors
- -chunk shows only the header and midi tracks (without contents, but
- channel number if available)
- -short shows only program changes and text information
- -info shows only program changes, bank changes, volume and text
- information (no notes and time delays)
- -lyric shows only text and lyric meta events and interprets special
- character sequences in text (as used in some karaoke players):
- / or as end of line, end of paragraph
- @K kind of midi file (usually karaoke)
- @V version
- @I information
- @L language
- @T title of file
- If none of the options -chunk, -short, -info, -lyric is specified all
- midi commands are printed.
- -tact marks all tact changes with a point and comments.
- The measure number is printed as comment behind each tact bar.
- -units prints a comment /* U... */ before each midi event
- with current song position in midi units.
- -ms prints a comment /* ...ms */ before each midi event
- with current song position in milliseconds since start of song.
- Warning:
- Do not expect that MIDI2TXT + TXT2MIDI will produce a copy of the original
- file! MIDI allows to encode its commands in different ways without
- changing the semantic of the notes (It is allowed to compress the
- midi file by ommiting redunant command bytes, but it is no duty).
- [7] A sample of resulting text output
- // is a comment that ends at end of line (all characters are ignored)
- /* is a comment that ignores all characters, lines until */
- // the comments at right side are not produced by the program
- // sample.mid
- mthd // start of header
- // 1 song // midi2txt converts only the first song!
- // 3 tracks
- unit 192 // is 1/4 // time units that build a quarter pause
- end mthd // end of header
- mtrk // start of a track without channel
- copyright "(c) Guenter Nagler" // any copyright text
- trackname "Ballade pour Adeline" // any track name
- tact 4 / 4 24 8 // song in 4/4 tact, 24 clicks per beat, 8/32 is 1/4 note
- beats 68 // tempo in ticks/min or beats/min
- end mtrk // end of track
- mtrk($D) // a track with channel D hex (=13 dec)
- trackname "Melody"
- program BritePno // program name
- balance left // a panpot control parameter
- +c4 $40; // + are pressing keys, velocity as param
- 48;+g4 $40; // 48 is 1/16 duration (pause to next command)
- 48;-g4 $7F; // - are releasing keys, velocity as param
- +c5 $40; // note commands are separated by ;
- 1/16;-c5 $7F; // exact aligned duration can be written as 1/16
- +d5 $40;
- 1/16;-d5 $7F;
- -c4 $7F;
- +c4 $40;
- 1/16;+g4 $40;
- 1/16;-g4 $7F;
- +c5 $40;
- 1/16;-c5 $7F;
- +d5 $40;
- 1/16;-d5 $7F;
- -c4 $7F;
- +c4 $40;
- 1/16;+g4 $40;
- 1/16;-g4 $7F;
- +c5 $40;
- 1/16;-c5 $7F;
- +d5 $40;
- 1/16;-d5 $7F;
- -c4 $7F;
- +c4 $40;
- 1/16;+g4 $40;
- 1/16;-g4 $7F;
- +c5 $40;
- 1/16;-c5 $7F;
- +d5 $40;
- 1/16. // tact 1 // end of tact 1 (using option -tact)
- end mtrk
- A further description of the text language can be found in documentation
- of TXT2MIDI.
- [8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
- WWW: http://www.gnmidi.com
- contains all my dos/unix midi programs
- EMAIL: info@gnmidi.com
- [9] CHANGES
- v1.0 to v1.1:
- * added version field in midi header
- * tempo is now printed by beats command as floatingpoint numbers
- * new option -error checks if midifile is correct otherwise
- prints an error message
- * some portability changes for UNIX compatibility
- v1.1 to v1.2:
- * added detailed sysex information for common sysex commands
- (GMReset, GSReset, GSExit)
- * minor bugs in output information level
- v1.2 to v1.3:
- * added meta events mnemonics prefixchannel and prefixport
- v1.3 to v1.4:
- * bug fixed that caused unexpected end-of-file-error for certain valid midi files
- * added -version option
- * note B is now written as B (former H, as used in German language)
- v1.4 to v1.5:
- * added RPN control commands highrpn, lowrpn
- * fixed bug that generated negative number of quarternotes for very high
- pause values
- * added XGreset command
- * added option to print unit numbers in comments /* ... */
- * output filename can be specified directly (behind input filename)
- v1.5 to v1.6:
- * added option -units
- * added option -ms
- * usage explains options
- v1.6 to v1.7:
- * support large events (larger than 1 kb)
- v1.7 to v1.8:
- * cannot calculate and print milliseconds in other than first track
- if tempo changes during the song, because the program does not consider
- tempo changes in first track when printing any other track.
- (see program midinote.zip it does consider this)
- * printing of milliseconds and units suppressed if not printing all info
- (e.g. using options -i -e -l ...)
- * now printing time/units after each pause
- v1.8 to v1.9:
- * added new option -dec to make it easier to parse midi file from text
- * added comments to each track telling the tracknumber
- v1.9 to v1.10:
- * option -tact now also supports tact other than 4/4
- v1.10 to v1.11:
- * program names adapted to be compatible to the other utilities
- * printing xf tail as comment
- * fixed small RPN problem
- v1.11 to v1.12:
- * handling of option -tact in case of midi files with tact errors
- v1.12 to v1.13:
- * bug fix when read error occurs in very long sysex that is too short
- v1.13 to v1.14:
- * help for users that cannot use the dos utilitiy