Skip to content

Conversation

@bjarkihall
Copy link

@bjarkihall bjarkihall commented Jan 2, 2026

Hi and thanks for your wonderful work, I was playing around with some scripts from you and was digging through some of the code to find some solutions to minor issues I had.
I hope it's okay for me to create this PR where I tried to split the fixes into separate commits with messages what the intention was. You're welcome to reject the PR if it's not what the project needs, I'm new to this repository and lua/Reaper scripting in general.

First one was MIDI/mpl_Export selected items as MIDI files into project path.lua where I noticed it loses the selection after executing the script, which doesn't play well with adding more actions to the selection (or to add to or remove from the selection).

I also noticed the Media Item length wasn't respected - this is debatable, since if we export only the existing MIDI events, the loop only spans those events, but I was creating drum loops and the .mid files didn't span the length of the media items (and the Action indicates the "media item" itself is being exported, which spans a longer time than the events).
The workaround is to always manually add some event (silent note or CC) to the end of the selection to ensure that the whole media item length is respected, but my commit does this out of the box - maybe a boolean makes more sense to toggle if auto-adding to the end of the media item is the wanted behavior?

I also tried to auto-name the files based on the media item's name and noticed special characters could cause issues (at least on Windows) so I added basic filename sanitation. Maybe there's a better way to do this?

Regarding RS5K Manager, I had a runtime error crashing the plugin whenever it loaded an "empty" file (0 Byte .wav files) from a Database. The error helped me find some folders in the database where I had indeed some empty files, but a runtime error didn't fully explain what was going on so I thought it would be better to just ignore empty files - I'm not 100% sure the commit fully fixes the issue but at least it highlights the problem.

Hope this is helpful to you or others using the plugin.
Please ask if something isn't clear and I'll try my best to give more insight.

Happy new year,
Bjarki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant