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 itis '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
On 03/01/2015 08:03 PM, JF via Pd-list wrote:
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 itis '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.
zexy's [symbol2list] was designed to allow something like this.
iirc, the new [text] object will allow you to build something like this in Pd-vanilla.
gfmadsr IOhannes
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@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@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
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@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, Tim2015-03-01 20:03 GMT+01:00 JF via Pd-list pd-list@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@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
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@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@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@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@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----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@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@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@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@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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2015-03-02 12:26, Jack wrote:
Just do it with [list]s objects from vanilla.
ah indeed, i knew that one of those objectfamily-objects ([text], [list], [array]) provided the way to split a symbol into characters.
i thought it was [text], but was obviously wrong. [list fromsymbol] it is!
thanks for sharing.
fgam dr IOhannes
Thanks Jack, [list tosymbol] looks perfect.
There seems to be an error in the release log in the Pd documentation html and elsewhere...
0.46-0 "New [text tosymbol] and [text fromsymbol] to allow string manipulation."
I was wondering why [text tosymbol] wouldn't create.
I presume this is meant to read [list tosymbol] etc. and not [text]?
Thanks all, John.
On Sunday, 1 March 2015, 20:21, JF saintidle@yahoo.com wrote:
T hanks Iohannes & Tim,
I would be interested in how to achieve this with [text]?
On 03/01/2015 08:17 PM, tim vets wrote:
maybe using s2l ?
which is just an alias for [symbol2list]...
something (roughly) like:
[symbol drums_1.wav( | [symbol _( | | [s2l]
or simply specify the separator as an argument: [s2l _]
[unpack s s] | | [symbol .( | | [s2l] [unpack s s] [f ]
this won't work: [f] does NOT magically convert a symbol (as output by [unpack s s] into a float. luckily, [symbol2list] will output the "1" as a number 1 (rather than a symbol), so you can reduce that to: [unpack f s]
fmdsr IOhannes