Forums > MaxMSP

VST preset list to tabs

November 17, 2011 | 10:06 am

the Umenu works very easily with the preset list output from the VST` object, but I use a touchscreen and need a way to select presets without scrolling. I’d like to use a grid of buttons displaying names of 32 presets at a time, with paging buttons.

Elsewhere on these forums, I read about using a set of tabs for this. It looks like it would work great for me. But being a noob, I can’t figure out how to populate the tabs from the presets. The preset names seem to be sent out as a series of separate items, and I guess ‘tabs’ needs them all as a list? Instead of creating a tab for each preset, it creates one tab and just renames it… I looked at ‘join’, but that is showing up as ‘bogus’ in max 5, although there is documentation for it. Has it been deprecated? I figured there would be some way to get the delimited text out of a umenu, but it looks like that is not possible either.

And since presets sometimes contain commas or quotes, would these then need to be escaped? Maybe I need to dive into JS, to make this work.

Any tips welcome!


November 17, 2011 | 11:01 am

What about using jit.cellblock?
cheers
Roger

– Pasted Max Patch, click to expand. –

November 17, 2011 | 7:38 pm

Yeah, I looked into cellblock, but I like the look of the tabs better….

Is it a big deal to make this conversion?


November 17, 2011 | 9:18 pm

Okay, I looked into the Coll object. Unfortunately, it doesn’t have an ‘append’ command(?) so I had to use ‘insert’, and now my preset list is in reverse order, but it is now in the coll object.

But I’m not sure I’m any closer. The ‘dump’ output seems to send individual messages, and the TAB object doesn’t seem to have any programmatic way to address the name of a single specific tab.


November 17, 2011 | 9:49 pm

Judging from the text in the inspector in the tabs help example, I need to put quotes around any preset name that has spaces in it, and then join all the separate messages from a ‘coll’ dump (or the original vst~ output–I don’t think coll is helping) into a single list. Doesn’t sound hard, I just can’t find the objects to do it with…

I’m trying to understand Symbols. If I convert text with spaces into a symbol, do I still need quotes around it? Will a symbol work as the input to TABS? How do I know which it wants? The docs say symbol, but don’t indicate if the whole list is a single symbol or each item is a symbol.

Thanks in advance for any insight,
-eric


November 17, 2011 | 11:16 pm

Just try a list with multiple symbols, it should work…maybe…haven’t tried it. You could use sprintf for a list of symbols, and use "symout" to make the whole shebang into one symbol. I don’t have Max here but maybe it’ll work…I don’t think you need quotes in the sprintf or afterwards, it knows it’s a symbol if you use "symout".

I personally would like Tab to take its list using commas like umenu does, it would make these things easier. But maybe there’s an "under-the-hood" reason for doing it with spaces.


November 18, 2011 | 6:17 am

Doesn’t sprintf require you to know the number of arguments? And surely you can’t have 128 of them? The problem is going from many discrete messages to one message.

I’ll look and see if I missed something about sprintf….


November 18, 2011 | 6:31 am

Roger:

thanks for the patch using cellblock! It will work for the moment….

I’d still love a solution for tabs, though.

cheers,
-e


November 18, 2011 | 6:53 am

Okay, as I thought, the iter module in Roger’s cellblock solution is unnecessary, because the vst~ is already putting out separate items.

What I need is the INVERSE of iter….

Is there one? It occurs to me now that the vst~ object doesn’t give any indication of when it is done sending out presets (in the case of Synth1 with its 12,000 presets, that’s not a trivial issue…)

I could do with counting, though, and selecting the first n elements. Indeed, I’ll need to do something like that to get different pages.

I note that the help file variously lists the program output as "a list" and as "a series of symbols". This is an important distinction, right? Seems like it is the latter. If it was the former, the iter module would be needed. [?]

thanks,
-e


November 18, 2011 | 3:15 pm

oh the irony.

The answer is in the VERY NEXT post to this forum!

I used merge 0 with a coll object. Max creates the list correctly, and a message of 0 retrieves it. prepend tabs and it works perfectly.

Hope this helps somebody else.


December 1, 2011 | 12:00 am

[zl group] will let you collect a sequence of items into a single list, suitable for populating a tab object

– Pasted Max Patch, click to expand. –

Viewing 11 posts - 1 through 11 (of 11 total)