I am new to Cantabile, just a few weeks of experimenting in my spare time, and new to trying to make my own VST! I came across a way to make a VST with lua, it is called protoplug.
I downloaded the 64bit release for windows protoplug-1.4.0-win64.zip (I use Windows 11) and installed it and tried several of the examples inside of Cantabile, and it works!
Website: OSAR :: protoplug
“Protoplug is a VST/AU plugin that lets you load and edit lua scripts as audio effects and instruments. The scripts can process audio and MIDI, display their own interface, and use external libraries.”
There are a number of examples written in lua and the top layers of protoplug are written in lua, so, if you want to you can dig down and discover how it works.
Protoplug uses the ‘just in time’ implementation of lua (luajit), so it is very fast.
The protoplug website claims that it is fast enough to process sample data in real time.
I tried this, loading & playing samples, panning left/right in lua. To my ears it seems to work, but I did not write any timing code to prove that it work, still just experimenting.
I wrote a VST in lua, that inside of Cantabile, receives MIDI events, and for each noteON, treats the note as a root and plays a chord. I will attach it here if I can.