User interface object for 're-arrange order' (drag / drop?)

jomtones's icon

So I have a bunch of items that I'd like to be able to rearrange without lots of fiddling around. Closest metaphor I can think if is like a playlist in iTunes - if I drag a track to the start all the others shift forwards in the list.

Is there a UI object for this in Max? Or some other simple way of doing this? I've done a search on drag-drop but haven't found anything that looks very useful so far!

Many thanks

jomtones's icon

Bump!

Can anyone help?

dtr's icon

[playlist~] ?

jomtones's icon

Sorry not sure what you mean - can't find an object called 'playlist' .. ><

dtr's icon

Max 7 has it.

jomtones's icon

Damn... stuck with Max 6 in Ableton right now. Any other element that might be repurposed?

dtr's icon

Not a standard one that I know of. Perhaps a 3rd party external somewhere.

jomtones's icon

Downer. Can anyone advise on a simple way to use drag-drop in Max?

Mike S's icon

Drag and drop implies loading an audio file using dropfile, at least it does to me. I think I know what you mean though, and AFAIK there isn't a simple way to do this. You could use a combination of mousestate/thispatcher/scripting to respond to clicking and dragging, but it's not the simplest task.

Roman Thilenius's icon

no simple way. but [lcd] with its mouse / mouse idle / key up key down output works very well for things like that.

you should also consider using clickable buttons before the item´s names for "move up" instead of dragging.

jomtones's icon

Thanks Roman - that's a great idea. Has anyone seen a similar device with up / down re-ordering buttons? It's well beyond me at my current level of understanding Max.

Pedro Santos's icon

Well, it can be done in Max but it's not very straightforward or elegant... here is one example of a two-dimensional reordering space that I've built using buttons. It might give you some ideas or, more probably, discourage you from doing it... ;-)

Max Patch
Copy patch and select New From Clipboard in Max.

Use it in Presentation mode!

jomtones's icon

Brilliant, thanks Pedro I'll give this a look.

jomtones's icon

This looks really interesting Pedro but I can't figure it out - what does it do?

This is what I can see in presentation mode - I can move the yellow box around in the grid but the numbers don't seem to do anything (looking at in Max 6 'inside' Ableton) - screengrab attached

Cheers

Capture.png
png
Pedro Santos's icon

It's the other way around. You move the buttons in the top left and the cell grid gets updated with their positions.

ak's icon

@pedro pretty low level gui programming... impressive!

Pedro Santos's icon

Thanks, AK! I've built that a while ago out of stubbornness more than anything else, but it really isn't practical or elegant (the code, I mean)...
I've said this before: I think Max should have a more elegant/intuitive way of defining the order of a certain structure, like an effects chain, for example. Ultimately, a similar but simpler way of patching. I would love to be able to interconnect big structures like patchers, bpatchers, vizzie and bleap modules in a locked presentation mode.

The playlist in Max7 is a step in the right direction but it's very specific...

Roman Thilenius's icon

one very important trick is to divide up the problem/job into the GUI part and the actual mechanics which reorders the list.

first built one of these two parts, then the other, then find out how they can be connected to each other.

if i had to write this button based thing now, i would do it all in LCD, because i dont know way other object where displaying text is so easy. only in LCD you you always have control over the altitude position in pixels.

please also look in the helpfile of [coll], which can serve as container for your items list - and supports "insert" and "delete", which can be abused for exchanging the positions 5 and 7 as well.

jomtones's icon

Wow - got it working! Seems really cool, thanks!

How could I extend it to have more columns?