Writing Macros....

Discussion about: tracktion.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi all,

Is there anything out there documenting the methods available within the scripting language for various Waveform actions? For example, I'm trying to write a simple macro that will do the following on an audio clip after I set the in and out markers.

Split the clip at the in and out points
Select the newly created clip between the in and out points
Decrease the gain of the selected clip by 6dB
Back up (just a few bars or seconds or to the previous clip) and play

This is a macro I would use to decrease breath noise (without totally eliminating it) in a bunch of dialogue.

However, I can't find actions that will allow some of this. For example, In the properties panel I can choose to Split Clips at the mark in or mark out point, but there is no equivalent key command or macro action nor does there appear to be a way to move the cursor to the in or out marker (so that I could split the clip). I see nothing to available for changing gain. However, obviously this is possible....and there are actions for changing pitch).

So is there any documentation of pre-built methods, calls, etc., that do these types of things, or anything else that might help a very very rusty javascript programmer begin to try to sort this out?

TIA

George

PS

Is there a macro exchange out there somewhere?
iMacPro 1,1 | 64gb | OSX 10.15.7
http://www.gesslr.com
http://www.storyaudio.com

Post

There was a long thread in 2015 not long after the macro option became available. It might help.

viewtopic.php?f=22&t=441475&hilit=macro
[W10-64, T5/6/7/W8/9/10/11/12/13, 32(to W8)&64 all, Spike],[W7-32, T5/6/7/W8, Gina16] everything underused.

Post

Hmm, this isn't actually possible yet as there's no way to select the newly split clip. You can get most of the way there unfortunately...

Code: Select all

// Stop playback and get the position of the in and out markers
Tracktion.stopPlayback();
var in = Tracktion.getPosition ('markIn');
var out = Tracktion.getPosition ('markOut');

// Split clips at the markers
Tracktion.setPosition ('transport', out);
Tracktion.splitClips();
Tracktion.setPosition ('transport', in);
Tracktion.splitClips();

// Need something here to select the new clips...

// Reduce gain to -6dB
var clips = Tracktion.getSelectedEditElements ('clip');

for (var i = 0; i < clips.length; ++i)
    clips[i].setProperty ('gain', -6.0);

// Back up and play
Tracktion.setPosition ('transport', in - 2.0);
Tracktion.startPlayback();
I'll add some selection methods to the macros FR list and see if I have time to add something...

Post

dRowAudio wrote:Hmm, this isn't actually possible yet as there's no way to select the newly split clip. You can get most of the way there unfortunately...

Code: Select all

// Stop playback and get the position of the in and out markers
Tracktion.stopPlayback();
var in = Tracktion.getPosition ('markIn');
var out = Tracktion.getPosition ('markOut');

// Split clips at the markers
Tracktion.setPosition ('transport', out);
Tracktion.splitClips();
Tracktion.setPosition ('transport', in);
Tracktion.splitClips();

// Need something here to select the new clips...

// Reduce gain to -6dB
var clips = Tracktion.getSelectedEditElements ('clip');

for (var i = 0; i < clips.length; ++i)
    clips[i].setProperty ('gain', -6.0);

// Back up and play
Tracktion.setPosition ('transport', in - 2.0);
Tracktion.startPlayback();
I'll add some selection methods to the macros FR list and see if I have time to add something...
Thanks a million Dave!

I'm going through the thread that jabe provided and picking up some good tips. I'll post other questions there over the next couple of days.

Thanks again.
iMacPro 1,1 | 64gb | OSX 10.15.7
http://www.gesslr.com
http://www.storyaudio.com

Post

Any hope yet of some sort of user interaction within macros? Text boxes, query boxes, cues to select a thing, pauses?
my other modular synth is a bugbrand

Post

Here is where I will be posting updates on new things I find...

http://www.kvraudio.com/forum/viewtopic ... 2&t=500416
iMacPro 1,1 | 64gb | OSX 10.15.7
http://www.gesslr.com
http://www.storyaudio.com

Post Reply

Return to “Tracktion”