No internet connection
  1. Home
  2. How to

Can I use multi-touch on the deck?

By Yujiro Yonetsu @Yujiro_Yonetsu
    2021-03-18 13:55:29.521Z

    Hello.

    I now have an idea for a script I want to create, and I need your help with it.

    The first question is.
    Will the stream deck be able to take advantage of multi-touch?
    What I want to do is something like the following image.

    While selecting the "Slot you want to insert" in the upper row, press the "Plug-in you want to insert" in the lower row.

    Is it possible to do this?

    The lower rows script I can think of is

    sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
       insertOrSend: "Insert",
       pluginNumber: "selected slot in upper row",
       pluginPath: ["plug-in","EQ","EQ3 7-Band (mono)"],
    }, function(notMonoTrack) {
    sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
       insertOrSend: "Insert",
       pluginNumber: "selected slot in upper row",
       pluginPath: ["multichannel plug-in","EQ","EQ3 7-Band (stereo)"],
    })});
    

    However, I don't know the upper script that works with this.
    Please help me.

    Solved in post #9, click to view
    • 12 replies

    There are 12 replies. Estimated reading time: 13 minutes

    1. samuel henriques @samuel_henriques
        2021-03-23 18:59:06.304Z2021-03-23 20:30:50.975Z

        Hello @Yujiro_Yonetsu,

        I think a way to do this could be:

        for each button slot A, B, C... create a script with a globalState variable. These variables can be anything and are stored by soundFlow, and can be accessed from any other script.

        for each, do a new script with only this line:
        On button slot A do :

        globalState.insertSlot = 1
        

        On button slot B do :

        globalState.insertSlot = 2
        

        On button slot B do :

        globalState.insertSlot = 3
        

        Repeat until button slot J.

        to open plugin:

        if (globalState.insertSlot == undefined) {
        
            alert("Please Select a Slot.")
        
        } else {
            sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                insertOrSend: 'Insert',
                pluginNumber: Number(globalState.insertSlot),
                pluginPath: ['plug-in', 'EQ', 'FabFilter Pro-Q 2 (mono)'],
                selectForAllSelectedTracks: true,
            });
        
            globalState.insertSlot = undefined
        }
        

        The variable will only change if you press a new button and will be nothing if you restart sound flow( globalState variables will reset if you restart sounfFlow.)

        If you don't want to risk opening a plugin without choosing a slot, you can set it to nothing once the plugin is opened with this:

        globalState.insertSlot = undefined
        

        Let me know how it goes.

        1. Kitch Membery @Kitch2021-03-23 20:03:03.006Z

          Nice one Samuel!

          I'd also suggest clearing the global state at the end of the open plugin script. And a bail-out early if the global state is undefined at the beginning.

          Rock on!

          1. samuel henriques @samuel_henriques
              2021-03-23 20:14:19.981Z

              thank you @Kitch, was using the error handling to account for that, but its much smarter to just ask before, that way we'll know if there is an error.

              And thank you @Chris_Shaw.

            • Yujiro Yonetsu @Yujiro_Yonetsu
                2021-03-23 20:58:52.821Z

                Hello, @samuel_henriques
                Thank you for the most wonderful solution.
                Your teachings are going to make my dreams come true.

                Currently, this is how I think it should look.

                
                sf.ui.proTools.menuClick({
                    menuPath: ["Window","Edit"],
                });
                
                if (globalState.insertSlot !== undefined) {
                
                    sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                        insertOrSend: "Insert",
                        pluginNumber: Number(globalState.insertSlot),
                        pluginPath: ["Native plug-in", "EQ", "EQ3 7-Band (mono)"],
                    }, function (notMonoTrack) {
                        sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                            insertOrSend: "Insert",
                            pluginNumber: Number(globalState.insertSlot),
                            pluginPath: ["multichannel Native plug-in", "EQ", "EQ3 7-Band (stereo)"],
                        })
                    });
                
                    globalState.insertSlot = undefined
                }
                

                At the end of this script, I would like to add a "return to previous window" action.
                What do you think?
                Please let me know if you have any ideas.

                1. Yujiro Yonetsu @Yujiro_Yonetsu
                    2021-03-23 21:22:01.799Z

                    Come to think of it...

                    The script I'm working on now is not adaptable to tracks above LCR.

                    As for the content of this script, I realized that it should be like "Teezio's Plugin Loader".
                    It is very well done, and inserts well for mono, multi-channel, and multi-mono.
                    But I can't see the contents of the script from the package.
                    What is the solution in this case?

                    1. samuel henriques @samuel_henriques
                        2021-03-23 22:04:07.726Z

                        hey @Yujiro_Yonetsu ,

                        as for the script you made, I made a change on the part I sent you and the way you made it, it wouldn't work.

                        try this:

                        sf.ui.proTools.appActivate();
                        
                        let originalWin = sf.ui.proTools.focusedWindow.title.value.split(":").slice(0, 1).join(":")
                        
                        sf.ui.proTools.menuClick({ menuPath: ["Window", "Edit"] });
                        
                        if (globalState.insertSlot == undefined) {
                        
                            alert("Please Select a Slot.")
                        
                        } else {
                            sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                                insertOrSend: "Insert",
                                pluginNumber: Number(globalState.insertSlot),
                                pluginPath: ["Native plug-in", "EQ", "EQ3 7-Band (mono)"],
                            }, function (notMonoTrack) {
                                sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                                    insertOrSend: "Insert",
                                    pluginNumber: Number(globalState.insertSlot),
                                    pluginPath: ["multichannel Native plug-in", "EQ", "EQ3 7-Band (stereo)"],
                                })
                            });
                        
                            globalState.insertSlot = undefined
                        }
                        
                        
                        sf.ui.proTools.menuClick({ menuPath: ["Window", originalWin] });
                        

                        if you are in mix window, it will select edit and go back.

                        as for the Teezio's, it's not public script, what you would like from it is the part it knows witch type and width track is?

                        ReplySolution
                        1. Yujiro Yonetsu @Yujiro_Yonetsu
                            2021-03-25 15:50:47.922Z

                            Sorry for the delay in replying.

                            I can now go back to the window I was originally focused on.
                            Thank you very much.
                            That's perfect.

                            If I had one more desire, it would be to be able to insert multi-mono when there is no multichannel for channels above LCR.
                            (Teezio can do it. great!)

                            1. Yujiro Yonetsu @Yujiro_Yonetsu
                                2021-03-29 16:14:26.002Z

                                Hello.

                                After that, I improved it in various ways.

                                
                                sf.ui.proTools.appActivate();
                                
                                let originalWin = sf.ui.proTools.focusedWindow.title.value.split(":").slice(0, 1).join(":")
                                
                                //show edit window
                                sf.ui.proTools.menuClick({ menuPath: ["Window", "Edit"] });
                                
                                
                                //view to selected track
                                sf.ui.proTools.selectedTrack.trackScrollToView();
                                sf.ui.proTools.selectedTrack.titleButton.mouseClickElement({
                                    isControl: true,
                                    isShift: true,
                                });
                                
                                
                                //Close floating windows
                                sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in').allItems.forEach(function (win) {
                                    try { win.windowClose(); } catch (err) { }
                                });
                                
                                
                                //If global state is not selected
                                if (globalState.insertSlot == undefined) {
                                
                                    alert("Please Select a Slot.")
                                
                                    //Insert
                                } else {
                                    sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                                        insertOrSend: "Insert",
                                        pluginNumber: Number(globalState.insertSlot),
                                        pluginPath: ["Native plug-in", "EQ", "EQ3 7-Band (mono)"],
                                    }, function (notMonoTrack) {
                                        sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
                                            insertOrSend: "Insert",
                                            pluginNumber: Number(globalState.insertSlot),
                                            pluginPath: ["multichannel Native plug-in", "EQ", "EQ3 7-Band (stereo)"],
                                        })
                                    });
                                
                                    //reset globalstate
                                    globalState.insertSlot = undefined
                                }
                                
                                //show original window
                                sf.ui.proTools.menuClick({ menuPath: ["Window", originalWin] });
                                
                                //return to slot select window
                                sf.decks.get('user:ckmmgyrb800005e109czblt0g:ckmp19gyz0003l310679bo7r2').showOnStreamDeck({
                                    device: sf.devices.streamDeck.getDeviceByContext('241C0D50FDB0C78F56C6497C4F4A5D83'),
                                });
                                

                                I have a request for a few more features.

                                1. When this script finishes, the target track will be displayed at the top or leftmost position.
                                  I don't think that behavior is very beautiful.
                                  I would like to go back to the same track view state as when the script started.
                                  Is there any other way to use "Window Configuration" for that?

                                2. I would also like to create a "next free slot" in the slot selection screen.
                                  In that case, how should I do the GlobalState?
                                  (like this)

                                Would you be able to lend your expertise.

                      • In reply toYujiro_Yonetsu:

                        This is a cool deck concept / method for inserting plugins.
                        @Kitch

                        1. Kitch Membery @Kitch2021-03-23 20:03:48.184Z

                          Yeah it is @Chris_Shaw!

                          1. Yujiro Yonetsu @Yujiro_Yonetsu
                              2021-03-25 16:02:08.326Z

                              Thanks to the script that @samuel_henriques taught me, I've been trying out different things, and the shape of my idea has changed.

                              I found that I didn't need to press the buttons at the same time, so I decided to design it this way.

                              This is 1st page.
                              After the slot script, I added a script to display the second page.

                              
                              globalState.insertSlot = 1
                              
                              sf.decks.get('user:ckmmgyrb800005e109czblt0g:ckmp18gyp0002l310n1aytbqp').showOnStreamDeck({
                                  device: sf.devices.streamDeck.getDeviceByContext('241C0D50FDB0C78F56C6497C4F4A5D83'),
                              });
                              
                              

                              Here is 2nd page

                              I believe that by making it this way, more buttons can be effectively used.
                              How wonderful it would have been if the stream deck had five vertical rows instead of four, which is what I regret. ......

                              1. You should try to position the insert buttons horizontally.

                                Or you could use a 3x5 Stream Deck so the insert rows are horizontal and use that to control your XL Stream deck.