aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/10.PART2.wavetables.pd
blob: 925988ad116bffca149d3cf46f7c7aad261b3ecd (plain)
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
#N canvas 19 22 722 608 12;
#X floatatom 164 43 0 0 0;
#X graph graph1 0 -1.02 258 1.02 445 177 703 47;
#X array table10 259 float 1;
#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0.612 0.612 0.612 0.612 0.612 0.627692 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 -0.470769 -0.470769 -0.470769 -0.470769 -0.470769
-0.470769 -0.470769 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0.627692 0.627692 0.627692 0.643385 0.643385 0.643385
0.659077 0 -0.502154 -0.502154 -0.502154 -0.486462 -0.486462 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0.580615 0.596308 0.596308 0.596308 0.596308
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#X pop;
#X floatatom 202 171 0 0 100;
#N canvas 159 26 532 285 output 0;
#X obj 338 160 t b;
#X obj 338 110 f;
#X obj 338 60 inlet;
#X text 344 29 mute;
#X obj 338 185 f;
#X msg 426 180 0;
#X msg 338 85 bang;
#X obj 338 135 moses 1;
#X obj 397 110 moses 1;
#X obj 83 148 dbtorms;
#X obj 397 85 r master-lvl;
#X obj 83 42 r master-lvl;
#X obj 338 210 s master-lvl;
#X obj 20 182 inlet~;
#X obj 199 41 inlet;
#X text 199 18 level;
#X obj 199 105 s master-lvl;
#X msg 96 65 set \$1;
#X obj 96 90 outlet;
#X msg 214 65 \; pd dsp 1;
#X obj 83 198 line~;
#X obj 20 207 *~;
#X obj 20 232 dac~;
#X obj 83 173 pack 0 50;
#X text 20 159 audio;
#X text 96 114 show level;
#X obj 426 155 t b;
#X connect 0 0 4 0;
#X connect 1 0 7 0;
#X connect 2 0 6 0;
#X connect 4 0 12 0;
#X connect 5 0 12 0;
#X connect 6 0 1 0;
#X connect 7 0 0 0;
#X connect 7 1 26 0;
#X connect 8 1 4 1;
#X connect 9 0 23 0;
#X connect 10 0 1 1;
#X connect 10 0 8 0;
#X connect 11 0 9 0;
#X connect 11 0 17 0;
#X connect 13 0 21 0;
#X connect 14 0 16 0;
#X connect 14 0 19 0;
#X connect 17 0 18 0;
#X connect 20 0 21 1;
#X connect 21 0 22 0;
#X connect 21 0 22 1;
#X connect 23 0 20 0;
#X connect 26 0 5 0;
#X restore 164 199 pd output;
#X msg 240 172 MUTE;
#X text 30 123 oscillator -->;
#X text 456 587 updated for Pd version 0.34;
#X text 33 8 WAVETABLE OSCILLATORS;
#X text 36 106 wavetable;
#X obj 164 70 mtof;
#X floatatom 164 97 0 0 0;
#X obj 164 123 tabosc4~ table10;
#X text 94 42 pitch->;
#X text 35 309 Note that I selected "save contents" in the properties
dialog for table10 (right click on the table to see.) If this isn't
set \, the waveform won't be remembered as part of the patch but will
be reinitialized to zero when the patch is reopened.;
#X msg 35 549 \; table10 cosinesum 256 0.2 -0.2 0.2 -0.2 0.2 -0.2 0.2
;
#X msg 578 240 \; table10 const 0;
#X text 597 217 CLEAR TABLE;
#X text 35 395 For efficiency's sake tabosc4~ requires that the table
have a power of two plus three points (64+3=67 \, 128+3=131 \, 256+3=259
\, etc.) If you want wraparound to work smoothly \, you should make
the last three points copies of the first three. This is done because
tabread4~ does 4-point interpolation.;
#X text 38 494 If you want a specific sinusoidal composition \, you
can send table10 a message \, as below (see 11.arrays in the control
examples):;
#X text 36 240 Here \, in place of the "osc~" cosine wave oscillator
\, we introduce the tabosc4~ oscillator which produces an arbitrary
waveform. You can draw in the waveform with the mouse.;
#X connect 0 0 9 0;
#X connect 2 0 3 1;
#X connect 3 0 2 0;
#X connect 4 0 3 2;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 3 0;