Action to create Range

Hi team !

Haven’t been here for a while but there’s something I need help with …

When I was running 6.9, 7.x I had one of the buttons of my Mackie Control Surface configured to create a Range at the edit point (Very convenient when I want to split long recordings, like rehearsals).

I’m now running 8.10 and I cannot find the action to do that anymore !
There’s a whole bunch of actions related to ranges but I can’t seem to be able to find the one that is the equivalent of Right Clicking the Ranges ruler and selecting Add → Range

image

Any clue ?

Never mind :sweat_smile:
Exploring some backups of my 7.5 config, I figued it out … I had created a LUA Action to do that :sweat_smile:

Had forgotten about it :wink:

Could you share the Lua script you used? I’m trying to get my head around using Lua, and more examples would help. Maybe somebody who finds the topic later could use it more directly.

Well that’s a short one :slight_smile: see below.

Note that if you want inspiration regarding LUA, there are dozens of great examples in the Ardour’s code repo !

ardour {
	["type"]    = "EditorAction",
	name        = "Create Range at Playhead",
	license     = "MIT",
	author      = "Vincent Tassy",
	description = [[Creates a range at the playhead position]]
}

function factory () return function ()
	local playhead = Session:transport_sample ()
	local t = Temporal.timepos_t(playhead)
	Session:locations():add_range(t, t)
end end
1 Like