Steinberg WaveLab 7 Operation Manual
Here you can view all the pages of manual Steinberg WaveLab 7 Operation Manual. The Steinberg manuals for Music Production System are available online for free. You can easily download all the documents as PDF.
Page 81
4.9 Scripting 67 addMarker(type, name, comment) - Add a marker at the cursor position. Possible values for type are: ˆ generic ˆ temporary ˆ cdTrackStart ˆ cdTrackEnd ˆ cdTrackFrontier ˆ cdTrackIndex ˆ loopStart ˆ loopEnd ˆ muteStart ˆ muteEnd ˆ playbackStarter ˆ regionStart ˆ regionEnd ˆ errorStart ˆ errorEnd ˆ correctionStart ˆ correctionEnd Example: activeWave.addMarker(generic, "SomeName", "SomeComment"); findNextMarkerPosition(posStartSearch, type) - Searches for the next marker...
Page 82
68 WaveLab Concepts changeLevel(dbValue) - Changes the level of the selected audio range. fadeIn(shape) and fadeOut(shape) - Applies a fade on the selected audio range. shape can be one of the following: ˆ linear ˆ sinus ˆ squareRoot ˆ sinusoid ˆ log ˆ exp ˆ expp Example: activeWave.fadeIn(squareRoot); levelEnvelope(presetName) - Loads the envelope shape and applies its setting to an audio range. morph(presetName) - Loads an effect morphing preset and applies it according to its settings. invertPhase() -...
Page 83
4.9 Scripting 69 buf = activeWave.readSamples(0, 20, 100); // read 100 samples on left channel, fr om sample index 20 for (i = 0; i < 100; i++) { logWindow.printInfo(buf[i]); } Audio Montage Scripting Commands Functions Preliminary info: the Scripting API is an open project and will evolve according to user re- quests. size() - Returns the number of samples in the Audio Montage. sampleRate() - Returns the sample rate of the Audio Montage. numChannels() - Returns the number of output channels of the Audio...
Page 84
70 WaveLab Concepts ˆ regionEnd ˆ errorStart ˆ errorEnd ˆ correctionStart ˆ correctionEnd Example: activeWave.addMarker(generic, "SomeName", "SomeComment"); findNextMarkerPosition(posStartSearch, type) - Searches for the next marker oftype, from a given position. Returns the marker position, if any is found, or -1. insertMonoTrack(where) - Adds a Mono Audio Track at index 'where' insertStereoTrack(where) - Adds a Stereo Audio Track at index 'where' insertClip(iTrack,...
Page 85
4.9 Scripting 71 Related topics ECMAScript Reference 4.9.2 ECMAScript Reference WaveLab's scripting language is based on the ECMAScript scripting language, as defined in standard ECMA-262 Microsoft's JScript, Netscape's JavaScript and Adobe's Actionscript are also based on the ECMAScript standard. If you are not familiar with the ECMAScript language, there is a large amount of teaching and reference material available online. This reference page contains a list of all ECMAScript objects,...
Page 86
72 WaveLab Concepts Objects ˆ Object ˆ Function ˆ Array ˆ String ˆ Boolean ˆ Number ˆ Date ˆ RegExp ˆ Error Examples: //Test if a value is not a number var isNumber = isNaN("this is a string"); //Print the result in the log window logWindow.printInfo(isNumber); //Traces "true" because it is a String //Convert a string to a number var numStr = "2.345"; var num = parseFloat(numStr); //Print the result in the log window logWindow.printInfo(num); //Encode a string into an internet...
Page 87
4.9 Scripting 73 Functions ˆ toString() ˆ apply(thisArg, argArray) ˆ call(thisArg [, arg1 [, arg2, ...]]) Example: //Create a new custom marker Object function customMarker(name, comment, timeSecs) { this.name=name; this.comment=comment; this.timeSecs=timeSecs; } //Create a new instance of the custom marker var myMarker=new customMarker("A custom marker", "My custom marker comments",5); //Use prototype function to add a new property to it customMarker.prototype.samples = null;...
Page 88
74 WaveLab Concepts //Create an empty array var a = new Array(); //Add some items to it a.push("first array item"); a.push("next array item", "last array item"); //Print them out in the Log window logWindow.printInfo(a.toString()); //Call the Array's reverse function a.reverse(); //View the results in the Log window logWindow.printInfo(a.toString()); String Objects Functions ˆ toString() ˆ valueOf() ˆ charAt(pos) ˆ charCodeAt(pos) ˆ concat([string1 [, string2 [, ...]]]) ˆ...
Page 89
4.9 Scripting 75 Boolean objects Functions ˆ toString() ˆ valueOf() Example: //Test if an equation is true or false var isTrue = (1 + 1 == 3); //Convert the Boolean to a String and trace in the Log window logWindow.printInfo(isTrue.toString()); Number Objects Functions ˆ toString(radix) ˆ toLocaleString() ˆ toFixed(fractionDigits) ˆ toExponential(fractionDigits) ˆ toPrecision(precision) Example: //Convert a number into exponential notation var num = new Number(13.3714); //Show the result in the Log...
Page 90
76 WaveLab Concepts Functions ˆ abs(x) ˆ acos(x) ˆ asin(x) ˆ atan(x) ˆ atan2(y, x) ˆ ceil(x) ˆ cos(x) ˆ exp(x) ˆ floor(x) ˆ log(x) ˆ max([value1 [, value2 [, ...]]]) ˆ min([value1 [, value2 [, ...]]]) ˆ pow(x, y) ˆ random() ˆ round(x) ˆ sin(x) ˆ sqrt(x) ˆ tan(x) Examples: //Get a random number from 0 to 1 var r = Math.random(); //Print it out in the log window logWindow.printInfo(r); //Trace out Pi in the log window logWindow.printInfo(Math.PI); Date Objects Functions ˆ toString() ˆ toDateString() ˆ...