Text extraction
-
ringmodulator
- Member
- Posts: 35
- Contact:
once your script has discard non-numerical characters, you will be left with a string that represent a number.
then use SetValue(Output,round(StrToFloat(GetStringValue(input))));
then use SetValue(Output,round(StrToFloat(GetStringValue(input))));
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
-
ringmodulator
- Member
- Posts: 35
- Contact:
Sorry, but i don't understand how i could in the first step discard any non-numerical text.
Is there a subpatch or script for that ?
Is there a subpatch or script for that ?
yes, I meant in your script.
the incoming string is like an array of characters
first you get the size of the string
then you use a FOR loop from 0 to size-1
inside this FOR loop, you check each character, if it's a numerical char (ie between '0' and '9') append it in another empty string
then convert the string to a int
I'm too busy right now to code it, but I reckon that it could be useful in the futur to have a module that does just that.
the incoming string is like an array of characters
first you get the size of the string
then you use a FOR loop from 0 to size-1
inside this FOR loop, you check each character, if it's a numerical char (ie between '0' and '9') append it in another empty string
then convert the string to a int
I'm too busy right now to code it, but I reckon that it could be useful in the futur to have a module that does just that.
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
update :
File uploaded: http://www.sensomusic.com/forums/upload ... 0value.pat
I found a workaround, just always use 3 digits in the begining of the filename ie : 035 very slow song.wav
sometime ago I made some attempts at using metadata files, here's the idea :
say you have a wave file called groovy.wav
you load it into a special patch that will play the file, get its tempo and write, in the same directory, another file, actually a textfile with the value of the tempo writen into it. this file will be automatically named groovy.tpo
(I actually made something like this for markers and called the file groovy.mkr)
I definitly need to search my archive for tis patch...done :
File uploaded: http://www.sensomusic.com/forums/upload ... 0value.pat
I found a workaround, just always use 3 digits in the begining of the filename ie : 035 very slow song.wav
sometime ago I made some attempts at using metadata files, here's the idea :
say you have a wave file called groovy.wav
you load it into a special patch that will play the file, get its tempo and write, in the same directory, another file, actually a textfile with the value of the tempo writen into it. this file will be automatically named groovy.tpo
(I actually made something like this for markers and called the file groovy.mkr)
I definitly need to search my archive for tis patch...done :
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
-
ringmodulator
- Member
- Posts: 35
- Contact:
Ok, thanks for all your answers.
I've tried a lot of things, ..and it seems that nothing works.
I can't open your first patch, and the second one is freezed.
I've tried to use strings to integer, but hh says it's not a valid float number..
Comma text to array gives nothing..or rather an ununderstanding array, which besides does'nt change when i'm changing from file
.get comma text element index,.nothing.
I'm wondering if i could have a problem with my version (1.02.011d) to read some scripts
manipulating text.
Is that kind of issue known ?
I've tried a lot of things, ..and it seems that nothing works.
I can't open your first patch, and the second one is freezed.
I've tried to use strings to integer, but hh says it's not a valid float number..
Comma text to array gives nothing..or rather an ununderstanding array, which besides does'nt change when i'm changing from file
.get comma text element index,.nothing.
I'm wondering if i could have a problem with my version (1.02.011d) to read some scripts
manipulating text.
Is that kind of issue known ?
-
ringmodulator
- Member
- Posts: 35
- Contact:
And by the way, i think there's a misunderstanding : i'm not scripting myself anything.
I'm just a little patch builder, and can't even imagine how you guys could talk to the machine with words..i've tried, but ..too complicated.
So, that's why a part of your answer was chinese for me.
I'm just a little patch builder, and can't even imagine how you guys could talk to the machine with words..i've tried, but ..too complicated.
So, that's why a part of your answer was chinese for me.
if there is non-numerical characters in the string, you'll get an error
for the first patch : you have to change the path of the file lister according to your file structure and make sure all your files have 3 digit at the begining of their name.
for the second one, I must admit it is quite farfetched !
for the first patch : you have to change the path of the file lister according to your file structure and make sure all your files have 3 digit at the begining of their name.
for the second one, I must admit it is quite farfetched !
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
-
ringmodulator
- Member
- Posts: 35
- Contact:
Ok, to be precise, only your metadatas patch can open. I've changed the path in the filelister as indicated, but hh consider all directory i've tried as invalid , and still keep on trying to load your own files. But anyway,..
My patch is close to the end and i'd like to finish it.
The last step is to make hh able to read the tempo indicated at the beginning of the selected file..but of course, and that's the probleme, all my file's name are a mix of number and letters, but always in the same order (tempo- then any name). The comma text to array could be a solution . But i can't figure out how to use it, and any other solution is welcome.
My patch is close to the end and i'd like to finish it.
The last step is to make hh able to read the tempo indicated at the beginning of the selected file..but of course, and that's the probleme, all my file's name are a mix of number and letters, but always in the same order (tempo- then any name). The comma text to array could be a solution . But i can't figure out how to use it, and any other solution is welcome.
I was too lasy to script as well^^ but here is a quite simple patch solution.

Consider text in usine is Array of char = array of numbers that represents ascii char value. the ascci nuber for space is 32,
so we look if it's in there (via A=32 that will return 1 if there 0 otherwise for each element of the array)
and for the position of it (via max array position of this result, the array being filled with 0 and 1 only where space appears, the max return pos will be first space pos in the array)
then we extract the sub part of global array from start till the position of first space we got from previously,
all we have to do finally is convert this string to integer and we get numerical value of tempo.

Consider text in usine is Array of char = array of numbers that represents ascii char value. the ascci nuber for space is 32,
so we look if it's in there (via A=32 that will return 1 if there 0 otherwise for each element of the array)
and for the position of it (via max array position of this result, the array being filled with 0 and 1 only where space appears, the max return pos will be first space pos in the array)
then we extract the sub part of global array from start till the position of first space we got from previously,
all we have to do finally is convert this string to integer and we get numerical value of tempo.
-
ringmodulator
- Member
- Posts: 35
- Contact:
thanks a lot. no use of any script, this smart little patch do perfectly the job. i didn't thought we could directly wire the out of a text in an array..i was trying with the script comma text to array, which doesn't work as i've said if there is letters in the text. so i'm a bit confused. does comma text means only the numerical part of a text ? otherwise, what the use of this script ?
Comma text in usine means a string list of words separated by a comma ','
for exemple when you type: ""my file 1" ," my file 2"" ect, modules such as listbox or combobox know how they have to split 'elements' of a single big sentence to a list using found commas as separator markers, to get as a displayed result:
my file 1
my file 2
...
i don't know this script but i suppose it converts a commatext made of strings representing numbers to array of numbers, so it internally has a string to integer command that won't like non numeric characters but have to check.
edit: so found and checked the script and it's what it does, pick the comma text list, split to element, and tries to convert to value, so in you case it gets for exemple an item like
: 89 drumloop. it's not able to convert this whole thing string to a number.
if it had such commatext as input for exemple: "89,92,120,150" then it would work and output a numeric then array in the form of
89
92
120
150
for exemple when you type: ""my file 1" ," my file 2"" ect, modules such as listbox or combobox know how they have to split 'elements' of a single big sentence to a list using found commas as separator markers, to get as a displayed result:
my file 1
my file 2
...
i don't know this script but i suppose it converts a commatext made of strings representing numbers to array of numbers, so it internally has a string to integer command that won't like non numeric characters but have to check.
edit: so found and checked the script and it's what it does, pick the comma text list, split to element, and tries to convert to value, so in you case it gets for exemple an item like
: 89 drumloop. it's not able to convert this whole thing string to a number.
if it had such commatext as input for exemple: "89,92,120,150" then it would work and output a numeric then array in the form of
89
92
120
150
-
ringmodulator
- Member
- Posts: 35
- Contact:
Ok, thanks for your explanations. This appears much more clear now. And for the ASCII language, i'll try to get some translation tab, it may be usefull.
Who is online
Users browsing this forum: No registered users and 47 guests
