[PD] Parse/split symbol by delimiters like - or _ ?
Jack
jack at rybn.org
Mon Mar 2 12:26:12 CET 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Just do it with [list]s objects from vanilla.
Certaily can be improved...
++
Jack
Le 01/03/2015 21:21, JF via Pd-list a écrit :
> Thanks Iohannes & Tim,
>
>
> I would be interested in how to achieve this with [text]?
>
> I've been playing with text for the first time today, I thought
> that the 'fields' were only whitespace separated.
>
>
> if I had... [text define longsymbols]
>
>
> [symbol aaaa_bbbb ( | [text set longsymbols]
>
> ...how would I then retrieve the 'aaaa' and 'bbbb' separately?
>
> (Otherwise I will just use l2s/list2symbol)
>
> Thanks! John
>
>
> On Sunday, 1 March 2015, 19:21, tim vets <timvets at gmail.com>
> wrote:
>
>
>>
>>
>> sorry, in that example, the last [unpack s s] should probably be
>> [unpack f s]
>>
>>
>>
>> 2015-03-01 20:17 GMT+01:00 tim vets <timvets at gmail.com>:
>>
>> maybe using s2l ?
>>> something (roughly) like:
>>>
>>> [symbol drums_1.wav( | [symbol _(
>>>
>>> | | [s2l]
>>>
>>> [unpack s s]
>>>
>>> | | [symbol .( | | [s2l] [unpack s s]
>>>
>>> [f ] | [1\
>>>
>>> gr,
>>>
>>> Tim
>>>
>>>
>>>
>>>
>>> 2015-03-01 20:03 GMT+01:00 JF via Pd-list
>>> <pd-list at lists.iem.at>:
>>>
>>> Is it possible to split a formatted symbol such as...
>>>> drums_1.wav
>>>>
>>>> ...to extract the float '1' and use that to assign a
>>>> meaningful attribute?
>>>>
>>>>
>>>> For example a float could represent a loop playback switch.
>>>>
>>>> if I have 'drums_0.wav' I would like to extract the float,
>>>> find that it is '0' and then I would know that this WAV file
>>>> is say, not to be looped. Or if I had 'drums_1.wav' I would
>>>> be able to parse the filename, find the '1' which I now know
>>>> to loop the WAV file.
>>>>
>>>>
>>>> Thanks in advance! John
>>>>
>>>> _______________________________________________
>>>> Pd-list at lists.iem.at mailing list UNSUBSCRIBE and
>>>> account-management ->
>>>> http://lists.puredata.info/listinfo/pd-list
>>>>
>>>>
>>>
>>
>>
>>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list UNSUBSCRIBE and
> account-management -> http://lists.puredata.info/listinfo/pd-list
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJU9EjPAAoJEOuluecjw8GUBJEH/Ah/2S7su0pcJwM+NASFVchk
SKcD3kVinqs4rKyp/XLpWngtha0G4Fd3+6faS1UCW3rhT/9ObHE5gQhxxlf+SXPu
94bRK5+SK5Rm41b6j0LE2JLopjnR1NsOOD8xKBNBE9tH6N4n5sc22igeh6Rf2zlr
glvvUJJUlX//pumnrjdn4RBD49c7SRfckCkz+H2y1ViciyDu3sJdVqSpggzGD6rC
S7BOGHThP5vT2fAMXXHoEZ1k4vI6x9oOiWvCrDxa2OTzwtO1oKnC7OxAZp2oYoOF
ZoScOpjq+/7ueWBD8nCJLHBibAPd5pFdeOuHsqKHV5j3pIZuBj4Dkcq8vRr+dQI=
=AuA0
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cut_symbol-help.pd
Type: application/puredata
Size: 154 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150302/57b89f73/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cut_float-help.pd
Type: application/puredata
Size: 151 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150302/57b89f73/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cut_float.pd
Type: application/puredata
Size: 2202 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150302/57b89f73/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cut_symbol.pd
Type: application/puredata
Size: 2041 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150302/57b89f73/attachment-0003.bin>
More information about the Pd-list
mailing list