Macro / Quick Action question

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

Post

I'm new to tracktion and trying to get my head around macro programming.
I wonder, if there is a way to pitch a selection of audio clips by a linear increasing amount.
So, for example, i have 12 clips selected and i want a linear pitch progress from 1 - 12 semitones, so that the first selected clip will be pitched up by one semitone, the next one by 2 semitones, and so on...
I thought something like this could work...

Code: Select all

var clips = Tracktion.getSelectedEditElements ('clip');
var stepsize = 12 / clips.length;
for (var i = 0; i < clips.length; ++i)
{
    clips[i].changePitchSemitones(stepsize * i+1);  // <- not working!
}
... but I would need to use `Tracktion.changePitchSemitones(stepsize * i+1)` ... so how can I assign the pitch action to an element in the for loop?

Post

I haven't done much with scripts, but what exactly is clips.length? Length of the array, or length of the clip? Is stepsize an integer? How many tracks are you testing on?
Waveform 13; Win10 desktop/8 Gig; Win11 Laptop; MPK261; VFX+disfunctional ESQ-1

Post Reply

Return to “Tracktion”