Community Forums Archive

Go Back

Subject:Possible to write a script for this?
Posted by: peahicks
Date:3/11/2010 8:01:36 PM

hi, i've never used scripting in sound forge, but i have a menial task that i need to do on a number of sessions, and it'd be cool to have a script for it, if its even possible.

can i take a set of 57 wav files (loops) that are all exactly 44,100 samples long and have a script automatically rotate the audio of each file in increments of the sample length divided by 57 (1192 samples)?

i do this manually by opening all the files (which are named "01.wav" to "57.wav") and consulting a chart i made which tells me the amount of samples to select at the beginning of each file, then i hit the "rotate audio" button. the goal is to have the loop joints of all the files staggered evenly across the 44,100 sample length, so that when played together, the loop joints don't coincide all at the same time.

so, is it possible to write a script for this?

thanks in advance!!
pea

Subject:RE: Possible to write a script for this?
Reply by: ExSonyTJ
Date:3/13/2010 1:33:31 AM

Sure it's possible.

One way is to open each file, getting the ISfFileHost object, for each file, make a n SfAudioSelection that goes from 0 to the number of samples you want to rotate by, then use the OverwriteAudio method on the filehost to copy the selected audio to the end of the file, then the DeleteAudio method to delete it.

The other way is to open each file and use the ISfDataWindow object to select the audio you want to rotate, and then app.DoMenu to invoke the rotate command.

Go Back