aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/line-help.pd
blob: 7a46344fe22ab5c9b5f311d99f40a3917a760c66 (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
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
166
167
168
169
#N canvas 190 248 862 534 10;
#X obj 3 29 line;
#X text 38 29 -- ramp generator;
#X text 5 59 [line]'s left inlet defines the "target" value. The right
inlet defines the "time" value. The "target \, time" pair of numbers
inform [line] to produce a numeric "ramp" from its current value (whatever
that might be at any given moment) to the new value within the alloted
time which is defined at the right inlet.;
#X text 5 147 It is important to realize that [line] stores only the
current value...it does not remember the defined "time" (duration of
the ramp). Hence \, the following works:;
#X obj 10 262 line;
#X msg 44 238 1000;
#X msg 10 238 1000;
#X obj 10 195 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 10 215 t b b;
#X floatatom 10 284 5 0 0 0 - - -;
#X obj 151 270 line;
#X msg 151 246 1000;
#X obj 151 226 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X floatatom 151 292 5 0 0 0 - - -;
#X text 5 309 If [line] receives a new target value without an accompanying
"time" \, it simply jumps to the new value...as in the example above
on the right. In the example above on the left \, you'll see that [line]
will create a numeric ramp from 0 to 1000 over 1000 milliseconds. You
should also note that if you click that [bng] again a second time \,
nothing happens. This is because [line] is already at 1000 \, so sending
it new instructions to ramp to 1000 is meaningless and has no effect.
;
#X text 5 435 Having said all of that \, let's just reiterate that
it's important to send a "time" value to [line] before sending it a
new "target" value...unless of course you WANT it to jump immediately
to the new target.;
#X text 430 41 [line] will accept a list of two numbers. The first
in the list will be assigned as the new target \, the second in the
list will be the new time (duration of the ramp) as below:;
#X obj 416 7 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 416 501 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 449 215 line;
#X msg 449 127 1000 1000;
#X floatatom 449 236 5 0 0 0 - - -;
#X text 515 126 ramp up.;
#X msg 458 150 0 1000;
#X text 505 150 ramp down.;
#X msg 470 194 stop;
#X text 430 86 [line] will also accept the "stop" message which effectively
halt the current ramp.;
#N canvas 51 105 536 509 continuous_ramps 0;
#X text 29 44 [line] does not schedule its incoming messages. What
this means is that if you send [line] a new target value mid-way through
a ramp \, a new ramp is immediatly created to the new target value
starting from the "current" value.;
#X text 27 105 In other words \, if [line] receives a message specifying
some new target and time before reaching the previous target \, it
takes off from its current value.;
#X obj 34 254 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 0 1;
#X msg 64 212 stop;
#X msg 57 192 42;
#X obj 31 233 line;
#X msg 31 151 127 5000;
#X msg 49 172 0 5000;
#X text 18 23 CONTINUOUS RAMPS;
#X text 24 278 Due to this unique behavior \, a common construct found
in Pd patches includes the [pack] object as follows:;
#X obj 38 399 line;
#X floatatom 38 420 10 0 0 0 - - -;
#X floatatom 38 313 5 0 0 0 - - -;
#X obj 38 379 pack f 500;
#X msg 49 332 50;
#X msg 57 353 2000;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X connect 6 0 5 0;
#X connect 7 0 5 0;
#X connect 10 0 11 0;
#X connect 12 0 13 0;
#X connect 13 0 10 0;
#X connect 14 0 13 0;
#X connect 15 0 13 0;
#X restore 443 290 pd continuous_ramps;
#X text 152 196 While this does NOT work unless;
#X text 150 206 you click "500" first.;
#X msg 185 246 500;
#X msg 466 173 42;
#X text 492 174 jumps to this value immediately.;
#X text 507 194 stops the current ramp.;
#X text 428 316 More information about [line] can be found in the Pure
Documentation folder doc/3.audio.examples.;
#X text 431 478 This document was updated for Pd version 0.35 test
28 by Dave Sabine as part of a project called pddp proposed by Krzysztof
Czaja to build comprehensive documentation for Pd.;
#X text 423 354 RELATED OBJECTS;
#X obj 443 373 line~;
#N canvas 0 22 456 306 related_objects_from_other_libraries 0;
#X obj 23 21 tripleline;
#X obj 105 20 t3_line~;
#X obj 171 20 fade~;
#X obj 219 21 step;
#X text 17 54 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 16 103 The best places to find information about Pd's libraries
is:;
#X text 13 125 www.puredata.org and click on "Downloads" then "Software"
;
#X text 14 141 or;
#X text 15 155 iem.kug.ac.at/pdb/;
#X restore 444 397 pd related_objects_from_other_libraries;
#N canvas 0 22 462 536 grain_rate_and_creation_arguments 0;
#X text 20 18 GRAIN RATE;
#X text 32 38 The "grain rate" of [line] is the rate at which it will
output its values. The faster the grain is \, the smoother the ramp
will appear. While slower grain rates will produce a more disjunct
ramp. Of course this setting will alter the amount of CPU that the
[line] object will require. Higher rates require more computation.
;
#X text 33 144 This means simply that [line] will output a new value
between its current value and your new value once every 20 milliseconds.
;
#X text 33 125 The default grain rate is 20 milliseconds.;
#X text 30 192 [line]'s optional creation arguments can be used to
reset the grain rate. However \, the grain rate cannot be reset dynamically.
;
#X text 32 247 First creation argument is the initial value: the starting
point of the first ramp.;
#X text 31 286 The second creation argument sets the grain rate. Observe
the following two examples to see how the grain rate effects the output.
;
#X obj 44 417 line 0 5;
#X obj 47 450 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 0 1;
#X msg 147 346 127;
#X msg 179 354 0;
#X obj 146 382 pack f 5000;
#X obj 214 450 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 0 1;
#X obj 211 417 line 0 500;
#X connect 7 0 8 0;
#X connect 9 0 11 0;
#X connect 10 0 11 0;
#X connect 11 0 7 0;
#X connect 11 0 13 0;
#X connect 13 0 12 0;
#X restore 443 263 pd grain_rate_and_creation_arguments;
#X obj 3 3 cnv 5 850 20 empty empty [line] 20 10 1 18 -233017
-66577 0;
#X obj 819 4 pddp;
#X connect 4 0 9 0;
#X connect 5 0 4 1;
#X connect 6 0 4 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 8 1 5 0;
#X connect 10 0 13 0;
#X connect 11 0 10 0;
#X connect 12 0 11 0;
#X connect 17 0 18 0;
#X connect 19 0 21 0;
#X connect 20 0 19 0;
#X connect 23 0 19 0;
#X connect 25 0 19 0;
#X connect 30 0 10 1;
#X connect 31 0 19 0;