Subject:Idea list for useful scripts
Posted by: mokomo
Date:5/21/2005 9:45:14 PM
I'm considering learning how to script SF8. "Use scripting to automate common tasks and create customized features. New application scripting tools include the script editor window and toolbar. As a bonus, Sound Forge 8 ships with premade scripts of commonly used tasks. Scripting languages supported are C#, JScript, and VBScript." For those users who have a grasp of what is possible, can you post a few ideas of the sort of things you can achieve via SF scripting? I have a hazy notion about it being a custom macro writer or an efficient way to deploy the SF engine without opening the app ... but really I'm not sure. Anyone care to give a few pointers on what it is all about and suggest a few script ideas to illustrate? Message last edited on5/21/2005 9:48:03 PM bymokomo. |
Subject:RE: Idea list for useful scripts
Reply by: _TJ
Date:5/22/2005 5:57:14 PM
Obviously, you can open files, run effects on all or part of them or save them. and save them to one or more formats. The Batch Converter in Sound Forge 8.0 is basically a pre-compiled script. (In fact, the source is available in the scripting SDK). There is definitely room for specialized batch converters that make use of knowedge about your work environment to cut down on the amount of questions that the user has to be asked. (say, for instance that you always want to process all of the files in a given folder, or process .MP3 files differently than .WMV files). You can create, delete and modify markers & regions. So you could write scripts that used certain markers to control the flow the script. You can mix or cut and paste audio, apply fades or analyze audio. Using the .NET runtime, you can create dialog boxes and other user interface elements of extreme complexity. You could create Wizards to walk the users through a complex process and automate many of the steps. The .NET runtime also can read and write text files or talk to web sites and parse HTML or XML that is returned. It can start other applications and (depending on how they are written) talk to them. Or if you have processes that you do all the time (say, DC offset and normalize), you can write a simple script to do that and put it on the toolbar. I often end up needing to separately normalize left and right channels of a stereo file because one channel was recorded 6 db below the other. You can control undos by script. So you could have your dual-stereo-normalize look like a single undo step when it is done. You can read an modify properties of the file, such as Artist, Album, or sample rate. But probably the richest set of possibilities, is that you can make decisions based on properties of the file. So, you could scan a bunch of files looking for ones where the Summary info was incomplete. (i.e. make a list of files no Genre specified, or update the copyright info, but only for files that already have your copyright). Or rename files so that their sample rate is included in their filename. To learn techniques like creating folders and showing dialog boxes (called Forms in .NET), you need to learn the .NET 1.1 class libraries. To quickly come up to speed on what is scriptable in Sound Forge. I recommend that you look first at the IScriptableApp and ISfFileHost interfaces. And, of course. Look at all of the sample code. There are quite a few small scripts under the "Unit Tests" folder that demonstrate how to use one single feature of the Sound Forge script API. tj Message last edited on5/22/2005 6:00:55 PM by_TJ. |
Subject:RE: Idea list for useful scripts
Reply by: mokomo
Date:5/23/2005 1:42:12 AM
Thanks a lot TJ. Exactly the kind of info I was looking for! |
Subject:RE: Idea list for useful scripts
Reply by: Ghent
Date:7/21/2005 10:06:33 AM
Scripting saves me a LOT of time. Here is what I do with it (Special thanks to SonyTJ - Great help!). After transfering my digital recordings to my computer. I open up the file, trim it, then I run the script I wrote and Vula! I'm done! It's the greatest. Sometimes I open as many as 4 45minute files and have them all working at the same time (well, technically the latter files will get cued). Now I have time for that needed nap :) What would it take me before the scripting world! Woho! It was quite a job. After trimming the files, I would have to find much the left and right channels had been de-synced (due to recording equipment). Then I would have to sync them, then I would run a set of processes to eliminate extra noise (This includes running three processes), Then I would convert it to a mono file (it's a just speech). THEN I would run an extra filter or two to make it sound better (EQ Filter, etc) THEN I would save it in two differenent file formats (which is were I would make a lot of mistakes because I had to first select MP3, "No not 128Kbits encoding.") Then I would save it as WMA9. I'd often hit the WMA8 encoder - or the MUSIC encoder - "NO, not 64kbits Stereo!" All in all it took me a long time because the sound file is quite long. Sometimes I would forget to run a filter and would end up doing the whole file again. (Or I found I selected the wrong MP3 bitrate a week later.) After scripting, not only was is way faster, but it didn't make mistakes. It also help me get all my sound files consistant. (A real problem for me lately. Usally one would sound louder than the other, or one had the EQ filter, but the other one didn't). So now I just open the file, trim out the part I don't want and "Push the Button!" It runs all my filters (which takes a while, and, before scripting, I had to stay and wait for each one to finish so I could start the next one. If I walked away I would forget which one I was on). After running all the filters it automaticly saves them in both WMA9 and MP3 with the right setting - everytime. It's great! Check out the files at http://www.gracebaptist.ws/ (Note: only the newer 2005 files are made with SoundForge 8 scripting). Scripting is more than just weird words like C#. It's a portal to infinity. Virtually anything you can think of can be scripted. Want to embed your stations call letters in morse code every half hour to ensure FCC complience? Done! Message last edited on7/21/2005 10:11:40 AM byGhent. |