<div dir="ltr">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 another group? <div><div><br></div><div>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. <br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 18, 2016 at 3:12 PM, Robin Gareus <span dir="ltr"><<a href="mailto:robin@gareus.org" target="_blank">robin@gareus.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/18/2016 08:02 PM, Nathan Stewart wrote:<br>
> I took a look at the _vamp_audio_to_midi lua script, and had some questions:<br>
><br>
> 1) We don't currently have bindings for creating midi regions (or audio?) I<br>
> can't bind the constructor, but what should be exported?<br>
<br>
</span>Since the objects need C++ lifetime, they cannot be directly constructed<br>
from a script.<br>
<br>
Effectively  RegionFactory::create() needs to be exposed, but it's<br>
probably better to abstract that and create a dedicated method for Lua<br>
which hides some details (PropertyList), like<br>
MidiTimeAxisView::add_region() does for the Ardour GUI.<br>
<br>
add<br>
boost::shared_ptr<MidiRegion> ARDOUR::LuaAPI::create_midi_<wbr>region(...)<br>
to libs/ardour/lua_api.cc<br>
<span class=""><br>
<br>
> 2) The function expects one audio region and one midi region. We currently<br>
> can't select dissimilar types - so you can't for instance select an audio<br>
> region and a MIDI track.<br>
<br>
</span>Indeed, the current Audio-to-MIDI script is just an example and proof of<br>
concept.<br>
<span class=""><br>
> That would be one way to select the desired audio<br>
> region, and provide a destination for the MIDI region created.  If we<br>
> select an audio track (so that we can select the MIDI track for the<br>
> destination), we don't have a way to restrict the conversion to specific<br>
> regions.  Given the two current options, I think selecting regions and<br>
> creating a new track for them to go to would be the most desirable solution.<br>
<br>
</span>Yes, creating new MIDI tracks is likely the most usable option. I'd keep<br>
region/track mapping intact though.<br>
<br>
e.g select 3 audio-regions on audio-track1, 2 audio-egions on<br>
audio-track2   -> create 2 new midi tracks  (not 5).<br>
<br>
One downside: Undo is not possible (since track creation cannot be undone).<br>
<span class=""><br>
> 3) If we expect the output region to exist, it's currently<br>
> difficult to (impossible? I haven't yet figured out how, seeing indications<br>
> you can't) create an empty region in a MIDI track with no content.<br>
><br>
<br>
</span>press "D" (draw mode), then draw a region onto the midi-track.<br>
see  20sec into <a href="https://vimeo.com/186035015" rel="noreferrer" target="_blank">https://vimeo.com/186035015</a><br>
<br>
ciao,<br>
robin<br>
______________________________<wbr>_________________<br>
ardour-dev mailing list<br>
<a href="mailto:ardour-dev@lists.ardour.org">ardour-dev@lists.ardour.org</a><br>
<a href="http://lists.ardour.org/listinfo.cgi/ardour-dev-ardour.org" rel="noreferrer" target="_blank">http://lists.ardour.org/<wbr>listinfo.cgi/ardour-dev-<wbr>ardour.org</a><br>
</blockquote></div><br></div>