File: 14_player_attributes_reference.py

package info (click to toggle)
python-renardo-lib 0.9.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,220 kB
  • sloc: python: 10,999; sh: 34; makefile: 7
file content (422 lines) | stat: -rw-r--r-- 7,182 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# Tutorial 14: Player Attributes Reference
# --- TODO: this needs updating


# To see all attributes:
print(Player.get_attributes())

# You can see what effects are available by evaluating
print(FxList)

# Let's use the high pass filter for an example. You can see it's described
# like so:
# "<Fx 'highPassFilter' -- args: hpr, hpf>"

# Each effect has a "master" argument and then child arguments. Here the
# master argument is "hpf" (short for high pass filter) and the child argument
# is "hpr" (short for high pass resonance). The effect is only added when the
# master argument is non-zero:
d1 >> dirt([0,4,2,1], dur=1/2, hpf=4000)

# This sets the high pass filter to 4000 Hz so only frequences in the audio
# signal *above* that are actually heard. Let's change the resonance value. It's
# default value is 1, so let's make it smaller
d1 >> dirt([0,4,2,1], dur=1/2, hpf=4000, hpr=0.3)


# Notice a difference? We can use patterns / vars in our effects to make them
# change over time:
d1 >> dirt([0,4,2,1], dur=1/2, hpf=linvar([0,4000],8), hpr=P[1,1,0.3].stretch(8))




####################
# Reference
####################



####################
# amp - Amplitude (defaults to 1)
# Sets the volume of the note/pattern

d1 >> play("*", dur=1/2, amp=1)

# Half Volume
d1 >> play("*", dur=1/2, amp=.5)

# Creating a pattern with amp
d1 >> play("*", dur=1/2, amp=[1,0,1,1,0])



####################
# amplify - Changes amp, by multiplying agasint the existing value (instead of overwritting)

# Creating a pattern with amp
d1 >> play("*", dur=1/2, amp=[1,0,1,1,0])
d1 >> play("*", dur=1/2, amplify=[.5,1,0])

# Set up a "drop" in the music (Plays at full volume for 28, then 0 for 4)
p1 >> blip([0,1,2,3], amplify=var([1,0],[28,4]))



####################
# bend



####################
# benddelay - See bend



####################
# bits
# The bit depth, in number of bits, that the signal is reduced to;
# this is a value between 1 and 24 where other values are ignored.
# Use crush to set the amount of reduction to the bitrate (defaults to 8)



####################
# bitcrush - See bits



####################
# blur



####################
# bpf - Band Pass Filter



####################
# bpnoise - See bpf



####################
# bpr - See bpf



####################
# bpm



####################
# buf



####################
# channel



####################
# chop
# 'Chops' the signal into chunks using a low frequency pulse wave over the sustain of a note.



####################
# coarse



####################
# comb delay - See echo



####################
# crush



####################
# cut
# Cuts a duration
p1 >> pluck(P[:8], dur=1/2, cut=1/8)
p1 >> pluck(P[:8], dur=1/2, cut=1/4)
p1 >> pluck(P[:8], dur=1/2, cut=1/2)



####################
# cutoff



####################
# decay - See echo



####################
# degree - The degree of the note, or pitch, can be specified by keyword (also the first positional)
p1 >> blip(degree=[0,1,2,3])

# Which is the same as:
p1 >> blip([0,1,2,3])

# Only plays the "root" note of the chord
b1 >> bass(p1.degree[0])



####################
# delay - A duration of time to wait before sending the information to SuperCollider (defaults to 0)

# Delays every 3 note by .1
p1 >> blip([0,1,2,3], delay=[0,0,0.1])

# Delays every 3 note by .5
p1 >> blip([0,1,2,3], delay=[0,0,0.5])

# Plays the note once for each different delays
p1 >> blip([0,1,2,3], delay=(0,0.1))

p1 >> blip([0,1,2,3], delay=(0,0.25))

p1 >> blip([0,1,2,3], delay=(0,.1,.2,.3))



####################
# dist



####################
# dur - Durations (defaults to 1 and 1/2 for the Sample Player)



####################
# echo
# Title keyword: echo, Attribute keyword(s): decay
# Sets the decay time for any echo effect in beats, works best on Sample Player (defaults to 0)
# Multiplied against the sustain value
d1 >> play("x-o-", echo=0.1)

d1 >> play("x-o-", echo=0.5)

p1 >> pluck(P[:8], echo=.25)

p1 >> pluck(P[:8], echo=.5)

p1 >> pluck(P[:8], echo=.5, decay=.5)



####################
# env



####################
# fmod



####################
# formant



####################
# freq



####################
# hpf - High Pass Filter
# Filters out all the frequencies below given value, removing lower freqencies

# 4000 hertz
p1 >> pluck(P[:8], dur=1/2, hpf=4000)

# HPF is 0 for 4 beats, then 4000 for 4 beats
p1 >> pluck(P[:8], dur=1/2, hpf=var([0,4000],[4,4]))

# Linear change on hpf from 0 take 4 beats to get to 4000, 4 beats back to 0
p1 >> pluck(P[:8], dur=1/2, hpf=linvar([0,4000],[4,4]))

# Linear change on hpf from 0 take 8 beats to get to 4000, then reset back to 0
p1 >> pluck(P[:8], dur=1/2, hpf=linvar([0,4000],[8,0]))

# With resonance change (default is 1)
p1 >> pluck(P[:8], dur=1/2, hpf=linvar([0,4000],[8,0]), hpr=.5)

# With resonance change as a linvar
p1 >> pluck(P[:8], dur=1/2, hpf=linvar([0,4000],[8,0]), hpr=linvar([0.1,1],12))



####################
# hpr - See hpf



####################
# lpf - Low Pass Filter
# Filters out all the frequencies above given value, removing higher freqencies

# 4000 hertz
p1 >> pluck(P[:8], dur=1/2, lpf=400)

# With resonance change as a linvar
p1 >> pluck(P[:8], dur=1/2, lpf=linvar([500,4000],[8,0]), lpr=linvar([0.1,1],12))



####################
# lpr - See lpf



####################
# midinote



####################
# pan
# Panning, where -1 is far left, 1 is far right (defaults to 0)



####################
# pitch - See degree



####################
# pshift



####################
# oct



####################
# rate
# Variable keyword used for misc. changes to a signal. E.g. Playback rate of the Sample Player (defaults to 1)



####################
# room
# Title keyword: room, Attribute keyword(s): mix

# The room argument specifies the size of the room
d1 >> play("x-o-", room=0.5)

# Mix is the dry/wet mix of reverb or how much the reverb is mixed with the source.  1 is all reverb, 0 is no reverb at all. (Default 0.1)
d1 >> play("x-o-", room=0.5, mix=.5)



####################
# Reveb
# See Room



####################
# sample
# Special keyword for Sample Players; selects another audio file from the bank of samples for a sample character.



####################
# scale



####################
# shape



####################
# slide - Slide To
# Slides' the frequency value of a signal to freq * (slide+1) over the duration of a note (defaults to 0)

p1 >> pluck(P[:8], dur=1/2, slide=1)

p1 >> pluck(P[:8], dur=1/2, slide=12)

p1 >> pluck(P[:8], dur=1/2, slide=var([0,-1],[12,4]))



####################
# slidedelay



####################
# slidefrom



####################
# slider



####################
# spread



####################
# spin



####################
# striate



####################
# stutter



####################
# sus - Sustain (defaults to `dur`)



####################
# swell



####################
# vib - Vibrato
# Vibrato - Title keyword: vib, Attribute keyword(s): Vibrato (defaults to 0)

p1 >> pluck(P[:8], dur=1/2, vib=12)

# With child attribute, vibdepth (default 0.2)
p1 >> pluck(P[:8], dur=1/2, vib=12, vibdepth=0.5)



####################
# vibdepth - See vib