order make
[ITMCK.git] / itmck_manual.tex
blob7c87336442fbbd76ae50f7949d0d8268712244d6
1 % ITMCK manual v0.1
2 % This manual is in public domain.
4 \def\ecall#1{\bgroup\edef\next{\egroup#1}\next}
6 \font\ninerm=cmr9
7 \font\titlefont=cmr7 scaled\magstep4
8 \font\headIfont=cmr10 scaled\magstep3
9 \font\headIIfont=cmr10 scaled\magstep2
10 \font\headIIIfont=cmr10 scaled\magstep1
11 \font\bigtt=cmtt10 scaled\magstep2
12 \font\mediumtt=cmtt10 scaled\magstep1
14 \shipout\vbox to\vsize{
15 \vss
16 \centerline{\titlefont ITMCK Manual}
17 \smallskip
18 \centerline{v0.1}
19 \vss
21 \pageno=2
23 \newif\ifnotbeginchapter \notbeginchapterfalse
25 \newcount\secnoI
26 \newcount\secnoII
27 \newcount\secnoIII
29 \let\tocI=\relax
30 \let\tocII=\relax
31 \let\tocIII=\relax
33 \newwrite\tocfile \immediate\openout\tocfile=\jobname.toc
35 \def\headblock#1#2#3#4{\moveright#4pt\vbox{%
36 \hrule%
37 \hbox{%
38 \vrule%
39 #1%
40 \phantom{\'(}%
41 \ecall{#2}%
42 \phantom{\c)}%
43 \ecall{\write\tocfile{#3{#2}{\folio}}}%
45 }}%
47 \def\esecI{\uppercase{\romannumeral\secnoI}}
48 \def\esecII{\esecI.\the\secnoII}
49 \def\esecIII{\esecII.\char\the\secnoIII}
51 \def\headI: #1\par{%
52 \advance\secnoI by 1 \secnoII=0
53 \vfill\eject%
54 \headblock\headIfont{\esecI.\quad#1}\tocI0%
55 \penalty600\bigskip\penalty600%
56 \mark{\esecI}%
57 \global\notbeginchapterfalse%
59 \def\headII: #1\par{%
60 \advance\secnoII by 1 \secnoIII=96
61 \bigbreak%
62 \headblock\headIIfont{\esecII.\quad#1}\tocII3%
63 \penalty600\medskip\penalty600%
64 \mark{\esecII}%
66 \def\headIII: #1\par{%
67 \advance\secnoIII by 1
68 \medbreak%
69 \headblock\headIIIfont{\esecIII.\quad#1}\tocIII6%
70 \penalty600\smallskip\penalty600%
71 \mark{\esecIII}%
74 \def\cdotl{\ \cleaders\hbox{ \vrule height4.5pt depth-3.5pt width1pt\ }\hss\ }
75 \headline={\ninerm\ifnotbeginchapter\topmark\fi\cdotl\folio\cdotl\firstmark}
76 \footline={\ninerm\firstmark\cdotl\folio\cdotl\botmark}
77 \output={\plainoutput\global\notbeginchaptertrue}
79 \parskip=6pt plus 6pt minus 0.5pt
80 \parindent=1pc
82 \let\TT=\bigtt
83 \let\Tt=\mediumtt
85 % === Begin main document text ===
87 \headI: Introduction
89 This is the documentation for ITMCK. ITMCK is a program to take an input
90 MML (Music Macro Language) file to make Impulse Tracker compatible file
91 output.
93 \headII: Compiling
95 This program is written in C89 with GNU extensions and there is a UNIX
96 shell script named {\tt compile} to make compile into executable file. If
97 you have Microsoft Windows (or ReactOS), you should be able to run the
98 executable file directly, but on Linux you can compile it using the C
99 compiler and then it should work.
101 \headII: Invoking
103 This program must receive the MML code on standard input and then the
104 binary output on standard output. Usually you would redirect input from a
105 file having {\tt.mml} extension and redirect output to a file having
106 {\tt.it} extension.
108 For example: {\tt itmck < song.mml > song.it}
110 There are command-line parameters which can be activated as follows:
112 {\tt-c}\quad Set compatibility setting. Give it an argument which is the
113 number for the compatibility setting. Compatibility setting is described
114 later in this document.
116 {\tt-e}\quad Export raw sample data to standard output. The parameter will
117 be the number of the sample to export. This can only be used with
118 synthesized samples and cannot be used with external samples. The normal
119 output is suppressed when this mode is used.
121 {\tt-p}\quad Set prefix for external samples. When loading an external
122 file, the text here will be given as a prefix for the filename when
123 accessing the external files. It is necessary to include the trailing
124 slash if it is the name of a directory.
126 {\tt-t}\quad Trace input. No parameter is used. This will display each
127 line of input on standard error when it is being processed, including the
128 preprocessing, and errors for that line will appear with that line so that
129 you can debug the input file.
131 {\tt-v}\quad Version number. No parameter is used. No input is requested
132 and the standard output will include the version number of ITMCK.
134 {\tt-x}\quad Volume 0 mix optimization. No parameter is used. This command
135 will activate the ``volume 0 mix optimization'' flag in the output file.
137 \headII: License
139 ITMCK is licensed under GNU GPL v3 or later version. This document is
140 licensed under public domain. A copy of the GNU GPL v3 should have been
141 made available in a file named {\tt COPYING} in the same media that you
142 received the program with.
144 \headI: Syntax
146 \headII: Comments
148 \headII: Musical Notes
150 A music note, wherever it is expected, consists of a lowercase letter from
151 {\tt a} to {\tt h} followed by modifiers, or the letter {\tt n} followed
152 by a direct note number. In some cases (but not in the tracks), this is
153 followed by the octave number (unless it is a direct note entry).
155 The modifiers are: {\tt-} to lower the note by one semitone, {\tt+} to
156 raise the note by one semitone, and {\tt'} to raise the note by one
157 octave (the number of ``semitones'' in an ``octave'' can be reconfigured,
158 although it is normally twelve). It is allowed to have multiple modifiers.
159 Modifiers must come before the octave number (if applicable).
161 In a track, the note is optionally followed by the length. Modifiers also
162 come before the length, although the length is optional, and whether or
163 not it is included you may have optional full stops afterward, which act
164 like a dotted note in a sheet music.
166 Remember that even these direct note numbers, octave numbers, and length
167 numbers may include access the values of variables; for example,
168 {\tt@=x50[n\$x@+x1]13} will play a chromatic scale.
170 \headII: Numbers
172 There are three ways to write numbers in ITMCK wherever they are expected.
174 If multiple parameters are expected, you cannot normally separate numbers
175 by spaces. However, you can use commas if it would be ambiguous to put
176 them directly next to each other.
178 \headIII: Decimal
180 Write a decimal number optionally prefixed by a minus sign or plus sign.
181 (If the number is omitted, it is treated as zero.)
183 Example: {\tt42}
185 \headIII: Hexadecimal
187 Hexadecimal numbers are prefixed by a dollar sign, and the letters must
188 be written in uppercase.
190 Example: {\tt\$2A03}
192 \headIII: Variables
194 To use the value of a variable where a number is expected, use the
195 variable letter in lowercase after a dollar sign. There are 27 variables,
196 labeled {\tt\$a} to {\tt\$z} and the backquote variable {\tt\$`} (use of
197 the backquote variable is explained later).
199 Example: {\tt\$x}
201 \headI: Hash Directives
203 \headII: \TT\#AMIGA-SLIDES
205 If you select this mode, the portamento slides will be linear by period
206 (as they normally are on Amiga computers) instead of by frequency.
208 N.B.: Auto-portamento does not work if this is selected.
210 \headII: \TT\#CHANNEL
212 \headII: \TT\#COMPATIBILITY
214 Set compatibility setting (same as {\tt-c} switch). Currently the only
215 valid setting is zero which has no effect.
217 \headII: \TT\#GATE-DENOM
219 \headII: \TT\#INCLUDE
221 Specify a filename. It include a file with that name from the same
222 directory as another input file, which will be processed before continuing
223 with the current input file.
225 \headII: \TT\#LINEAR-SLIDES
227 This is the default setting and it makes portamento slides to be
228 ``linear'' (actually exponential by frequency).
230 \headII: \TT\#MINIMUM-VERSION
232 Check the version of ITMCK. This number must be hex number of form
233 {\tt\$xyz} corresponding to version x.y.z of ITMCK. It is a fatal error if
234 the current version of ITMCK is less than the value given on this line.
236 \headII: \TT\#MIXER
238 Set master volume, which must range from 1 to 128. Default setting is 48.
240 \headII: \TT\#MONO
242 Select mono audio.
244 \headII: \TT\#OCTAVE-REV
246 Specify a number 0 or 1. If you specify 0 (default) then {\tt>} means high
247 octave and {\tt<} means low octave. If you specify 1 then {\tt<} means
248 high octave and {\tt>} means low octave.
250 \headII: \TT\#OLD-EFFECTS
252 \headII: \TT\#PANNING-SEPARATION
254 \headII: \TT\#PORTAMENTO-SHARE
256 \headII: \TT\#SCALE
258 This command is used to customize the scale of notes. You can use the
259 letters {\tt a} to {\tt j} up to once each (although you need not use all
260 of them, and they need not be in order). Use full stops to indicate no
261 letters for that position (they can still be accessed by sharp/flat).
262 However many letter and dot is the number of tones per octave. You can
263 include a vertical bar to indicate what will be zero of scale (points
264 before that one are negative).
266 The default setting is: {\tt a.b|c.d.ef.g.} (including full stop at end)
268 As an example, the default setting means that there are twelve notes per
269 octave (don't count the vertical bar), {\tt a} has value $-3$, {\tt b} has
270 value $-1$, {\tt c} has value $0$, {\tt g} has value $7$, and so on. This
271 corresponds to the standard keys on a piano.
273 You cannot comment anything out on this line.
275 N.B.: If you change the scale other than twelve, you must affect the key
276 tables to reflect this.
278 \headII: \TT\#SCALE-BASE
280 Allows to define which letter should be considered the lowest note of the
281 octave. The default value is `{\tt c}'. If you set it to `{\tt a}', then
282 entering `{\tt a}' where a note is expected will use the A note below C
283 instead of the A note above C.
285 Scale bases use alphabetical order of the notes, rather than the order
286 specified in the {\tt\#SCALE} definition. Usually it is the same, although
287 this can differ so you should be careful about it.
289 \headII: \TT\#STEREO
291 Select stereo audio (default).
293 \headII: \TT\#SYNTH-LENGTH
295 \headII: \TT\#SYNTH16
297 If this command is activated, it causes raw samples that are imported and
298 any samples which are internally synthesized to use 16-bits, which can
299 result higher quality audio but larger file.
301 \headII: \TT\#TEMPO
303 Define initial tempo of song, in beats per minute, which must range from
304 32 to 255. The default value is 120.
306 The tempo can be changed later in the song by the {\tt t} command.
308 \headII: \TT\#TITLE
310 Set the song title, which will probably be displayed in a program that
311 plays this music. There is a maximum of 25 ASCII characters. You cannot
312 comment anything out on this line.
314 \headII: \TT\#TRACKER-VERSION
316 Allows you to change the value of ``Cwt'' field in the header of output.
317 By default it uses the hexadecimal number {\tt\$7xyz} for ITMCK version
318 x.y.z although you can change it to pretend to be a different program or
319 a different version.
321 \headII: \TT\#VOL0MIXOPT
323 This has the same effect as the {\tt-v} command-line switch.
325 \headII: \TT\#VOLUME
327 Set initial global volume, which must range from 0 to 128. Default setting
328 is 128.
330 \headII: \TT\#WHOLE-NOTE
332 Set the number of frames of a whole note, which must be greater than zero.
333 The default is 48 frames.
335 \headI: Channels
337 There are up to sixteen channels, labeled with the uppercase letters
338 {\tt A} to {\tt P}. Each channel plays notes individually and can have its
339 own settings for volume, panning, note length, transpose, special effects,
340 etc.
342 To define initial channel volume and panning, you can use the
343 {\tt\#CHANNEL} command or you may use a macro definition as follows:
345 {\tt@A = 30 40}
347 In this example, the channel being assigned is {\tt A} and the volume is
348 30 and the panning is 40. The volume ranges from 0 to 64. The panning
349 ranges from 0 to 64 (where 32 is centered), or enter 100 for surround
350 sound.
352 \headI: Song Message
354 A song message consists of any number of lines starting with {\tt"} and
355 followed by the text to place on that line. The text can include any ASCII
356 text, including semicolons and leading spaces. All of them are then put
357 together in the song message. This song message may be displayed in the
358 player. (Do not include another quotation mark at the end unless you want
359 it a part of the message.)
361 You cannot comment anything out on this line.
363 The song message should not exceed 8000 characters (counting line breaks
364 as one character each).
366 \headI: Samples
368 \headII: Synthesizer
370 \headI: Instruments
372 \headI: Music Entry
374 \headII: {\TT a}--{\TT j} (note letters)
376 \headII: {\TT l} (length)
378 \headII: {\TT n} (direct note entry)
380 \headII: {\TT o} (select octave)
382 \headII: {\TT q} (quantize)
384 \headII: {\TT r} (rest)
386 \headII: {\TT t} (tempo)
388 \headII: {\TT v} (volume)
390 \headII: {\TT z} (cancel effects)
392 \headII: {\TT C} (set note cuts)
394 \headII: {\TT G} (global volume)
396 \headII: {\TT I} (tremor)
398 \headII: {\TT J} (arpeggio)
400 \headII: {\TT K} (transpose)
402 \headII: {\TT L} {\TT||} {\TT|L} (song loop)
404 \headII: {\TT P} (panning)
406 \headII: {\TT Q} (retrigger)
408 \headII: {\TT R} (portamento)
410 \headII: {\TT T} (tremolo)
412 \headII: {\TT V} (vibrato)
414 \headII: {\TT X} (call macro)
416 \headII: {\TT Y} (panbrello)
418 \headII: {\TT[} {\TT]} (repeat)
420 \headII: {\TT<} {\TT>} (low octave/high octave)
422 \headII: {\TT\&} (slur)
424 \headII: {\TT\char`^} (tie)
426 \headII: {\TT/} (auto-portamento)
428 \headII: {\TT\char`\\} (synchronize channel)
430 \headII: {\TT@} (instrument select)
432 \headII: {\TT@@} (key table select)
434 \headII: {\TT@e} (direct effect entry)
436 \headII: {\TT@q} (quantize)
438 \headII: {\TT@u} (effect table select)
440 \headII: {\TT@A}--{\TT@P} (channel select)
442 \headII: {\TT@`} (ask status)
444 \headII: {\TT@=} {\TT@+} {\TT@-} {\TT@*} (assign variable)
446 \headI: Macros
448 \headI: Key Tables
450 \headI: Effect Tables
452 % === End main document text ===
454 \let\TT=\tentt
455 \let\Tt=\tentt
457 \vfill\eject
458 \immediate\closeout\tocfile
460 \headline={}
461 \footline={}
463 \def\dotleaders{\leaders\hbox{ . }\hfill}
464 \def\tocI#1#2{\line{#1 \dotleaders\ #2}}
465 \def\tocII#1#2{\line{\quad#1\rm\ \dotleaders\ #2}}
466 \def\tocIII#1#2{\line{\qquad#1\ \dotleaders\ #2}}
468 \vfill
469 \line{\headIfont Table of Contents\hfil}
470 \bigskip
471 \input\jobname.toc
472 \vfill
474 \bye