Hi! I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help!Cheers! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
[list trim] works for symbols too! A little known secret. ________________________________ From: Pd-list pd-list-bounces@lists.iem.at on behalf of Hrvoje Radnic via Pd-list pd-list@lists.iem.at Sent: 23 September 2017 13:33 To: Pd-List Subject: [PD] trim symbols?
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers!
Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
You can use [list fromsymbol] to convert the symbol to a list of ASCII values and than work on that. See attached patch, it should do what you want.
Note that the patch assumes that the ending (like .wav) is always 4 characters. Also it uses a simple list-drip mechanism that should be efficient for small lists, in doubt use list-drip of list-abs instead.
best wishes, ingo
On 23/09/17 14:33, Hrvoje Radnic via Pd-list wrote:
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers!
Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Wow, thanks everybody for great solutions!
Ingo's answer is the most satisfying for me because it stays in vanilla. For now, I will just subpatch it in my project and use it as a reference, but I must admit it will take some time before I really understand every part of that patch. All the best! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
From: Ingo Stock <mail@ingostock.de>
To: pd-list@lists.iem.at Sent: Saturday, September 23, 2017 3:32 PM Subject: Re: [PD] trim symbols?
You can use [list fromsymbol] to convert the symbol to a list of ASCII values and than work on that. See attached patch, it should do what you want.
Note that the patch assumes that the ending (like .wav) is always 4 characters. Also it uses a simple list-drip mechanism that should be efficient for small lists, in doubt use list-drip of list-abs instead.
best wishes, ingo
On 23/09/17 14:33, Hrvoje Radnic via Pd-list wrote:
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list _______________________________________________
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Here it is with some comments, you are welcome!
On 23/09/17 18:04, Hrvoje Radnic wrote:
Wow, thanks everybody for great solutions!
Ingo's answer is the most satisfying for me because it stays in vanilla. For now, I will just subpatch it in my project and use it as a reference, but I must admit it will take some time before I really understand every part of that patch.
All the best!
Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
*From:* Ingo Stock mail@ingostock.de *To:* pd-list@lists.iem.at *Sent:* Saturday, September 23, 2017 3:32 PM *Subject:* Re: [PD] trim symbols?
You can use [list fromsymbol] to convert the symbol to a list of ASCII values and than work on that. See attached patch, it should do what you want.
Note that the patch assumes that the ending (like .wav) is always 4 characters. Also it uses a simple list-drip mechanism that should be efficient for small lists, in doubt use list-drip of list-abs instead.
best wishes, ingo
On 23/09/17 14:33, Hrvoje Radnic via Pd-list wrote:
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers!
Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Thanks again!Very nice solution.Cheers! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
From: Ingo Stock <mail@ingostock.de>
To: "pd-list@lists.iem.at" pd-list@lists.iem.at Sent: Saturday, September 23, 2017 6:36 PM Subject: Re: [PD] trim symbols?
Here it is with some comments, you are welcome!
On 23/09/17 18:04, Hrvoje Radnic wrote:
Wow, thanks everybody for great solutions!
Ingo's answer is the most satisfying for me because it stays in vanilla. For now, I will just subpatch it in my project and use it as a reference, but I must admit it will take some time before I really understand every part of that patch.
All the best! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
*From:* Ingo Stock mail@ingostock.de *To:* pd-list@lists.iem.at *Sent:* Saturday, September 23, 2017 3:32 PM *Subject:* Re: [PD] trim symbols?
You can use [list fromsymbol] to convert the symbol to a list of ASCII values and than work on that. See attached patch, it should do what you want.
Note that the patch assumes that the ending (like .wav) is always 4 characters. Also it uses a simple list-drip mechanism that should be efficient for small lists, in doubt use list-drip of list-abs instead.
best wishes, ingo
On 23/09/17 14:33, Hrvoje Radnic via Pd-list wrote:
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers!
Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I've always used [splitfilename] from iemlib for this. Or is it considered depreciated and there is a vanilla way to do this now? I might change my patches to remove the iemlib dependency.
On 2017년 09월 23일 14:33, Hrvoje Radnic via Pd-list wrote:
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Err, should have read the previous answers first. Consider this answered.
On 2017년 09월 23일 16:29, Max wrote:
I've always used [splitfilename] from iemlib for this. Or is it considered depreciated and there is a vanilla way to do this now? I might change my patches to remove the iemlib dependency.
On 2017년 09월 23일 14:33, Hrvoje Radnic via Pd-list wrote:
Hi!
I would like to display the name of the .wav file loaded from the HDD (using [openpanel]), but, without a full path and without the file extension. For example, [openpanel] outputs "symbol C:/Users/Hrvoje/Desktop/my_patches/SAMP_SEQ/samples/BD.wav" and I just want "BD" to be displayed. Is it possible in pd vanilla? Thank you for the help! Cheers! Hrvoje Radnic http://soundcloud.com/sumovi-protiv-valova 00385(0)915225162
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list