File: poly-help.pd

package info (click to toggle)
puredata 0.55.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,508 kB
  • sloc: ansic: 118,824; tcl: 10,221; cpp: 9,327; makefile: 1,632; sh: 1,476; python: 152; xml: 98; awk: 13
file content (165 lines) | stat: -rw-r--r-- 6,973 bytes parent folder | download | duplicates (2)
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
#N canvas 459 95 567 557 12;
#X declare -stdpath ./;
#X text 16 519 see also:;
#X obj 29 16 poly;
#X obj 94 519 makenote;
#X obj 99 319 poly 4 1;
#X msg 211 285 stop;
#X msg 203 259 clear;
#X text 68 16 - MIDI-style polyphonic voice allocator;
#X listbox 92 379 13 0 0 0 - - - 0;
#X obj 92 349 pack f f f;
#X text 248 260 clear memory;
#X text 249 286 flush hanging note on messages;
#X obj 9 50 cnv 1 550 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 800 147 484 391 reference 0;
#X obj 8 52 cnv 5 450 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0;
#X obj 8 192 cnv 2 450 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 8 313 cnv 2 450 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 7 370 cnv 5 450 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 7 155 cnv 1 450 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 7 85 cnv 1 450 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0;
#X obj 27 18 poly;
#X text 66 18 - MIDI-style polyphonic voice allocator.;
#X text 131 93 float - MIDI pitch value., f 40;
#X text 131 111 clear -;
#X text 187 111 clear memory., f 32;
#X text 138 129 stop -;
#X text 187 129 flush hanging note on messages., f 32;
#X text 132 162 float - set velocity value., f 40;
#X obj 7 246 cnv 1 450 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 7 216 cnv 1 450 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0;
#X text 132 224 float - the voice number., f 40;
#X obj 7 276 cnv 1 450 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000 0;
#X text 111 323 1) float - number of voices (default 1)., f 43;
#X text 111 341 2) float - non-zero sets to voice stealing.;
#X text 131 284 float - note velocity., f 40;
#X text 131 254 float - note pitch., f 40;
#X restore 383 17 pd reference;
#X text 477 17 <= click;
#X obj 9 506 cnv 1 550 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 194 205 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X text 237 230 <-- emulating note on/off messages;
#X obj 52 205 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X obj 99 205 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X obj 146 205 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X obj 92 408 route 1 2 3 4, f 39;
#X listbox 92 436 7 0 0 0 - - - 0;
#X obj 92 463 print v1;
#X listbox 159 436 7 0 0 0 - - - 0;
#X listbox 227 436 7 0 0 0 - - - 0;
#X listbox 294 436 7 0 0 0 - - - 0;
#X obj 159 463 print v2;
#X obj 227 463 print v3;
#X obj 294 463 print v4;
#N canvas 662 49 425 614 clone 0;
#X text 33 19 You'll usually want [poly] to control a single polyhonic synth. The "route" method shown in the parent patch would then imply that you'd have the same subpatch or abstraction taking the note message., f 48;
#X listbox 181 370 13 0 0 0 - - - 0;
#X obj 181 338 pack f f f;
#X obj 181 438 output~;
#X obj 60 436 declare -stdpath ./, f 11;
#X obj 181 402 clone -s 1 clone-abs-c 4;
#X obj 181 304 poly 4 1;
#X text 65 532 In [clone] \, we use the "-s" flag to set the starting copy number to 1 \, so it matches the voice numbers from [poly] \, which is indexed by 1 as well., f 43;
#X obj 181 256 makenote 55 1500;
#X msg 111 188 60;
#X msg 144 188 62;
#X msg 181 188 65;
#X msg 222 188 69;
#X floatatom 181 226 5 0 0 0 - - - 0;
#X obj 119 256 notein;
#X text 33 102 An approach that is more useful in this case is using [clone] to load an abstraction \, see below. Here we use [makenote] but you can also try your MIDI keyboard input with [notein]., f 48;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 5 0 3 0;
#X connect 6 0 2 0;
#X connect 6 1 2 1;
#X connect 6 2 2 2;
#X connect 8 0 6 0;
#X connect 8 1 6 1;
#X connect 9 0 13 0;
#X connect 10 0 13 0;
#X connect 11 0 13 0;
#X connect 12 0 13 0;
#X connect 13 0 8 0;
#X connect 14 0 6 0;
#X connect 14 1 6 1;
#X restore 444 449 pd clone;
#X text 166 319 <-- first argument \, number of voices second;
#X text 195 335 argument selects voice stealing;
#X text 339 521 updated for Pd version 0.54-1;
#X obj 221 519 clone;
#X obj 163 518 notein;
#X text 40 62 The [poly] object takes pitch in the left inlet and velocity in the right inlet \, but the example here takes a list input \, which gets spread at inlets (as is common in Pd). The output is voice number (left outlet) \, pitch (mid outlet) and velocity (right outlet)., f 68;
#X text 39 125 You can pack the output and use the [route] object to route messages to different voices (as below) or feed it [clone] (see example in [pd clone]). The [poly] object can be configured to do voice stealing with the 2nd argument (the default is 'no stealing')., f 68;
#X msg 52 231 72 \$1;
#X msg 99 231 74 \$1;
#X msg 146 231 77 \$1;
#X msg 194 231 81 \$1;
#N canvas 661 49 444 661 monophonic 0;
#X obj 163 454 output~;
#X obj 171 240 notein;
#X obj 163 354 osc~;
#X obj 163 393 *~;
#X obj 163 318 mtof;
#X obj 209 416 pow~ 4;
#X obj 209 311 / 127;
#X obj 209 377 line~;
#X msg 209 341 \$1 150;
#X obj 137 274 poly 1 1;
#X obj 232 131 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X obj 90 131 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X obj 137 131 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X obj 184 131 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 64;
#X msg 90 157 72 \$1;
#X msg 184 157 77 \$1;
#X msg 232 157 81 \$1;
#X listbox 137 207 10 0 0 0 - - - 0;
#X msg 137 157 74 \$1;
#X text 33 19 If you set [poly] to a single voice you can make it manage a monophonic synth control a single polyhonic synth. Without this minimum management you may end up getting undesired note off messages from releasing keys that were previously pressed instead from the currently pressed one., f 50;
#X text 59 542 Note however that some monophonic synths may have a more sophisticated management where it goes back to the previously pressed key (if you're still pressing it) \, but [poly] can only manage this in a much simpler way., f 45;
#X text 228 233 you can also try your MIDI keyboard., f 19;
#X connect 1 0 9 0;
#X connect 1 1 9 1;
#X connect 2 0 3 0;
#X connect 3 0 0 0;
#X connect 4 0 2 0;
#X connect 5 0 3 1;
#X connect 6 0 8 0;
#X connect 7 0 5 0;
#X connect 8 0 7 0;
#X connect 9 1 4 0;
#X connect 9 2 6 0;
#X connect 10 0 16 0;
#X connect 11 0 14 0;
#X connect 12 0 18 0;
#X connect 13 0 15 0;
#X connect 14 0 17 0;
#X connect 15 0 17 0;
#X connect 16 0 17 0;
#X connect 17 0 9 0;
#X connect 18 0 17 0;
#X restore 444 419 pd monophonic;
#X connect 3 0 8 0;
#X connect 3 1 8 1;
#X connect 3 2 8 2;
#X connect 4 0 3 0;
#X connect 5 0 3 0;
#X connect 7 0 20 0;
#X connect 8 0 7 0;
#X connect 15 0 40 0;
#X connect 17 0 37 0;
#X connect 18 0 38 0;
#X connect 19 0 39 0;
#X connect 20 0 21 0;
#X connect 20 1 23 0;
#X connect 20 2 24 0;
#X connect 20 3 25 0;
#X connect 21 0 22 0;
#X connect 23 0 26 0;
#X connect 24 0 27 0;
#X connect 25 0 28 0;
#X connect 37 0 3 0;
#X connect 38 0 3 0;
#X connect 39 0 3 0;
#X connect 40 0 3 0;