Lua script transposition region

How to define a transposition of 3.8 semitones for example for a region in Lua? This is for a configuration script.

Is there really no one to answer this simple question?

Assuming you mean Audio regions (not MIDI synth): In Ardour pitch-changes (and time-stretch) are not a defined as property of a region.

The operation is not performed every time the region plays, but computed only once: A new file source is created (based on the original), and the region on the timeline is replaced with a region backed by that new file.

You can probably rip out all the analysis and other unrelated parts from the ardour/rubberband_swing.lua at master · Ardour/ardour · GitHub Lua script, and only call set_strech_and_pitch(1, 1.2454) to pitch up by 3.8 semitones when processing the audio.


To calculate the pitch ratio for 12 tone equal temperament: 2 ^ (semitones ÷ 12); here 2^(3.8/12) = 1.245449622…

Thanks!
My questions are related to a script that I would like to make to import all the audio parameters of the objects created in my kandiskyscore application.

It works for Reaper, but seems nearly impossible for Ardour. It’s very unfortunate

in a script

local ar = region:to_audioregion ()
local rb = ARDOUR.LuaAPI.Rubberband (ar, false)
rb:set_strech_and_pitch (1, 1.2454)

I get:

attempt to call a nil value (field ‘Rubberband’)

la varibale region est bien définie.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.