home *** CD-ROM | disk | FTP | other *** search
-
- +-----------------------------------------------------------------------+
- | Noise Compiler v1.0 Manual |
- +-----------------------------------------------------------------------+
- by Wouter van Oortmerssen
-
-
- Short: The noise compiler is a program that translates source files in
- a type of "music programming language" into Noise/ProTracker (tm)
- compatible files.
-
- Hardware requirements: any Amiga (tm) computer.
- recommended: 1 or 2 megs of ram, HD, Sampler.
-
-
- The Noise Grammar Language can be described as:
-
- - An extended context-free grammar
- - A programming language for music
- - A music specification formalism
-
- It can be used as:
-
- - A music program
- - specification language for musical structures
- - an experimental tool for generating music
- (from minimal random elements to competely random)
-
-
- +-----------------------------------------------------------------------+
- | The Noise Grammar formalism |
- +-----------------------------------------------------------------------+
-
- The noise compiler reads ascii source files containing a description
- of a musical piece, parses the text into a so called "syntax-tree",
- and then starts generating a sequence of notes by recursively walking
- down your definition. finally, it will load all samples and write
- all data to a ProTracker (tm) file.
-
- A noise grammar program (extension ".ngr") consist of one to unlimited
- number of so called "rules" (it really helps if you already know something
- about context free grammars). Each rule looks like:
-
- <sym> "->" <symlist> ";"
-
- (NOTE: i use an informal notation, as BNF looks too much like the language
- itself. I use <> to denote an item that has to be replaced by some
- adequate ascii representation, "" for strings that are to be taken
- literally)
-
- example:
-
- beat -> drum [C#,1] /* a C-flat */
- { [D,2] | [D#,2] | [Db,2] } /* D, D-sharp, D-flat */
- ( boomboom 1 ); /* index=1 */
-
- every token may be separated by a whitespace, which denotes any number of
- spaces/tabs/linefeeds, and comments which start with "/*" and end
- with "*/", and may be nested infinitely.
-
- a <symlist> is one or more <item>s. an <item> can be:
-
- <sym> <index>
-
- will be recursively replaced by the definition of <sym>.
- <index> is optional and explained later
- example: drum
-
- "(" <weight> <symlist> ")"
-
- as <sym>, only an optional <weight> (default=500, range 0-1000) specifies
- the chance of <symlist> getting rewritten, with 0=no chance at all.
- example:
-
- (beat) (250 beat)
-
- decide while generating if the defintion for "beat" gets played or
- not, resp. 50% and 25% chance.
-
- "{" <weight> <symlist> "|" ..... "}"
-
- any number of <symlist>s may be between the {}, separated by a bar |.
- <weight> is again optional, and again between 0-1000, only now
- the default =1. With no weights, simply one of the <simlist>s is
- picked. examples:
-
- { beat | boomboom | [Gb+,4] } /* chances: each 33% */
- { 3 beat | 7 boomboom } /* chances: 30%,70% resp. */
-
- <samplename> <vol>
-
- an AmigaDos path to a sample, <vol> is an optional integer, range 0-64
- example: "samples:guitar.iff"
-
- "[" <note> "," <duration> "]"
-
- a note specification, see below.
-
- <hexinteger>
-
- a special effects spec., see below.
-
-
- NOTES.
- ------
-
- a <note> is a character like: C D E F G A B
- it may be followed by any number of modifiers, where:
-
- "#" = sharp
- "b" = flat
- "+" = octave up
- "-" = octave down
-
- in general, you can get only one octave up/down, and the parser will
- give an error if you write something like "E+++"
- Any number of "#" and "b" are allowed, only in general you would
- write "D" for "C##", or "F" for "E#" etc. Note that the current
- version of the noise compiler only allows for C-major. Examples:
-
- C C (the one in the middle of a piano)
- C#+ C-sharp one octave up
- Dbb- C one octave down
-
- for those who are not at all familiar with classical notes, a note
- may also be specified as an integer ranging from -12 to 23, with
- 0 being the middle C again, and negative numbers lower notes.
-
- the <duration> is an integer specifying the time in units spent
- on playing the note, before starting the new one, range = 1-100
- A unit is about a quarter of a normal note, so a whole note should
- be written "4" etc. examples:
-
- [C,1]
- [F#,4] /* an F-sharp for one second */
-
-
- SOUND EFFECTS.
- --------------
-
- various souneffects may be used as an hexadecimal integer.
- Such an effect only works with the next following note.
- Example:
-
- mainpart -> $E01 drums solo drums
-
- puts hardware audio filter off before play. Summary of effects:
-
- ----------------------------------------------------------------------------
- 0 - Normal play or Arpeggio 0xy : x-first halfnote add, y-second
- 1 - Slide Up 1xx : upspeed
- 2 - Slide Down 2xx : downspeed
- 3 - Tone Portamento 3xx : up/down speed
- 4 - Vibrato 4xy : x-speed, y-depth
- 5 - Tone Portamento + Volume Slide 5xy : x-upspeed, y-downspeed
- 6 - Vibrato + Volume Slide 6xy : x-upspeed, y-downspeed
- 7 - Tremolo 7xy : x-speed, y-depth
- 9 - Set SampleOffset 9xx : offset (23 -> 2300)
- A - VolumeSlide Axy : x-upspeed, y-downspeed
- C - Set Volume Cxx : volume, 00-40
- E - E-Commands Exy : see below...
- F - Set Speed Fxx : speed (00-1F) / tempo (20-FF)
- ----------------------------------------------------------------------------
- E0- Set Filter E0x : 0-filter on, 1-filter off
- E1- FineSlide Up E1x : value
- E2- FineSlide Down E2x : value
- E3- Glissando Control E3x : 0-off, 1-on (use with tonep.)
- E4- Set Vibrato Waveform E4x : 0-sine, 1-ramp down, 2-square
- E5- Set Loop E5x : set loop point
- E6- Jump to Loop E6x : jump to loop, play x times
- E7- Set Tremolo Waveform E7x : 0-sine, 1-ramp down. 2-square
- E9- Retrig Note E9x : retrig from note + x vblanks
- EA- Fine VolumeSlide Up EAx : add x to volume
- EB- Fine VolumeSlide Down EBx : subtract x from volume
- EC- NoteCut ECx : cut from note + x vblanks
- ED- NoteDelay EDx : delay note x vblanks
- EF- Invert Loop EFx : speed
- ----------------------------------------------------------------------------
-
-
- INDEXING.
- ---------
-
- while () and {|||} are nice ways to either generate totally random music, or
- just make your pieces sound more natural due to some variation, one often
- wishes to have the random choices made repeated: for example, if
- you design a symbol "beat" that you wish to re-use in certain parts of
- your program, and the definition contains some random-variation, you
- may want to have the random choices fixed for the second time you use it,
- because it would sound totally random otherwise. for example, considering
- the pseudo-definition of "beat" above:
-
- beats -> beat boomboom beat boomboom;
-
- this looks like a normal rhytm, but "beat" is replaced by two different
- sequences of notes. with:
-
- beats -> beat1 boomboom2 beat1 boomboom2;
-
- you specify that with the first "beat", the random choices are recorded
- and all others that are similar indexed will have their notes generated
- according to the first. note that this doesn't work for samples, i.e:
-
- beats -> "bass.iff" beat1 "hihat.iff" beat1;
-
- will generate two exactly the same sequences, only played by different
- instruments.
-
-
- SYMBOLS AND CHANNELS.
- ---------------------
-
- A symbol consists of any number of lowercase characters. As the
- Amiga plays four channels simulanously, there's not one start
- symbol for the grammar, but four, called: "one", "two", "three",
- "four". Atleast one of these has to be defined in a grammar.
- Example:
-
- one -> "dat:noiz/Dguitar" 20 aa1;
- two -> "dat:noiz/drumz/bassdrum" aa1;
-
- aa -> a $E00 a $E01 a a;
-
- a -> { c d c c d d | d d | c d c d | c c };
-
- c -> [C,1] [C#,3];
- d -> [D,2] [D,3];
-
- plays the sequence "aa" simultanously over two channels, by two
- different instruments, with volumes 20 and 64. the sequence "aa"
- consists of several instances of "a", while switching filter
- on/off. "a" consist of 4 possible sequences, which in turn
- consist of notes to be played. (NOTE: don't try these examples,
- they no pieces of real music, just "examples")
-
-
- DESIGNING TUNES.
- ----------------
- The process of designing your songs may proceed in two ways:
- bottom up or top down. In the latter case you would have quite
- a fixed idea of what the song should be like: you write down
- the global structure of the song, and then step by step
- write out the symbols to notes.
- In the former case, you could design some nice set of symbols,
- each being a sequence of notes, and start building larger blocks
- from them, to create a song.
- For example, for a small guitar tune, we would start with
- a defintion of some notes, a and b
-
- a -> [D,1] [E,3];
- b -> [D,1] [D#,7];
-
- Then, we would combine them into a sequence:
-
- c -> a a a b;
-
- Finally, we play those over channel one, and define a sample:
-
- one -> guitar c c c a [C,16]; /* just one channel */
-
- /* our set of instruments */
- guitar -> "dat:noiz/Dguitar";
-
- note that notes get played by a certain instrument from the point it
- is encountered in the grammar.
-
- Example:
-
-
- /* "gaspits.ngr":
- gaspits that make noises on the vibrations of the fridge,
- combined with drums and guitars */
-
- gaspits -> "dat:noiz/gaspits"; /* the samples */
- drum -> "dat:noiz/drumz/bassdrum" 50;
- guitar -> "dat:noiz/dguitar" 32;
-
-
- one -> gaspits c; /* play rule "c" over channel 1 */
-
- a -> [C,4] [D,8];
- b -> [E,2] [E,2] [D#,8];
-
- c -> a b [E-,16]
- a b [E-,16]
- b [D#-,8];
-
-
- two -> drum f; /* drums on channel two and three */
- three -> drum [C,1] f;
-
- d -> g [C,2] [C,2];
- e -> g [C,1] [C,1] [C,1] [C,1];
-
- f -> d e d e d e;
-
- g -> [C,4] [C,4] [C,4];
-
-
- four -> guitar [Fb-,64] [F-,64]; /* soft quitar-sounds on four */
-
-
-
-
- USING RANDOMNESS.
- -----------------
- You may use randomness to bring subtle variations into your music,
- for example, with:
-
- mynote -> { 10 [D,2] | 1 [D#,2] | 1 [Db,2] };
-
- we define a note that is played like a "D" most of the time, but
- occasionally flat or sharp. We can easily do the same thing with
- the duration, or even with the order a certain sequence gets played.
- However, do not expect chances to be purely random: random
- sequences are generated by a computer random function that
- cannot be perfect (atleast not in this implementation), i.e
- when you specify 80% 10% 10%, in reality it may turn out to be
- 75% 5% 20%
- You can also make more random music: You still specify what the piece
- is to be like, only at crucial points you let the computer decide:
- You then may want to compile the grammar several times to see
- which sounds best, and find out strange but interesting music comes
- out, which you hadn't thought of yourself.
-
-
- ---------------------------------------------------------------------
-
-
- Contact the author:
-
- Wouter@alf.let.uva.nl
- Wouter@mars.let.uva.nl
- Oortmers@gene.fwi.uva.nl
-