"Scraping" over tracks

It’s not, it’s a separate issue.

You might find some info on this forum, otherwise the scripting manual is the best place to find the current methods. Also the IRC channel is active.

Did you make any progress? @x42 Any idea why he’s getting the error about Session being a nil value? Also any change of getting line number in the Lua editor?

No. I posted an updated script (which works here, see below) and they still produced that error.

The error message LuaException: [string "ardour {..."]:18: attempt to index a nil value (global 'Session') however indicates that the script header is not properly terminated. The whole script is placed into the ardour {} table, likely due to a missing curly brace. Copy/paste issue.

There are no plans, just use your favorite external editor.

ardour {
	["type"]    = "EditorAction",
	name        = "add loop start",
	license     = "MIT",
	author      = "David Healey",
	description = [[Insert loop start location marker]]
}

function factory () return function ()

		function round(n)
			return math.floor (n + 0.5)
		end

		--Main
		local sel = Editor:get_selection ()
		local rl  = sel.regions:regionlist ()
		local sr  = Session:nominal_sample_rate ()
		local pos = Temporal.timepos_t (Session:transport_sample ())

		for r in rl:iter() do
			if r:position () <= pos and r:position () + r:length () > pos then
				Editor:add_location_mark (pos)
				local mark = Session:locations():mark_at(pos, Temporal.timecnt_t(sr / 100))
				mark:set_name (1 .. " LOOP START-" .. round((pos:distance(r:position())):samples()))
				mark:lock ()
				break
			end
		end
	end
end
1 Like

Occam’s razor strikes again!

Hi, back to Melissa… :slightly_smiling_face:

Has anyone got a working binary or package? Unfortunately I know very little about Projucer nor have I ever had luck with it in the past…

Is any of this stuff getting forked or at least committed to the git repo to fix the Linux builds?

At the very least could the Linux compile instructions be written down in sequence?

Here’s the binary I compiled on Debian Testing - https://filedn.eu/larUQgXOwVjQdvpPaD96lHH/Melissa

1 Like

Thanks for your generosity!

Unfortunately I’m Debian 11 currently and I don’t seem to have libtensorflow nor is it in the Repos:

./Melissa: error while loading shared libraries: libtensorflow.so.2: cannot open shared object file: No such file or directory

Is that an external dependency you had to install manually?

Yes, see this post - no Fonts · Issue #23 · mosynthkey/Melissa · GitHub

Ah I see,

I used to chase this kind of stuff well into the wee hours but I don’t any more and I don’t have time currently even if I were intrigued enough… Looks like a really cool app though, at least if it is known to compile on Linux maybe somebody will fill in the blanks and do a git PR so the authors can at least commit all the work you and the other poster did… Thanks for doing that and sharing the binary!

DHealey, thanks for getting back to me. As x42 already replied, he was kind enough to have a chat with me and provided an updated script, which unfortunately produced the same error, both on v7.5 and v8.

I will test it on my PC in the next couple of days to see if it will behave differently to my notebook and will let you know.

It is indeed an odd issue and I have no explanation for it…

Hi DHealey. Found the time to do the tests on my PCs as promised. So this script now has been tested on an:

Intel CPU Notebook running Ubuntu,
Intel CPU PC running Ubuntu and
AMD CPU PC running Ubuntu Studio

To make sure, It’s not a PEBKAC, here’s all the steps I went through:

Installed today downloaded v8.2.0 from the official website.
Didn’t install optional “Harrison XT” and ACE GUIs" plugins.
Ignored “frequency scaling” warning.
Copied lua script to “/opt/Ardour-8.2.0-demo/share/scripts”.
Started Ardour as user and didn’t copy config files from Ardour v7 installation.
Created new session.
Added and activated an audio track.
Imported a flac file.

Now to the lua part:
Opened Edit/Lua Scripts/Script Manager.
Selected Action Scripts/Action 3 and added add_loop_start
Selected Edit in the Script Manager and hit the Run button
Received:
LuaException: [string "ardour {..."]:18: attempt to index a nil value (global 'Session')

The call button doesn’t seem to do anything either.

As I already mentioned, I can live without the surely helpful script. But if this issue is of interest for you and x42, I’m happy to do further testing. Just let me know.

Try a different script, because we know that one won’t work anyway because of the timing system. Use one of the scripts from the A7 folder.

Also does it make a difference if you put the script in ~/.config/ardour8/scripts? That’s where I put mine.

I found the reason! It’s not enough to select the track. You actually have to activate the region, to set a loop marker.

Your script is working with x42’s changed line

local pos = Temporal.timepos_t (Session:transport_sample ())

The only thing now is, that it doesn’t add a mark in the Loop/Punch Ranges ruler, but location markers. So it’s actually behaving like hitting the tab button. Any chance to set the marker in the correct ruler?

Oh yeah this is because I created it for a specific purpose. I’m editing samples for a sample library and have to add loop points to each region, 1000s of them sometimes. So I add them as markers, then I have a command line tool I run over the Ardour session that reads the markers and embeds them as meta-data within the exported audio files ready to be imported into my sampler.

Or at least that was the process I was using. Now I don’t bother adding the loops in Ardour and do it directly in the sampler, which explains why I haven’t updated this script and why I forgot what it does :slight_smile:

Mystery solved :grinning:

Any chance you could make these markers be added to the loop/punch ruler, instead of the location ruler? I already looked in the class reference, but can’t find any add_loop_mark function.

I can’t see it either, but I’m not sure you need it. You know there is a key command ] to loop the current selection?

The problem I had was you can only have 1 set of loop markers in Ardour, but I needed to add many sets of loop markers.

Yes, I’m aware of the key command, but thanks.

I do have a similar problem then you had. I add a couple of location markers to different parts of a song, eg. a solo. Ardour offers three different ways to set a loop from these location markers, which all are quite inconvenient (Creating a range from location marker, then create a loop from it, etc.). What I am looking/hoping for is a simple one click solution, like a right click on one of the location markers, drop down field with the option “Create loop to next location marker”.

But don’t bother. Ardour probably has a different focus and there are enough alternatives out there which I could use. It’s just that it would be nice to have all the functionalities in my tool of choice.

Looking at the two old Ozzy songs on my screen while my Marshall is warming up, I see them both synched to the time line (one is at 136 BPM the other at 86), tempo changes set, I moved them along the time line until the measures in the songs matched those in the visual timeline (easy going due to the audibe count-in after the intro in Mr.Crowley).
Setting the loop regions to the parts I’m interested in is a piece of cake now, because solos tend to start on uneven bars and end an even number of bars later. (If you know the song well enough you’ll find the position of the solo by just looking at the waveform.) With a setup like that you’ll also have easy going adding a few measures before or after the solo, so you’re not losing your nerves and fingers when playing a few loops subsequently. :wink:

Thanks Tom. That’s pretty much my workflow as well.

What I find inconvenient, is that after I set my location markers, I have to create range markers from them, then create a loop between the range markers to finally do the loop.

A simple right click, create loop range to next location marker would be very nice.

But as I already mentioned, I stole enough time from people and if this feature is not included in Ardour, it’s probably not relevant for the professional users. I’m still happy, what Ardour has to offer and will keep using it.