Old 10-19-2019, 09:13 PM   #1
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 2,450
Default export selected MIDI items individually?

Is there an existing script that allows you to export all selected MIDI items (i.e. File -> Export Project MIDI) as separate files? It seems the only option is to consolidate all selected items in to one file. I couldn't find anything in ReaPack...

Is it possible to create such a script?
clepsydrae is offline   Reply With Quote
Old 10-20-2019, 02:17 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,057
Default

Convert active take MIDI to .mid file reference
It will record in project working directory (typically, /Audio).

Then Convert active take MIDI to in-project MIDI source data. It will not remove the previously created file.
X-Raym is offline   Reply With Quote
Old 10-20-2019, 08:41 AM   #3
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 2,450
Default

Thanks! -- unfortunately that doesn't work for me because it doesn't include the project tempo in the resulting file -- that's why I was hoping to automate the File -> Export Project MIDI dialog...

Any hope of that? I didn't find anything in the API docs that seemed usable...
clepsydrae is offline   Reply With Quote
Old 10-20-2019, 01:56 PM   #4
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,906
Default

Quote:
Originally Posted by clepsydrae View Post
Is there an existing script that allows you to export all selected MIDI items (i.e. File -> Export Project MIDI) as separate files? It seems the only option is to consolidate all selected items in to one file. I couldn't find anything in ReaPack...

Is it possible to create such a script?
Are your recording your free hand piano playing?
TonE is offline   Reply With Quote
Old 10-20-2019, 02:02 PM   #5
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 2,450
Default

I'm creating various midi items (mainly by hand in Reaper) and exporting them for use in a video where custom scripts (blender + animation nodes + script) will take the timing info and use it to manipulate animated notes. So I need the exported MIDI to include tempo information for the sake of accurate alignment with the audio/graphics/etc.
clepsydrae is offline   Reply With Quote
Old 10-20-2019, 05:48 PM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,057
Default

Quote:
that doesn't work for me because it doesn't include the project tempo

I think you have a valid feature request there !


Meanwhile, I think the "easiest" solution would be to alter this generated mid file to embed the project tempo. Via script of course.


Maybe there is simpler solution to alter the tempo of an existing midi file. This would allows to not do the file parsing from scripts which may be simpler to develop.



Another solution would be to generate all the midi file from a script without using native actions but it will surely be more complex.
X-Raym is offline   Reply With Quote
Old 10-20-2019, 07:11 PM   #7
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 2,450
Default

Thank you for the ideas! -- given the complexity, I probably wouldn't bother someone here with a script request since it sounds like it'd be somewhat specific to my application. But if anyone wants to implement something like what you describe, I'd certainly be grateful. :-)

Re: a FR, I think the non-inclusion of tempo is relatively intentional... see e.g. my recent thread here, where Schwa implies that it's not logical to include it, and though I know little about this all, it seems logical enough.

I can just do the specification of the bpm on the blender side in the scripts I have going there... it's just less flexible and requires more manual setting of stuff, but fortunately I'll probably be dealing with a single bpm most of the time.

I just thought maybe there was a hook to call the File -> Export Project MIDI via API but it sounds like there is not... ?
clepsydrae is offline   Reply With Quote
Old 10-21-2019, 03:50 AM   #8
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,057
Default

@clepsydrae
No hook-filter system in reaper API.


But what you can do is a script which would export your MIDi with regular action and export a txt file (one global for all selected items or one by item) containing the BPM (and path if all selected items is selected).
It would be like having an external metadata file.


Blender script could parse it and then parse your midi files.


This is simpler cause it doesnt requires to alter existing files at precise bit location and results is more easy to debug.
X-Raym is offline   Reply With Quote
Old 10-21-2019, 11:15 PM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,057
Default

An even way simpler way to add tempometadata to your files is to take advantage of Take Names.
Ust add a suffix with your tempo to all take before using the convert option and you will be done.
X-Raym is offline   Reply With Quote
Old 10-22-2019, 10:05 AM   #10
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 2,450
Default

Good thoughts, thanks.
clepsydrae is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.