[PD] round off the corners of a [line] movement?

Christof Ressi info at christofressi.com
Wed Sep 27 16:28:55 CEST 2023


Now I am not sure if [line"] was supposed to be [line~]... Just in case, 
here's a signal version called [cline~].

Christof

On 27.09.2023 14:51, Christof Ressi wrote:
> [line] outputs a linear ramp, so you just need to apply a transfer 
> function to get the behavior you want. For example, if you want a 
> gradual start and gradual, you could use the second half of a cosine 
> wave.
>
> I have an abstraction called [cline] that supports various shapes (see 
> attachment).
>
> Christof
>
> On 26.09.2023 20:06, Peter P. wrote:
>> Hi list,
>>
>> often when I use [line¨] to make frequency glissandi, the point when the
>> ramp starts, and the point where it ends, appear as very sudden events
>> to my ears. I am wondering if there is an easy way to gradually speed up
>> the ramp when it starts, and slow it down before it reaches its target
>> value?
>> The only way I can think of so far is to model such a behavior with two
>> masses connected by an elastic link using the pmpd library. But a
>> vanilla way would be very interesting too!
>>
>> Thanks in advance for all ideas and pointers!
>> cheersz, Peter
>>
>>
>>
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management -> 
>> https://lists.puredata.info/listinfo/pd-list
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
-------------- next part --------------
#N canvas 747 262 842 546 10;
#X obj 3 181 line~;
#X obj 130 140 snapshot~;
#X obj 30 359 outlet~;
#X obj 58 -8 inlet;
#X obj 4 205 -~ 0;
#X obj 82 121 -;
#X obj 4 234 /~ 1;
#X obj 4 295 *~ 1;
#X obj 30 326 +~ 0;
#X obj 62 90 t l f b;
#X obj 10 151 spigot;
#N canvas 256 342 893 547 transfer 0;
#X obj 62 61 inlet~;
#X obj 117 61 r \$0-transfer;
#N canvas 309 228 1087 458 exp 0;
#X obj 358 196 exp~;
#X obj 419 191 exp;
#X obj 354 73 inlet~;
#X obj 359 162 *~ 1;
#X obj 357 232 -~ 1;
#X obj 420 227 - 1;
#X obj 355 270 /~ 1;
#X obj 354 341 outlet~;
#X text 122 50 normalized natural exponential function;
#X obj 405 72 r \$0-arg;
#X obj 412 128 * -1;
#X obj 505 126 switch~;
#X obj 504 74 inlet;
#X obj 504 96 == 2;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 3 0;
#X connect 3 0 0 0;
#X connect 4 0 6 0;
#X connect 5 0 6 1;
#X connect 6 0 7 0;
#X connect 9 0 10 0;
#X connect 10 0 3 1;
#X connect 10 0 1 0;
#X connect 12 0 13 0;
#X connect 13 0 11 0;
#X restore 165 243 pd exp;
#X obj 134 303 outlet~;
#N canvas 0 50 450 300 pow 0;
#X obj 87 130 inlet~;
#X obj 106 213 outlet~;
#X obj 107 176 pow~ 1;
#X msg 148 131 1;
#X obj 148 76 max 0;
#X obj 148 104 select 0;
#X obj 148 45 r \$0-arg;
#X obj 246 134 switch~;
#X obj 248 82 inlet;
#X obj 249 107 == 1;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 3 0 2 1;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 5 1 2 1;
#X connect 6 0 4 0;
#X connect 8 0 9 0;
#X connect 9 0 7 0;
#X restore 107 244 pd pow;
#X text 286 89 missing or invalid argument is set to 'lin' (0);
#N canvas 266 122 787 443 cos 0;
#X obj 94 25 inlet~;
#X obj 91 335 outlet~;
#X obj 251 24 inlet;
#X obj 90 241 cos~;
#X obj 93 186 *~ 1;
#X obj 91 212 +~ 0;
#X obj 91 270 +~ 0;
#X obj 91 300 *~ 1;
#X obj 164 165 unpack f f f f;
#X msg 184 108 0.25 -0.25 0 1;
#X msg 204 139 0.25 0.5 1 1;
#X msg 173 81 0.5 0.5 1 0.5;
#X obj 170 29 r \$0-arg;
#X obj 168 56 sel 0 1 2;
#X text 307 48 cos 0: second half of a cosine wave (s-shape) \; cos
1: last quarter of a cosine wave (slow rise) \; cos 2: third quarter
of a cosine wave (fast rise) \; 'reset' message simply goes through
the rejection outlet of select and sets output of cos~ to zero.;
#X obj 264 330 switch~;
#X obj 264 286 == 3;
#X connect 0 0 4 0;
#X connect 2 0 16 0;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 6 0 7 0;
#X connect 7 0 1 0;
#X connect 8 0 4 1;
#X connect 8 1 5 1;
#X connect 8 2 6 1;
#X connect 8 3 7 1;
#X connect 9 0 8 0;
#X connect 10 0 8 0;
#X connect 11 0 8 0;
#X connect 12 0 13 0;
#X connect 13 0 11 0;
#X connect 13 1 9 0;
#X connect 13 2 10 0;
#X connect 16 0 15 0;
#X restore 224 244 pd cos;
#X obj 117 91 select lin pow exp cos;
#X obj 225 26 r \$0-arg;
#X obj 187 117 demux;
#X obj 225 55 != 0;
#X text 284 114 exp with argument 0 is routet to 'lin';
#X text 199 170 switch off what you don't need;
#X obj 64 244 *~;
#X obj 165 167 t f;
#X msg 126 138 0;
#X msg 163 140 1;
#X msg 216 140 2;
#X msg 253 139 3;
#X obj 79 200 == 0;
#X connect 0 0 4 0;
#X connect 0 0 2 0;
#X connect 0 0 6 0;
#X connect 0 0 13 0;
#X connect 1 0 7 0;
#X connect 2 0 3 0;
#X connect 4 0 3 0;
#X connect 6 0 3 0;
#X connect 7 0 15 0;
#X connect 7 1 16 0;
#X connect 7 2 9 0;
#X connect 7 3 18 0;
#X connect 7 4 15 0;
#X connect 8 0 10 0;
#X connect 9 0 15 0;
#X connect 9 1 17 0;
#X connect 10 0 9 1;
#X connect 13 0 3 0;
#X connect 14 0 4 1;
#X connect 14 0 2 1;
#X connect 14 0 6 1;
#X connect 14 0 19 0;
#X connect 15 0 14 0;
#X connect 16 0 14 0;
#X connect 17 0 14 0;
#X connect 18 0 14 0;
#X connect 19 0 13 1;
#X restore 4 265 pd transfer;
#N canvas 542 443 817 556 arg 0;
#X obj 112 42 inlet;
#X obj 111 72 route set;
#X obj 195 6 loadbang;
#X obj 163 274 s \$0-arg;
#X obj 49 273 s \$0-transfer;
#X obj 184 73 symbol \$1;
#X obj 259 73 \$2;
#X obj 163 241 f;
#X obj 196 39 t b b;
#X obj 177 175 route bang float;
#X msg 177 200 0;
#X obj 183 108 pack s f;
#X obj 100 205 t s b;
#X obj 110 136 list split 1;
#X connect 0 0 1 0;
#X connect 1 0 13 0;
#X connect 2 0 8 0;
#X connect 5 0 11 0;
#X connect 6 0 11 1;
#X connect 7 0 3 0;
#X connect 8 0 5 0;
#X connect 8 1 6 0;
#X connect 9 0 10 0;
#X connect 9 1 7 1;
#X connect 10 0 7 1;
#X connect 11 0 13 0;
#X connect 12 0 4 0;
#X connect 12 1 7 0;
#X connect 13 0 12 0;
#X connect 13 1 9 0;
#X restore 168 89 pd arg;
#X text 228 20 anything ("set ...");
#X text -49 70 list \; (target \, time);
#X text 230 259 note: it's best to change the shape of the transfer
function when starting a new ramp and not in the middle of an ongoing
ramp. with this technique you can easily design envelope generators
with individual shapes for each section.;
#X text 232 117 use "set" messages to change arguments dynamically:
;
#X text 231 69 creation arguments: \; 1) lin (= default) \, pow \,
exp \, cos \; 2) exponent (pow) \, shape (exp) \, segment (cos);
#X obj 109 -9 inlet;
#X text 265 141 lin: linear ramp \; pow: x^a \; exp: exponential function
\, shape determined by 2nd arg. \; 0 = linear \, > 0 = fast rise \,
< 0 = slow rise \; cos: segment of a cosine wave determined by 2nd
arg. 0 = second half (s-shape) \; 1 = last quarter (fast rise) \; 2
= third quarter (slow rise) \;;
#X text 231 334 caution: jumps in zero time are not possible \, the
minimum time difference between two messages is one block (1.452 ms)!
;
#X obj 58 21 route list float stop;
#X msg 152 46 stop;
#X connect 0 0 4 0;
#X connect 1 0 4 1;
#X connect 1 0 8 1;
#X connect 1 0 5 1;
#X connect 1 0 0 0;
#X connect 3 0 21 0;
#X connect 4 0 6 0;
#X connect 5 0 6 1;
#X connect 5 0 7 1;
#X connect 5 0 10 1;
#X connect 6 0 11 0;
#X connect 7 0 8 0;
#X connect 8 0 1 0;
#X connect 8 0 2 0;
#X connect 9 0 10 0;
#X connect 9 1 5 0;
#X connect 9 2 1 0;
#X connect 10 0 0 0;
#X connect 11 0 7 0;
#X connect 18 0 0 1;
#X connect 21 0 9 0;
#X connect 21 1 9 0;
#X connect 21 2 22 0;
#X connect 21 3 12 0;
#X connect 22 0 0 0;


More information about the Pd-list mailing list