blob: 1b030693dfb674ec207eefd88a0b5f845392a409 (
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
|
#N canvas 351 47 650 572 10;
#X obj 31 224 *~;
#X obj 32 253 dac~;
#X obj 111 243 pow 2;
#X obj 114 218 hsl 128 15 0 1 0 0 empty empty volume -2 -8 0 10 -262144
-1 -1 0 1;
#X obj 111 284 line~;
#X obj 111 263 pack f 20;
#X obj 283 212 cnv 15 350 130 empty empty empty 20 12 0 14 -24198 -66577
0;
#X text 290 223 synopsis:;
#X text 289 278 inlet1: signal (frequency);
#X text 289 298 inlet2: float (set phase);
#X text 290 319 outlet: signal (bandlimited square at given f);
#X obj 183 354 cnv 15 450 120 empty empty empty 20 12 0 14 -241291
-66577 0;
#X floatatom 262 408 7 0 0 0 - - -;
#X text 315 410 Hz;
#X text 194 408 border @;
#X text 14 519 copyright by Roman Haefeli;
#X text 14 540 published under the GNU Public License;
#X obj 244 484 cnv 15 390 25 empty empty empty 20 12 0 14 -258699 -66577
0;
#X text 252 490 due to bandlimitation peaks above/below +/-1 may occur
;
#X obj 34 61 hsl 128 15 20 17000 1 0 empty empty frequency -2 -8 0
10 -262144 -1 -1 3000 1;
#X obj 31 83 pack f 100;
#X obj 31 104 line~;
#X msg 18 493 version 0.2.0;
#X text 220 83 if the instance containing the tables is deleted \,
the other instances won't work anymore. reload the patch then.;
#X text 261 361 try different values for <number of tables>:;
#N canvas 573 67 190 308 compute_bandlimited_range 0;
#X msg 21 34 get_num_of_tables;
#X obj 21 97 route num_of_tables;
#X obj 21 12 loadbang;
#X obj 21 128 t b f;
#X obj 21 152 samplerate~;
#X obj 21 174 / 2;
#X obj 51 194 * 2;
#X obj 51 217 + 1;
#X obj 21 238 /;
#X obj 21 264 outlet;
#X obj 21 56 s BLTRIANGLE;
#X obj 21 76 r BLTRIANGLE;
#X connect 0 0 10 0;
#X connect 1 0 3 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 3 1 6 0;
#X connect 4 0 5 0;
#X connect 5 0 8 0;
#X connect 6 0 7 0;
#X connect 7 0 8 1;
#X connect 8 0 9 0;
#X connect 11 0 1 0;
#X restore 262 383 pd compute_bandlimited_range;
#X text 219 28 if [bltriangle~] is instantiated more than once \, only
the first instance creates the tables. if the argument value differs
\, the biggest is taken.;
#X text 221 129 the number of tables is at the same time the number
of harmonics of the table with the highest number of harmonics. this
value defines also the frequency \, below which [bltriangle~] switches
to a raw triangle.;
#X text 290 250 [bltriangle~ <number of tables>];
#X text 260 431 if frequency above border -> bandlimited triangle;
#X text 260 447 if frequency below border -> raw triangle;
#X obj 32 151 bltriangle~ 20;
#X connect 0 0 1 0;
#X connect 0 0 1 1;
#X connect 2 0 5 0;
#X connect 3 0 2 0;
#X connect 4 0 0 1;
#X connect 5 0 4 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 31 0;
#X connect 25 0 12 0;
#X connect 31 0 0 0;
|