February 5th, 2011:
This script is no longer being maintained. Please use, help test, and extend [ Midi Convert ] instead.


Translates Renoise songs into MIDI format

Part of: The XRNS-PHP Project
Download: http://sourceforge.net/projects/xrns-php/
Developers: Marvin Tjon (Bantai), Dac Chartrand (Conner_Bw)


Renoise does not feature MIDI export. XRNS2MIDI fills in the gap.

Important: This PHP script is made for fun as a hobby, by people who don't get paid to do it. It is not officially supported by Renoise. If you find bugs, we encourage you to fix them and share your patches.

Screenshot showing XRNS2MIDI in action
Keep an eye on status messages in the console while XRNS2MIDI generates a MIDI file and two log files


XRNS2MIDI adds the frequently requested MIDI export functionality to Renoise. The generated MIDI file can be loaded into other sequencers for further production. Apparently, another use for the MIDI file is to fulfill the demand from a record label to provide such a file together with the music for remix purposes.

Feed the script an XRNS song module. If everything goes well, you will receive three files:

It is customary to dedicate each MIDI track to a single instrument. Renoise however does not enforce or promote such a workflow. Consequently, XRNS2MIDI spends considerable effort on grouping all notes and other events by instrument to get as close to the MIDI workflow as possible.

Renoise boasts several tracker effects such as retrigger, portamento, vibrato, arpeggiator, ghost notes, effect slides, some of which do not have a straightforward MIDI cousin. XRNS2MIDI aims to emulate those tracker effects as close as possible.


With the XRNS Script Frontend running the XRNS-PHP scripts is a breeze and usage speaks for itself.

If you are going the command-line way, usage is as follows:

         $ php -n xrns2midi.php /path/to/file1.xrns (/path/to/)file2.mid

Current progress

At this point XRNS2MIDI can generate MIDI files from XRNS songs on at least a basic level of accuracy. Notes and Note-offs seem to be placed correctly, event timing was reported to be tested successfully, notes are grouped by instrument and exported per track, reasonably complex songs are processed within a minute... the list goes on. Check out the changelog to see what features have been implemented.

On the other hand, there is also room for plenty improvement, feature-wise and stability-wise. The XRNS-PHP SourceForge Tracker lists Feature Requests and Bug Reports.

Implemented effect commands

Pattern Effect Commands

Volume Column Effects

Panning Column Effects



  1. Fixed: Renoise 2.5
  2. Fixed: Get correct BPM for Renoise 2 and up
  3. Updated PHP Midi Classes to version 1.75


  1. Fixed: F0 - "cut note after 0 ticks" command was ignored
  2. Added PHP Version checking and debugger detection, some cleanups and a lot of wasted time on failed attempts to implement AllNotesOff, the FF00 (Kill all notes and fx) command and the F100 (Stop Song) command.


This release has many bug-fixes related to tick-based timing, and volume and panning column effects, including but not limited to:

  1. Fixed: Missing BPM changes on LPB switch.
  2. Fixed: Wrong timestamp at line with tempo or speed change.
  3. Fixed: Wrongly executed tick-based effects.
  4. Delay Cut Trick now supported.
  5. Panning column effects Dx, Ex and Fx are now implemented.
  6. Note-offs can be used with Dx-command. Not tested with other effects.
  7. Enabled XRNS schema validation.


  1. Tick-based effects bug fixed: see [bb5]Satobox - Wrecked Ship.xrns fails to be converted.
  2. Added code for XRNS schema validation, currently bypassed for development.

Currently, tick-based effects are partly implemented for vol/pan column and not at all for the effect column.


  1. First steps towards tick-based effects.
  2. Basic support for retrigger and note delay in volume and panning columns. Combination of those tick-based effects is untested.

v0.17 First reasonably functional version

  1. In version 0.15, the initial tempo was accidentally removed from the array. Changed a bit of code and now it should work and maybe fixes (or breaks) some other stuff in the process.
  2. Each track name had the name of 1 instrument slot too far. Fixed this stupid bug now.
  3. LPB is now set in the parsing code. This has a two-fold benefit: it fixes another timing bug and there is a considerable speed up of 30 to 40%! Such an improvement makes me nervous. I can't believe it doesn't produce a whole new string of bugs. So keep testing and reporting.
  4. Since Send Tracks can also contain Speed and Tempo effects, those are now also parsed.

If you convert high speed XRNS songs and try to import the generated .mid in Renoise, remember that the Tempo Pattern Command can only get as high as 255. BotB - Syntherzuiper is at speed 3, 960 BPM. Similarly, Cubase goes only as high as 300 BPM. We can solve that by increasing the resolution (lower duration per tracker line) and adjusting the PPQN as needed.


  1. Again, hopefully improved event positioning when changing Speed, also fixes freezes.
  2. Logs are now spit out before freezing (most of time at least).
  3. When the script fails because of improper event ordering, it will exit with an uncaught exception. So remember to clear your temp dir once in while. Too lazy for it now, but I will catch the exception later to clean up temp stuff automatically.


  1. Improved event positioning when changing Speed, also fixes freezes.
  2. Higher performance with greedy array search method.
  3. More execution time info in the console


  1. Attempt to fix the LPB bug.
  2. Flipped the $globals array, so it's grouped by parameter rather than line number, which eventually should be faster. But overall the fix attempt made the script even slower plus I am not even sure it works completely. At least the endTrk events seem to be placed alright.

v0.11 First version by Marvin Tjon (Bantai), based on v0.03 by Dac Chartrand (Conner_Bw)

  1. Every Renoise Instrument gets its own midi track, named after the instrument
  2. Notes should be placed correctly
  3. Notes are cut by other notes by default (otherwise all notes would eventually be played at the same time)
  4. Volume in volume column (if note and instr number are provided)
  5. Tempo changes
  6. Speed changes
  7. Lines Per Beat
  8. Note-Offs
  9. The beginning of each Pattern is marked
  10. Pattern Loop in the Pattern Sequencer is marked
  11. Automatic note-offs at end of song for every playing note
  12. Preparations for sub-line commands such as retrigger and delay

Get XRNS-PHP at SourceForge.net. Fast, secure and Free Open Source software downloads