tutticode 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +56 -0
- package/README.md +159 -2
- package/README.zh-CN.md +138 -0
- package/dist/skills/tutticode/SKILL.md +140 -0
- package/dist/skills/tutticode/references/agent-loop.md +103 -0
- package/dist/skills/tutticode/references/devices/aligndelay.md +28 -0
- package/dist/skills/tutticode/references/devices/amp.md +25 -0
- package/dist/skills/tutticode/references/devices/analog.md +180 -0
- package/dist/skills/tutticode/references/devices/arpeggiator.md +37 -0
- package/dist/skills/tutticode/references/devices/autopan.md +37 -0
- package/dist/skills/tutticode/references/devices/autoshift.md +66 -0
- package/dist/skills/tutticode/references/devices/beatrepeat.md +35 -0
- package/dist/skills/tutticode/references/devices/cabinet.md +19 -0
- package/dist/skills/tutticode/references/devices/channeleq.md +23 -0
- package/dist/skills/tutticode/references/devices/chorus.md +31 -0
- package/dist/skills/tutticode/references/devices/collision.md +129 -0
- package/dist/skills/tutticode/references/devices/compressor.md +40 -0
- package/dist/skills/tutticode/references/devices/corpus.md +51 -0
- package/dist/skills/tutticode/references/devices/delay.md +37 -0
- package/dist/skills/tutticode/references/devices/denoise.md +19 -0
- package/dist/skills/tutticode/references/devices/drift.md +82 -0
- package/dist/skills/tutticode/references/devices/drumbuss.md +29 -0
- package/dist/skills/tutticode/references/devices/drumrack.md +225 -0
- package/dist/skills/tutticode/references/devices/dsclang.md +26 -0
- package/dist/skills/tutticode/references/devices/dsclap.md +25 -0
- package/dist/skills/tutticode/references/devices/dscymbal.md +22 -0
- package/dist/skills/tutticode/references/devices/dsfm.md +25 -0
- package/dist/skills/tutticode/references/devices/dshh.md +23 -0
- package/dist/skills/tutticode/references/devices/dskick.md +25 -0
- package/dist/skills/tutticode/references/devices/dssnare.md +23 -0
- package/dist/skills/tutticode/references/devices/dstom.md +24 -0
- package/dist/skills/tutticode/references/devices/dynamic-tube.md +26 -0
- package/dist/skills/tutticode/references/devices/echo.md +56 -0
- package/dist/skills/tutticode/references/devices/electric.md +50 -0
- package/dist/skills/tutticode/references/devices/ensemble.md +129 -0
- package/dist/skills/tutticode/references/devices/eqeight.md +69 -0
- package/dist/skills/tutticode/references/devices/eqthree.md +27 -0
- package/dist/skills/tutticode/references/devices/erosion.md +22 -0
- package/dist/skills/tutticode/references/devices/filter.md +55 -0
- package/dist/skills/tutticode/references/devices/filterdelay.md +37 -0
- package/dist/skills/tutticode/references/devices/gate.md +36 -0
- package/dist/skills/tutticode/references/devices/glue.md +36 -0
- package/dist/skills/tutticode/references/devices/graindelay.md +26 -0
- package/dist/skills/tutticode/references/devices/hybrid-reverb.md +22 -0
- package/dist/skills/tutticode/references/devices/impulse.md +157 -0
- package/dist/skills/tutticode/references/devices/leveler.md +23 -0
- package/dist/skills/tutticode/references/devices/limiter.md +26 -0
- package/dist/skills/tutticode/references/devices/meld.md +239 -0
- package/dist/skills/tutticode/references/devices/midichord.md +46 -0
- package/dist/skills/tutticode/references/devices/midifmarp.md +26 -0
- package/dist/skills/tutticode/references/devices/midinoteecho.md +30 -0
- package/dist/skills/tutticode/references/devices/midinotelength.md +27 -0
- package/dist/skills/tutticode/references/devices/midipitch.md +26 -0
- package/dist/skills/tutticode/references/devices/midirandom.md +24 -0
- package/dist/skills/tutticode/references/devices/midiscale.md +25 -0
- package/dist/skills/tutticode/references/devices/midivelocity.md +27 -0
- package/dist/skills/tutticode/references/devices/multibanddynamics.md +62 -0
- package/dist/skills/tutticode/references/devices/operator.md +163 -0
- package/dist/skills/tutticode/references/devices/overdrive.md +24 -0
- package/dist/skills/tutticode/references/devices/pedal.md +26 -0
- package/dist/skills/tutticode/references/devices/phaserflanger.md +42 -0
- package/dist/skills/tutticode/references/devices/pitchshifter.md +56 -0
- package/dist/skills/tutticode/references/devices/redux.md +27 -0
- package/dist/skills/tutticode/references/devices/resonator.md +49 -0
- package/dist/skills/tutticode/references/devices/reverb.md +43 -0
- package/dist/skills/tutticode/references/devices/roar.md +70 -0
- package/dist/skills/tutticode/references/devices/sampler.md +228 -0
- package/dist/skills/tutticode/references/devices/saturator.md +24 -0
- package/dist/skills/tutticode/references/devices/simpler.md +230 -0
- package/dist/skills/tutticode/references/devices/sixop.md +190 -0
- package/dist/skills/tutticode/references/devices/spectralresonator.md +42 -0
- package/dist/skills/tutticode/references/devices/spectraltime.md +45 -0
- package/dist/skills/tutticode/references/devices/synth.md +28 -0
- package/dist/skills/tutticode/references/devices/tension.md +117 -0
- package/dist/skills/tutticode/references/devices/utility.md +29 -0
- package/dist/skills/tutticode/references/devices/vinyl.md +31 -0
- package/dist/skills/tutticode/references/devices/vocoder.md +41 -0
- package/dist/skills/tutticode/references/devices/wavetable.md +128 -0
- package/dist/skills/tutticode/references/devices.md +114 -0
- package/dist/skills/tutticode/references/effect-controls.md +145 -0
- package/dist/skills/tutticode/references/first-sounds.md +89 -0
- package/dist/skills/tutticode/references/for-agents.md +119 -0
- package/dist/skills/tutticode/references/functions.md +1848 -0
- package/dist/skills/tutticode/references/getting-started.md +79 -0
- package/dist/skills/tutticode/references/harmony-and-scales.md +105 -0
- package/dist/skills/tutticode/references/javascript.md +90 -0
- package/dist/skills/tutticode/references/mini-notation.md +120 -0
- package/dist/skills/tutticode/references/mixing.md +101 -0
- package/dist/skills/tutticode/references/muse.md +67 -0
- package/dist/skills/tutticode/references/sample-operations.md +102 -0
- package/dist/skills/tutticode/references/sounds.md +109 -0
- package/dist/skills/tutticode/references/time-and-structure.md +161 -0
- package/dist/skills/tutticode/references/tuttidaw-extensions.md +131 -0
- package/dist/skills/tutticode-sound-for-media/SKILL.md +97 -0
- package/dist/skills/tutticode-sound-for-media/references/music-recipes.md +86 -0
- package/dist/skills/tutticode-sound-for-media/references/sfx-recipes.md +129 -0
- package/dist/tutticode.cjs +18694 -0
- package/package.json +39 -4
|
@@ -0,0 +1,1848 @@
|
|
|
1
|
+
# Function reference
|
|
2
|
+
|
|
3
|
+
Generated from TuttiDAW's pattern engine: every function, method and signal
|
|
4
|
+
it knows, with a short description and an example that compiles. Names
|
|
5
|
+
marked *(TuttiDAW only)* are extensions that strudel.cc does not have.
|
|
6
|
+
|
|
7
|
+
## Functions
|
|
8
|
+
|
|
9
|
+
### `aliasBank(bank, alias?)`
|
|
10
|
+
|
|
11
|
+
Gives a drum machine bank another name for bank(); also takes an object { bank: alias }.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
aliasBank("RolandTR909", "nine")
|
|
15
|
+
s("bd*4, hh*8").bank("nine")
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### `all(fn)`
|
|
19
|
+
|
|
20
|
+
Applies one transformation to every program voice.
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
all(x => x.fast(2)); $: note("60 64")
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### `arrange(...sections)`
|
|
27
|
+
|
|
28
|
+
Sections played back to back for the given cycles, looping.
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
arrange([4, note("c e")], [2, note("f a")])
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### `bus(name)` *(TuttiDAW only)*
|
|
35
|
+
|
|
36
|
+
TuttiDAW extension, not in Strudel: declares a bus, a return track of the program; give it .fx(...) and .mix(...), and send voices to it with .send(name, dB).
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
bus("verb").fx("Reverb:Large Hall", {dryWetBalance: 1})
|
|
40
|
+
keys: note("c3 e3 g3").send("verb", -12)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `cat(...patterns)`
|
|
44
|
+
|
|
45
|
+
One pattern per cycle, in turn.
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
cat(note("c e"), note("g b"))
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `chooseCycles(...patterns)`
|
|
52
|
+
|
|
53
|
+
Picks one pattern at random each cycle.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
chooseCycles(s("bd"), s("hh"), s("sd")).fast(4)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### `chord(symbols)`
|
|
60
|
+
|
|
61
|
+
Sets chord symbols; also available as .chord(symbols) or .chord().
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
chord("<Bbm9 Fm9>/4").dict("ireal").voicing()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `hush()`
|
|
68
|
+
|
|
69
|
+
Silence.
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
stack(s("bd").hush(), s("hh*4"))
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### `irand(n)`
|
|
76
|
+
|
|
77
|
+
Random whole numbers from 0 to n-1 (continuous).
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
n(irand(8).segment(4)).scale("C:minor")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### `master`
|
|
84
|
+
|
|
85
|
+
TuttiDAW extension, not in Strudel: the program's own bus, which every voice and bus feeds; give it .fx(...) and .mix(...).
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
master.fx("Limiter").mix({vol: -1})
|
|
89
|
+
$: s("bd sd")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `n(numbers)`
|
|
93
|
+
|
|
94
|
+
Numbers: scale degrees with .scale(), sample variants with s().
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
n("0 2 4").scale("C:minor")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### `note(notes)`
|
|
101
|
+
|
|
102
|
+
Plays pitches: note names (c4, eb3) or MIDI numbers (60).
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
note("c3 e3 g3 b3")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `pure(value)`
|
|
109
|
+
|
|
110
|
+
One event per cycle with the value.
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
note(pure(60))
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### `register(name, fn)`
|
|
117
|
+
|
|
118
|
+
Defines a new method (and a function) from your own code; the pattern comes last.
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
register('dub', (pat) => pat.room(0.5))
|
|
122
|
+
$: note("c3 e3").dub()
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `run(n)`
|
|
126
|
+
|
|
127
|
+
The numbers 0 to n-1 in one cycle.
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
n(run(4)).scale("C:major")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `s(sounds)`
|
|
134
|
+
|
|
135
|
+
Picks the sound: drum names (bd sd hh) or a synth (sawtooth, piano).
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
s("bd sd [~ bd] sd")
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `samples(mapOrManifest, base?)`
|
|
142
|
+
|
|
143
|
+
Declares external sample references; browser consumers load audio explicitly.
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
samples('github:user/repo')
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### `seq(...patterns)`
|
|
150
|
+
|
|
151
|
+
Squeezes all patterns into one cycle, one after another.
|
|
152
|
+
|
|
153
|
+
```js
|
|
154
|
+
seq(s("bd"), s("sd sd"))
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `setcpm(cpm)`
|
|
158
|
+
|
|
159
|
+
Asks for a tempo in cycles per minute (one cycle = one bar).
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
setcpm(30)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `setcps(cps)`
|
|
166
|
+
|
|
167
|
+
Asks for a tempo in cycles per second.
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
setcps(0.5)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### `setDefault(control, value?)`
|
|
174
|
+
|
|
175
|
+
A value every event plays with unless it sets that control itself; also takes an object of controls.
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
setDefault({ room: 0.3, lpf: 2000 })
|
|
179
|
+
note("c3 e3 g3").s("sawtooth")
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### `setDefaultVoicings(name)`
|
|
183
|
+
|
|
184
|
+
Sets the default voicing dictionary for this program only.
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
setDefaultVoicings('ireal'); chord("Cm9").voicing()
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### `setGainCurve(fn)`
|
|
191
|
+
|
|
192
|
+
Passes every gain and velocity value through a function, e.g. x => x * x for a quadratic curve.
|
|
193
|
+
|
|
194
|
+
```js
|
|
195
|
+
setGainCurve(x => x * x)
|
|
196
|
+
s("hh*8").gain(".4 1")
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### `silence`
|
|
200
|
+
|
|
201
|
+
A pattern with no events.
|
|
202
|
+
|
|
203
|
+
```js
|
|
204
|
+
cat(s("bd"), silence)
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### `slider(value, min = 0, max = 1, step?)`
|
|
208
|
+
|
|
209
|
+
A numeric pattern with an inline literal control.
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
note(slider(60, 48, 72, 1))
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### `soundAlias(sound, alias)`
|
|
216
|
+
|
|
217
|
+
Gives a sound another name for s(); every voice can use it.
|
|
218
|
+
|
|
219
|
+
```js
|
|
220
|
+
soundAlias("RolandTR808_bd", "kick")
|
|
221
|
+
s("kick*4")
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `squeeze(indices, listOrObject)`
|
|
225
|
+
|
|
226
|
+
Squeezes selected cycles into selector events; also a method.
|
|
227
|
+
|
|
228
|
+
```js
|
|
229
|
+
note(squeeze("0 1", ["60 64", "67 72"]))
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### `stack(...patterns)`
|
|
233
|
+
|
|
234
|
+
Plays patterns at the same time.
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
stack(s("bd*4"), note("c2 g2"))
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### `timeCat(...steps)`
|
|
241
|
+
|
|
242
|
+
Sequence in one cycle with relative lengths; a bare "..." pattern weighs its number of steps.
|
|
243
|
+
|
|
244
|
+
```js
|
|
245
|
+
timeCat([3, s("bd")], [1, s("sd")])
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### `toggle(value)` *(TuttiDAW only)*
|
|
249
|
+
|
|
250
|
+
A value pattern with an inline on/off control (Tutti extension, not in Strudel).
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
note("60 64").mask(toggle(1))
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Methods
|
|
257
|
+
|
|
258
|
+
### `.accelerate(amount?)`
|
|
259
|
+
|
|
260
|
+
Glides a sample's pitch over its note: from its speed to speed + accelerate.
|
|
261
|
+
|
|
262
|
+
```js
|
|
263
|
+
s("bd*2 sd").accelerate("<-0.5 1>")
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### `.add(x)`
|
|
267
|
+
|
|
268
|
+
Adds to every value; on note()/n() patterns add note(...) / n(...).
|
|
269
|
+
|
|
270
|
+
```js
|
|
271
|
+
n("0 2 4".add("<0 3>")).scale("C:major")
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### `.almostAlways(f)`
|
|
275
|
+
|
|
276
|
+
Applies f to about 90% of the events.
|
|
277
|
+
|
|
278
|
+
```js
|
|
279
|
+
s("hh*8").almostAlways(x => x.gain(0.7))
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### `.almostNever(f)`
|
|
283
|
+
|
|
284
|
+
Applies f to about 10% of the events.
|
|
285
|
+
|
|
286
|
+
```js
|
|
287
|
+
s("hh*8").almostNever(x => x.ply(2))
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### `.always(f)`
|
|
291
|
+
|
|
292
|
+
Always applies f.
|
|
293
|
+
|
|
294
|
+
```js
|
|
295
|
+
s("hh*4").always(x => x.fast(2))
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### `.amp(level?)`
|
|
299
|
+
|
|
300
|
+
Linear level, multiplied with gain (1 = unchanged).
|
|
301
|
+
|
|
302
|
+
```js
|
|
303
|
+
note("c3*4").s("sawtooth").amp("<1 0.5>")
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### `.anchor(note)`
|
|
307
|
+
|
|
308
|
+
Aligns the voicing to a note name or MIDI pitch (default C5).
|
|
309
|
+
|
|
310
|
+
```js
|
|
311
|
+
chord("C").anchor("D5").voicing()
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### `.arp(indices)`
|
|
315
|
+
|
|
316
|
+
Sequences chord tones inside each event, wrapping indices without octaving.
|
|
317
|
+
|
|
318
|
+
```js
|
|
319
|
+
chord("C").voicing().arp("0 1 2 3")
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### `.attack(time?)`
|
|
323
|
+
|
|
324
|
+
Envelope attack time in seconds.
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
note("c e").s("sawtooth").attack(0.1)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### `.bank(name?)`
|
|
331
|
+
|
|
332
|
+
Drum machine bank for s(), e.g. "RolandTR909".
|
|
333
|
+
|
|
334
|
+
```js
|
|
335
|
+
s("bd sd").bank("RolandTR909")
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### `.begin(position?)`
|
|
339
|
+
|
|
340
|
+
Where a sample starts, 0..1 of its length.
|
|
341
|
+
|
|
342
|
+
```js
|
|
343
|
+
s("hh*4").begin("<0 0.25>")
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### `.bpattack(time?)`
|
|
347
|
+
|
|
348
|
+
Band-pass filter envelope attack in seconds.
|
|
349
|
+
|
|
350
|
+
```js
|
|
351
|
+
note("c2 e2").s("sawtooth").bpf(500).bpattack(0.3).bpenv(3)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### `.bpdecay(time?)`
|
|
355
|
+
|
|
356
|
+
Band-pass filter envelope decay in seconds.
|
|
357
|
+
|
|
358
|
+
```js
|
|
359
|
+
note("c2*4").s("sawtooth").bpf(400).bpenv(4).bpdecay(0.2)
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### `.bpenv(depth?)`
|
|
363
|
+
|
|
364
|
+
Band-pass filter envelope depth in octaves (negative sweeps down).
|
|
365
|
+
|
|
366
|
+
```js
|
|
367
|
+
note("c2 e2 f2 g2").s("sawtooth").bpf(500).bpattack(0.5).bpenv("<4 -2>")
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### `.bpf(frequency?)`
|
|
371
|
+
|
|
372
|
+
Band-pass filter center in Hz ("1000:4" also sets its Q).
|
|
373
|
+
|
|
374
|
+
```js
|
|
375
|
+
s("hh*8").bpf(2000)
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### `.bpq(q?)`
|
|
379
|
+
|
|
380
|
+
Band-pass filter Q.
|
|
381
|
+
|
|
382
|
+
```js
|
|
383
|
+
s("hh*8").bpf(1500).bpq(4)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### `.bprelease(time?)`
|
|
387
|
+
|
|
388
|
+
Band-pass filter envelope release in seconds.
|
|
389
|
+
|
|
390
|
+
```js
|
|
391
|
+
note("c2 ~").s("sawtooth").bpf(400).bpenv(3).bprelease(0.5)
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### `.bpsustain(level?)`
|
|
395
|
+
|
|
396
|
+
Band-pass filter envelope sustain level, 0..1.
|
|
397
|
+
|
|
398
|
+
```js
|
|
399
|
+
note("c2*2").s("sawtooth").bpf(400).bpenv(3).bpdecay(0.2).bpsustain(0.5)
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### `.chop(parts)`
|
|
403
|
+
|
|
404
|
+
Cuts each event and its sample into equal parts played in turn.
|
|
405
|
+
|
|
406
|
+
```js
|
|
407
|
+
s("bd sd").chop(4)
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### `.chorus(amount?)`
|
|
411
|
+
|
|
412
|
+
Chorus amount, 0..1.
|
|
413
|
+
|
|
414
|
+
```js
|
|
415
|
+
note("c e g").s("sawtooth").chorus(0.5)
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### `.chunk(n, f)`
|
|
419
|
+
|
|
420
|
+
Applies f to one of n slices of the cycle, a different slice each cycle.
|
|
421
|
+
|
|
422
|
+
```js
|
|
423
|
+
note("c d e f").chunk(4, x => x.add(note(12)))
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### `.clip(factor?)`
|
|
427
|
+
|
|
428
|
+
Multiplies note length (1 = full step); a sample stops at the note end.
|
|
429
|
+
|
|
430
|
+
```js
|
|
431
|
+
note("c a f e").clip(0.5)
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### `.coarse(factor?)`
|
|
435
|
+
|
|
436
|
+
Sample-rate reduction: higher is coarser.
|
|
437
|
+
|
|
438
|
+
```js
|
|
439
|
+
s("bd sd").coarse(8)
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### `.color(color?)`
|
|
443
|
+
|
|
444
|
+
The voice's colour (a CSS name, #hex or rgb()), as the nearest clip colour.
|
|
445
|
+
|
|
446
|
+
```js
|
|
447
|
+
note("c3 e3 g3").color("orange")
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### `.compressor(threshold?)`
|
|
451
|
+
|
|
452
|
+
Compressor threshold in dB ("thr:ratio:knee:attack:release").
|
|
453
|
+
|
|
454
|
+
```js
|
|
455
|
+
s("bd sd").compressor("-20:20:10:.002:.02")
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### `.compressorAttack(time?)`
|
|
459
|
+
|
|
460
|
+
Compressor attack in seconds.
|
|
461
|
+
|
|
462
|
+
```js
|
|
463
|
+
s("bd sd").compressor(-20).compressorAttack(0.01)
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### `.compressorKnee(knee?)`
|
|
467
|
+
|
|
468
|
+
Compressor knee in dB.
|
|
469
|
+
|
|
470
|
+
```js
|
|
471
|
+
s("bd sd").compressor(-20).compressorKnee(6)
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### `.compressorRatio(ratio?)`
|
|
475
|
+
|
|
476
|
+
Compressor ratio.
|
|
477
|
+
|
|
478
|
+
```js
|
|
479
|
+
s("bd sd").compressor(-20).compressorRatio(8)
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### `.compressorRelease(time?)`
|
|
483
|
+
|
|
484
|
+
Compressor release in seconds.
|
|
485
|
+
|
|
486
|
+
```js
|
|
487
|
+
s("bd sd").compressor(-20).compressorRelease(0.2)
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### `.cpm(cyclesPerMinute)`
|
|
491
|
+
|
|
492
|
+
Plays the pattern at this many cycles per minute, relative to the program tempo.
|
|
493
|
+
|
|
494
|
+
```js
|
|
495
|
+
note("c e g").cpm(45)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### `.crush(bits?)`
|
|
499
|
+
|
|
500
|
+
Bit crusher: lower is crunchier.
|
|
501
|
+
|
|
502
|
+
```js
|
|
503
|
+
s("bd sd").crush(4)
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### `.cut(group?)`
|
|
507
|
+
|
|
508
|
+
Cut group: a hit stops the playing samples of its group.
|
|
509
|
+
|
|
510
|
+
```js
|
|
511
|
+
s("[oh hh]*4").cut(1)
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### `.decay(time?)`
|
|
515
|
+
|
|
516
|
+
Envelope decay time in seconds.
|
|
517
|
+
|
|
518
|
+
```js
|
|
519
|
+
note("c e").s("square").decay(0.2)
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### `.degrade()`
|
|
523
|
+
|
|
524
|
+
Drops half of the events at random.
|
|
525
|
+
|
|
526
|
+
```js
|
|
527
|
+
s("hh*8").degrade()
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### `.degradeBy(amount)`
|
|
531
|
+
|
|
532
|
+
Drops events at random with the given probability.
|
|
533
|
+
|
|
534
|
+
```js
|
|
535
|
+
s("hh*8").degradeBy(0.3)
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
### `.delay(amount?)`
|
|
539
|
+
|
|
540
|
+
Delay wet amount, 0..1 ("0.5:0.25:0.7" also sets time and feedback).
|
|
541
|
+
|
|
542
|
+
```js
|
|
543
|
+
s("cp").delay(0.5)
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### `.delayfeedback(amount?)`
|
|
547
|
+
|
|
548
|
+
Delay feedback, 0..1.
|
|
549
|
+
|
|
550
|
+
```js
|
|
551
|
+
s("cp").delay(0.5).delayfeedback(0.6)
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### `.delaytime(time?)`
|
|
555
|
+
|
|
556
|
+
Delay time in cycles.
|
|
557
|
+
|
|
558
|
+
```js
|
|
559
|
+
s("cp").delay(0.5).delaytime(0.125)
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
### `.detune(amount?)`
|
|
563
|
+
|
|
564
|
+
Unison detune of the voice (supersaw).
|
|
565
|
+
|
|
566
|
+
```js
|
|
567
|
+
note("c3 e3").s("supersaw").detune(0.3)
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### `.dict(name)`
|
|
571
|
+
|
|
572
|
+
Selects default, ireal, lefthand or legacy voicing shapes.
|
|
573
|
+
|
|
574
|
+
```js
|
|
575
|
+
chord("C7").dict("lefthand").voicing()
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
### `.distort(amount?)`
|
|
579
|
+
|
|
580
|
+
Distortion amount.
|
|
581
|
+
|
|
582
|
+
```js
|
|
583
|
+
note("c2*4").s("sawtooth").distort(2)
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
### `.div(x)`
|
|
587
|
+
|
|
588
|
+
Divides every value.
|
|
589
|
+
|
|
590
|
+
```js
|
|
591
|
+
n("8 4".div(2)).scale("C:major")
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
### `.djf(position?)`
|
|
595
|
+
|
|
596
|
+
DJ filter, 0..1: low-pass below 0.5, open at 0.5, high-pass above (Auto Filter DJ).
|
|
597
|
+
|
|
598
|
+
```js
|
|
599
|
+
n("0 2 4 7").scale("d:minor").s("supersaw").djf("<.5 .3 .2 .75>")
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
### `.dry(level?)`
|
|
603
|
+
|
|
604
|
+
Level of the direct sound beside room and delay, 0 (only the effect) .. 1.
|
|
605
|
+
|
|
606
|
+
```js
|
|
607
|
+
n("[0,3,7](3,8)").s("triangle").room(.7).dry("<0 .5 1>")
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
### `.early(cycles)`
|
|
611
|
+
|
|
612
|
+
Shifts the pattern earlier by a fraction of a cycle.
|
|
613
|
+
|
|
614
|
+
```js
|
|
615
|
+
s("hh*2").early(0.125)
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
### `.echo(times, time, feedback)`
|
|
619
|
+
|
|
620
|
+
Repeats each event, quieter each time.
|
|
621
|
+
|
|
622
|
+
```js
|
|
623
|
+
s("bd sd").echo(3, 1/8, 0.7)
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
### `.echoWith(times, time, f)`
|
|
627
|
+
|
|
628
|
+
Repeats the pattern, applying f(pattern, index) to each copy.
|
|
629
|
+
|
|
630
|
+
```js
|
|
631
|
+
note("c").echoWith(3, 1/8, (p, i) => p.add(i * 2))
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
### `.end(position?)`
|
|
635
|
+
|
|
636
|
+
Where a sample stops, 0..1 of its length.
|
|
637
|
+
|
|
638
|
+
```js
|
|
639
|
+
s("oh*4").end(0.3)
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### `.euclid(pulses, steps)`
|
|
643
|
+
|
|
644
|
+
Euclidean rhythm: pulses spread evenly over steps.
|
|
645
|
+
|
|
646
|
+
```js
|
|
647
|
+
note("c3").euclid(3, 8)
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
### `.euclidLegato(pulses, steps, rotation?)`
|
|
651
|
+
|
|
652
|
+
Euclidean rhythm where each pulse lasts until the next.
|
|
653
|
+
|
|
654
|
+
```js
|
|
655
|
+
note("c3").euclidLegato(3, 8)
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
### `.euclidLegatoRot(pulses, steps, rotation)`
|
|
659
|
+
|
|
660
|
+
Rotated euclidean rhythm where each pulse lasts until the next, across the cycle boundary.
|
|
661
|
+
|
|
662
|
+
```js
|
|
663
|
+
note("c3").euclidLegatoRot(3, 8, 1)
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
### `.euclidRot(pulses, steps, rotation)`
|
|
667
|
+
|
|
668
|
+
Euclidean rhythm, rotated by some steps.
|
|
669
|
+
|
|
670
|
+
```js
|
|
671
|
+
note("c3").euclidRot(3, 8, 2)
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
### `.every(n, f)`
|
|
675
|
+
|
|
676
|
+
Applies f on the first of every n cycles.
|
|
677
|
+
|
|
678
|
+
```js
|
|
679
|
+
note("c d e g").every(4, x => x.rev())
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
### `.fanchor(anchor = 0)`
|
|
683
|
+
|
|
684
|
+
Centre of a filter envelope: 0 sweeps up from the cutoff (default), 0.5 around it, 1 down to it.
|
|
685
|
+
|
|
686
|
+
```js
|
|
687
|
+
note("f2*8").s("sawtooth").lpf(1000).lpenv(8).fanchor("<0 0.5 1>")
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
### `.fast(factor)`
|
|
691
|
+
|
|
692
|
+
Speeds the pattern up by the factor (may be a pattern).
|
|
693
|
+
|
|
694
|
+
```js
|
|
695
|
+
note("c e g").fast("<1 2>")
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
### `.firstOf(n, f)`
|
|
699
|
+
|
|
700
|
+
Applies f on cycle 0, n, 2n, ...
|
|
701
|
+
|
|
702
|
+
```js
|
|
703
|
+
note("c d e g").firstOf(4, x => x.rev())
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### `.fit()`
|
|
707
|
+
|
|
708
|
+
Plays each sample (its begin..end window) at the speed that fills its event.
|
|
709
|
+
|
|
710
|
+
```js
|
|
711
|
+
s("bd/2").fit()
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
### `.fm(index?)`
|
|
715
|
+
|
|
716
|
+
FM modulation index.
|
|
717
|
+
|
|
718
|
+
```js
|
|
719
|
+
note("c e g").fm(2)
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
### `.fmap(fn)`
|
|
723
|
+
|
|
724
|
+
Maps each raw event value, retaining its times and source ranges.
|
|
725
|
+
|
|
726
|
+
```js
|
|
727
|
+
note("60 64".fmap(x => x + 12))
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
### `.fmattack(time?)`
|
|
731
|
+
|
|
732
|
+
FM envelope attack in seconds.
|
|
733
|
+
|
|
734
|
+
```js
|
|
735
|
+
note("c e").fm(4).fmattack(0.1)
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
### `.fmdecay(time?)`
|
|
739
|
+
|
|
740
|
+
FM envelope decay in seconds.
|
|
741
|
+
|
|
742
|
+
```js
|
|
743
|
+
note("c e").fm(4).fmdecay(0.2)
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### `.fmenv(curve = "lin")`
|
|
747
|
+
|
|
748
|
+
FM envelope ramps: "lin" (0) or "exp" (1).
|
|
749
|
+
|
|
750
|
+
```js
|
|
751
|
+
note("c e g b").fm(4).fmdecay(0.2).fmsustain(0).fmenv("<exp lin>")
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
### `.fmh(ratio?)`
|
|
755
|
+
|
|
756
|
+
FM modulator-to-carrier ratio.
|
|
757
|
+
|
|
758
|
+
```js
|
|
759
|
+
note("c e g").fm(2).fmh(1.5)
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
### `.fmsustain(level?)`
|
|
763
|
+
|
|
764
|
+
FM envelope sustain level, 0..1.
|
|
765
|
+
|
|
766
|
+
```js
|
|
767
|
+
note("c e").fm(4).fmdecay(0.2).fmsustain(0.3)
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
### `.freq(hertz?)`
|
|
771
|
+
|
|
772
|
+
Pitch in Hz instead of a note (rounded to the nearest semitone).
|
|
773
|
+
|
|
774
|
+
```js
|
|
775
|
+
freq("220 275 330 440").s("triangle")
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
### `.ftype(type?)`
|
|
779
|
+
|
|
780
|
+
Filter type: "12db" (0), "ladder" (1) or "24db" (2).
|
|
781
|
+
|
|
782
|
+
```js
|
|
783
|
+
note("c2 eb2 g2").s("sawtooth").lpf(500).lpenv(4).ftype("<0 1 2>")
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
### `.fx(name, params?)` *(TuttiDAW only)*
|
|
787
|
+
|
|
788
|
+
TuttiDAW extension, not in Strudel: adds an audio effect after the instrument of the voice, in call order.
|
|
789
|
+
|
|
790
|
+
```js
|
|
791
|
+
note("c4 e4").fx("Reverb:Large Hall", {decayTime: "4s"})
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
### `.gain(level?)`
|
|
795
|
+
|
|
796
|
+
Volume, 0..1 and up.
|
|
797
|
+
|
|
798
|
+
```js
|
|
799
|
+
s("hh*8").gain(0.6)
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
### `.hpattack(time?)`
|
|
803
|
+
|
|
804
|
+
High-pass filter envelope attack in seconds.
|
|
805
|
+
|
|
806
|
+
```js
|
|
807
|
+
note("c2 e2").s("sawtooth").hpf(500).hpattack("<0.5 0.1>").hpenv(4)
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
### `.hpdecay(time?)`
|
|
811
|
+
|
|
812
|
+
High-pass filter envelope decay in seconds.
|
|
813
|
+
|
|
814
|
+
```js
|
|
815
|
+
note("c2*4").s("sawtooth").hpf(300).hpenv(4).hpdecay(0.2)
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
### `.hpenv(depth?)`
|
|
819
|
+
|
|
820
|
+
High-pass filter envelope depth in octaves (negative sweeps down).
|
|
821
|
+
|
|
822
|
+
```js
|
|
823
|
+
note("c2 e2 f2 g2").s("sawtooth").hpf(500).hpattack(0.5).hpenv("<4 2 -2>")
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
### `.hpf(frequency?)`
|
|
827
|
+
|
|
828
|
+
High-pass filter cutoff in Hz.
|
|
829
|
+
|
|
830
|
+
```js
|
|
831
|
+
s("hh*8").hpf(2000)
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
### `.hpq(resonance?)`
|
|
835
|
+
|
|
836
|
+
High-pass filter resonance.
|
|
837
|
+
|
|
838
|
+
```js
|
|
839
|
+
s("hh*8").hpf(1200).hpq(4)
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
### `.hprelease(time?)`
|
|
843
|
+
|
|
844
|
+
High-pass filter envelope release in seconds.
|
|
845
|
+
|
|
846
|
+
```js
|
|
847
|
+
note("c2 ~").s("sawtooth").hpf(300).hpenv(3).hprelease(0.5)
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
### `.hpsustain(level?)`
|
|
851
|
+
|
|
852
|
+
High-pass filter envelope sustain level, 0..1.
|
|
853
|
+
|
|
854
|
+
```js
|
|
855
|
+
note("c2*2").s("sawtooth").hpf(300).hpenv(3).hpdecay(0.2).hpsustain(0.5)
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
### `.inhabit(listOrObject)`
|
|
859
|
+
|
|
860
|
+
Squeezes one selected cycle into each selector event.
|
|
861
|
+
|
|
862
|
+
```js
|
|
863
|
+
note("0 1".inhabit(["60 64", "67 72"]))
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
### `.inside(n, f)`
|
|
867
|
+
|
|
868
|
+
Applies f as if the cycle were n cycles long.
|
|
869
|
+
|
|
870
|
+
```js
|
|
871
|
+
note("c d e f").inside(2, rev)
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
### `.inst(name, params?)` *(TuttiDAW only)*
|
|
875
|
+
|
|
876
|
+
TuttiDAW extension, not in Strudel: plays the voice on a TuttiDAW instrument ("Device" or "Device:Preset"), params in the device units.
|
|
877
|
+
|
|
878
|
+
```js
|
|
879
|
+
note("c2 eb2").inst("Drift:Deep Bass", {cutoff: 600})
|
|
880
|
+
```
|
|
881
|
+
|
|
882
|
+
### `.iresponse(name?)`
|
|
883
|
+
|
|
884
|
+
Impulse response of the reverb: a library IR by name, or category:index like a sample.
|
|
885
|
+
|
|
886
|
+
```js
|
|
887
|
+
s("bd sd [~ bd] sd").room(.6).iresponse("teaching-room")
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
### `.iter(n)`
|
|
891
|
+
|
|
892
|
+
Starts each cycle one subdivision later in the pattern.
|
|
893
|
+
|
|
894
|
+
```js
|
|
895
|
+
note("c d e f").iter(4)
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
### `.iterBack(n)`
|
|
899
|
+
|
|
900
|
+
Like .iter(), going the other way.
|
|
901
|
+
|
|
902
|
+
```js
|
|
903
|
+
note("c d e f").iterBack(4)
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
### `.jux(f)`
|
|
907
|
+
|
|
908
|
+
Original panned left, f of it panned right.
|
|
909
|
+
|
|
910
|
+
```js
|
|
911
|
+
s("bd sd hh").jux(rev)
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
### `.kcutoff(frequency?)`
|
|
915
|
+
|
|
916
|
+
Low-pass cutoff in Hz after krush.
|
|
917
|
+
|
|
918
|
+
```js
|
|
919
|
+
s("bd*4, ~ sd").krush(4).kcutoff(1200)
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
### `.krush(amount?)`
|
|
923
|
+
|
|
924
|
+
Heavy drive (Saturator Hard Curve); kcutoff adds its low-pass. Not played by strudel.cc.
|
|
925
|
+
|
|
926
|
+
```js
|
|
927
|
+
s("bd*4, ~ sd").krush(4)
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
### `.lastOf(n, f)`
|
|
931
|
+
|
|
932
|
+
Applies f on the last of every n cycles.
|
|
933
|
+
|
|
934
|
+
```js
|
|
935
|
+
note("c d e g").lastOf(4, x => x.fast(2))
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
### `.late(cycles)`
|
|
939
|
+
|
|
940
|
+
Shifts the pattern later by a fraction of a cycle.
|
|
941
|
+
|
|
942
|
+
```js
|
|
943
|
+
s("hh*2").late(0.125)
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
### `.layer(...f)`
|
|
947
|
+
|
|
948
|
+
Plays f of the pattern for each f, without the original.
|
|
949
|
+
|
|
950
|
+
```js
|
|
951
|
+
note("c e").layer(x => x.add(7), x => x.add(12))
|
|
952
|
+
```
|
|
953
|
+
|
|
954
|
+
### `.leslie(amount?)`
|
|
955
|
+
|
|
956
|
+
Rotary speaker amount, 0..1 (Chorus-Ensemble Doppler + Auto Pan rotor). Not played by strudel.cc.
|
|
957
|
+
|
|
958
|
+
```js
|
|
959
|
+
note("<[c3,e3,g3] [a2,c3,e3]>").s("square").leslie(0.8)
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
### `.loop(on?)`
|
|
963
|
+
|
|
964
|
+
Loops a sample until its note ends (1 = on).
|
|
965
|
+
|
|
966
|
+
```js
|
|
967
|
+
s("hh:4 ~").loop(1).end(0.1)
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
### `.loopAt(cycles)`
|
|
971
|
+
|
|
972
|
+
Slows the pattern down and plays the sample at the speed that makes it last that many cycles.
|
|
973
|
+
|
|
974
|
+
```js
|
|
975
|
+
s("bd").loopAt(2)
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
### `.lpattack(time?)`
|
|
979
|
+
|
|
980
|
+
Filter envelope attack in seconds.
|
|
981
|
+
|
|
982
|
+
```js
|
|
983
|
+
note("c2 e2").s("sawtooth").lpf(300).lpenv(4).lpattack(0.2)
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
### `.lpdecay(time?)`
|
|
987
|
+
|
|
988
|
+
Filter envelope decay in seconds.
|
|
989
|
+
|
|
990
|
+
```js
|
|
991
|
+
note("c2 e2").s("sawtooth").lpf(300).lpenv(4).lpdecay(0.2)
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
### `.lpenv(depth?)`
|
|
995
|
+
|
|
996
|
+
Low-pass filter envelope depth.
|
|
997
|
+
|
|
998
|
+
```js
|
|
999
|
+
note("c2 e2").s("sawtooth").lpf(300).lpenv(4)
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
### `.lpf(frequency?)`
|
|
1003
|
+
|
|
1004
|
+
Low-pass filter cutoff in Hz ("800:4" also sets resonance).
|
|
1005
|
+
|
|
1006
|
+
```js
|
|
1007
|
+
note("c2*4").s("sawtooth").lpf(800)
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
### `.lpq(resonance?)`
|
|
1011
|
+
|
|
1012
|
+
Low-pass filter resonance.
|
|
1013
|
+
|
|
1014
|
+
```js
|
|
1015
|
+
note("c2*4").s("sawtooth").lpf(600).lpq(8)
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
### `.lprelease(time?)`
|
|
1019
|
+
|
|
1020
|
+
Filter envelope release in seconds.
|
|
1021
|
+
|
|
1022
|
+
```js
|
|
1023
|
+
note("c2 e2").s("sawtooth").lpf(300).lpenv(4).lprelease(0.5)
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
### `.lpsustain(level?)`
|
|
1027
|
+
|
|
1028
|
+
Filter envelope sustain level, 0..1.
|
|
1029
|
+
|
|
1030
|
+
```js
|
|
1031
|
+
note("c2 e2").s("sawtooth").lpf(300).lpenv(4).lpsustain(0.3)
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
### `.mask(pattern)`
|
|
1035
|
+
|
|
1036
|
+
Silences the parts where the mask is 0 or ~.
|
|
1037
|
+
|
|
1038
|
+
```js
|
|
1039
|
+
note("c d e f").mask("1 0 1 1")
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
### `.midifx(name, params?)` *(TuttiDAW only)*
|
|
1043
|
+
|
|
1044
|
+
TuttiDAW extension, not in Strudel: adds a MIDI effect before the instrument of the voice; the notes stay as written.
|
|
1045
|
+
|
|
1046
|
+
```js
|
|
1047
|
+
note("[c3,e3,g3]").midifx("Arpeggiator", {style: "UpDown", rate: "1/16"})
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
### `.mix(mixer)` *(TuttiDAW only)*
|
|
1051
|
+
|
|
1052
|
+
TuttiDAW extension, not in Strudel: the voice's mixer: vol in dB (-70..6), pan -1..1, mute true / false; a bus's and the master's too.
|
|
1053
|
+
|
|
1054
|
+
```js
|
|
1055
|
+
note("c3 e3").mix({vol: -6, pan: -0.3})
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
### `.mode(alignment)`
|
|
1059
|
+
|
|
1060
|
+
Aligns above, below, duck or root; oldabove and oldroot are legacy modes.
|
|
1061
|
+
|
|
1062
|
+
```js
|
|
1063
|
+
chord("C").mode("root:g2").voicing()
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
### `.mul(x)`
|
|
1067
|
+
|
|
1068
|
+
Multiplies every value.
|
|
1069
|
+
|
|
1070
|
+
```js
|
|
1071
|
+
n("1 2 3".mul(2)).scale("C:major")
|
|
1072
|
+
```
|
|
1073
|
+
|
|
1074
|
+
### `.never(f)`
|
|
1075
|
+
|
|
1076
|
+
Never applies f.
|
|
1077
|
+
|
|
1078
|
+
```js
|
|
1079
|
+
s("hh*4").never(x => x.fast(2))
|
|
1080
|
+
```
|
|
1081
|
+
|
|
1082
|
+
### `.noise(amount?)`
|
|
1083
|
+
|
|
1084
|
+
Noise mixed into the synth oscillator, 0..1.
|
|
1085
|
+
|
|
1086
|
+
```js
|
|
1087
|
+
note("c3").s("sawtooth").noise("<0.1 0.25 0.5>")
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
### `.off(time, f)`
|
|
1091
|
+
|
|
1092
|
+
Adds a copy shifted later by time with f applied.
|
|
1093
|
+
|
|
1094
|
+
```js
|
|
1095
|
+
note("c3 eb3 g3").off(1/8, x => x.add(7))
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
### `.offset(n)`
|
|
1099
|
+
|
|
1100
|
+
Moves by whole voicing positions; wrapping the dictionary changes octave.
|
|
1101
|
+
|
|
1102
|
+
```js
|
|
1103
|
+
chord("C*4").offset("0 1 2 3").voicing()
|
|
1104
|
+
```
|
|
1105
|
+
|
|
1106
|
+
### `.often(f)`
|
|
1107
|
+
|
|
1108
|
+
Applies f to about 75% of the events.
|
|
1109
|
+
|
|
1110
|
+
```js
|
|
1111
|
+
s("hh*8").often(x => x.gain(0.4))
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
### `.orbit(orbit?)`
|
|
1115
|
+
|
|
1116
|
+
Voices on one orbit share its delay and reverb settings.
|
|
1117
|
+
|
|
1118
|
+
```js
|
|
1119
|
+
stack(s("hh*6").delay(.5).delaytime(.25).orbit(1), s("~ sd ~ sd").delay(.5).orbit(1))
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1122
|
+
### `.outside(n, f)`
|
|
1123
|
+
|
|
1124
|
+
Applies f as if n cycles were one.
|
|
1125
|
+
|
|
1126
|
+
```js
|
|
1127
|
+
note("<c d> e").outside(2, rev)
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
### `.palindrome()`
|
|
1131
|
+
|
|
1132
|
+
Forwards on even cycles, backwards on odd ones.
|
|
1133
|
+
|
|
1134
|
+
```js
|
|
1135
|
+
note("c d e g").palindrome()
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
### `.pan(position?)`
|
|
1139
|
+
|
|
1140
|
+
Stereo position, 0 = left, 1 = right.
|
|
1141
|
+
|
|
1142
|
+
```js
|
|
1143
|
+
s("hh*4").pan("<0 1>")
|
|
1144
|
+
```
|
|
1145
|
+
|
|
1146
|
+
### `.panchor(anchor?)`
|
|
1147
|
+
|
|
1148
|
+
Where the pitch envelope sits around the note: 0 sweeps up from it, 1 down to it; default the psustain level.
|
|
1149
|
+
|
|
1150
|
+
```js
|
|
1151
|
+
note("c3 c4").penv(12).panchor("<0 0.5 1>")
|
|
1152
|
+
```
|
|
1153
|
+
|
|
1154
|
+
### `.pattack(time?)`
|
|
1155
|
+
|
|
1156
|
+
Pitch envelope attack in seconds.
|
|
1157
|
+
|
|
1158
|
+
```js
|
|
1159
|
+
note("c3").penv(12).pattack(0.1)
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
### `.pcurve(curve = 0)`
|
|
1163
|
+
|
|
1164
|
+
Pitch envelope curve: 0 linear (default), 1 exponential, good for kicks.
|
|
1165
|
+
|
|
1166
|
+
```js
|
|
1167
|
+
note("g1*4").s("sine").pdecay(0.5).penv(32).pcurve("<0 1>")
|
|
1168
|
+
```
|
|
1169
|
+
|
|
1170
|
+
### `.pdecay(time?)`
|
|
1171
|
+
|
|
1172
|
+
Pitch envelope decay in seconds.
|
|
1173
|
+
|
|
1174
|
+
```js
|
|
1175
|
+
note("c2*4").penv(24).pdecay(0.1)
|
|
1176
|
+
```
|
|
1177
|
+
|
|
1178
|
+
### `.penv(semitones?)`
|
|
1179
|
+
|
|
1180
|
+
Pitch envelope amount in semitones.
|
|
1181
|
+
|
|
1182
|
+
```js
|
|
1183
|
+
note("c2*4").s("sine").penv(24).pdecay(0.1)
|
|
1184
|
+
```
|
|
1185
|
+
|
|
1186
|
+
### `.phaser(rate?)`
|
|
1187
|
+
|
|
1188
|
+
Phaser speed in Hz.
|
|
1189
|
+
|
|
1190
|
+
```js
|
|
1191
|
+
note("c e g").s("sawtooth").phaser(2)
|
|
1192
|
+
```
|
|
1193
|
+
|
|
1194
|
+
### `.phasercenter(frequency?)`
|
|
1195
|
+
|
|
1196
|
+
Phaser center frequency in Hz.
|
|
1197
|
+
|
|
1198
|
+
```js
|
|
1199
|
+
note("c e g").s("sawtooth").phaser(2).phasercenter(2000)
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
### `.phaserdepth(depth?)`
|
|
1203
|
+
|
|
1204
|
+
Phaser depth, 0..1.
|
|
1205
|
+
|
|
1206
|
+
```js
|
|
1207
|
+
note("c e g").s("sawtooth").phaser(2).phaserdepth(0.5)
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
### `.phasersweep(width = 2000)`
|
|
1211
|
+
|
|
1212
|
+
How far the phaser sweeps around its center, in Hz (default 2000).
|
|
1213
|
+
|
|
1214
|
+
```js
|
|
1215
|
+
n(run(8)).scale("D:pentatonic").s("sawtooth").phaser(2).phasersweep("<800 4000>")
|
|
1216
|
+
```
|
|
1217
|
+
|
|
1218
|
+
### `.pick(listOrObject)`
|
|
1219
|
+
|
|
1220
|
+
Selects a pattern, preserving its timing; list indices clamp to the ends.
|
|
1221
|
+
|
|
1222
|
+
```js
|
|
1223
|
+
note("<0 1>".pick(["60 64", "67 72"]))
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1226
|
+
### `.pickOut(listOrObject)`
|
|
1227
|
+
|
|
1228
|
+
Keeps each selector event and plays the selected pattern value at its start.
|
|
1229
|
+
|
|
1230
|
+
```js
|
|
1231
|
+
note("<0 1>".pickOut(["60 64", "67 72"]))
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
### `.pickRestart(listOrObject)`
|
|
1235
|
+
|
|
1236
|
+
Selects a pattern and restarts it at each selector onset.
|
|
1237
|
+
|
|
1238
|
+
```js
|
|
1239
|
+
note("0 1".pickRestart(["60 64", "67 72"]))
|
|
1240
|
+
```
|
|
1241
|
+
|
|
1242
|
+
### `.ply(n)`
|
|
1243
|
+
|
|
1244
|
+
Repeats every event n times within its own length.
|
|
1245
|
+
|
|
1246
|
+
```js
|
|
1247
|
+
s("bd ~ sd cp").ply(2)
|
|
1248
|
+
```
|
|
1249
|
+
|
|
1250
|
+
### `.postgain(level?)`
|
|
1251
|
+
|
|
1252
|
+
Volume after the effects.
|
|
1253
|
+
|
|
1254
|
+
```js
|
|
1255
|
+
s("bd").postgain(0.8)
|
|
1256
|
+
```
|
|
1257
|
+
|
|
1258
|
+
### `.prelease(time?)`
|
|
1259
|
+
|
|
1260
|
+
Pitch envelope release in seconds.
|
|
1261
|
+
|
|
1262
|
+
```js
|
|
1263
|
+
note("c3").penv(12).prelease(0.3)
|
|
1264
|
+
```
|
|
1265
|
+
|
|
1266
|
+
### `.psustain(level?)`
|
|
1267
|
+
|
|
1268
|
+
Pitch envelope sustain level, 0..1.
|
|
1269
|
+
|
|
1270
|
+
```js
|
|
1271
|
+
note("c3").penv(12).pdecay(0.1).psustain(0.5)
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
### `.range(min, max)`
|
|
1275
|
+
|
|
1276
|
+
Maps a 0..1 signal to min..max.
|
|
1277
|
+
|
|
1278
|
+
```js
|
|
1279
|
+
s("hh*8").lpf(sine.range(300, 3000))
|
|
1280
|
+
```
|
|
1281
|
+
|
|
1282
|
+
### `.range2(min, max)`
|
|
1283
|
+
|
|
1284
|
+
Maps a -1..1 signal to min..max.
|
|
1285
|
+
|
|
1286
|
+
```js
|
|
1287
|
+
note("c*4").pan(sine2.range2(0, 1))
|
|
1288
|
+
```
|
|
1289
|
+
|
|
1290
|
+
### `.rangex(min, max)`
|
|
1291
|
+
|
|
1292
|
+
Like .range() on an exponential curve (good for frequencies).
|
|
1293
|
+
|
|
1294
|
+
```js
|
|
1295
|
+
s("hh*8").lpf(saw.rangex(200, 4000))
|
|
1296
|
+
```
|
|
1297
|
+
|
|
1298
|
+
### `.rarely(f)`
|
|
1299
|
+
|
|
1300
|
+
Applies f to about 25% of the events.
|
|
1301
|
+
|
|
1302
|
+
```js
|
|
1303
|
+
note("c*8").rarely(x => x.add(7))
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
### `.release(time?)`
|
|
1307
|
+
|
|
1308
|
+
Envelope release time in seconds.
|
|
1309
|
+
|
|
1310
|
+
```js
|
|
1311
|
+
note("c e").s("sawtooth").release(0.5)
|
|
1312
|
+
```
|
|
1313
|
+
|
|
1314
|
+
### `.rev()`
|
|
1315
|
+
|
|
1316
|
+
Plays each cycle backwards.
|
|
1317
|
+
|
|
1318
|
+
```js
|
|
1319
|
+
note("c d e g").rev()
|
|
1320
|
+
```
|
|
1321
|
+
|
|
1322
|
+
### `.room(amount?)`
|
|
1323
|
+
|
|
1324
|
+
Reverb amount, 0..1 ("0.5:3" also sets size).
|
|
1325
|
+
|
|
1326
|
+
```js
|
|
1327
|
+
s("cp").room(0.5)
|
|
1328
|
+
```
|
|
1329
|
+
|
|
1330
|
+
### `.rootNotes(octave = 2)`
|
|
1331
|
+
|
|
1332
|
+
Plays each chord root in the requested scientific octave.
|
|
1333
|
+
|
|
1334
|
+
```js
|
|
1335
|
+
chord("C Am F G").rootNotes(2)
|
|
1336
|
+
```
|
|
1337
|
+
|
|
1338
|
+
### `.scale(name)`
|
|
1339
|
+
|
|
1340
|
+
Turns n degrees into notes of a scale like "C:minor" (root in octave 3).
|
|
1341
|
+
|
|
1342
|
+
```js
|
|
1343
|
+
n("0 2 4 6").scale("<C:major A:minor>")
|
|
1344
|
+
```
|
|
1345
|
+
|
|
1346
|
+
### `.scrub(positions)`
|
|
1347
|
+
|
|
1348
|
+
Starts the sample at each position (0..1); "position:speed" sets the speed too.
|
|
1349
|
+
|
|
1350
|
+
```js
|
|
1351
|
+
s("bd").scrub("0 0.5:2 0.25")
|
|
1352
|
+
```
|
|
1353
|
+
|
|
1354
|
+
### `.segment(n)`
|
|
1355
|
+
|
|
1356
|
+
Samples the pattern n times per cycle (turns signals into notes).
|
|
1357
|
+
|
|
1358
|
+
```js
|
|
1359
|
+
n(saw.range(0, 7).segment(8)).scale("C:major")
|
|
1360
|
+
```
|
|
1361
|
+
|
|
1362
|
+
### `.send(bus, dB)` *(TuttiDAW only)*
|
|
1363
|
+
|
|
1364
|
+
TuttiDAW extension, not in Strudel: sends the voice to a bus at a level in dB (-70 is off, 0 the most); one level per bus, a pattern moves it.
|
|
1365
|
+
|
|
1366
|
+
```js
|
|
1367
|
+
bus("verb").fx("Reverb")
|
|
1368
|
+
$: note("c3 e3").send("verb", -12)
|
|
1369
|
+
```
|
|
1370
|
+
|
|
1371
|
+
### `.set(pattern)`
|
|
1372
|
+
|
|
1373
|
+
Merges values from another pattern while retaining this pattern rhythm.
|
|
1374
|
+
|
|
1375
|
+
```js
|
|
1376
|
+
n("0 1 2 3").set(chord("<C Am>")).voicing()
|
|
1377
|
+
```
|
|
1378
|
+
|
|
1379
|
+
### `.shape(amount?)`
|
|
1380
|
+
|
|
1381
|
+
Waveshaping drive, 0..1.
|
|
1382
|
+
|
|
1383
|
+
```js
|
|
1384
|
+
s("bd*4").shape(0.4)
|
|
1385
|
+
```
|
|
1386
|
+
|
|
1387
|
+
### `.size(size?)`
|
|
1388
|
+
|
|
1389
|
+
Reverb room size.
|
|
1390
|
+
|
|
1391
|
+
```js
|
|
1392
|
+
s("cp").room(0.5).size(4)
|
|
1393
|
+
```
|
|
1394
|
+
|
|
1395
|
+
### `.slice(count, indices)`
|
|
1396
|
+
|
|
1397
|
+
Plays slice i of count equal slices of the sample for each index event (or a list of 0..1 cut points).
|
|
1398
|
+
|
|
1399
|
+
```js
|
|
1400
|
+
s("bd").slice(4, "0 2 1 3")
|
|
1401
|
+
```
|
|
1402
|
+
|
|
1403
|
+
### `.slow(factor)`
|
|
1404
|
+
|
|
1405
|
+
Stretches the pattern over more cycles.
|
|
1406
|
+
|
|
1407
|
+
```js
|
|
1408
|
+
note("c e g b").slow(2)
|
|
1409
|
+
```
|
|
1410
|
+
|
|
1411
|
+
### `.someCycles(f)`
|
|
1412
|
+
|
|
1413
|
+
Applies f to about half of the cycles.
|
|
1414
|
+
|
|
1415
|
+
```js
|
|
1416
|
+
s("bd*4").someCycles(x => x.fast(2))
|
|
1417
|
+
```
|
|
1418
|
+
|
|
1419
|
+
### `.someCyclesBy(p, f)`
|
|
1420
|
+
|
|
1421
|
+
Applies f to whole cycles with probability p.
|
|
1422
|
+
|
|
1423
|
+
```js
|
|
1424
|
+
s("bd*4").someCyclesBy(0.3, x => x.fast(2))
|
|
1425
|
+
```
|
|
1426
|
+
|
|
1427
|
+
### `.sometimes(f)`
|
|
1428
|
+
|
|
1429
|
+
Applies f to about half of the events.
|
|
1430
|
+
|
|
1431
|
+
```js
|
|
1432
|
+
s("hh*8").sometimes(x => x.gain(0.5))
|
|
1433
|
+
```
|
|
1434
|
+
|
|
1435
|
+
### `.sometimesBy(p, f)`
|
|
1436
|
+
|
|
1437
|
+
Applies f to events with probability p.
|
|
1438
|
+
|
|
1439
|
+
```js
|
|
1440
|
+
note("c*8").sometimesBy(0.3, x => x.add(12))
|
|
1441
|
+
```
|
|
1442
|
+
|
|
1443
|
+
### `.speed(speed?)`
|
|
1444
|
+
|
|
1445
|
+
Sample playback speed; 2 is an octave up, negative plays backwards.
|
|
1446
|
+
|
|
1447
|
+
```js
|
|
1448
|
+
s("bd*4").speed("1 2 -1 0.5")
|
|
1449
|
+
```
|
|
1450
|
+
|
|
1451
|
+
### `.splice(count, indices)`
|
|
1452
|
+
|
|
1453
|
+
Like slice, with each slice sped up or slowed down to fill its event.
|
|
1454
|
+
|
|
1455
|
+
```js
|
|
1456
|
+
s("bd").splice(4, "0 2 1 3")
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1459
|
+
### `.spread(amount?)`
|
|
1460
|
+
|
|
1461
|
+
Stereo spread of the synth voices, 0 (mono) .. 1 (wide).
|
|
1462
|
+
|
|
1463
|
+
```js
|
|
1464
|
+
note("d f a").s("supersaw").spread("<0 0.3 1>")
|
|
1465
|
+
```
|
|
1466
|
+
|
|
1467
|
+
### `.squiz(factor?)`
|
|
1468
|
+
|
|
1469
|
+
Squeezes each wave cycle: 2 is an octave up, 4 two (Shifter). Not played by strudel.cc.
|
|
1470
|
+
|
|
1471
|
+
```js
|
|
1472
|
+
note("c3 e3 g3").s("sawtooth").squiz("<1 2 4>")
|
|
1473
|
+
```
|
|
1474
|
+
|
|
1475
|
+
### `.striate(parts)`
|
|
1476
|
+
|
|
1477
|
+
Plays the pattern parts times per cycle, a further part of each sample each time.
|
|
1478
|
+
|
|
1479
|
+
```js
|
|
1480
|
+
s("bd sd").striate(4)
|
|
1481
|
+
```
|
|
1482
|
+
|
|
1483
|
+
### `.struct(pattern)`
|
|
1484
|
+
|
|
1485
|
+
Plays the values on the rhythm of a pattern of x / ~.
|
|
1486
|
+
|
|
1487
|
+
```js
|
|
1488
|
+
note("c,e,g").struct("x ~ x x")
|
|
1489
|
+
```
|
|
1490
|
+
|
|
1491
|
+
### `.stut(times, feedback, time)`
|
|
1492
|
+
|
|
1493
|
+
Like .echo() with the last two arguments swapped.
|
|
1494
|
+
|
|
1495
|
+
```js
|
|
1496
|
+
s("bd sd").stut(3, 0.7, 1/8)
|
|
1497
|
+
```
|
|
1498
|
+
|
|
1499
|
+
### `.sub(x)`
|
|
1500
|
+
|
|
1501
|
+
Subtracts from every value.
|
|
1502
|
+
|
|
1503
|
+
```js
|
|
1504
|
+
n("7 5 3".sub(1)).scale("C:minor")
|
|
1505
|
+
```
|
|
1506
|
+
|
|
1507
|
+
### `.superimpose(...f)`
|
|
1508
|
+
|
|
1509
|
+
Adds f of the pattern on top of the original.
|
|
1510
|
+
|
|
1511
|
+
```js
|
|
1512
|
+
note("c e g").superimpose(x => x.add(12))
|
|
1513
|
+
```
|
|
1514
|
+
|
|
1515
|
+
### `.sustain(level?)`
|
|
1516
|
+
|
|
1517
|
+
Envelope sustain level, 0..1.
|
|
1518
|
+
|
|
1519
|
+
```js
|
|
1520
|
+
note("c e").s("square").sustain(0.3)
|
|
1521
|
+
```
|
|
1522
|
+
|
|
1523
|
+
### `.swingBy(amount, slices)`
|
|
1524
|
+
|
|
1525
|
+
Splits each cycle into slices and delays events in the second half of each slice (0 = straight, 1/3 = triplet swing).
|
|
1526
|
+
|
|
1527
|
+
```js
|
|
1528
|
+
s("hh*8").swingBy(1/3, 4)
|
|
1529
|
+
```
|
|
1530
|
+
|
|
1531
|
+
### `.transpose(semitones)`
|
|
1532
|
+
|
|
1533
|
+
Moves notes up or down by semitones.
|
|
1534
|
+
|
|
1535
|
+
```js
|
|
1536
|
+
note("c e g").transpose("<0 5>")
|
|
1537
|
+
```
|
|
1538
|
+
|
|
1539
|
+
### `.tremolo(rate?)`
|
|
1540
|
+
|
|
1541
|
+
Tremolo speed in Hz: the level rises and falls (Auto Pan in Tremolo mode).
|
|
1542
|
+
|
|
1543
|
+
```js
|
|
1544
|
+
note("d d d# d").fast(4).s("supersaw").tremolo("<3 2 8>")
|
|
1545
|
+
```
|
|
1546
|
+
|
|
1547
|
+
### `.tremolodepth(depth = 1)`
|
|
1548
|
+
|
|
1549
|
+
Tremolo depth, 0..1 (default 1: down to silence).
|
|
1550
|
+
|
|
1551
|
+
```js
|
|
1552
|
+
note("a1*8").s("square").tremolo(4).tremolodepth("<1 .5>")
|
|
1553
|
+
```
|
|
1554
|
+
|
|
1555
|
+
### `.undegrade()`
|
|
1556
|
+
|
|
1557
|
+
Keeps exactly the events .degrade() drops.
|
|
1558
|
+
|
|
1559
|
+
```js
|
|
1560
|
+
s("hh*8").undegrade()
|
|
1561
|
+
```
|
|
1562
|
+
|
|
1563
|
+
### `.undegradeBy(amount)`
|
|
1564
|
+
|
|
1565
|
+
Keeps exactly the events .degradeBy(amount) drops.
|
|
1566
|
+
|
|
1567
|
+
```js
|
|
1568
|
+
s("hh*8").undegradeBy(0.3)
|
|
1569
|
+
```
|
|
1570
|
+
|
|
1571
|
+
### `.unison(voices?)`
|
|
1572
|
+
|
|
1573
|
+
Number of unison voices (supersaw).
|
|
1574
|
+
|
|
1575
|
+
```js
|
|
1576
|
+
note("c3 e3").s("supersaw").unison(5)
|
|
1577
|
+
```
|
|
1578
|
+
|
|
1579
|
+
### `.unit(unit?)`
|
|
1580
|
+
|
|
1581
|
+
With "c", speed counts whole samples per cycle (as loopAt and fit set it).
|
|
1582
|
+
|
|
1583
|
+
```js
|
|
1584
|
+
s("bd").speed(0.5).unit("c")
|
|
1585
|
+
```
|
|
1586
|
+
|
|
1587
|
+
### `.velocity(velocity?)`
|
|
1588
|
+
|
|
1589
|
+
Note velocity, 0..1.
|
|
1590
|
+
|
|
1591
|
+
```js
|
|
1592
|
+
note("c e g").velocity("<1 0.5>")
|
|
1593
|
+
```
|
|
1594
|
+
|
|
1595
|
+
### `.vib(rate?)`
|
|
1596
|
+
|
|
1597
|
+
Vibrato rate in Hz ("5:0.5" also sets its depth).
|
|
1598
|
+
|
|
1599
|
+
```js
|
|
1600
|
+
note("a e").vib(5)
|
|
1601
|
+
```
|
|
1602
|
+
|
|
1603
|
+
### `.vibmod(depth?)`
|
|
1604
|
+
|
|
1605
|
+
Vibrato depth in semitones.
|
|
1606
|
+
|
|
1607
|
+
```js
|
|
1608
|
+
note("a e").vib(5).vibmod(0.3)
|
|
1609
|
+
```
|
|
1610
|
+
|
|
1611
|
+
### `.voicing()`
|
|
1612
|
+
|
|
1613
|
+
Turns chord symbols into pitched voicings, or indexes them with n.
|
|
1614
|
+
|
|
1615
|
+
```js
|
|
1616
|
+
n("0 1 2 3").chord("<C Am F G>").voicing()
|
|
1617
|
+
```
|
|
1618
|
+
|
|
1619
|
+
### `.voicings(dictionary = "ireal")`
|
|
1620
|
+
|
|
1621
|
+
Voicing with an optional dictionary (legacy spelling).
|
|
1622
|
+
|
|
1623
|
+
```js
|
|
1624
|
+
"C7 G7".voicings("lefthand").note()
|
|
1625
|
+
```
|
|
1626
|
+
|
|
1627
|
+
### `.vowel(vowel?)`
|
|
1628
|
+
|
|
1629
|
+
Formant filter: a, e, i, o or u.
|
|
1630
|
+
|
|
1631
|
+
```js
|
|
1632
|
+
note("c2*4").s("sawtooth").vowel("<a e i o>")
|
|
1633
|
+
```
|
|
1634
|
+
|
|
1635
|
+
## Signals
|
|
1636
|
+
|
|
1637
|
+
### `cosine`
|
|
1638
|
+
|
|
1639
|
+
Sine shifted a quarter cycle: starts at 1.
|
|
1640
|
+
|
|
1641
|
+
```js
|
|
1642
|
+
note("c*8").pan(cosine)
|
|
1643
|
+
```
|
|
1644
|
+
|
|
1645
|
+
### `cosine2`
|
|
1646
|
+
|
|
1647
|
+
Cosine from -1 to 1.
|
|
1648
|
+
|
|
1649
|
+
```js
|
|
1650
|
+
note("c*4").pan(cosine2.range2(0, 1))
|
|
1651
|
+
```
|
|
1652
|
+
|
|
1653
|
+
### `isaw`
|
|
1654
|
+
|
|
1655
|
+
Ramp from 1 down to 0 every cycle.
|
|
1656
|
+
|
|
1657
|
+
```js
|
|
1658
|
+
s("hh*8").gain(isaw)
|
|
1659
|
+
```
|
|
1660
|
+
|
|
1661
|
+
### `isaw2`
|
|
1662
|
+
|
|
1663
|
+
Falling saw from -1 to 1.
|
|
1664
|
+
|
|
1665
|
+
```js
|
|
1666
|
+
note("c*4").pan(isaw2.range2(0, 1))
|
|
1667
|
+
```
|
|
1668
|
+
|
|
1669
|
+
### `perlin`
|
|
1670
|
+
|
|
1671
|
+
Smooth random values from 0 to 1.
|
|
1672
|
+
|
|
1673
|
+
```js
|
|
1674
|
+
s("hh*8").lpf(perlin.range(500, 4000))
|
|
1675
|
+
```
|
|
1676
|
+
|
|
1677
|
+
### `rand`
|
|
1678
|
+
|
|
1679
|
+
Random values from 0 to 1 (seeded, repeatable).
|
|
1680
|
+
|
|
1681
|
+
```js
|
|
1682
|
+
s("hh*8").gain(rand.range(0.4, 1))
|
|
1683
|
+
```
|
|
1684
|
+
|
|
1685
|
+
### `rand2`
|
|
1686
|
+
|
|
1687
|
+
Random values from -1 to 1.
|
|
1688
|
+
|
|
1689
|
+
```js
|
|
1690
|
+
note("c*4").pan(rand2.range2(0, 1))
|
|
1691
|
+
```
|
|
1692
|
+
|
|
1693
|
+
### `saw`
|
|
1694
|
+
|
|
1695
|
+
Ramp from 0 up to 1 every cycle.
|
|
1696
|
+
|
|
1697
|
+
```js
|
|
1698
|
+
n(saw.range(0, 7).segment(8)).scale("C:major")
|
|
1699
|
+
```
|
|
1700
|
+
|
|
1701
|
+
### `saw2`
|
|
1702
|
+
|
|
1703
|
+
Saw from -1 to 1.
|
|
1704
|
+
|
|
1705
|
+
```js
|
|
1706
|
+
note("c*4").pan(saw2.range2(0, 1))
|
|
1707
|
+
```
|
|
1708
|
+
|
|
1709
|
+
### `sine`
|
|
1710
|
+
|
|
1711
|
+
Smooth wave from 0 to 1, starting at 0.5.
|
|
1712
|
+
|
|
1713
|
+
```js
|
|
1714
|
+
note("c*8").lpf(sine.range(300, 2000))
|
|
1715
|
+
```
|
|
1716
|
+
|
|
1717
|
+
### `sine2`
|
|
1718
|
+
|
|
1719
|
+
Sine from -1 to 1.
|
|
1720
|
+
|
|
1721
|
+
```js
|
|
1722
|
+
note("c*4").add(sine2.range2(0, 12).segment(4))
|
|
1723
|
+
```
|
|
1724
|
+
|
|
1725
|
+
### `square`
|
|
1726
|
+
|
|
1727
|
+
0 for the first half of the cycle, 1 for the second.
|
|
1728
|
+
|
|
1729
|
+
```js
|
|
1730
|
+
s("hh*8").gain(square.range(0.3, 1))
|
|
1731
|
+
```
|
|
1732
|
+
|
|
1733
|
+
### `square2`
|
|
1734
|
+
|
|
1735
|
+
Square from -1 to 1.
|
|
1736
|
+
|
|
1737
|
+
```js
|
|
1738
|
+
note("c*4").pan(square2.range2(0, 1))
|
|
1739
|
+
```
|
|
1740
|
+
|
|
1741
|
+
### `tri`
|
|
1742
|
+
|
|
1743
|
+
Up from 0 to 1 and back in each cycle.
|
|
1744
|
+
|
|
1745
|
+
```js
|
|
1746
|
+
note("c*8").pan(tri)
|
|
1747
|
+
```
|
|
1748
|
+
|
|
1749
|
+
### `tri2`
|
|
1750
|
+
|
|
1751
|
+
Triangle from -1 to 1.
|
|
1752
|
+
|
|
1753
|
+
```js
|
|
1754
|
+
note("c*4").pan(tri2.range2(0, 1))
|
|
1755
|
+
```
|
|
1756
|
+
|
|
1757
|
+
## Other names for the same thing
|
|
1758
|
+
|
|
1759
|
+
- `att`: Same as .attack().
|
|
1760
|
+
- `bandf`: Same as .bpf().
|
|
1761
|
+
- `bandq`: Same as .bpq().
|
|
1762
|
+
- `bp`: Same as .bpf().
|
|
1763
|
+
- `bpa`: Same as .bpattack().
|
|
1764
|
+
- `bpd`: Same as .bpdecay().
|
|
1765
|
+
- `bpe`: Same as .bpenv().
|
|
1766
|
+
- `bpr`: Same as .bprelease().
|
|
1767
|
+
- `bps`: Same as .bpsustain().
|
|
1768
|
+
- `colour`: Same as .color().
|
|
1769
|
+
- `ctf`: Same as .lpf().
|
|
1770
|
+
- `cutoff`: Same as .lpf().
|
|
1771
|
+
- `dec`: Same as .decay().
|
|
1772
|
+
- `delayfb`: Same as .delayfeedback().
|
|
1773
|
+
- `delayt`: Same as .delaytime().
|
|
1774
|
+
- `density`: Same as .fast().
|
|
1775
|
+
- `dfb`: Same as .delayfeedback().
|
|
1776
|
+
- `dist`: Same as .distort().
|
|
1777
|
+
- `dt`: Same as .delaytime().
|
|
1778
|
+
- `echowith`: Same as .echoWith().
|
|
1779
|
+
- `fastcat`: Same as seq().
|
|
1780
|
+
- `firstof`: Same as .firstOf().
|
|
1781
|
+
- `fmatt`: Same as .fmattack().
|
|
1782
|
+
- `fmdec`: Same as .fmdecay().
|
|
1783
|
+
- `fme`: Same as .fmenv().
|
|
1784
|
+
- `fmi`: Same as .fm().
|
|
1785
|
+
- `fmsus`: Same as .fmsustain().
|
|
1786
|
+
- `hcutoff`: Same as .hpf().
|
|
1787
|
+
- `hp`: Same as .hpf().
|
|
1788
|
+
- `hpa`: Same as .hpattack().
|
|
1789
|
+
- `hpd`: Same as .hpdecay().
|
|
1790
|
+
- `hpe`: Same as .hpenv().
|
|
1791
|
+
- `hpr`: Same as .hprelease().
|
|
1792
|
+
- `hps`: Same as .hpsustain().
|
|
1793
|
+
- `hresonance`: Same as .hpq().
|
|
1794
|
+
- `ir`: Same as .iresponse().
|
|
1795
|
+
- `iterback`: Same as .iterBack().
|
|
1796
|
+
- `lastof`: Same as .lastOf().
|
|
1797
|
+
- `legato`: Same as .clip().
|
|
1798
|
+
- `lp`: Same as .lpf().
|
|
1799
|
+
- `lpa`: Same as .lpattack().
|
|
1800
|
+
- `lpd`: Same as .lpdecay().
|
|
1801
|
+
- `lpe`: Same as .lpenv().
|
|
1802
|
+
- `lpr`: Same as .lprelease().
|
|
1803
|
+
- `lps`: Same as .lpsustain().
|
|
1804
|
+
- `patt`: Same as .pattack().
|
|
1805
|
+
- `pdec`: Same as .pdecay().
|
|
1806
|
+
- `ph`: Same as .phaser().
|
|
1807
|
+
- `phasdp`: Same as .phaserdepth().
|
|
1808
|
+
- `phc`: Same as .phasercenter().
|
|
1809
|
+
- `phd`: Same as .phaserdepth().
|
|
1810
|
+
- `phs`: Same as .phasersweep().
|
|
1811
|
+
- `pickSqueeze`: Same as inhabit.
|
|
1812
|
+
- `prel`: Same as .prelease().
|
|
1813
|
+
- `randcat`: Same as chooseCycles().
|
|
1814
|
+
- `rel`: Same as .release().
|
|
1815
|
+
- `resonance`: Same as .lpq().
|
|
1816
|
+
- `roomsize`: Same as .size().
|
|
1817
|
+
- `seg`: Same as .segment().
|
|
1818
|
+
- `sequence`: Same as seq().
|
|
1819
|
+
- `slowcat`: Same as cat().
|
|
1820
|
+
- `sound`: Same as s().
|
|
1821
|
+
- `sparsity`: Same as .slow().
|
|
1822
|
+
- `stepcat`: Same as timeCat().
|
|
1823
|
+
- `stutwith`: Same as .echoWith().
|
|
1824
|
+
- `stutWith`: Same as .echoWith().
|
|
1825
|
+
- `sus`: Same as .sustain().
|
|
1826
|
+
- `swing`: Same as .swingBy(1/3, slices).
|
|
1827
|
+
- `sz`: Same as .size().
|
|
1828
|
+
- `timecat`: Same as timeCat().
|
|
1829
|
+
- `trem`: Same as .tremolo().
|
|
1830
|
+
- `tremdepth`: Same as .tremolodepth().
|
|
1831
|
+
- `v`: Same as .vib().
|
|
1832
|
+
- `vel`: Same as .velocity().
|
|
1833
|
+
- `vibrato`: Same as .vib().
|
|
1834
|
+
- `vmod`: Same as .vibmod().
|
|
1835
|
+
- `withValue`: Same as fmap: maps raw values, not the pattern itself.
|
|
1836
|
+
|
|
1837
|
+
## Accepted for Strudel compatibility
|
|
1838
|
+
|
|
1839
|
+
These names are accepted so that Strudel code runs, but they do not change
|
|
1840
|
+
what TuttiDAW plays yet (the diagnostics say so):
|
|
1841
|
+
`_pianoroll`, `_punchcard`, `_scope`, `_spectrum`, `_spiral`, `analyze`, `channel`, `id`, `log`, `markcss`, `pianoroll`, `punchcard`, `scope`, `spectrum`, `spiral`, `tag`.
|
|
1842
|
+
|
|
1843
|
+
## Not needed in TuttiDAW
|
|
1844
|
+
|
|
1845
|
+
Strudel setup calls that are accepted and have nothing to do here:
|
|
1846
|
+
|
|
1847
|
+
- `loadSamples`: Not needed in TuttiDAW: samples(...) declares sample packs and the studio loads them when they play.
|
|
1848
|
+
- `initAudio`: Not needed in TuttiDAW: audio starts when you press Play.
|