Drawing on a canvas with Lua Scripting

Is it possible with using LUA in Ardour , to open a window and draw on it ? Hopefully with canvas style commands like line, rectangle , circle, and point.

I looked in the bindings and did not see much graphics related.

There is no such capability.

Dang it. Any future for it ?

Thank you for the quick response.

@x42 would need to comment, but I don’t believe there are.

Ok. I was thinking along the lines of Guitar / Piano chords on a marker display to play along. Also a built in Circle of Fifths for reference.

We basically do not intend Lua to be used to create GUI components. There are some very limited things you can do, but nothing like you’re thinking of.

@x42 will correct me if I am wrong.

I have not entirely ruled out allowing custom Lua GUIs, but it’s currently not on any todo list. If we head down that direction Lua GUIs should have complete event-loop integration and support interaction (mouse, keyboard,…) or I/O in case of ctrl surfaces. Then there also needs to be a way to integrate scripts in existing menus or context menus, and in the latter case also provide context to the script.

Since Ardour is free/libre software we do not need Lua to allow someone to customize the GUI.

What you can however already do is, draw an inline mixer display, but that’s likely not helpful for your current idea.

1 Like

Does YTK / GTK2 or Cairo allow SVG to be displayed within a window in Ardour ?

There’s no API in Cairo itself to render an SVG path. There’s at least 1 3rd party library that can (rsvg IIRC) and there are also tools to convert an SVG into cairo calls.

I am thinking it would be better to procedural draw with cairo then. What would be the best example in the Ardour code to see how a graphic window is opened and draw on with cairo ?

I am unfamiliar with cairo, but it looks like it is well documented.

Interesting you brought up referencing the Circle of Fifths, one of the things I was going to implement in the help menu of LogicalArdour was a reference to a web page with the circle of fifths, something like this:

My concern with opening a webpage is that browsers use up a lot of CPU and memory if left open.

Otherwise, that is a nice feature! And that circle of fifths link is the best!

a work around:
If you are just doing pictures, why not download jpegs and put it in Snapshot plugins (windows only but works in yabridge)

Snapshot plugin which allows you to store a jpg in a vst in the track.

put it in channels or even template that does not pass any audio and loading the Snapshot Plugins with all the pics of my audio for that session. . deactivate the channel so it does not use resources.

I am not affiliated with anything to do with the maker of Snapshot, not compensated, and it is free.
https://non-lethal-applications.com/other-products

1 Like

If you want to do DSP with custom GUIs with a scripting language inside the DAW, you might want to have a look a JSFX (REAPER | JSFX Programming), a language supported natively by the REAPER DAW. But there is also a plugin called “ysfx”, which brings support for JSFX plugins to other DAWs.

Not all JSFX plugins run perfectly in original ysfx (GitHub - jpcima/ysfx: Hosting library for JSFX), but there is a fork of ysfx (which is unmaintained), which brings many improvements at GitHub - JoepVanlier/ysfx: Hosting library for JSFX. The maintainer of that fork also has a collection of many great JSFX plugins, from which to learn: GitHub - JoepVanlier/JSFX: A bundle of JSFX and scripts for reaper..