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]
On Jul 13, 2019, at 1:33 PM, pd-list-request@lists.iem.at wrote:
Message: 3
Date: Sat, 13 Jul 2019 18:46:23 +0200
From: "Christof Ressi" <christof.ressi@gmx.at mailto:christof.ressi@gmx.at>
To: "Roman Haefeli" <reduzent@gmail.com mailto:reduzent@gmail.com>, Pd-List
<pd-list@lists.iem.at mailto:pd-list@lists.iem.at>, "Miller Puckette" <msp@ucsd.edu mailto:msp@ucsd.edu>
Subject: Re: [PD] OSC data from [list trim]
Message-ID:
trinity-c77aaaa8-5963-4469-9cc2-798d3807b5a5-1563036383216@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@gmail.com mailto:reduzent@gmail.com>
An: pd-list@lists.iem.at mailto:pd-list@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@lists.iem.at mailto:Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list https://lists.puredata.info/listinfo/pd-list