Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Jérôme Abel

Hi all,

Some vanilla solutions in attachments, taken from some projects.

++

--
Jérôme Abel
http://jeromeabel.net

#N canvas 13 101 902 398 10;
#X obj 110 127 route float symbol;
#X obj 110 84 route bang;
#X obj 110 63 list;
#X obj 110 39 loadbang;
#X obj 110 105 list append \$1;
#X obj 458 58 loadbang;
#X msg 458 127 0;
#X obj 458 78 symbol test-\$1;
#X obj 515 118 t b;
#X obj 387 223 route 0;
#X obj 387 245 t b;
#X obj 458 98 sel test-0;
#X obj 387 319 bng 15 250 50 0 empty empty no_arg 17 7 0 10 -262144
-1 -1;
#X obj 451 274 bng 15 250 50 0 empty empty a_float 17 7 0 10 -262144
-1 -1;
#X floatatom 426 248 5 0 0 0 - - -, f 5;
#X text 457 31 Test if tere is no argument;
#X obj 515 206 route float symbol;
#X obj 515 163 route bang;
#X obj 515 142 list;
#X obj 515 184 list append \$1;
#X obj 587 266 bng 15 250 50 0 empty empty a_symbol 17 7 0 10 -262144
-1 -1;
#X symbolatom 567 236 10 0 0 0 - - -, f 10;
#X obj 387 344 print \$0-NO-ARG;
#X obj 426 295 print \$0-FLOAT;
#X obj 567 295 print \$0-SYMBOL;
#X obj 162 154 print \$0-SYMBOL_ARG;
#X obj 110 179 print \$0-FLOAT_ARG;
#X connect 0 0 26 0;
#X connect 0 1 25 0;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X connect 5 0 7 0;
#X connect 6 0 14 0;
#X connect 7 0 11 0;
#X connect 8 0 18 0;
#X connect 9 0 10 0;
#X connect 9 1 14 0;
#X connect 10 0 12 0;
#X connect 11 0 6 0;
#X connect 11 1 8 0;
#X connect 12 0 22 0;
#X connect 14 0 13 0;
#X connect 14 0 23 0;
#X connect 16 0 9 0;
#X connect 16 1 21 0;
#X connect 17 0 19 0;
#X connect 18 0 17 0;
#X connect 19 0 16 0;
#X connect 21 0 20 0;
#X connect 21 0 24 0;
#N canvas 482 360 450 300 10;
#X obj 166 80 test_arguments;
#X obj 166 108 test_arguments 10;
#X obj 166 138 test_arguments data/test.txt;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Peter P.
* hans w. koch  [2018-12-22 19:28]:
> i have this vanilla abstraction based on a patch by johannes, which gives 1 
> for argument present and 0 if absent
> maybe thats for you?

Thanks Hans, this looks good and seems to be a similar way than the one
proposed by Christof.

best, P
> 
> best hans



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Grid, x y control

2018-12-22 Thread Max

Dang! I want this thing in the Put menu! :)

On 21.12.18 14:22, Alexandre Torres Porres wrote:

my [else/slider2d] solves that in a vanilla way

Em sex, 21 de dez de 2018 às 09:57, Esteban Viveros > escreveu:


Take a look into:

https://forum.pdpatchrepo.info/topic/10854/xy-abstraction-to-get-mouse-click-and-drag-coordinates-vanilla



Em sex, 21 de dez de 2018 às 07:46, João Pais mailto:jmmmp...@gmail.com>> escreveu:

__
a small trick I learned the last days - if you use coords
instead of donecanvasdialog, it won't trigger the edit mode
issue in vanilla. For the parameters you use, it should work.

I could leave a couple of theoretical suggestions:
- one disadvantage of data-s is that to move the marker, it's
necessary to drag it from one of its corners. A click in a blank
space won't have any effect. This might be circumvented using
[mousestate] or a similar external, but it won't be vanilla code
anymore.
- it's a pity that the variable limits in a struct can't be
themselves assigned to variables. It's still not possible to
reduce the size of the canvas but have different boundaries for
the square. I guess a dynamically-created template would be an
idea, but I didn't try with it yet.

Best,

Joao

See [touch] in droidparty abstractions which is built using
data structures.. I've been working with it for a while.


https://github.com/chr15m/PdDroidParty/tree/master/droidparty-abstractions


On Dec 14, 2018, at 9:36 AM, pd-list-requ...@lists.iem.at
 wrote:

Date: Fri, 14 Dec 2018 15:34:29 +0100
From: Max mailto:abonneme...@revolwear.com>>
To: "pd-list@lists.iem.at "
mailto:pd-list@lists.iem.at>>
Subject: [PD] Grid, x y control
Message-ID:
<3dec1357-cfcd-5d82-7364-eb52dcdd3...@revolwear.com
>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi list,

what's the current recommendation for a simple x-y Pd GUI
controller
type of thing? Like a slider but horizontal and vertical.
There are probably a few externals providing this, which
one is the
best/most compatible/future proof?
In vanilla this can be emulated with an object reporting
its position on
a canvas, but to use it one must change to the edit mode
which is kind
of counter-intuitive.

Anything I'm missing?

m



Dan Wilcox
@danomatika 
danomatika.com 
robotcowboy.com 



___
Pd-list@lists.iem.at  mailing list
UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list



-- 


Esteban Viveros

www.estebanviveros.com 


___
Pd-list@lists.iem.at  mailing list
UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list






___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread hans w. koch
i have this vanilla abstraction based on a patch by johannes, which gives 1 for 
argument present and 0 if absent
maybe thats for you?

best hans



checkarg.pd
Description: Binary data


argtest.pd
Description: Binary data


> Am 22.12.2018 um 16:52 schrieb Matt Davey :
> 
> If you're ok with using an external library, then there is [pofutil] in the 
> pof library which outputs a list of arguments when sent a [dollarg( message.
> 
> so, like:
> 
> [dollarg(
> |
> [pofutil]
> 
> You can then just use pd's list functions (list length, list split, etc) to 
> pull that list apart and check its length, etc. 
> 
> [route symbol float] should do the last bit you wanted, 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Christof Ressi
unfortunately, this doesn't work. missing arguments will become 0 and therefore 
can't be differentiated from a float arg with with the same value. I think it's 
only dollarsyms (e.g. "_$1") where the missing argument doesn't become 0.

I think Pd vanilla really needs a mechanism to retreive the creation arguments 
as a list. personally I quite like $@.

> Gesendet: Samstag, 22. Dezember 2018 um 19:00 Uhr
> Von: "João Pais" 
> An: pd-list , "Peter P." 
> Betreff: Re: [PD] Abstraction arguments: tell apart symbols from floats from 
> no argument at all
>
> another way to do it might be the following. I don't have now the time to  
> test it:
> 
> - loadbang a list with all the arguments (maybe initiated by something  
> like [list $1 $2 $3 ... $16 or whatever])
> - use an abstraction from list-abs to drip the list
> - send the output through a route to test the type
> 
> If you know beforehand that 0s won't be part of the arguments, it will be  
> even easier, just filter out the 0s when detecting the argument type.
> 
> 
> > * Christof Ressi  [2018-12-22 17:15]:
> >> if you're ok with externals you can also use [dollarg] from iemlib or  
> >> [canvasargs] from iemguts. for a hacky vanilla solution, see attached  
> >> patch. I'm sure there are more ways, this is just one that I remembered.
> > And it is a nice one, Thanks Christof!
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list
>



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread João Pais
another way to do it might be the following. I don't have now the time to  
test it:


- loadbang a list with all the arguments (maybe initiated by something  
like [list $1 $2 $3 ... $16 or whatever])

- use an abstraction from list-abs to drip the list
- send the output through a route to test the type

If you know beforehand that 0s won't be part of the arguments, it will be  
even easier, just filter out the 0s when detecting the argument type.




* Christof Ressi  [2018-12-22 17:15]:
if you're ok with externals you can also use [dollarg] from iemlib or  
[canvasargs] from iemguts. for a hacky vanilla solution, see attached  
patch. I'm sure there are more ways, this is just one that I remembered.

And it is a nice one, Thanks Christof!




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Peter P.
* Christof Ressi  [2018-12-22 17:15]:
> if you're ok with externals you can also use [dollarg] from iemlib or 
> [canvasargs] from iemguts. for a hacky vanilla solution, see attached patch. 
> I'm sure there are more ways, this is just one that I remembered.
And it is a nice one, Thanks Christof!
P



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Christof Ressi
if you're ok with externals you can also use [dollarg] from iemlib or 
[canvasargs] from iemguts. for a hacky vanilla solution, see attached patch. 
I'm sure there are more ways, this is just one that I remembered.
 
Christof 

Gesendet: Samstag, 22. Dezember 2018 um 16:52 Uhr
Von: "Matt Davey" 
An: "Peter P." 
Cc: pd-list 
Betreff: Re: [PD] Abstraction arguments: tell apart symbols from floats from no 
argument at all

If you're ok with using an external library, then there is [pofutil] in the pof 
library which outputs a list of arguments when sent a [dollarg( message.
 
so, like:

[dollarg(
|
[pofutil]
 
You can then just use pd's list functions (list length, list split, etc) to 
pull that list apart and check its length, etc. 
 
[route symbol float] should do the last bit you wanted, 
 ___ Pd-list@lists.iem.at mailing 
list UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

arg-test.pd
Description: Binary data


arg-test-abs.pd
Description: Binary data
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Matt Davey
If you're ok with using an external library, then there is [pofutil] in the
pof library which outputs a list of arguments when sent a [dollarg( message.

so, like:

[dollarg(
|
[pofutil]

You can then just use pd's list functions (list length, list split, etc) to
pull that list apart and check its length, etc.

[route symbol float] should do the last bit you wanted,
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


[PD] Abstraction arguments: tell apart symbols from floats from no argument at all

2018-12-22 Thread Peter P.
Hi list,

please excuse me if this has been discussed numerous times, but the
search engine at https://lists.puredata.info/pipermail/pd-list/ does not
give me reasonable answers.

I am writing an abstraction and for one of its numeric arguments I would
like to detect if it has been not specified, or if it has been set to a
float including 0. How can I do this?

I would also like to detect if another argument is a float or a symbol and
process these two differently without causing Pd error messages. Is this
possible?

Thank you!
P



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list