Is it possible to trigger an action in the outer world whit an ardour action? I want, for instance, to run a python script when start recording audio in ardour.
I dont know if it works, and dont have Ardour at hand now but you may use a Lua script (embedded in Ardour). In Lua you can call:
You may use the Editor hook to bind the lua script to the Start record action.
Editor Hooks/Callbacks Menu → Edit → Scripted Actions → Manage
For more details see https://manual.ardour.org/lua-scripting/
And give a look here to get inspiration from pre-existing scripts : https://github.com/Ardour/ardour/tree/master/share/scripts
Hope it helps.
Can you be more specific as to what your imagined scenario is? Just in case there is another viable option, other than database-like triggering.
I am generating some sounds in my python script and want to record them. I want to let the script run multiple times , so I have to record it on multiple takes, but I want the recording to start exactly at the moment the python script starts running, so that I have a (semi-)perfect on the time-axis synced tracks. This is my concrete scenario.
Perhaps have a “trigger” sound (distinct) or something that starts the beginning of your script, like a snare hit, and then have the rest of the script start, say, 1000ms afterwards. Set that up to loop, and should be easy to let it run for a while, then go back in later and cut it up, using that distinct sound as the easily-identified starting point. Perhaps add another distinct sound to the end of your script. Think of a movie clapperboard.
In case you’re geeky and using Jack you could make your python script a Jack client that spits audio and monitors midi notes.
You could then directly connect Ardour to your script inputs/outputs (e.g. using Carla or maybe directly on Ardour).
The script would wait for a given midi note coming in to trigger the audio playback that Ardour would record directly.
You may get some insipration from these sample script over here : https://jackclient-python.readthedocs.io/en/0.5.0/examples.html