home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / amiga_e-2.1b.lha / Amiga_E-2.1b / Docs / Utilities / NGRC.doc < prev    next >
Encoding:
Text File  |  1993-10-05  |  11.0 KB  |  335 lines

  1.  
  2. +-----------------------------------------------------------------------+
  3. |            Noise Compiler v1.0 Manual            |
  4. +-----------------------------------------------------------------------+
  5.                          by Wouter van Oortmerssen
  6.  
  7.  
  8. Short:    The noise compiler is a program that translates source files in
  9.     a type of "music programming language" into Noise/ProTracker (tm)
  10.     compatible files.
  11.  
  12. Hardware requirements:    any Amiga (tm) computer.
  13. recommended:        1 or 2 megs of ram, HD, Sampler.
  14.  
  15.  
  16. The Noise Grammar Language can be described as:
  17.  
  18.     - An extended context-free grammar
  19.     - A programming language for music
  20.     - A music specification formalism
  21.  
  22. It can be used as:
  23.  
  24.     - A music program
  25.     - specification language for musical structures
  26.     - an experimental tool for generating music
  27.       (from minimal random elements to competely random)
  28.  
  29.  
  30. +-----------------------------------------------------------------------+
  31. |            The Noise Grammar formalism            |
  32. +-----------------------------------------------------------------------+
  33.  
  34. The noise compiler reads ascii source files containing a description
  35. of a musical piece, parses the text into a so called "syntax-tree",
  36. and then starts generating a sequence of notes by recursively walking
  37. down your definition. finally, it will load all samples and write
  38. all data to a ProTracker (tm) file.
  39.  
  40. A noise grammar program (extension ".ngr") consist of one to unlimited
  41. number of so called "rules" (it really helps if you already know something
  42. about context free grammars). Each rule looks like:
  43.  
  44. <sym> "->" <symlist> ";"
  45.  
  46. (NOTE:    i use an informal notation, as BNF looks too much like the language
  47.     itself. I use <> to denote an item that has to be replaced by some
  48.     adequate ascii representation, "" for strings that are to be taken
  49.     literally)
  50.  
  51. example:
  52.  
  53. beat -> drum [C#,1]                     /* a C-flat */
  54.         { [D,2] | [D#,2] | [Db,2] }     /* D, D-sharp, D-flat */
  55.         ( boomboom 1 );                 /* index=1 */
  56.  
  57. every token may be separated by a whitespace, which denotes any number of
  58. spaces/tabs/linefeeds, and comments which start with "/*" and end
  59. with "*/", and may be nested infinitely.
  60.  
  61. a <symlist> is one or more <item>s. an <item> can be:
  62.  
  63.     <sym> <index>
  64.  
  65. will be recursively replaced by the definition of <sym>.
  66. <index> is optional and explained later
  67. example: drum
  68.  
  69.     "(" <weight> <symlist> ")"
  70.  
  71. as <sym>, only an optional <weight> (default=500, range 0-1000) specifies
  72. the chance of <symlist> getting rewritten, with 0=no chance at all.
  73. example:
  74.  
  75. (beat)        (250 beat)
  76.  
  77. decide while generating if the defintion for "beat" gets played or
  78. not, resp. 50% and 25% chance.
  79.  
  80.     "{" <weight> <symlist> "|" ..... "}"
  81.  
  82. any number of <symlist>s may be between the {}, separated by a bar |.
  83. <weight> is again optional, and again between 0-1000, only now
  84. the default =1. With no weights, simply one of the <simlist>s is
  85. picked. examples:
  86.  
  87. { beat | boomboom | [Gb+,4] }        /* chances: each 33% */
  88. { 3 beat | 7 boomboom }            /* chances: 30%,70% resp. */
  89.  
  90.     <samplename> <vol>
  91.  
  92. an AmigaDos path to a sample, <vol> is an optional integer, range 0-64
  93. example: "samples:guitar.iff"
  94.  
  95.     "[" <note> "," <duration> "]"
  96.  
  97. a note specification, see below.
  98.  
  99.     <hexinteger>
  100.  
  101. a special effects spec., see below.
  102.  
  103.  
  104. NOTES.
  105. ------
  106.  
  107. a <note> is a character like:  C D E F G A B
  108. it may be followed by any number of modifiers, where:
  109.  
  110. "#" = sharp
  111. "b" = flat
  112. "+" = octave up
  113. "-" = octave down
  114.  
  115. in general, you can get only one octave up/down, and the parser will
  116. give an error if you write something like "E+++"
  117. Any number of "#" and "b" are allowed, only in general you would
  118. write "D" for "C##", or "F" for "E#" etc. Note that the current
  119. version of the noise compiler only allows for C-major. Examples:
  120.  
  121. C    C (the one in the middle of a piano)
  122. C#+    C-sharp one octave up
  123. Dbb-    C one octave down
  124.  
  125. for those who are not at all familiar with classical notes, a note
  126. may also be specified as an integer ranging from -12 to 23, with
  127. 0 being the middle C again, and negative numbers lower notes.
  128.  
  129. the <duration> is an integer specifying the time in units spent
  130. on playing the note, before starting the new one, range = 1-100
  131. A unit is about a quarter of a normal note, so a whole note should
  132. be written "4" etc. examples:
  133.  
  134. [C,1]
  135. [F#,4]         /* an F-sharp for one second */
  136.  
  137.  
  138. SOUND EFFECTS.
  139. --------------
  140.  
  141. various souneffects may be used as an hexadecimal integer.
  142. Such an effect only works with the next following note.
  143. Example:
  144.  
  145. mainpart -> $E01 drums solo drums
  146.  
  147. puts hardware audio filter off before play. Summary of effects:
  148.  
  149. ----------------------------------------------------------------------------
  150. 0 - Normal play or Arpeggio             0xy : x-first halfnote add, y-second
  151. 1 - Slide Up                            1xx : upspeed
  152. 2 - Slide Down                          2xx : downspeed
  153. 3 - Tone Portamento                     3xx : up/down speed
  154. 4 - Vibrato                             4xy : x-speed,   y-depth
  155. 5 - Tone Portamento + Volume Slide      5xy : x-upspeed, y-downspeed
  156. 6 - Vibrato + Volume Slide              6xy : x-upspeed, y-downspeed
  157. 7 - Tremolo                             7xy : x-speed,   y-depth
  158. 9 - Set SampleOffset                    9xx : offset (23 -> 2300)
  159. A - VolumeSlide                         Axy : x-upspeed, y-downspeed
  160. C - Set Volume                          Cxx : volume, 00-40
  161. E - E-Commands                          Exy : see below...
  162. F - Set Speed                           Fxx : speed (00-1F) / tempo (20-FF)
  163. ----------------------------------------------------------------------------
  164. E0- Set Filter                          E0x : 0-filter on, 1-filter off
  165. E1- FineSlide Up                        E1x : value
  166. E2- FineSlide Down                      E2x : value
  167. E3- Glissando Control                   E3x : 0-off, 1-on (use with tonep.)
  168. E4- Set Vibrato Waveform                E4x : 0-sine, 1-ramp down, 2-square
  169. E5- Set Loop                            E5x : set loop point
  170. E6- Jump to Loop                        E6x : jump to loop, play x times
  171. E7- Set Tremolo Waveform                E7x : 0-sine, 1-ramp down. 2-square
  172. E9- Retrig Note                         E9x : retrig from note + x vblanks
  173. EA- Fine VolumeSlide Up                 EAx : add x to volume
  174. EB- Fine VolumeSlide Down               EBx : subtract x from volume
  175. EC- NoteCut                             ECx : cut from note + x vblanks
  176. ED- NoteDelay                           EDx : delay note x vblanks
  177. EF- Invert Loop                         EFx : speed
  178. ----------------------------------------------------------------------------
  179.  
  180.  
  181. INDEXING.
  182. ---------
  183.  
  184. while () and {|||} are nice ways to either generate totally random music, or
  185. just make your pieces sound more natural due to some variation, one often
  186. wishes to have the random choices made repeated: for example, if
  187. you design a symbol "beat" that you wish to re-use in certain parts of
  188. your program, and the definition contains some random-variation, you
  189. may want to have the random choices fixed for the second time you use it,
  190. because it would sound totally random otherwise. for example, considering
  191. the pseudo-definition of "beat" above:
  192.  
  193. beats -> beat boomboom beat boomboom;
  194.  
  195. this looks like a normal rhytm, but "beat" is replaced by two different
  196. sequences of notes. with:
  197.  
  198. beats -> beat1 boomboom2 beat1 boomboom2;
  199.  
  200. you specify that with the first "beat", the random choices are recorded
  201. and all others that are similar indexed will have their notes generated
  202. according to the first. note that this doesn't work for samples, i.e:
  203.  
  204. beats -> "bass.iff" beat1 "hihat.iff" beat1;
  205.  
  206. will generate two exactly the same sequences, only played by different
  207. instruments.
  208.  
  209.  
  210. SYMBOLS AND CHANNELS.
  211. ---------------------
  212.  
  213. A symbol consists of any number of lowercase characters. As the
  214. Amiga plays four channels simulanously, there's not one start
  215. symbol for the grammar, but four, called: "one", "two", "three",
  216. "four". Atleast one of these has to be defined in a grammar.
  217. Example:
  218.  
  219. one -> "dat:noiz/Dguitar" 20 aa1;
  220. two -> "dat:noiz/drumz/bassdrum" aa1;
  221.  
  222. aa -> a $E00 a $E01 a a;
  223.  
  224. a -> { c d c c d d | d d | c d c d | c c };
  225.  
  226. c -> [C,1] [C#,3];
  227. d -> [D,2] [D,3];
  228.  
  229. plays the sequence "aa" simultanously over two channels, by two
  230. different instruments, with volumes 20 and 64. the sequence "aa"
  231. consists of several instances of "a", while switching filter
  232. on/off. "a" consist of 4 possible sequences, which in turn
  233. consist of notes to be played. (NOTE: don't try these examples,
  234. they no pieces of real music, just "examples")
  235.  
  236.  
  237. DESIGNING TUNES.
  238. ----------------
  239. The process of designing your songs may proceed in two ways:
  240. bottom up or top down. In the latter case you would have quite
  241. a fixed idea of what the song should be like: you write down
  242. the global structure of the song, and then step by step
  243. write out the symbols to notes.
  244. In the former case, you could design some nice set of symbols,
  245. each being a sequence of notes, and start building larger blocks
  246. from them, to create a song.
  247. For example, for a small guitar tune, we would start with
  248. a defintion of some notes, a and b
  249.  
  250. a -> [D,1] [E,3];
  251. b -> [D,1] [D#,7];
  252.  
  253. Then, we would combine them into a sequence:
  254.  
  255. c -> a a a b;
  256.  
  257. Finally, we play those over channel one, and define a sample:
  258.  
  259. one -> guitar c c c a [C,16];          /* just one channel */
  260.  
  261. /* our set of instruments */
  262. guitar -> "dat:noiz/Dguitar";
  263.  
  264. note that notes get played by a certain instrument from the point it
  265. is encountered in the grammar.
  266.  
  267. Example:
  268.  
  269.  
  270. /* "gaspits.ngr":
  271.    gaspits that make noises on the vibrations of the fridge,
  272.    combined with drums and guitars */
  273.  
  274. gaspits -> "dat:noiz/gaspits";         /* the samples */
  275. drum -> "dat:noiz/drumz/bassdrum" 50;
  276. guitar -> "dat:noiz/dguitar" 32;
  277.  
  278.  
  279. one -> gaspits c;                      /* play rule "c" over channel 1 */
  280.  
  281. a -> [C,4] [D,8];
  282. b -> [E,2] [E,2] [D#,8];
  283.  
  284. c -> a b [E-,16]
  285.      a b [E-,16]
  286.        b [D#-,8];
  287.  
  288.  
  289. two -> drum f;                         /* drums on channel two and three */
  290. three -> drum [C,1] f;
  291.  
  292. d -> g [C,2] [C,2];
  293. e -> g [C,1] [C,1] [C,1] [C,1];
  294.  
  295. f -> d e d e d e;
  296.  
  297. g -> [C,4] [C,4] [C,4];
  298.  
  299.  
  300. four -> guitar [Fb-,64] [F-,64];       /* soft quitar-sounds on four */
  301.  
  302.  
  303.  
  304.  
  305. USING RANDOMNESS.
  306. -----------------
  307. You may use randomness to bring subtle variations into your music,
  308. for example, with:
  309.  
  310. mynote -> { 10 [D,2] | 1 [D#,2] | 1 [Db,2] };
  311.  
  312. we define a note that is played like a "D" most of the time, but
  313. occasionally flat or sharp. We can easily do the same thing with
  314. the duration, or even with the order a certain sequence gets played.
  315. However, do not expect chances to be purely random: random
  316. sequences are generated by a computer random function that
  317. cannot be perfect (atleast not in this implementation), i.e
  318. when you specify 80% 10% 10%, in reality it may turn out to be
  319. 75% 5% 20%
  320. You can also make more random music: You still specify what the piece
  321. is to be like, only at crucial points you let the computer decide:
  322. You then may want to compile the grammar several times to see
  323. which sounds best, and find out strange but interesting music comes
  324. out, which you hadn't thought of yourself.
  325.  
  326.  
  327. ---------------------------------------------------------------------
  328.  
  329.  
  330. Contact the author:
  331.  
  332.     Wouter@alf.let.uva.nl
  333.     Wouter@mars.let.uva.nl
  334.     Oortmers@gene.fwi.uva.nl
  335.