substring methods?
-
woodslanding
- Member
- Posts: 1327
- Contact:
I'd like to strip the extension from filenames for display, within a script. Should be easy, but not finding any substring methods in the docs....
thanks!
thanks!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Haven't used them yet, but...
I believe you can use Array modules on text strings. And there are modules for finding characters & extracting subarrays.
There are plenty of string functions in the scripting language.
I believe you can use Array modules on text strings. And there are modules for finding characters & extracting subarrays.
There are plenty of string functions in the scripting language.
Address the process rather than the outcome. Then, the outcome becomes more likely. - Fripp
http://www.sensomusic.org/wiki2/doku.ph ... tutorial05
I had the same issue kept looking at Declaration and References, where in the tutorial it had more information that helped.
-S
I had the same issue kept looking at Declaration and References, where in the tutorial it had more information that helped.
-S
"Every act of creation is first an act of destruction." -Picasso
i rember did it by the past. there ares commands for that. try to find in delphi reference maybe could help..
http://www.delphibasics.co.uk/Article.asp?Name=Text
http://www.delphibasics.co.uk/Article.asp?Name=Text
-
woodslanding
- Member
- Posts: 1327
- Contact:
Well, I tried using 'Split', but it wasn't recognized.
The link is to the declarations, not the tutorial. And I looked inside the modules for extracting file names and paths, but they all use dedicated methods. And a dedicated method to strip the file extension is missing.
And stripping the extension display on a list object does not affect the CT out.
The link is to the declarations, not the tutorial. And I looked inside the modules for extracting file names and paths, but they all use dedicated methods. And a dedicated method to strip the file extension is missing.
And stripping the extension display on a list object does not affect the CT out.
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
"The link is to the declarations, not the tutorial"
Are you talking about the http://www.sensomusic.org/wiki2/doku.ph … tutorial05 I posted in reply?
Should point to section 5. Strings of the tutorial, as it does on my end.
The page does look like a declarations, but is actually within the tutorial...that was why I originally had problems finding substring functions.
-S
Are you talking about the http://www.sensomusic.org/wiki2/doku.ph … tutorial05 I posted in reply?
Should point to section 5. Strings of the tutorial, as it does on my end.
The page does look like a declarations, but is actually within the tutorial...that was why I originally had problems finding substring functions.
-S
"Every act of creation is first an act of destruction." -Picasso
woodslanding -
http://www.sensomusic.org/forums/upload ... xample.pat
Here is an example of how to extract filenames using substring methods as in the link I had sent.
This brings in the filename as a string, and finds the count of characters in the filename.
Using this count and the delete you can find the starting point of the extension and just delete it.
Some of the substring commands I find problems with as well but a lot of times it's mostly my usage.
Like setting the length of a String was the first choice I picked, however this would not work as it was expecting a Tparameter instead of the string.
I hope this helps out
-S
http://www.sensomusic.org/forums/upload ... xample.pat
Here is an example of how to extract filenames using substring methods as in the link I had sent.
This brings in the filename as a string, and finds the count of characters in the filename.
Using this count and the delete you can find the starting point of the extension and just delete it.
Some of the substring commands I find problems with as well but a lot of times it's mostly my usage.
Like setting the length of a String was the first choice I picked, however this would not work as it was expecting a Tparameter instead of the string.
I hope this helps out
-S
"Every act of creation is first an act of destruction." -Picasso
Awesome! I've been trying and failing many string manipulations. This will be a huge help with everything. Your patch helps understanding..... I modified it to allow extracting from paths with longer extensions, ie... '.rack'.
http://www.sensomusic.com/forums/upload ... ample2.pat
Why did you use 'process' as opposed to 'callback' or 'process idle' in the 1st script?
So in my test I was just using a static text panel to update.
In this case I wanted to make sure I saw updates and trace updates in my debugging.
In the case of a callback I would have to be dynamically changing the input to get the trigger to happen.
If I used the same filename and text box, I never had a change.
I am not 100% sure if using a callback would be the best for a text input unless possibly you did like a has-changed and based off of that trigger. In past patches I tried to make sure everything was cut and clear as I had some conflicts.
Not totally related, but things like specifying a range of 0-100 on a Tparameter; you would think that the callback would only trigger on a value between 0-100, this is not the case as a -1 will also trigger etc... So without blabbing more, it has just been more of a conditioning of how I approach based on my past scripting more or less, and just a cut a clear script to achieve your end result.
-S
In this case I wanted to make sure I saw updates and trace updates in my debugging.
In the case of a callback I would have to be dynamically changing the input to get the trigger to happen.
If I used the same filename and text box, I never had a change.
I am not 100% sure if using a callback would be the best for a text input unless possibly you did like a has-changed and based off of that trigger. In past patches I tried to make sure everything was cut and clear as I had some conflicts.
Not totally related, but things like specifying a range of 0-100 on a Tparameter; you would think that the callback would only trigger on a value between 0-100, this is not the case as a -1 will also trigger etc... So without blabbing more, it has just been more of a conditioning of how I approach based on my past scripting more or less, and just a cut a clear script to achieve your end result.
-S
"Every act of creation is first an act of destruction." -Picasso
-
woodslanding
- Member
- Posts: 1327
- Contact:
Wow, thank you so much, this is working great!!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
I am glad to hear woodslanding....I love to help and if you ever need any I am here!
Even if you have an idea and want to shoot back-and-forth, I love trying to solve things like that.
I am not a super-coder nor sometimes the best in efficiency, but I am an excellent integrator and can usually find solutions.
-S
Even if you have an idea and want to shoot back-and-forth, I love trying to solve things like that.
I am not a super-coder nor sometimes the best in efficiency, but I am an excellent integrator and can usually find solutions.
-S
"Every act of creation is first an act of destruction." -Picasso
Ah ok. Thank you Sephult the Integrator. I guess this is a title I'm working towards becoming worthy of.
Cheers, the Tparameter range thing I shall certainly bear in mind.
Who is online
Users browsing this forum: No registered users and 23 guests
