No internet connection
  1. Home
  2. How to

Cubase Midi record Mode

By olafnoise @olafnoise
    2021-03-26 09:43:39.515Z

    Hi,
    Is there a way to assign a button to each of the 3 midi record modes in Cubase ?
    I tried a menu macro but the transport menu is changing when you change record mode so it's not working ..
    The click UI element on the midi icon at the bottom left of the main window doesn't work either ... can't pick the element ...
    any help welcome ..

    Ølaf

    • 8 replies
    1. O
      olafnoise @olafnoise
        2021-04-01 17:11:58.090Z

        up

        1. In reply toolafnoise:

          Hi Olaf,

          It's possible to query UI menus for their names in a script, in the event where you don't know the full name of the menu item in advance.
          You may also be able to just use the Loose Match option.

          To help you, we'd need to know the exact menu items you want to click - please share screenshots and examples.

          1. Oolafnoise @olafnoise
              2021-04-03 07:53:35.164Z

              Hi Christian and thank you for your reply

              Here is the first way to change MIDI record mode. But as you can see the menu "Transport" is changing according to the chosen mode ...

              Now here is the second way with the MIDI icon at the bottom left of the main window.
              But I can't pick the UI element


              Thanks in advance

              Ølaf

              1. Thanks, Ølaf.

                I don't have Cubase on this computer, but try this:

                
                function cycleCubaseMenu({ parentMenuName, menuPrefix }) {
                    var parentMenuItem = sf.ui.cubase.getMenuItem(parentMenuName).children.first.children.find(c => c.title.value.startsWith(menuPrefix));
                    if (!parentMenuItem)
                        throw `Couldn't find "${parentMenuName}" -> "${menuPrefix}" menu`;
                
                    var modeButtons = parentMenuItem.children.first.children;
                
                    var checkedIndex = modeButtons.findIndex(c => c.isMenuChecked);
                    checkedIndex++;
                    if (checkedIndex >= modeButtons.length)
                        checkedIndex = 0;
                
                    modeButtons.allItems[checkedIndex].elementClick();
                }
                
                cycleCubaseMenu({
                    parentMenuName: 'Transport',
                    menuPrefix: 'MIDI Record Mode:',
                });
                
                1. Note that the code I showed above would cycle through all 4 elements in the submenu.

                  Here's another version with a filter function that can ensure you don't cycle through the last item:

                  
                  function cycleMenu({ app, parentMenuName, menuPrefix, filter }) {
                      var parentMenuItem = app.getMenuItem(parentMenuName).children.first.children.find(c => c.title.value.startsWith(menuPrefix));
                      if (!parentMenuItem)
                          throw `Couldn't find "${parentMenuName}" -> "${menuPrefix}" menu`;
                  
                      var modeButtons = parentMenuItem.children.first.children.allItems.filter(filter ? filter : () => true);
                  
                      var checkedIndex = modeButtons.findIndex(c => c.isMenuChecked);
                      checkedIndex++;
                      if (checkedIndex >= modeButtons.length)
                          checkedIndex = 0;
                  
                      modeButtons[checkedIndex].elementClick();
                  }
                  
                  cycleMenu({
                      app: sf.ui.cubase,
                      parentMenuName: 'Transport',
                      menuPrefix: 'MIDI Record Mode:',
                      filter: mi => mi.role === 'AXMenuItem' && !mi.title.value.startsWith('Auto'),
                  });
                  
            • O
              In reply toolafnoise:
              olafnoise @olafnoise
                2021-04-03 15:10:27.726Z

                Thanks Christian

                Unfortunately, the script doesn't have any effect.
                here's the log
                03.04.2021 17:01:04.43 [Backend]: #StreamDeck: KeyDown (4,3) -> gu cubase rec mode 2
                Validating command... user:default:ckn1tn5pr0001xe10koy2g3kw
                Invoking command...user:default:ckn1tn5pr0001xe10koy2g3kw

                03.04.2021 17:01:04.43 [Backend]: >> Command: gu cubase rec mode 2 [user:default:ckn1tn5pr0001xe10koy2g3kw]

                But actually, i haven't been clear enough.
                There is a built in command in Cubase to cycle between the midi rec modes
                But there is nothing in the display that indicates in what mode you are.
                What i tried to do is to have 3 butons on my stream deck to select the mode I want ..
                That would be an inelegant but effective way to quickly know what you're going to record instead of looking in a stupid menu

                best
                Ølaf

                1. Ok. We'll need somebody who has Cubase then to help, as I mentioned I can't test it myself here :)
                  The above scripts works just fine with the menus I set up to test with in Finder, so I'm sure it's a small fix.

                  1. Oolafnoise @olafnoise
                      2021-04-03 16:41:24.181Z

                      ok got it
                      thanks anyway
                      Hope somebody will find it ... when you see the number of posts requesting this option for years (as a shortcut)

                      best
                      Ølaf