Update language2.txt.
[ahxm.git] / doc / language2.txt
blob090db69c9e1ed1ef960c41feaa089651369bafff
1 Ann Hell Ex Machina Scripting - II: Extended Commands
2 =====================================================
4  Angel Ortega <angel@triptico.com>
6 Overview
7 --------
9 Those directives that are not pure music instructions or are specific to a
10 given output mode are called extended commands. They are expressed as
11 curly bracket-enclosed blocks of keywords directly followed by their
12 optional, respective arguments. As for the basic commands, formatting and
13 indentation is free-form.
15 Extended commands are interleaved with basic commands, they are inserted
16 exactly where found and can be enclosed in blocks or group structures as
17 well.
19 Software synthesizer commands
20 -----------------------------
22 wav
23 ~~~
25  wav "file.wav" <base note>
26  wav "file.wav" <base note> <min note> <max note>
27  wav "file.wav" <base note> <min note> <max note> <loop start> <loop end>
29 pat
30 ~~~
32  pat "file.pat"
34 sustain
35 ~~~~~~~
37  sustain <time>
39 vibrato
40 ~~~~~~~
42  vibrato <depth> <frequency>
44 Example:
46  /* good depth values range from 0.45 to 0.68 */
47  /* good frequency values are 6hz to 10hz */
48  { vibrato 0.45ms 6 }
50 channel
51 ~~~~~~~
53  channel <channel #> <volume>
55 vol
56 ~~~
58  vol <volume>
59  vol <volume> <volume>
60  vol <volume> <volume> <volume>
61  vol <volume> <volume> <volume> <volume>
62  vol <volume> <volume> <volume> <volume> <volume> <volume>
64 pitch_stretch
65 ~~~~~~~~~~~~~
67  pitch_stretch <note> <length in wholes> <volume>
69 time_stretch
70 ~~~~~~~~~~~~
72  time_stretch <note> <length in wholes> <volume>
74 This command is NOT IMPLEMENTED.
76 Digital effect commands
77 -----------------------
79 delay
80 ~~~~~
82  delay <channel> <time>
84 Creates a phase delay in <channel>. Sample output will be delayed by
85 the <time> specification. No further filtering is done.
87 Example:
89  /* add a phase delay of 20 milliseconds in the right channel */
90  { delay 1 20ms }
92 echo
93 ~~~~
95  echo <channel> <time> <gain>
97 Creates an echo effect in <channel>. Sample output will be pass as is,
98 but mixed with the original signal phased by <time> and amplified by
99 <gain>.
101 Example:
103  /* add an 50% echo after 15 milliseconds */
104  { echo 0 15ms 0.5 }
106 comb
107 ~~~~
109  comb <channel> <time> <gain>
111 Creates a comb filter in <channel>. Comb filters are used for implementing
112 reverbs.
114 Example:
116  /* comb filter */
117  { comb 0 1ms 0.4 }
119 allpass
120 ~~~~~~~
122  allpass <channel> <time> <gain>
124 Creates an allpass filter in <channel>. Allpass filters are used for
125 implementing reverbs (see the built-in reverb command).
127 Example:
129  /* allpass filter */
130  { allpass 0 20ms 0.9 }
132 flanger
133 ~~~~~~~
135  flanger <channel> <time> <gain> <depth> <freq> <phase>
137 Creates a flanger effect in <channel>.
139 Example:
141  /* good stereo flanger */
142  { flanger 0 1s 0.9 3.40ms 0.1 0
143    flanger 1 1s 0.9 3.40ms 0.1 0.25 }
145 wobble
146 ~~~~~~
148  wobble <channel> <freq> <phase>
150 Creates a wobble effect in <channel>. Amplitude will have a sine wave
151 applied with a frequency of <freq>, so volume will effectively go from
152 full amplitude to silence twice a period. The initial value for the
153 phase is set in <phase>. The wobble effect can be used to implement
154 tremolos with short frequencies and pan effects with long ones.
156 Examples:
158  /* tremolo (10Hz frequency) */
159  { wobble 0 10 0 }
161  /* long stereo panning: one complete cycle
162     in 4 seconds (0.25Hz), with a 1/4 period
163     phase difference between both channels */
164  { wobble 0 0.25 0
165    wobble 1 0.25 0.25 }
167 square_wobble
168 ~~~~~~~~~~~~~
170  square_wobble <channel> <freq> <phase>
172 Creates a square wobble effect in <channel>. Its behaviour is the same
173 as the wobble command, but applying a square wave instead, so volume
174 will abruptly change from full amplitude to absolute silence twice a
175 period.
177 fader
178 ~~~~~
180  fader <channel> <time> <initial volume> <final volume>
182 Creates a fader effect in <channel>. <Time> is the length that will take
183 the channel volume to change from <initial volume> to <final volume>.
184 After <time> is passed, volume will be filtered to <final volume> until
185 the effect is destroyed.
187 Example:
189  /* a 5 seconds fade-in in left channel */
190  { fader 0 5s 0.0 1.0 }
192 reverb
193 ~~~~~~
195  reverb <channel>
197 Creates simple reverb in <channel>. This reverb is defined as
199  { allpass 0 20ms 0.9
200    allpass 0 36ms 0.9
201    allpass 0 39ms 0.9 }
206  off <channel>
208 This command resets the digital effect chain for <channel>, destroying
209 all possible effects in it. Samples will then pass unmodified.
211 MIDI commands
212 -------------
214 midi_channel
215 ~~~~~~~~~~~~
217  midi_channel <channel #>
219 Sets the MIDI channel for the current track. The <channel #> value must range
220 from 1 to 16.
222 midi_program
223 ~~~~~~~~~~~~
225  midi_program <program #>
227 Adds a MIDI program change event. The <program #> value ranges from 0 to 127.
229 ----
230 Angel Ortega - http://www.triptico.com