Hello Fellow Patchers,
WHAT I'M DOING:
I am trying to create an automated interactive karaoke system where users will select songs from a HUGE karaoke database and the songs will automatically be cued by the system. What I would like to have happen is to have two separate systems where users could search by either Artist or Song Title. I thought I could use the dict object to create a hierarchical database that I could use to populate umenus. For example, if "By Artist" is selected, the dict would populate one umenu with all Artists, and selections from this menu could call up from the dict the songs available from that artist to populate a second umenu.
WHAT MY PROBLEM IS:
I built an iterative system to build the dictionaries from text files by using zl.iter and a sprintf object to format them into messages to the dict object. The process takes REALLY LONG! Like 15+ minutes for a single volume. There are so many entries that zl object stops reporting them even though I set the @zlmaxsize really high and I have to feed the text in in chunks. Apart from the time involved in building the dictionary, I cant seem to call up the data correctly. I think for some reason the highest level of my data structure is stored as a key. The usual messages like "getnames" or "getkeys" do not return the correct data. I can see the data, which appears to be hierarchically correct, with a dict.view object, but I cant dig down past the highest level with a "get" message.
Am I missing something? Can I reformat the dict somehow to return the information correctly (ie move the highest level from a key to a dictionary)? Is there a faster way to build the dictionary? Is there a different way to create a menu system like I describe at the top of this post directly from the file structure on the hard drive and forgo a dict?
Here is an example patch that shows what I am trying to do. I am also attaching the text file for the first volume if you are brave enough to feed it into the system to build the entire first volume dictionary (of 23 volumes) to see what I am talking about when it comes to performance.
Thank you for your help. Happy Patching!