ARRAY Search [RUBY] ??
Posted: Tue Aug 13, 2013 3:38 am
Wow, was hoping that I was getting a little more handle with RUBY ... apparently, 'almost' is still only good in horseshoes
Have made 'some' progress ... like parsing down an XML file that contains 'patch presets' for programs I'm working on. With the latest discovery of these files, it now seems possible that I can use this XML file to create all the patch names and PRG numbers I need, instead of manually assembling them
I'm experimenting with some ideas to see what the better course to take in doing this.
I have a 'working' module that dissects the XML file into 2 separate arrays. One is the 'patch name', the other is its' 'patch number' [MIDI].
I need to get this full list [maybe 100 or so], organized into related groups [by name], and maintain a reference to its patch number. These 'groups' will feed a 'pull down menu' selector, allowing the User to select a patch from a specific 'bank'.
I was thinking that a 'Search Array' routine would be helpful in putting these groups together. Which has, thus-ly, led to much brain abuse
I've been going through RUBY sites trying to get a handle on this ... only to ALMOST get it working .... or completely NOT working with errors messages that I think RUBY is starting to make up
it's ridiculous I tell ya
I thought that a 'Search' routine that would find ANY character in the array list would output the full name it was contained in [along with its index number]. As more characters are added, the output list would narrow down to the prime candidates. But man, I've not gotten anything working [Ruby wise]. I did find a 'Green' module that kinda works, but it is not finding/matching with only part of a string .... it basically needs the full name ... and it is CASE sensitive, which adds to the problem.
I think I can do this with a single dimension array ... as the dual attempt really got nowhere [for my attempts].
Any bones that could be tossed this way to help would be most appreciated ! I'm going to try and reduce my 'Xperiment Schematic' to something manageable and readable ... but right now it's a conglomerate of all type of trials ... not pretty
off we go ....
Have made 'some' progress ... like parsing down an XML file that contains 'patch presets' for programs I'm working on. With the latest discovery of these files, it now seems possible that I can use this XML file to create all the patch names and PRG numbers I need, instead of manually assembling them
I'm experimenting with some ideas to see what the better course to take in doing this.
I have a 'working' module that dissects the XML file into 2 separate arrays. One is the 'patch name', the other is its' 'patch number' [MIDI].
I need to get this full list [maybe 100 or so], organized into related groups [by name], and maintain a reference to its patch number. These 'groups' will feed a 'pull down menu' selector, allowing the User to select a patch from a specific 'bank'.
I was thinking that a 'Search Array' routine would be helpful in putting these groups together. Which has, thus-ly, led to much brain abuse
I've been going through RUBY sites trying to get a handle on this ... only to ALMOST get it working .... or completely NOT working with errors messages that I think RUBY is starting to make up
I thought that a 'Search' routine that would find ANY character in the array list would output the full name it was contained in [along with its index number]. As more characters are added, the output list would narrow down to the prime candidates. But man, I've not gotten anything working [Ruby wise]. I did find a 'Green' module that kinda works, but it is not finding/matching with only part of a string .... it basically needs the full name ... and it is CASE sensitive, which adds to the problem.
I think I can do this with a single dimension array ... as the dual attempt really got nowhere [for my attempts].
Any bones that could be tossed this way to help would be most appreciated ! I'm going to try and reduce my 'Xperiment Schematic' to something manageable and readable ... but right now it's a conglomerate of all type of trials ... not pretty
off we go ....