aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/5.reference/swap-help.pd
blob: 039e5659e7bf545d1e542e0c8a71bc61902f159c (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
#N canvas 475 187 615 593 12;
#X msg 72 167 bang;
#X floatatom 72 292 0 0 0 0 - - -;
#X floatatom 84 200 0 0 0 0 - - -;
#X floatatom 139 237 0 0 0 0 - - -;
#X obj 33 15 swap;
#X text 81 16 - SWAP TWO NUMBERS \, RESPECTING RIGHT-TO-LEFT ORDER
;
#X text 117 166 outputs 2 stored values;
#X obj 72 266 swap 6.5;
#X text 115 200 sets second value and outputs both;
#X text 171 238 sets first value;
#X text 157 266 creation argument initializes first value;
#X floatatom 139 291 0 0 0 0 - - -;
#X obj 139 331 print right;
#X obj 72 367 print left;
#X text 43 427 A common use of swap is to reverse the operands in arithmetic
objects like this:;
#X obj 72 491 swap;
#X obj 72 519 -;
#X floatatom 72 541 5 0 0 0 - - -;
#X floatatom 103 469 3 0 0 0 - - -;
#X floatatom 72 469 3 0 0 0 - - -;
#X text 291 549 updated for Pd version 0.41;
#X text 32 52 The swap object swaps the positions of two incoming numbers.
The number coming in through the right inlet will be sent to the left
outlet and the number coming in left will come out right. Only the
left inlet is hot and triggers output on both outlets. Output order
is right to left as in [trigger].;
#X connect 0 0 7 0;
#X connect 1 0 13 0;
#X connect 2 0 7 0;
#X connect 3 0 7 1;
#X connect 7 0 1 0;
#X connect 7 1 11 0;
#X connect 11 0 12 0;
#X connect 15 0 16 0;
#X connect 15 1 16 1;
#X connect 16 0 17 0;
#X connect 18 0 15 1;
#X connect 19 0 15 0;