home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / MISC / PAREQ12A / README.DOC < prev    next >
Encoding:
Text File  |  1996-01-09  |  10.5 KB  |  327 lines

  1.  
  2. The mtm program was written by a Mup user.
  3. It is not supported by Arkkra Enterprises.
  4.  
  5.  
  6. mtm: Midi to Mup formatter
  7. --------------------------
  8.  
  9. NOTE: At present this program is considered to be in beta test. 
  10.       I haven't seen any major bugs in a while, and for various
  11.       reasons I'm not likely to put a lot more work into MTM.
  12.       (Mostly because it does about everything I need it to do.)
  13.  
  14.       MTM's major limitation is that it will only read a single
  15.       input note at a time per input track.  In other words, no
  16.       chords.  I've got some ideas on how to somewhat easily
  17.       accomplish that if someone wants to take the time to do
  18.       it.  Contact me for more details if you're interested.
  19.  
  20.       Lastly, no attempt has been made to get mtm to compile
  21.       anywhere but a Sun running SunOS 4.1.X.  It should
  22.       probably compile on most or all Unix systems, but few
  23.       have been tested.  As for PCs, well you're on your
  24.       own.  (Hey, I'm a Unix developer. :-)
  25.  
  26.  
  27. Compiling
  28. ---------
  29.  
  30.      First, extract the files into a directory.  If you're using
  31. a Unix system, just type make. You may need to make some minor
  32. changes if you are using gcc or another compiler.
  33.  
  34.  
  35. Description
  36. -----------
  37.  
  38.      Mtm takes midi files as input and creates MUP files as output.
  39. It allows assigning keys individually to each track, translation of
  40. track numbers to different staff numbers, header creation, and
  41. different beamstyles for each time signature.  However, despite all the
  42. limitations I list below, mtm has saved me tens of hours of work
  43. entering notes.  I do a lot of complex brass quintet arrangements, and
  44. with mtm, it generally takes me fifteen minutes cleanup on a 350 bar
  45. piece as opposed to three-four (or more!)  hours of note entry.
  46.  
  47. Limitations
  48. -----------
  49.  
  50.      Lots of them:
  51.  
  52.     o mtm accepts only one note per track at a given tick.
  53.       No chords.
  54.  
  55.     o Notation is sometimes awkward.  For example, within a
  56.       single measure, a dotted half is always a dotted half,
  57.       even if it starts on an eighth note boundary.
  58.  
  59.     o Accidentals may be handled awkwardly.  In a sharp key,
  60.       all notes are output as sharps, in a flat key, flats.
  61.       No double flats/sharps output, ever.  And MTM doesn't
  62.       understand enharmonic notation.  No attempt is made
  63.       to look at the context of a note.
  64.  
  65.     o On a similar, er, note, mtm puts in too many accidentals.
  66.       I found at one point that it was missing accidentals, and
  67.       so the current code guards against that.  Unfortunately
  68.       the cure presents other problems.  The good news is that
  69.       the new problems are a lot easier to find and deal with
  70.       than a completely missing accidental.
  71.  
  72.     o Mtm assumes all input has the same default octave.  This
  73.       means manually resetting the bass clef defoct parameter
  74.       to "4". (See example below.)  Other clefs may also be
  75.       affected.
  76.  
  77.     o No notes smaller than 32nd notes are notated.
  78.  
  79.     o Mtm may not be able to figure out how to notate some weird
  80.       length note.  I think that most are covered, but I know that
  81.       some odd lengths aren't.  The good news is that when you run
  82.       MUP on the output file, MUP will give an error at the
  83.       affected line, which can then be manually edited.
  84.  
  85.     o Duplets are handled only in three cases.  Mtm handles
  86.       quarter, eighth, and sixteenth note triplets, but not
  87.       anything else.
  88.  
  89.     o Probably more that I haven't yet thought of.
  90.  
  91.  
  92. Usage
  93. -----
  94.  
  95.      With no arguments, mtm reads from standard in and writes to standard
  96. out.  The following arguments are understood:
  97.  
  98.     -f <filename>    Read from filename instead of standard in
  99.  
  100.     -i <filename>    Use <filename> instead of ".midtomup" as the
  101.             filename to read commands from
  102.  
  103.     -g        Try to "fudge" the notes to a real value.  This
  104.             is *not* true quantization.  Fudging simply
  105.             checks to see if the number of ticks of note 
  106.             length is within a certain fudging factor
  107.             (normally 10).  Without the -g option, if a
  108.             note length is 115 ticks, and a quarternote
  109.             is 120 ticks, then you'll get an error in the
  110.             output file.  With the -g option, a note length
  111.             of 115 will automatically be set to 120, and
  112.             a quarter note will be output.  
  113.  
  114.             Any errors from fudging will also produce
  115.             errors in the mup file.  The same note lengths
  116.             are used.
  117.  
  118.     -a <factor>    Set the fudge factor (normally 10) to <factor>.
  119.  
  120.     -n        Normally MTM places the measure number as a
  121.             comment in the output file before each new
  122.             measure.  This option disables that feature.
  123.  
  124.     -v        Print version and exit.
  125.  
  126.      If translated file has one or more lines with the word
  127. "BADLEN" in them, then mtm has found notes it can't figure out
  128. how to notate.  With this error you are given three different
  129. bits of information, more than enough to correctly translate the
  130. note yourself.  The format is:
  131.  
  132.     BADLEN=AAA,BBB: quarters=CCC
  133.  
  134. The letters "AAA" will be replaced by the length of the note from
  135. the MIDI file in ticks.  The letters "BBB" will be replaced with
  136. the number of ticks that make up a quarter note, and the letters
  137. "CCC" will be replaced with a floating point number telling you
  138. how many quarternotes "AAA" ticks are. (That final number probably
  139. won't be anything close to an even number.)  Using these numbers
  140. you can determine how long the note is and how to notate it.
  141. For example:
  142.  
  143.     BADLEN=255,120: quarters=2.125
  144.  
  145. Well, a half note = 2*120=240, so our note is longer than a half
  146. note by 15 ticks.  15 is 1/8 of 120, so we have a half note tied
  147. to an eighth note.  Or if you know the .125 = 1/8, then you can
  148. tell by "quarters=2.125" that you have a half note tied to an
  149. eighth note.
  150.  
  151.      As mentioned above, mtm reads a file named ".midtomup" in the current
  152. directory, or optionally specified by the "-i" option.  In most cases,
  153. a comment is placed in the output file saying what action mtm has taken.
  154. All commands *must* begin in column one of the input file.  Below is
  155. a description of the available commands, and following that is an
  156. example input file.
  157.  
  158.      #header
  159.      <text>
  160.      #headend
  161.  
  162.     All text between "#header" and "#headend" will be placed,
  163.     *without* error checking, into the output file as the first
  164.     line(s) of the file.  This can be used to set up staff names,
  165.     labels, key signatures, clefs, and any other header information
  166.     you wish to place in the file.
  167.  
  168.  
  169.      #beamstyle
  170.      <styles>
  171.      #beamend
  172.  
  173.     Text between "#beamstyle" and "#beamend" should be in the
  174.     form "numerator/denominator=<beamstyle>". "<beamstyle>"
  175.     is a beamstyle as described in the MUP user's manual.
  176.     Set the beamstyle you wish for each numerator/denominator,
  177.     and as time signatures change within the midi input file,
  178.     the beamstyle will automatically be set.
  179.  
  180.  
  181.      #translate <input_track>=<output_staff>
  182.  
  183.     Translate is used to translate an incoming midi track number
  184.     to a different staff number.  For example, you may use midi
  185.     track 11 for some of your work, but wish those notes to be
  186.     on staff five.  For that output, use the command:
  187.  
  188.         #translate 11=5
  189.  
  190.  
  191.      #key <input_track>=<key offset>
  192.  
  193.     Key is used to set the key signature for each track. IF NO KEY
  194.     IS SET FOR A TRACK, THE TRACK DEFAULTS TO THE THE MIDI KEY
  195.     SIGNATURE.  Also note that "translate" does not change the
  196.     track, so regardless of the staff output, you must set the key
  197.     using the input track.
  198.  
  199.     This command sets the "key offset" for a track.  For example,
  200.     If the true key signature is three flats, and track 2 is a horn
  201.     track, you might want to have the horn line print in two
  202.     flats.  The key offset would be equal to "-1", and would be set
  203.     using the following command:
  204.  
  205.         #key 2=-1
  206.  
  207.     A key offset is the number of flats you would add to a key
  208.     signature to produce the key signature you want. (A flat
  209.     negates a sharp, so adding flats to a sharp key sig,
  210.     makes fewer sharps.  Adding negative numbers of flats
  211.     to a sharp key sig makes *more* sharps.)
  212.  
  213.      //<text>
  214.  
  215.     This is a comment, and is placed immediately into the
  216.     output file.
  217.  
  218.  
  219. A Sample .midtomup File
  220. -----------------------
  221.  
  222.      Below is a sample .midtomup file I use for one of my arrangements.
  223. The header, translations, and beamstyles are pretty standard for me
  224. across pieces, while the key sigs change (of course).
  225.  
  226.  
  227. #header
  228. header
  229.     title (18) "Not Very Pretty"
  230.     title (12) "" "John Composer"
  231.     title (12) "" "arr. by Sean L. Gilley"
  232. header2
  233.     title "- \% -"
  234. score
  235.     staffs=5
  236.     time=4/4
  237.     measnum=y
  238.     barstyle=1-5
  239.     key=0&
  240.     label="Trumpet 1"
  241.     visible=y
  242. staff 2
  243.     label="Trumpet 2"
  244.     visible=y
  245. staff 3
  246.     key=1&
  247.     label="French Horn"
  248.     visible=y
  249. staff 4
  250.     key=2&
  251.     clef=bass
  252. //
  253. // Mup gives bass and treble clefs different default octaves,
  254. // which is good for typing stuff in.  But mtm assumes everyone
  255. // is in the same octave.  Not good.  As it turns out, setting
  256. // defoct=4 for bass clef parts put everyone in the same default
  257. // octave and solves our problem.
  258. //
  259.     defoct=4
  260.     label="Trombone"
  261.     visible=y
  262. staff 5
  263.     key=2&
  264.     clef=bass
  265.     defoct=4
  266.     label="Tuba"
  267.     visible=y
  268. music
  269. #headend
  270. #beamstyle
  271. 4/4=4,4,4,4
  272. 3/4=4,4,4
  273. #beamend
  274. //
  275. // My midi output has 1st trumpet on track one,
  276. // 2nd trumpet on track two, French Horn on track 11,
  277. // trombone on track three, and tuba on track four.
  278. // I want staff 1=1st trumpet, staff 2=2nd trumpet,
  279. // staff 3=French Horn, staff 4=trombone, and
  280. // staff 5=tuba.  The translations below accomplish
  281. // this for me.
  282. //
  283. // Trombone part
  284. #translate 3=4
  285. // Tuba part
  286. #translate 4=5
  287. // French Horn part
  288. #translate 11=3
  289. //
  290. // Key signatures. Trumpets in key of C, FH in key of
  291. // F (one flat) and trombone/tuba in key of B& (two flats).
  292. //
  293. #key 3=-2
  294. #key 4=-2
  295. #key 11=-1
  296.  
  297.  
  298. Bugs
  299. ----
  300.  
  301.      Probably quite a few that I haven't seen.  The only recent bug
  302. I've seen has to do with ties.  Sometimes mtm won't recognize that
  303. a note is the second note of a tie, and will go ahead and place the
  304. accidental.  MUP just flags this as a warning, so it isn't critical,
  305. just annoying.
  306.  
  307. Credits
  308. -------
  309.  
  310.      This code is based upon "mftext" and the accompanying files
  311. by Tim Thompson (att!twitch!glimmer!tjt) and Michael Czeiszperger
  312. (czei@pan.com).  Without that code, mtm probably wouldn't have
  313. been written.  Really.
  314.  
  315. Support
  316. -------
  317.  
  318.      Well, I'll try.  But I'm got a job plus doing my own arrangements
  319. so support is, shall we say, limited.  But feel free to ask, and
  320. feel just as free to fix the problem if you're a programmer.  If you
  321. do modify the code so it works better, please send me a copy.
  322. That way I can keep this code here up to date.
  323.  
  324. E-mail:    slg@mycroft.cmhnet.org
  325.  
  326.  
  327.