Dear all,
Is it possible to write message after sprintf set; function you can see below detail of patcher :
#N canvas 0 22 1157 404 12; #N canvas 461 290 450 300 listiter 0; #X obj 32 33 inlet; #X obj 87 32 inlet; #X obj 46 105 outlet; #X obj 47 70 zl iter $1; #X connect 0 0 3 0; #X connect 1 0 3 1; #X connect 3 0 2 0; #X restore -3669 -1701 pd listiter 2; #X msg -3674 -1674 $1; #X msg -3742 -1745 store; #X msg -3573 -1667 $1; #N canvas 461 290 450 300 listiter 0; #X obj 32 33 inlet; #X obj 87 32 inlet; #X obj 46 105 outlet; #X obj 47 70 zl iter $1; #X connect 0 0 3 0; #X connect 1 0 3 1; #X connect 3 0 2 0; #X restore -3566 -1702 pd listiter 2; #X msg -3459 -1665 $1; #N canvas 461 290 450 300 listiter 0; #X obj 32 33 inlet; #X obj 87 32 inlet; #X obj 46 105 outlet; #X obj 47 71 zl iter $1; #X connect 0 0 3 0; #X connect 1 0 3 1; #X connect 3 0 2 0; #X restore -3452 -1700 pd listiter 2; #X msg -3597 -1494; #X obj -3738 -1623 f; #X obj -3673 -1748 route /harmonizer/hamp /harmonizer/hdelay /harmonizer/hfreq /harmonizer/hwin; #X obj -3672 -1776 r harmonizer; #X obj -3647 -1630 sprintf set ; /harmonizer/hamp %f 10 ; /harmonizer/hdelay %f 10 ; /harmonizer/hfreq %f 10 ; /harmonizer/hwin %f 10 ;; #X msg -3862 -1584 $1; #X obj -3856 -1522 s harmonizer; #X obj -3864 -1685 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 -262144 -1 -1 110 256; #X obj -3855 -1552 prepend /harmonizer/hamp; #X msg -4068 -1597 $1; #X obj -4072 -1638 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 -262144 -1 -1 0 256; #X obj -4054 -1556 prepend /harmonizer/hdelay; #X text -3353 -1696 equivalent to zl iter #2; #X text -3546 -1503 writing message after bang on store like /harmonizer/hamp 200 10 ; etc ;; #X connect 0 0 1 0; #X connect 1 0 8 1; #X connect 2 0 8 0; #X connect 3 0 11 1; #X connect 4 0 3 0; #X connect 5 0 11 2; #X connect 6 0 5 0; #X connect 8 0 11 0; #X connect 9 0 0 0; #X connect 9 1 4 0; #X connect 9 2 6 0; #X connect 10 0 9 0; #X connect 11 0 7 0; #X connect 12 0 15 0; #X connect 14 0 12 0; #X connect 15 0 13 0; #X connect 16 0 18 0; #X connect 17 0 16 0; #X connect 18 0 13 0;
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-10-15 22:05, Olivier Baudry wrote:
Dear all,
Is it possible to write message after sprintf set; function you can see below detail of patcher :
most likiely you are trying to create a couple of messages like "/harmonizer/hamp 12.1 10". but [sprintf] (btw, there is no [sprintf] object built-into Pd (nor is it needed most of the time)) will not create messages, it will create a symbol. it will even create symbols containing spaces, which are a bit tricky as they look exactly like ordinary atom-lists (messages, objects with args) that use space as delimiter, but unfortunately are something completely different. it seems that what you really want to do is to build (and send) a set of parameterized messages, which can be done using $arg expansion.
e.g. the folowing will send a message "2" to the receiver "foo", a message "2" to the receiver "bar" and a message "10" to the receiver "baz" whenever you click on [list 2 10(.
[list 2 10( | [; foo $1; bar $1; baz $2(
see the msg-help (right-click on the msgbox) for more info.
if you don't want to send those messages immediately but create a msgbox with fixed values that you can copy around and click as an easy preset system, you could do:
[list 2 10( | [set, add, add foo $1, add bar $1, add baz $2( | [ (
replace the [list 2 10( msgbox with a [pack] to make the values changeable at runtime.
some other notes, you might find useful when patching:
subpatches (e.g. [pd foo]) do not evaluate the subpatches arguments. e.g. if you have a patch containing a subpatch [pd listiter 2] and within the subpatch yo have [zl iter $1], then the '$1' will not (necessarily) be replaced by 'listiter' and even less by '2'; it will be replaced by the argument you gove to the [foo] abstraction!
Pd doesn't have a built-in [prepend] object. there are a number of libraries that provide imncompatible [prepend] objects, so it's better not to use them. Pd has a built-in [list prepend] object (unless you are using an old version of Pd) which will mostly do what you want. if you want to get rid of the "list" selector, you can use [list trim] thereafter. however, if you only want to append a single value to fixed selector (as indicated by [prepend /harmonizer/hdelay]) you can simply do $1 expansion in message boxes: [harmonizer/hdelay $1(
fgmasdr IOhannes
PS: how did you manage to create objects at coordinates like "-3742