Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-30 Thread Derek Kwan
> > an example of an object that uses it? where exactly is this function?
> Scope~ itself uses sic_setup (for the leftmost inlet).
> -Jonathan 


Hello,

So I gave using class_domainsignalin() and class_addfloat() a shot in
the setup of both main and proxy classes in my test external which is what
sic_setup() is doing for audio rate objects with separate float methods and it
does work for the main inlet (which was never an issue) but produces the
same results as before for the proxy inlet. Maybe I'm not using the
proxy class correctly? And sic_inlet is just a wrapper around
inlet_new() and sets a default value of the signal via pd_float() so
that's no help to me either.

Basically what connects the proxy inlet to the main class from what i've
found here:
http://puredata.info/Members/mjmogo/proxy-example-for-pd.zip/view is
that the proxy class is declared as a member in the main class's struct
(t_proxy pxy for example) and serves as the dest for a new inlet
declared in the main class's new method through:

inlet_new( -> x_obj,  -> pxy.l_pd, 0, 0);

which creates a control inlet but all of the proxy's class's methods are
accessible (besides dsp methods since it's a control inlet, I've
tried...) or this other way I've tried:

inlet_new( -> x_obj,  -> pxy.l_pd, _signal, _signal);
or
inlet_new( -> x_obj,  -> pxy.l_pd, _signal, 0);

both of which create an audio inlet and none of the proxy class's
methods are accessible (including the class_domainsignalin() and
class_addfloat() methods declared in the proxy class) but you can get
the signal value going into the second inlet from the main class's perform 
method. 

The other things that sic_setup does is if passed SIC_NOMAINSIGNALIN,
just make's a float inlet and if passed no float function, makes just a
regular signal inlet that interprets floats as signals via
CLASS_MAINSIGNALIN().

I'll do more digging...

Derek
=
Derek Kwan
www.derekxkwan.com

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-30 Thread Jonathan Wilkes via Pd-list
> an example of an object that uses it? where exactly is this function?
Scope~ itself uses sic_setup (for the leftmost inlet).
-Jonathan 

On Wednesday, March 30, 2016 11:03 AM, Alexandre Torres Porres 
 wrote:
 

 2016-03-29 18:55 GMT-03:00 Jonathan Wilkes via Pd-list :

looking at that cyclone wrapper function it seems  like you should be able to 
get the same behavior with a proxy inlet.

an example of an object that uses it? where exactly is this function?
thanks

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-29 Thread Jonathan Wilkes via Pd-list
Yes, there's a very good reason to employ a solution to a name clash.  
Also, using a capital letter in an external name is a poor solution to that 
problem.  Even calling the thing "pdrunsonwindowstooscope~" would have 
been better.
-Jonathan



On Tuesday, March 29, 2016 3:21 AM, IOhannes m zmoelnig  
wrote:
 

 On 2016-03-28 22:35, Jonathan Wilkes via Pd-list wrote:
> "Scope~" already has a capital "S" in the name for no _good_ reason, so it's 
> not like the method space is the only discrepancy.

the *very good* reason for the capital "S" is that back in the days when
cyclone was developed, Pd (vanilla) sported a [scope~] object.

fgmadrt
IOhannes

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


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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-29 Thread Jonathan Wilkes via Pd-list
Well, I just couldn't understand how to get the behavior you're after by 
looking at the inlet_new code.  But looking at that cyclone wrapper function it 
seems 
like you should be able to get the same behavior with a proxy inlet.
-Jonathan


On Tuesday, March 29, 2016 8:01 AM, Derek Kwan  
wrote:
 

 > 
> Actually after looking deeper I have no clue.  It looks like cyclone has 
> some helper functions to set a separate float method for the leftmost signal 
> inlet.  If you can figure out how it works perhaps you can try doing the same 
> for a secondary inlet.

Hello Jonathan,

Yeah, scope's setup calls sic_setup (defined in shared/sickle/sic.c)
which takes in a dsp function and a float function as input. Looks like
if there is a float function passed, the signal stuff gets handled by
class_domainsignalin() while floats are handled by class_addfloat() and
there isn't a float function passed, it's just all handled by
CLASS_MAINSIGNALIN(). I know CLASS_MAINSIGNALIN() and class_addfloat()
are called from input into the main inlet, and i suppose
class_domainsignalin() is too? There's another function sic_inlet() in
sic.c but it looks like just a wrapper around inlet_new() and
pd_float().

Derek
=
Derek Kwan
www.derekxkwan.com


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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-29 Thread Derek Kwan
> 
> Actually after looking deeper I have no clue.  It looks like cyclone has 
> some helper functions to set a separate float method for the leftmost signal 
> inlet.  If you can figure out how it works perhaps you can try doing the same 
> for a secondary inlet.

Hello Jonathan,

Yeah, scope's setup calls sic_setup (defined in shared/sickle/sic.c)
which takes in a dsp function and a float function as input. Looks like
if there is a float function passed, the signal stuff gets handled by
class_domainsignalin() while floats are handled by class_addfloat() and
there isn't a float function passed, it's just all handled by
CLASS_MAINSIGNALIN(). I know CLASS_MAINSIGNALIN() and class_addfloat()
are called from input into the main inlet, and i suppose
class_domainsignalin() is too? There's another function sic_inlet() in
sic.c but it looks like just a wrapper around inlet_new() and
pd_float().

Derek
=
Derek Kwan
www.derekxkwan.com

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-29 Thread Derek Kwan
(oops, forgot to cc the list, sorry iohannes, still getting a handle on
this...) 

> did i miss something?
> why would it not work with proxy inlets?
>

With the code I found here:
http://puredata.info/Members/mjmogo/proxy-example-for-pd.zip/view
tackling proxy inlets (basically making a proxy class and pointing the
destination of inlet_new to it), declaring inlet_new with 0's
as the selectors (as in the example code) would result in a control
inlet (when I'm wanting a signal inlet)  but methods like class_addfloat
declared in the proxy class's setup would work.

Passing _signal as the first selector in inlet_new
would result in a second inlet, but the values of the signal were only
accessible within the main class's dsp/perform methods and not within
dsp/perform methods declared in proxy's setup but more importantly, the
class_addfloat and so on methods declared in proxy's setup aren't
callable.

Derek
-- 
=
Derek Kwan
www.derekxkwan.com

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-29 Thread IOhannes m zmoelnig
On 2016-03-28 22:35, Jonathan Wilkes via Pd-list wrote:
> "Scope~" already has a capital "S" in the name for no _good_ reason, so it's 
> not like the method space is the only discrepancy.

the *very good* reason for the capital "S" is that back in the days when
cyclone was developed, Pd (vanilla) sported a [scope~] object.

fgmadrt
IOhannes



signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-29 Thread IOhannes m zmoelnig
On 2016-03-28 22:35, Jonathan Wilkes via Pd-list wrote:
> Hi Derek,Have a look at the inlet_new code in m_obj.c. But after skimming it 
> I don't see 
> any sensible way to achieve what you want. 

did i miss something?
why would it not work with proxy inlets?

am,sdr
IOhannes



signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-28 Thread Jonathan Wilkes via Pd-list
Actually after looking deeper I have no clue.  It looks like cyclone has 
some helper functions to set a separate float method for the leftmost signal 
inlet.  If you can figure out how it works perhaps you can try doing the same 
for a secondary inlet.
-Jonathan
  

On Monday, March 28, 2016 11:59 PM, Alexandre Torres Porres 
 wrote:
 

 2016-03-28 17:35 GMT-03:00 Jonathan Wilkes via Pd-list :

after skimming it I don't see any sensible way to achieve what you want.  

Just to be clear, do you mean you can't see any way, or that you may see some 
possible hacks that might be very clumsy and might not work well and be kind of 
non sensible tasks?
> it's not like the method space is the only discrepancy.
In fact, the object already sets this method via a message in the first inlet, 
and this was working already in the last release, although the documentation 
was wrong, saying it had a "buffsize" method, when it is actually "bufsize". At 
first I thought the object was bugged, but the documentation was.

So we already have that implemented and it is fine. We've been working on it 
for a great deal now, and the only discrepancy left is this feature. It'd be 
good to make it 100% compatible, and it is really convenient to use this 
feature by the way - as we always have to tweak with this parameter when using 
scope~ 
cheers

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-28 Thread Alexandre Torres Porres
2016-03-28 17:35 GMT-03:00 Jonathan Wilkes via Pd-list :

> after skimming it I don't see any sensible way to achieve what you want.
>

Just to be clear, do you mean you can't see any way, or that you may see
some possible hacks that might be very clumsy and might not work well and
be kind of non sensible tasks?

> it's not like the method space is the only discrepancy.

In fact, the object already sets this method via a message in the first
inlet, and this was working already in the last release, although the
documentation was wrong, saying it had a "buffsize" method, when it is
actually "bufsize". At first I thought the object was bugged, but the
documentation was.

So we already have that implemented and it is fine. We've been working on
it for a great deal now, and the only discrepancy left is this feature.
It'd be good to make it 100% compatible, and it is really convenient to use
this feature by the way - as we always have to tweak with this parameter
when using scope~

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-28 Thread Derek Kwan
Thanks, John, I'll take a look myself and yeah, I'm not super-optimistic
either. There are calls to class_addcreator for "scope~" and
"cyclone/scope~" but yeah, "Scope~" is a weird one...

Derek

=
Derek Kwan
www.derekxkwan.com

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-28 Thread Jonathan Wilkes via Pd-list
Hi Derek,Have a look at the inlet_new code in m_obj.c. But after skimming it I 
don't see 
any sensible way to achieve what you want.  I'd suggest just using the 
left-most 
inlet with a sensible method name.
"Scope~" already has a capital "S" in the name for no _good_ reason, so it's 
not like the method space is the only discrepancy.

-Jonathan



On Monday, March 28, 2016 3:06 PM, IOhannes m zmölnig  
wrote:
 

 On 03/28/2016 01:27 AM, Derek Kwan wrote:
>> Are you really sure you want that? These days most Pd-users expect an 
>> implicit float-to-signal conversion. This might lead to unexpected (though 
>> well-defined) behaviour of your objects.
>> My advice is to not try hard to break the expectancy of your users.
> 
> Hello,
> 
> In normal circumstances, I'd be in 100% agreement with you, the user
> experience should be consistent throughout the entirety of PD. But in
> this situation I'm doing work for cyclone, [...]

yes, sorry.

i only realized that this was about a max/msp compat object after i sent
the email (and being virtually offline with only a mobile phone to type
emails, i decided to not amend my post)

mfdsar
IOhannes

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


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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-28 Thread IOhannes m zmölnig
On 03/28/2016 01:27 AM, Derek Kwan wrote:
>> Are you really sure you want that? These days most Pd-users expect an 
>> implicit float-to-signal conversion. This might lead to unexpected (though 
>> well-defined) behaviour of your objects.
>> My advice is to not try hard to break the expectancy of your users.
> 
> Hello,
> 
> In normal circumstances, I'd be in 100% agreement with you, the user
> experience should be consistent throughout the entirety of PD. But in
> this situation I'm doing work for cyclone, [...]

yes, sorry.

i only realized that this was about a max/msp compat object after i sent
the email (and being virtually offline with only a mobile phone to type
emails, i decided to not amend my post)

mfdsar
IOhannes



signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-27 Thread IOhannes zmölnig
Am 27. März 2016 07:21:59 MESZ, schrieb Derek Kwan :
>My main goal is to have a second signal inlet that can also accept
>floats
>not as a substitute for a signal but calls a separate method. 

Are you really sure you want that? These days most Pd-users expect an implicit 
float-to-signal conversion. This might lead to unexpected (though well-defined) 
behaviour of your objects.
My advice is to not try hard to break the expectancy of your users.


mfg.ugd.fhj
IOhannes

--
Sent from my pdp-11

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-25 Thread Alexandre Torres Porres
2016-03-25 19:21 GMT-03:00 Jonathan Wilkes via Pd-list :

> There's a way to do it.  Search the mailing list for "proxy inlet".
>


this is where the search took me to http://puredata.info/Members/mjmogo

Inlet Proxy Object

An example of how to create an inlet
proxy object to handle arbitrary selectors on a cold inlet.

that was it, right?


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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-25 Thread Alexandre Torres Porres
2016-03-25 19:21 GMT-03:00 Jonathan Wilkes via Pd-list :

> (Unless of course you are  trying to be compatible with a Max/MSP object
> that does it that way.)
>

yep, [scope~] by the way, second signal inlet should set "bufsize" when
receiving a float, to be more specific. Well, glad there is a way :)

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


Re: [PD] can signal inlets that aren't the main inlet have float or message methods?

2016-03-25 Thread Jonathan Wilkes via Pd-list
There's a way to do it.  Search the mailing list for "proxy inlet".
However, as a general rule this is a bad idea.  (Unless of course you are 
trying to be compatible with a Max/MSP object that does it that way.)
-Jonathan



On Friday, March 25, 2016 5:33 PM, Derek Kwan  
wrote:
 

 
Hey y'all,

I'm actually the one that needs this, I've been working with Alexandre on 
updating Cyclone.

If further info is needed, the method I've been trying to use is inlet_new.

The part of documentation that seems to drive the nail in the coffin is this 
bullet-point:

"It is not possible to add methods for more than one selector to a right inlet. 
Particularly it is not possible to add a universal method for arbitrary 
selectors to a right inlet."

found on this page:  
http://pdstatic.iem.at/externals-HOWTO/pd-externals-HOWTOse8.html#x10-41000C

 

www.derekxkwan.com

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


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