Summary

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.

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

Introduction

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:

MIDI: SONGNAME.mid

MidiXML: SONGNAME.mid.xml

MF2T: SONGNAME.mid.txt

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.

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

F0XX: Set BPM

F1XX: Set Speed (minus F100: Stop Song)

Volume Column Effects

00 - 7F: Set volume of note

Dx: Delay note for x ticks

Ex: Retrig note spaced by x ticks

Fx: Cut note after x ticks

Panning Column Effects

Dx: Delay note for x ticks

Ex: Retrig note spaced by x ticks

Fx: Cut note after x ticks

Changelog

v0.23

Fixed: Renoise 2.5

Fixed: Get correct BPM for Renoise 2 and up

Updated PHP Midi Classes to version 1.75

v0.22

Fixed: F0 - "cut note after 0 ticks" command was ignored

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.

v0.20

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

v0.19

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.

v0.18

First steps towards tick-based effects.

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

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.

Each track name had the name of 1 instrument slot too far. Fixed this stupid bug now.

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.

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.

v0.15

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.

v0.14

Improved event positioning when changing Speed, also fixes freezes.

Higher performance with greedy array search method.

More execution time info in the console

v0.12

Attempt to fix the LPB bug.

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)

Every Renoise Instrument gets its own midi track, named after the instrument

Notes should be placed correctly

Notes are cut by other notes by default (otherwise all notes would eventually be played at the same time)