Page 1 of 2

WaveLab scripting questions

Posted: Fri Aug 30, 2013 11:16 pm
by MrSoundman
What's the correct way to de-select any current selection? Can I use this:

Code: Select all

activeWave.select(0,0)
(editted to correct title)

Re: WaveLab scripting question

Posted: Sat Aug 31, 2013 6:13 am
by PG
no,

Code: Select all

select(0, -1)

Re: WaveLab scripting question

Posted: Sat Aug 31, 2013 9:50 am
by MrSoundman
And to select the entire wave, is this the best way:

Code: Select all

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

Re: WaveLab scripting questions

Posted: Sat Aug 31, 2013 11:15 am
by PG
Yes

Re: WaveLab scripting questions

Posted: Sat Aug 31, 2013 9:15 pm
by MrSoundman
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:

Code: Select all

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

Re: WaveLab scripting questions

Posted: Sat Aug 31, 2013 10:08 pm
by PG
Indeed, the user preset location is searched, not the factory preset location. Maybe something to improve.

Re: WaveLab scripting questions

Posted: Sat Aug 31, 2013 10:30 pm
by PG
No, in fact there is a solution, do this:

Code: Select all

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

Re: WaveLab scripting questions

Posted: Sun Sep 01, 2013 10:15 pm
by MrSoundman
Excellent -- thank you!

Re: WaveLab scripting questions

Posted: Wed Sep 04, 2013 12:03 am
by theoldman
so secret code. is there a place to get some info on scripting.for the scriptingly challenged :oops:

Re: WaveLab scripting questions

Posted: Wed Sep 04, 2013 6:28 am
by PG
All the info is on the documenation. If something is not clear, ask here...

Re: WaveLab scripting questions

Posted: Wed Oct 25, 2017 12:47 am
by orchiddoug
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!??

Re: WaveLab scripting questions

Posted: Wed Oct 25, 2017 12:53 am
by orchiddoug
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);

Re: WaveLab scripting questions

Posted: Wed Oct 25, 2017 9:05 am
by PG
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)

Re: WaveLab scripting questions

Posted: Mon Oct 30, 2017 9:55 pm
by orchiddoug
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 :)

Re: WaveLab scripting questions

Posted: Mon Oct 30, 2017 11:17 pm
by PG
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.

Re: WaveLab scripting questions

Posted: Tue Oct 31, 2017 11:48 am
by MrSoundman
PG wrote:
Mon Oct 30, 2017 11:17 pm
WaveLab 9.5 has a better scripting documentation too.
Where, please? Currently mentioned here, but no actual documentation.

Re: WaveLab scripting questions

Posted: Tue Oct 31, 2017 12:45 pm
by PG
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 KiB) Downloaded 209 times
For the online help, hmm, I don't find it. I will ask the concerned person. But this should be the same as above.

Re: WaveLab scripting questions

Posted: Tue Oct 31, 2017 10:41 pm
by MrSoundman
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?

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 1:53 am
by MrSoundman
PG wrote:
Tue Oct 31, 2017 12:45 pm
If you have WaveLab 9.5, you get the full doc from the WaveLab scripting window (help button).
copy here: scripting_doc.zip
For the online help, hmm, I don't find it. I will ask the concerned person. But this should be the same as above.
It's now online here, thanks!

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 1:54 am
by MrSoundman
MrSoundman wrote:
Tue Oct 31, 2017 10:41 pm
On Windows (ActiveX), since upgrading to 9.5, the COM Object WaveLabPro9_5.Application is not registered .... is there a way to register this?
Perhaps I should start a scripting thread in the WL9 forum, or can this thread be moved?

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 8:08 am
by PG
On Windows (ActiveX), since upgrading to 9.5, the COM Object WaveLabPro9_5.Application is not registered .... is there a way to register this?
I am currently looking at this, and there seems to be a registration issue.
I am not a specialist of ActiveX, but maybe you can make use of the tlb file:
C:\Program Files\Steinberg\WaveLab Pro 9.5\Tools\Windows Scripting\WaveLab.tlb

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 9:15 am
by PG
Actually, it works when installing... but you have to run the script from a 64 bit application (like File Explorer, and unlike the file manager I was using).

If you need to register again, you can run this small .bat file:

Code: Select all

cd /d "C:\Program Files\Steinberg\WaveLab Pro 9.5"
"C:\Program Files\Steinberg\WaveLab Pro 9.5\WaveLabPro9_5.exe" /regserver

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 11:59 am
by misohoza
Great thread.

Not a lot of info about Wavelab scripting out there.

May I ask one question?
I've noticed you can use firstClip() and nextClip() to cycle through all clips in the montage. Is something similar possible in wave editor? So you could use the loop to run the script on all open files in a File group.

There is a openWave() which can be used for this but as I understand it needs a full path as argument.

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 12:38 pm
by PG
I've noticed you can use firstClip() and nextClip() to cycle through all clips in the montage. Is something similar possible in wave editor? So you could use the loop to run the script on all open files in a File group.
Not possible. But why not adding it, if you argument me a good use case.

Re: WaveLab scripting questions

Posted: Thu Nov 02, 2017 2:40 pm
by misohoza
Scripting is supposed to help with repetitive tasks. If you could avoid selecting next audio file open in the editor and running the same script again, it would speed up the workflow even more. Like batch processing with a script.

Thinking about some real life use cases, a lot is already possible with batch processor (trimming, normalising, dc offset,...), but certain things like adding markers, processing a specific range, is not.