aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/spigot-help.pd
blob: 7f912580b9d5e2e111f775415e8dc2d46f94ec77 (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
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
#N canvas 94 22 874 659 10;
#X msg 8 96 0.5 1000;
#X floatatom 38 160 1 0 0 0 - - -;
#X obj 8 177 spigot;
#X obj 7 198 print;
#X msg 20 136 walk the cat;
#X msg 13 116 bang;
#X obj 27 11 spigot;
#X text 75 11 - pass or block messages;
#X text 51 160 control: nonzero to pass messages \, zero to stop them
;
#X text 4 294 USING [SPIGOT] TO CREATE A GATE.;
#X text 14 312 Unlike its closest cousin MAX \, Pd does not have a
native [gate] object. There are other Pd libraries which include gates
for both audio and numerical data \, but similar routines can be built
in Pd using [spigot]. The example below shows a two-way gate using
two [spigots] and the [expr] object.;
#X obj 87 505 spigot;
#X floatatom 88 459 1 0 0 0 - - -;
#X text 105 458 controls: open and close the gates.;
#X floatatom 23 527 5 0 0 0 - - -;
#X floatatom 87 527 5 0 0 0 - - -;
#X obj 4 400 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 7 418 metro 200;
#X obj 4 439 f;
#X obj 31 439 + 1;
#X obj 118 484 expr 1-$f1;
#X text 24 398 Click to start sending info through the gates.;
#X obj 88 439 loadbang;
#X text 8 38 [spigot] passes messages from its left inlet to its outlet
\, as long as a nonzero number is sent to its right inlet. When its
right inlet gets zero \, incoming messages are "blocked" (i.e. ignored).
;
#X text 6 231 [spigot] works essentially like a doorway. When the door
is open \, messages can pass through. When the door is closed \, messages
are ignored. By default \, the door is always closed!;
#X obj 23 505 spigot;
#X text 5 547 In the example above \, the magic is created by the [expr]
object which performs a simple calculation using the incoming number
(1 or 0). Note that the figure "$f1" is a variable which assumes the
value of the incoming number.;
#X text 447 17 CREATION ARGUMENTS?;
#X obj 567 98 spigot 0;
#X text 434 216 [SPIGOT] FOR AUDIO SIGNALS?;
#X text 447 233 [spigot] does not work with audio signals. The data
types which are accepted by this object are floats \, symbols \, lists
\, bangs \, anythings and pointers. However \, audio signals require
a completely different treatment.;
#X text 444 285 Pd does not have a [spigot] for audio signals \, but
the same effect can be created using the following structure:;
#X obj 458 332 osc~ 800;
#X obj 426 15 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 426 596 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 458 389 *~;
#X floatatom 471 372 1 0 0 0 - - -;
#X obj 440 467 env~;
#X floatatom 440 488 5 0 0 0 - - -;
#X msg 598 342 \; pd dsp \$1 \;;
#X obj 598 323 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 485 486 dac~;
#X obj 485 466 *~ 0.05;
#X text 615 324 Turn on audio computation first.;
#X text 489 377 Here is the [spigot].;
#X text 488 390 When "0" \, audio signal;
#X text 487 406 is effectively blocked.;
#X text 488 420 When "1" \, audio signal is;
#X text 488 435 not effected in any way.;
#X text 446 518 RELATED OBJECTS;
#N canvas 0 22 454 304 related_objects_from_other_libraries 0;
#X obj 40 36 gate;
#X text 18 86 These objects are offered in Pd only if you have downloaded
and properly installed the appropriate library. These objects may or
may not exist in a single library.;
#X text 17 135 The best places to find information about Pd's libraries
is:;
#X text 14 157 www.puredata.org and click on "Downloads" then "Software"
;
#X text 15 173 or;
#X text 16 187 iem.kug.ac.at/pdb/;
#X restore 459 539 pd related_objects_from_other_libraries;
#X obj 456 188 spigot cat;
#X obj 534 188 spigot dog;
#X text 454 33 [spigot] only accepts one numerical creation argument:
a one or a zero. At creation time the [spigot] is "closed". With a
one \, its defaults to open.;
#X obj 635 98 spigot 1;
#X obj 579 71 bng 15 250 50 0 empty empty empty 0 -6 0 8 -225271 -1
-1;
#X obj 511 98 spigot;
#X obj 511 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 567 117 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 635 117 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 451 576 This document was updated for Pd version 0.38-4. It
was edited by Dave Sabine and Hans-Christoph Steiner as part of a project
called pddp proposed by Krzysztof Czaja to build comprehensive documentation
for Pd.;
#X text 455 143 [spigot] used to accept any symbol \, but all of these
are meaningless and have no effect on the operation of the object.
This was removed in Pd 0.38-3;
#X connect 0 0 2 0;
#X connect 1 0 2 1;
#X connect 2 0 3 0;
#X connect 4 0 2 0;
#X connect 5 0 2 0;
#X connect 11 0 15 0;
#X connect 12 0 20 0;
#X connect 12 0 25 1;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X connect 18 0 19 0;
#X connect 18 0 11 0;
#X connect 18 0 25 0;
#X connect 19 0 18 1;
#X connect 20 0 11 1;
#X connect 22 0 12 0;
#X connect 25 0 14 0;
#X connect 28 0 58 0;
#X connect 32 0 35 0;
#X connect 33 0 34 0;
#X connect 35 0 37 0;
#X connect 35 0 42 0;
#X connect 36 0 35 1;
#X connect 37 0 38 0;
#X connect 40 0 39 0;
#X connect 42 0 41 0;
#X connect 54 0 59 0;
#X connect 55 0 28 0;
#X connect 55 0 56 0;
#X connect 55 0 54 0;
#X connect 56 0 57 0;