[PD] OSC data from [list trim]

Mitchell Turner mmturner2468 at gmail.com
Sat Jul 13 20:48:27 CEST 2019


Christof,
The first element of the list being a symbol is the exact problem and your split > float > append makes a functioning work around.  Here is what I ended up with.

[listen 8000( 
|
|
[netrecieve -u -b]
|
|
[oscparse]
|
|
[list trim]
|
|
[list split 1]
|      |
|      |
[f]    |
|      |
|      |
[list append]
|
|
[route 1]

I guess Iā€™m not clear on why the first element after [list trim] is a symbol? 

Thanks so much for the help,
Mitch



> On Jul 13, 2019, at 1:33 PM, pd-list-request at lists.iem.at wrote:
> 
> Message: 3
> Date: Sat, 13 Jul 2019 18:46:23 +0200
> From: "Christof Ressi" <christof.ressi at gmx.at <mailto:christof.ressi at gmx.at>>
> To: "Roman Haefeli" <reduzent at gmail.com <mailto:reduzent at gmail.com>>, Pd-List
> 	<pd-list at lists.iem.at <mailto:pd-list at lists.iem.at>>, "Miller Puckette" <msp at ucsd.edu <mailto:msp at ucsd.edu>>
> Subject: Re: [PD] OSC data from [list trim]
> Message-ID:
> 	<trinity-c77aaaa8-5963-4469-9cc2-798d3807b5a5-1563036383216 at 3c-app-gmx-bs75>
> 	
> Content-Type: text/plain; charset=UTF-8
> 
> I think the problem lies somewhere else. There is a fundamental issue with [oscparse]: it breaks the address pattern into its parts and forms a Pd list, but treats numbers as symbols. 
> 
> In Mitchell's case, he might be sending an OSC message like "/1/toggle1 1", so [oscparse] outputs a list "1 toggle1 1". However, the first atom "1" in the list will be a symbol, so you can't route it with [route 1]. There's a workaround: split the list with [list split 1], pass the first atom through [f] (since Pd 0.48 it interprets symbols as floats) and join the two lists again with [list append].
> 
> @Miller: addresses like "/foo/1/bar/2" are very common and the output of [oscparse] can cause confusion. Would you agree that the number parts should be rather interpreted as floats? Would it be too late to change this? If we keep the current behavior, we should at least clearly document it (and show the workaround).
> 
> [unpackOSC] doesn't have this problem because the address parts are cleary symbols and you can route them with [routeOSC /1 /2 /3 /4], etc.
> 
> Christof
> 
> 
>> Gesendet: Samstag, 13. Juli 2019 um 18:28 Uhr
>> Von: "Roman Haefeli" <reduzent at gmail.com <mailto:reduzent at gmail.com>>
>> An: pd-list at lists.iem.at <mailto:pd-list at lists.iem.at>
>> Betreff: Re: [PD] OSC data from [list trim]
>> 
>> On Sat, 2019-07-13 at 12:01 -0400, Mitchell Turner wrote:
>>> 
>>> If I send this message ā€œ1 toggle1 1ā€ to a [route 1], I expect the
>>> message toggle1 1 to come out of the first outlet of route, however,
>>> nothing comes out of the first outlet.  
>> 
>> 
>> There is a distinction in both worlds, Pd messages and OSC messages,
>> between a two-element-list with float 1 and the symbols "toggle" on one
>> hand and on the other a symbol containing "1 toggle". [route 1] catches
>> only the former, while the latter is passed to the right outlet.
>> 
>> Make sure that you send OSC messages with two atoms, '1' and 'toggle'
>> instead of one symbolic atom '1 toggle'.
>> 
>> Roman
>> _______________________________________________
>> Pd-list at lists.iem.at <mailto:Pd-list at lists.iem.at> mailing list
>> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list <https://lists.puredata.info/listinfo/pd-list>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190713/d13cb640/attachment-0001.html>


More information about the Pd-list mailing list