-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinvert~-help.pd
125 lines (125 loc) · 3.94 KB
/
invert~-help.pd
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
#N canvas 327 105 1153 891 10;
#X obj 206 207 invert~ 1;
#X obj 26 289 tabwrite~ original;
#X obj 206 289 tabwrite~ inverted;
#X obj 269 231 loadbang;
#X obj 269 253 metro 100;
#N canvas 0 50 450 250 (subpatch) 0;
#X array inverted 512 float 2;
#X coords 0 1 511 0 140 100 1 0 0;
#X restore 206 334 graph;
#N canvas 0 50 450 250 (subpatch) 0;
#X array original 512 float 2;
#X coords 0 1 511 0 140 100 1 0 0;
#X restore 26 334 graph;
#X obj 29 16 cnv 15 440 30 empty empty empty 20 12 0 14 -191765 -66577
0;
#X obj 149 574 loadbang;
#X obj 149 596 metro 100;
#N canvas 0 50 450 250 (subpatch) 0;
#X array scaled_inverted 512 float 2;
#X coords 0 200 511 0 140 100 1 0 0;
#X restore 256 684 graph;
#N canvas 0 50 450 250 (subpatch) 0;
#X array scaled_original 512 float 2;
#X coords 0 200 511 0 140 100 1 0 0;
#X restore 36 684 graph;
#X obj 36 639 tabwrite~ scaled_original;
#X obj 256 639 tabwrite~ scaled_inverted;
#X obj 256 577 invert~ 1 200;
#X obj 37 533 *~ 200;
#X text 627 39 Arguments:;
#X text 695 63 1st: 1|0 to enable|disable inverting;
#X text 649 150 Inlets:;
#X text 697 175 1st (signal): signal to be inverted;
#X text 698 191 2nd (control): 1|0 to enable|disable inverting (overwrites
first argument);
#X text 649 243 Outlet: inverted signal;
#X text 881 843 Written by Alexandros Drymonitis;
#X obj 344 558 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 362 555 second inlet controls inverting;
#X obj 734 606 loadbang;
#X obj 734 628 metro 100;
#N canvas 0 50 450 250 (subpatch) 0;
#X array offset_inverted 512 float 2;
#X coords 0 1 511 0 140 100 1 0 0;
#X restore 841 716 graph;
#N canvas 0 50 450 250 (subpatch) 0;
#X array offset_original 512 float 2;
#X coords 0 1 511 0 140 100 1 0 0;
#X restore 621 716 graph;
#X obj 621 671 tabwrite~ offset_original;
#X obj 841 671 tabwrite~ offset_inverted;
#X text 40 23 [invert~]: vanilla abstraction to invert a unipolar signal
;
#X obj 27 161 phasor~ 109;
#X obj 37 511 phasor~ 109;
#X obj 622 513 phasor~ 109;
#N canvas 1035 141 482 481 init 0;
#X obj 22 89 s original;
#X msg 22 34 ylabel -10 0 1;
#X obj 38 65 s inverted;
#X msg 22 164 ylabel -10 0 200;
#X obj 22 219 s scaled_original;
#X obj 38 195 s scaled_inverted;
#X obj 215 110 loadbang;
#X obj 38 335 s offset_inverted;
#X obj 22 359 s offset_original;
#X msg 22 304 ylabel -10 0 0.75 1;
#X connect 1 0 0 0;
#X connect 1 0 2 0;
#X connect 3 0 4 0;
#X connect 3 0 5 0;
#X connect 6 0 1 0;
#X connect 6 0 3 0;
#X connect 6 0 9 0;
#X connect 9 0 7 0;
#X connect 9 0 8 0;
#X restore 479 16 pd init;
#X obj 386 207 invert~ 1;
#N canvas 0 50 450 250 (subpatch) 0;
#X array double_inverted 512 float 2;
#X coords 0 1 511 0 140 100 1 0 0;
#X restore 386 334 graph;
#X obj 386 289 tabwrite~ double_inverted;
#X text 622 445 In case the signal has an offset \, the second argument
must be set accordingly to give the correct result (in this case \,
the second argument value is signal_scaling + (signal_offset * 2))
;
#X text 37 474 You can also invert unipolar signals that exceeds one
(in which case the range must be set via the second argument;
#X obj 622 535 *~ 0.25;
#X obj 622 557 +~ 0.75;
#X obj 841 609 invert~ 1 1.75;
#X text 34 79 [invert~] will invert a unipolar signal that goes from
0 to 1 (or from 1 to 0) with one argument only (which can be omitted
and overwritten by the right inlet of the abstraction);
#X text 696 83 2nd (optional): scaling of the signal. this argument
is necessary when the signal to be inverted exceeds 1 or has an offset
;
#X connect 0 0 2 0;
#X connect 0 0 36 0;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 4 0 1 0;
#X connect 4 0 38 0;
#X connect 8 0 9 0;
#X connect 9 0 12 0;
#X connect 9 0 13 0;
#X connect 14 0 13 0;
#X connect 15 0 12 0;
#X connect 15 0 14 0;
#X connect 23 0 14 1;
#X connect 25 0 26 0;
#X connect 26 0 29 0;
#X connect 26 0 30 0;
#X connect 32 0 0 0;
#X connect 32 0 1 0;
#X connect 33 0 15 0;
#X connect 34 0 41 0;
#X connect 36 0 38 0;
#X connect 41 0 42 0;
#X connect 42 0 29 0;
#X connect 42 0 43 0;
#X connect 43 0 30 0;