No internet connection
  1. Home
  2. How to

Paste a SERIES of SFX files to memory locations?

By Owen Granich-Young @Owen_Granich_Young
    2021-10-13 18:46:42.780Z

    So I have a script I've found here on the forum to easily paste a SINGLE audio file to markers, awesome, but I would love if there was a way for a script to use a SERIES of audio files and paste them to Location Markers.

    Basically often in SFX editing I have something like a creatures footsteps, or maybe punches where there are quite a lot in a row, and I don't want them to sound exaclty the same but at it's core it's the same sound. So I have a series of sound fx that are all slight variations of said sound. How could one get a script to look at a selection of individual SFX files and cut them to memory locations one after the other so it's not repeating the exact sound over and over but instead cycling through them until you've reached the end of the memory locations.

    Those files could be in the clip bin or on the destination track they're headed to in a large block I'm not picky there (often I spot from soundminer to the track I'm going to be cutting on.) I suppose some sort of 'Cut / Paste / Tab to to and select next file / next memory location / cut copy paste etc loop would work? Wondering if someone has a better more elegant idea?

    Bonus points if you could also do it to sync point's in the file not just the head of the file as an option.

    Here's a video of me manually doing the task for clarity of what I'm asking for. I've already manually dropped my makers.

    Probably don't need to watch the whole thing 😂could have made that video about 5 seconds and it would be the same, but I gotta get the work done at some point 😅

    I know, big ask, so no worries if everybodies got more important things to work on.

    Bests,
    Owen Granich-Young

    • 2 replies
    1. O
      Owen Granich-Young @Owen_Granich_Young
        2021-10-13 22:38:53.203Z2021-10-13 23:10:16.532Z

        Ok so I built a clunky one ripping scripts off the forum here from @chrscheuer @samuel_henriques and my favorite memory location package from @raphaelsepulveda and it's working (abiet a bit slow and only one sample at a time.)

        Built it as a Marco but here it is converted to script:

        
        sf.ui.proTools.menuClick({
            menuPath: ["Edit", "Cut"],
        });
        
        //Calling command "RS_Create/Go To Temp Location" from package "Raphael Sepulveda Utilities" (installed from user/pkg/version "wumCaKnhA0T91I79tL1NbXLQmH03/ckijqv49o000b4z10qr66346e/cktxeotob0002gz10dx9agktp")
        sf.soundflow.runCommand({
            commandId: 'user:1632133035922:cktuwk8zf000bqf101vj36pff',
            props: {
                name: "NEXT Sample",
                goToAndClear: "1",
            }
        });
        
        /* sf.ui.proTools.memoryLocationsTempCreate({
            tempNumber: 1,
        }); */
        
        //Calling command "Next Memory Locaiton with LOCATION" from package "SAVE FOR LATER"
        function findLocationNameMatch(locationName) {
        
            const mainCounter = sf.ui.proTools.getCurrentTimecode().stringValue
            let cleanMainCounter = mainCounter.replace(/[ :\+\|.]/g, '').trim()
        
        
            //  if maulter is bars beats, remove last three digits, since memory locations list ignores them
            mainCounter.match(/\|/) ? cleanMainCounter = cleanMainCounter.slice(0, -3) : null
        
        
        
            const memoryLocations = sf.proTools.memoryLocationsFetch().collection.list.filter(x =>
                x.mainCounterValue.replace(/[ :\+\|.]/g, '').trim() > cleanMainCounter &&
                x.name.match(locationName));
        
            try {
                sf.ui.proTools.memoryLocationsGoto({
                    memoryLocationNumber: memoryLocations[0].number
                });
            } catch (err) { log(`End of location markers containing:\n${locationName}`) }
        }
        
        sf.ui.proTools.appActivateMainWindow();
        
        
        findLocationNameMatch("Location")
        
        //Calling command "Delete memory location at Selection" from package "SAVE FOR LATER"
        let opened = false;
        if (!sf.ui.proTools.memoryLocationsWindow.invalidate().exists) {
            sf.ui.proTools.menuClick({ menuPath: ['Window', 'Memory Locations'] });
            sf.ui.proTools.memoryLocationsWindow.elementWaitFor();
            opened = true;
        }
        
        try {
        
            sf.ui.proTools.memoryLocationsWindow.popupButtons.whoseTitle.is('Memory Locations').first.popupMenuSelect({
                menuSelector: items => items.filter(i => i.names[0].match(/^Delete \"/))[0]
            });
        
        } finally {
            if (opened) {
                sf.ui.proTools.menuClick({ menuPath: ['Window', 'Memory Locations'] });
            }
        }
        
        
        sf.ui.proTools.menuClick({
            menuPath: ["Edit", "Paste"],
        });
        
        //Calling command "RS_Create/Go To Temp Location" from package "Raphael Sepulveda Utilities" (installed from user/pkg/version "wumCaKnhA0T91I79tL1NbXLQmH03/ckijqv49o000b4z10qr66346e/cktxeotob0002gz10dx9agktp")
        sf.soundflow.runCommand({
            commandId: 'user:1632133035922:cktuwk8zf000bqf101vj36pff',
            props: {
                name: "NEXT Sample",
                goToAndClear: "1",
            }
        });
        
        /* sf.ui.proTools.memoryLocationsTempGoto({
            tempNumber: 1,
        }); */
        
        sf.keyboard.press({
            keys: "shift+l",
        });
        
        
        
        

        Things I don't like about my script :

        I have to press the button for every sample, how do I tell it to just run until it runs out of memory locations for it to post files to?

        I have it cutting and pasting, instead of copying and pasting, so that I can get back to the next sample, but Ideally it wouldn't cut the file but go to the next one and ciricle back to the first one if it runs out of files in a selected area.

        The way I built it it's very particualr that all the files have to butt up exactly to each other. How can it instead just know to grab the next one on the timeline?

        Interestingly, I found while making this that although using 'goto temp marker' is faster, temp marker only seems to drop on the frame that the cursor is in, not the actual sample, so when I used that instead of Raphel's utility I was left with a lot of hanging bits of chopped audio.

        1. OOwen Granich-Young @Owen_Granich_Young
            2021-10-13 23:05:03.277Z2021-10-13 23:11:28.095Z

            No longer referencing any open code.