MENU OBJECT problem - works only on 1st tap

Discuss Lemur and share techniques.
octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32
MENU OBJECT problem - works only on 1st tap

Post by octobersongs » 23 May 2014 18:22

I've created a couple of Menu Objects with 5 or 6 items in each menu using the Custom Midi technique below and it works beautifully, except for one thing. One menu was for simple Edit menu items in Cubase (delete, copy, paste, etc.). Once an iPad/Lemur menu item had been selected, that item name (say, paste) would show on the closed menu and the data would have been pasted appropriately in Cubase. But if I wanted to repeat the paste to another location in Cubase, selecting paste again would do nothing. I would have to choose another menu item from that menu (like delete) and then reselect paste to complete the second paste action. Has anyone run into this before?

Thanks,
Joe


Softcore wrote:
Actually, there two ways to achieve this, considering you need a 127 CC value....

You can either use a custom midi out OR script. In the following examples both solutions are displayed - the menu otuputs on CC controllers 21-30 (10 options - notice the "selection+21" thing in both the solutions)

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: MENU OBJECT problem - works only on 1st tap

Post by oldgearguy » 24 May 2014 11:15

Short answer is you can't easily do it with menus. Since you didn't change the selection, Lemur doesn't send/do anything. If you want to be able to repeat certain operations, using a custom button object for those things (like pasting) would be the easiest/ quickest way.

There is probably some way to eventually get it to work using menus, but if your goal is a working app (versus the goal of deeply learning Lemur) use a button.

octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32

Re: MENU OBJECT problem - works only on 1st tap

Post by octobersongs » 24 May 2014 18:12

Thanks for that. Thought there might be some script that could be added so that it would register that it had been tapped again. (Don't mind going a little deeper.)

jc

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: MENU OBJECT problem - works only on 1st tap

Post by oldgearguy » 25 May 2014 15:01

octobersongs wrote:Thanks for that. Thought there might be some script that could be added so that it would register that it had been tapped again. (Don't mind going a little deeper.)

jc

I played a bit this morning. There is a trick you can do; not sure if there's any long-term side effects.

If you have a menu of 10 items (selection returns 0-9), you can set the Menu.selection value to 10 in a script after doing an operation from that menu. For example, if you call a paste script when the user selects paste, by setting the Menu.selection value to 1 more than the max in the menu, it blanks out the display so that the user can pull down the menu and reselect the same option.

Some issues -- the menu display will blank out and this will not work if you have a full menu (32 items). NOTE - do not try setting the selection to -1. This will crash Lemur and force you to edit the script outside Lemur to change from -1 to something else.

I have a junk script attached that has a menu and a monitor. Select a menu option to see what happens and decide if it's something that can help.
Attachments
Untitled.jzml
(2KiB)Downloaded 143 times

octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32

Re: MENU OBJECT problem - works only on 1st tap

Post by octobersongs » 26 May 2014 18:36

Thanks for looking into this oldgearguy.

Expanding on your script, is it possible to have none of the menu selections appear, as your "Option 3" does not? Would that allow you to reselect & re-execute any of the menu options? In this usage, it's unimportant for my last choice to show, so none of them need to appear. A text object could be placed over the menu object saying "file" or "edit". The monitor in you example wouldn't even be needed.

jc

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: MENU OBJECT problem - works only on 1st tap

Post by oldgearguy » 26 May 2014 19:58

octobersongs wrote:Thanks for looking into this oldgearguy.

Expanding on your script, is it possible to have none of the menu selections appear, as your "Option 3" does not? Would that allow you to reselect & re-execute any of the menu options? In this usage, it's unimportant for my last choice to show, so none of them need to appear. A text object could be placed over the menu object saying "file" or "edit". The monitor in you example wouldn't even be needed.

jc

I just had the monitor object to show that if you repeatedly selected option 3, it actually did something (as opposed to the default behavior of not doing anything), hence the simple counter.

Yes - if you redirected the selection value to 6 (in this case) after each selection, it would display a blank and allow you to keep reselecting the same option.

it's as simple as creating a script in the menu object set to: "On Expression" "selection" "any"
and the script contents are just:

selection = sizeof(getattribute(Menu, 'items')); (substitute whatever the name of your menu object is for Menu)

octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32

Re: MENU OBJECT problem - works only on 1st tap

Post by octobersongs » 26 May 2014 22:56

By adding these lines of code, it seems to have defeated the actual function of the choices in the menu (in this case, "File" options like new, open, close, etc., of which I have 5). I'm absolutely positive that it is my almost complete lack of understanding of how scripts are to be created that is problem.

In these two menus objects ("MenuFile" & "MenuEdit") I have a "Custom MIDI" script to allow for sending ascending controller numbers to Cubase to execute the intended command. For the Edit menu, clicking and pulling down to the first option, "undo", sends controller 0. Selecting "undo" should send controller 1, "delete" controller 2, etc. This worked properly before I added the new script objects and lines.

Image

Image

This is how the adapted script now reads (in which I'm sure there are errant and unnecessary lines).

Image

Again oldgearguy, I appreciate your attention.

jc

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: MENU OBJECT problem - works only on 1st tap

Post by oldgearguy » 27 May 2014 09:55

You might have to be a bit more selective about when/where you reset the selection value. :D

If you have a script that does things based on the menu selection, I'd reset the selection value at the end of that script. That way, you act on the menu choice, do your stuff, then reset the selection value for the next time around. So, after you send out the MIDI info, add the reset of selection right at the end of that script and see what happens.

(don't forget to delete the "On Expression" script too)

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: MENU OBJECT problem - works only on 1st tap

Post by Softcore » 27 May 2014 13:59

Perhaps going into a completely different route with my post, but anyways....you can also "sketch up" a visually "menu" control with other objects and therefore have more control over what happens when anything is tapped....

to showcase:
https://forum.liine.net/viewtopic.php?f ... =10#p10550

octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32

Re: MENU OBJECT problem - works only on 1st tap

Post by octobersongs » 27 May 2014 18:17

Thank you softcore.

I adapted your "horizontal_menu" so that tapping the menu options would send the appropriate control change (118 - 125) and, even though each option works properly, I'm left with the original problem of not being able to reselect the same option, like if I were to repeatedly "paste" data. Your example functions in the same way my menu object does, having to choose another menu option before I can reselect the original option.

jc

Post Reply