[Ardour-Dev] lua bindings - midi region create
therealnathanstewart at gmail.com
Tue Oct 18 12:38:09 PDT 2016
I realize it's an example, but it's precisely what I'm wanting to
tackle. For now, draw will work to try the next step, but what about
prompting for an existing MIDI track? OTOH - creating a track might not be
bad. If you put the new track in a group, you could pair them, so new
operations wouldn't create new tracks. But that creates additional
questions - is it already in a group? Does it preclude it from being in
On that subject... what IS the correct way to get user input? In my looking
through cppcheck, I found some sscanf overflows that were in throwaway code
designed to create a temporary filename. I started to look, but grabbing
input from the user in a cross platform manner looked like a rabbit trail
and I wasn't sure where it started or ended.
On Tue, Oct 18, 2016 at 3:12 PM, Robin Gareus <robin at gareus.org> wrote:
> On 10/18/2016 08:02 PM, Nathan Stewart wrote:
> > I took a look at the _vamp_audio_to_midi lua script, and had some
> > 1) We don't currently have bindings for creating midi regions (or
> audio?) I
> > can't bind the constructor, but what should be exported?
> Since the objects need C++ lifetime, they cannot be directly constructed
> from a script.
> Effectively RegionFactory::create() needs to be exposed, but it's
> probably better to abstract that and create a dedicated method for Lua
> which hides some details (PropertyList), like
> MidiTimeAxisView::add_region() does for the Ardour GUI.
> boost::shared_ptr<MidiRegion> ARDOUR::LuaAPI::create_midi_region(...)
> to libs/ardour/lua_api.cc
> > 2) The function expects one audio region and one midi region. We
> > can't select dissimilar types - so you can't for instance select an audio
> > region and a MIDI track.
> Indeed, the current Audio-to-MIDI script is just an example and proof of
> > That would be one way to select the desired audio
> > region, and provide a destination for the MIDI region created. If we
> > select an audio track (so that we can select the MIDI track for the
> > destination), we don't have a way to restrict the conversion to specific
> > regions. Given the two current options, I think selecting regions and
> > creating a new track for them to go to would be the most desirable
> Yes, creating new MIDI tracks is likely the most usable option. I'd keep
> region/track mapping intact though.
> e.g select 3 audio-regions on audio-track1, 2 audio-egions on
> audio-track2 -> create 2 new midi tracks (not 5).
> One downside: Undo is not possible (since track creation cannot be undone).
> > 3) If we expect the output region to exist, it's currently
> > difficult to (impossible? I haven't yet figured out how, seeing
> > you can't) create an empty region in a MIDI track with no content.
> press "D" (draw mode), then draw a region onto the midi-track.
> see 20sec into https://vimeo.com/186035015
> ardour-dev mailing list
> ardour-dev at lists.ardour.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ardour-Dev