No internet connection
  1. Home
  2. How to

Split clips / duplicate track / alternate muting of clips

By Tristan Hoogland @Tristan
    2021-05-19 23:38:25.100Z

    Hi,

    Posting this thought now as I've been meaning to for months, but keep forgetting. The title is perhaps not as clear as I'd like, but basically the scenario is:

    Often I will have a track that I'm wanting to duplicate and split the clips so I can process differently. An example of this might be that a producer has provided me with a stem that contains both a kick and snare (occurring individually - i.e. beat 1 kick, beat 2 snr, etc) and to have better control over the individual hits I'll use either beat detective or tab-to-transient to break up the stem, then duplicate the track and go between each track, muting the opposing region so I end up with basically a dedicated KICK track and a dedicated SNARE track. To better illustrate what this looks like I've attached a picture.

    Track 1 - the original stem containing a snare and hi hat together
    // DUPLICATE TRACK TWICE //
    Track 2 - Snare (split)
    Track 3 - Hats (split)

    I guess this script could be in two stages, one to split the regions. But primarily the one I'd really like to focus on is the ability to mute the opposing region as you can see in the picture as that's a bit time consuming as I click between each region manually.

    Any thoughts or solutions out there already?

    • 9 replies
    1. T
      Tristan Hoogland @Tristan
        2021-05-19 23:38:38.997Z
        1. Kitch Membery @Kitch2021-05-20 19:16:47.846Z

          @Tristan_Hoogland mate!

          Select the clips that are chopped up and then run this script :-)

          function main() {
              sf.ui.proTools.appActivateMainWindow();
              sf.ui.proTools.mainWindow.invalidate();
          
              const selectedTrackNames = sf.ui.proTools.selectedTrackNames;
          
              let originalSelection = sf.ui.proTools.selectionGet();
          
              sf.ui.proTools.trackSelectByName({ names: [selectedTrackNames[0]] });
          
              let clipsTable = sf.ui.proTools.mainWindow.tables.whoseTitle.is('CLIPS').first;
              let selectedClipCount = clipsTable.getElements("AXSelectedRows").allItems.length;
          
              sf.keyboard.press({ keys: "down", });
              sf.keyboard.press({ keys: "ctrl+tab", });
          
              for (let i = 1; i <= selectedClipCount; i++) {
                  if (i % 2 === 0) {
                      sf.ui.proTools.trackSelectByName({ names: [selectedTrackNames[0]] });
          
                  } else {
                      sf.ui.proTools.trackSelectByName({ names: [selectedTrackNames[1]] });
                  }
          
                  sf.ui.proTools.menuClick({ menuPath: ["Edit", "Mute Clips"], });
          
                  if (i <= selectedClipCount - 1) {
                      sf.keyboard.press({ keys: "ctrl+tab", });
                  }
              }
              sf.ui.proTools.trackSelectByName({ names: selectedTrackNames });
          
              sf.ui.proTools.selectionSet({
                  selectionStart: originalSelection.selectionStart,
                  selectionEnd: originalSelection.selectionEnd,
              });
          }
          
          main();
          

          Rock on!

          1. TTristan Hoogland @Tristan
              2021-05-21 04:11:52.288Z

              Of course Kitch to the rescue! Thanks for punching this out mate. I'll test it in the studio tomorrow :)

              1. Kitch Membery @Kitch2021-05-21 04:12:50.848Z

                Rock on mate!

                1. TTristan Hoogland @Tristan
                    2021-05-22 00:00:03.596Z

                    Heya Kitch, tried this today, but sadly getting the following error:

                    "Error: Object reference not set to an instance of an object"

                    Mean anything to you?

                    1. Kitch Membery @Kitch2021-05-22 00:01:19.890Z

                      Is your clips list closed by chance?

                      1. TTristan Hoogland @Tristan
                          2021-05-22 00:16:31.183Z

                          Oh yep that certainly moved things along. With that said it seems to start out semi-ok, but then crashes shortly after that. As you can see in my #hires video (sorry I'm in a rush, should work out screen recording) the cursor tries to jump across a bunch and stops muting the regions... strange.

                          https://www.dropbox.com/s/ud3lrizma6zfx7u/IMG_5441.MOV?dl=0

                          1. Kitch Membery @Kitch2021-05-22 00:22:45.443Z

                            FYI: For screen recording, you can use Command + Shift + 5 for screen recordings (assuming you are on a recent version of the Mac OSX).

                          2. In reply toKitch:
                            Kitch Membery @Kitch2021-05-22 00:21:05.080Z

                            Try one thing for me... Switch the main counter to samples and see if that works. :-)