WaveLab scripting questions

What’s the correct way to de-select any current selection? Can I use this:

activeWave.select(0,0)

(editted to correct title)

no,

select(0, -1)

And to select the entire wave, is this the best way:

activeWave.select(0,activeWave.size())

Yes

Apologies if this is turning into a scripting tutorial … but is there any way to specify to use the factory presets for a function? For example, this fails unless I first load the factory preset and save it in my own profile:

activeWave.normalize("EBU R-128 Recommendation")

Indeed, the user preset location is searched, not the factory preset location. Maybe something to improve.

No, in fact there is a solution, do this:

activeWave.normalize("%factory%/EBU R-128 Recommendation")

Excellent – thank you!

so secret code. is there a place to get some info on scripting.for the scriptingly challenged :blush:

All the info is on the documenation. If something is not clear, ask here…

I have looked everywhere for DEFINITIONS on Scripting. The documentation gives EXAMPLES but does not DEFINE what each number represents in the script. For example… right now I’m trying to figure out what each NUMBER represents in the following command:

activeWave.select(0, 10 * activeWave.sampleRate());

What does the “0” represent? I have changed it and experimented, and it doesn’t seem to do anything. The result is always the same.

I’m trying to automatically select 30 seconds INTO a wave to start, and then the next 30 seconds. I thought it would be 30,30 but it still is selecting the BEGINNING of the SONG.

Can someone please explain!??

This is my complete code to make a 30 second sound clip. I thought it would start 30 seconds in and select the next 30 seconds… so starting at 30 seconds to 60 seconds into the song. Then save that bit only, cutting off the beginning and the ending. then do the fade in and fade out. But it still is ending up to be the FIRST 30 seconds of the song… 0 - 30 seconds. What am I doing wrong? Here’s my code:

activeWave.select(30, 30 * activeWave.sampleRate());
activeWave.trim();
activeWave.select(0,2*activeWave.sampleRate());
activeWave.fadeIn(linear);
activeWave.select(activeWave.size() - (2 * activeWave.sampleRate()), activeWave.size());
activeWave.fadeOut(linear);

The value represent a number of samples.
Hence if you want to specify X second, then you have to specify (X * activeWave.sampleRate())
Hence if you want to specify X millisecondd, then you have to specify ((X * activeWave.sampleRate()) / 1000)

Awesome! I can’t believe I didn’t realize that I had to do it again for the 1st number. LOL

Three more questions:
A) Is there a command that would trigger an “OPEN” to open a file, or even multiple files in the same folder?
B) Is there a command that would then trigger a “SAVE AS” command to automatically bring up the save window for me to type a name into?
C) Is there a command that would trigger “SAVE” instead, if I want to keep the name the same, but automatically save it?

Thanks for your help! I truly appreciate it, as I have HUNDREDS of files to edit to small sound clips.

Doug :slight_smile:

I must say WaveLab 8.x is old for me, and I can only comment on WaveLab 9.5
In WaveLab 9.5, there is a command to open a file by its name (certain also in 8)
There is no save/save-as command, but there is a “render” function that allows you to render the files anyway you like. This is new to WaveLab 9.5, hence not in 8.
WaveLab 9.5 has a better scripting documentation too.

Where, please? Currently mentioned here, but no actual documentation.

If you have WaveLab 9.5, you get the full doc from the WaveLab scripting window (help button).
copy here:
scripting_doc.zip (9.03 KB)
For the online help, hmm, I don’t find it. I will ask the concerned person. But this should be the same as above.

OK got it, thanks!
On Windows (ActiveX), since upgrading to 9.5, the COM Object WaveLabPro9_5.Application is not registered … is there a way to register this?

It’s now online here, thanks!

Perhaps I should start a scripting thread in the WL9 forum, or can this thread be moved?