New Tool (0.1): Renoise Simple Midi File Support

Renoise Simple Midi File Support

General idea

Renoise has built-in support for midi files importing. It works by creating a new midi instrument and adds new dedicated tracks in existing patterns.

This plugin will reuse existing instrument and will only update existing tracks with notes from the file.

Current implementation

  • reads midi files with .xrmid extension,
  • prints notes and file information in Scripting Terminal.
  • adds midi note events (note, volume, delay) to selected pattern track.
  • adjusts number of pattern lines and visible note columns to match the midi file.

Capabilities and limitations

This is my first Renoise tool and first code in Lua. I am also new to the midi file format and midi events. The use case implemented here is very simple and might be limited to my specific need. It is not meant to be a replacement for the built-in midi files import nor a general purpose midi file to Renoise song converter.

It is not possible to override midi files import procedure so the midi files need to be renamed to have .xrmid extension. E.g. my-file.mid needs to be renamed to my-file.xrmid.

Currently, it only interprets note-on and note-off midi events. All notes will use currently selected instrument. On import, currently select track will be cleared and extended if needed. Only midi channel 1 will be read.

It will not work well for multi-instrument or percussion midi files.

Usage

Double click any .xrmid file in songs or instruments file browser. Currently selected track in currently selected pattern will be replaced with the notes from the file.

Feedback

This tool works well enough for the collection of midi files I have. I haven’t tested it enough on other midi files available on the internet, hence the version 0.1. Any suggestions on other use cases that it should support is much appreciated. Example midi files for testing are welcomed.

Credits

MIDI file import is done with MIDI.lua by Peter J Billam. It was released under MIT/X11 licence and has been included here without any changes in the code.

General plugin structure has been significantly inspired by Additional File Format Import Support code by Martin Bealby.

Thanks!

Licence

This tool is available on GitHub and is released under Apache License Version 2.0.

Download

8 Likes

Damn!!!

I’VE BEEN WAITING FOR SOMETHING LIKE THIS FOR YEAAAAAAARS;

YOU ARE A LEGEND!!

The whole renoise community says: thank you so much!

1 Like

Hi Rpnz.

You set the bar pretty high :slight_smile: I saw that this is a long-time missing feature. Dunno why. Anyway, this is like 1-2 days of codding so it is far from being perfect. I am beginning to test it on random midi files from sheet music websites and will fix the issues on a case by case basis.

Would you like to join my official design and testing team? :laughing: What kind of features it is missing? What does not work as expected? On what kind of files it fails? You know, two heads are better than one :grin:

Thanks!

1 Like

sure! i will join!

email me at roppenzo at gmail dot com

Awesome! We are two men army now :laughing:

Version 0.2

  • added an option to skip note volume information (Options - Include velocity = false).
  • fixed an issue with old notes cleanup when pattern was too short but had hidden notes in it (outside of pattern lines range).
  • fixed an issue with tool crashing on trying to add notes outside of the Renoise max 512 pattern lines length.
  • skipped setting note volume for midi notes with maximum velocity (127).
  • added note-off commands for first line of the track.

Batch file copy / rename

To create a copy of all .mid files in current (.) and all nested directories execute the following command:

find . -type f -name '*.mid' -print0 | xargs --null -I{} cp -v {} {}.xrmi

In a similar way, to rename all .mid files execute:

find . -type f -name '*.mid' -print0 | xargs --null -I{} mv -v {} {}.xrmi

Newly created files will be suffixed with .xrmi extension. E.g. my-file.mid will be copied or renamed to my-file.mid.xrmid.

It works in GNU/Linux environment and should work on macOS/OSX. On Windows use Total Commander’s built-in Multi-rename tool or anything else with a similar capability.

Updated readme

Download

1 Like

this should be a native behaviour ! @taktik adding new patterns is just silly.

.

1 Like

nice ! updates already!!

Based on @Roppenzo feedback:

Version 0.3

  • added a file browser that accepts both .mid and .xrmid files in Tools - Renoise Simple Midi File Support - Select file.
  • fixed an issue with tool crashing on trying to add more than 12 note columns.
  • set volume and delay columns as always visible.

Updated readme

Download

2 Likes

this is getting better and better and better!

Last update in this month.

Version 0.4

  • redesigned tools options flow for file loading and removed Select file button.
  • added submenus to Tools - Renoise Simple Midi File Support
    • Options - opens tool options.
    • Import midi file - opens file browser.
  • added Import midi file context menu for pattern track (right click).

Updated readme

Download

strange behaviour in windows explorer:

1
2

Thanks! I do not have a Windows box to test it. It worked fine in XFCE on Linux. I have fixed this by skipping the *.mid, *.xrmid file filter. All files will be visible by default. If the file being loaded is not *.mid or *.xrmid then a status message will be show and file will not be loaded. This will be release in v0.5.

I have also tested it on some drum kits and it works fine. Added some new options for fine tuning.

2 Likes

we have a new super script-hero-tool-maker on the forums! :sunglasses:

1 Like

When will be v0.5. released ? :slight_smile:

1 Like

Hi. The code was ready but I was busy with some other stuff. I don’t have many ideas on what else could we add to this tool. Maybe import to phrases instead of only to patterns depending on which screen you are currently on. What do you think?

Version 0.5

  • changed file browser to show all files instead of .mid and .xrmid to a fix an issue on Windows (thanks, Roppenzo).
  • improved the workflow for file browser to first select the file and then show Options dialog if Options - Show for each file is enabled.
  • added an option to skip note delay information (Options - Include delay = false).
  • added an option to skip note-off (OFF) events (Options - Include note-off = false).
  • added an option to correct note start or end position if delay is higher than FD (disabled by default) (Options - Correct positions = true).
  • added tooltips for options.
  • reviewed, corrected and updated readme.

Updated readme

Download

1 Like