Xrenoise To Mid?

XRNS2MIDI groups everything by instrument.

Renoise note columns are purposely circumvented, otherwise the conversion makes no sense, where in every mainstream MIDI sequencer one “row” is one “instrument”.

As long as your drumkit is a single multi-timbral Renoise instrument, no matter what colunms you put the notes using Renoise, it will be grouped in one MIDI track using this conversion script.

That being said, please file a Feature request at sourceforge. The idea is a decent one.

Cheers!

I tested the CVS version and there is a big problem. The version in CVS takes very long on the lines:

$xml = MasterTrack::$midi->getXML();
MasterTrack::$midi->saveMidFile($mid_file);

…like, very very very long. I used Kaneel’s BB5 track as my test. I tried putting the references back on $len = _readVarLen($binStr, &$p); and it went faster by 80 seconds for Kaneel’s track. But still, not significant by any means.

As a side note, objects are now passed by reference by default in PHP5, but as far as I know &$p is not defunct, as $p in the context of the code is just a plain variable, and can be either a copy or a reference, depending on the use of &, so &$p is fine.

Anyway, I don’t understand how it could have gotten slower. Specifically since the parts of the code it is slow on are calling midi.class.php which has not really changed? I’m at a loss…

I didn’t think of the instrument-grouping, thanx for pointing that out. I added a request, hope you don’t mind it’s “anonymous”, I didn’t want to register just for that.

I deleted the files, and did a fresh check out, the problem persisted.

I upgraded MAMP/PHP and now the script won’t even finish running. It silently aborts after "Parsing pattern [33]: 33 … "

I will investigate on the weekend. It may be my computer.

Thanks.

Where can one download v0.20? I’m totally lost in that SourceForge jungle, but it’s so great to see this wonderful script advancing!

Until this is sorted out:

  • Download XRNS-SF from this thread.
  • start the file “get_cvs_dev_version_scripts.cmd” and it will download these from the SourceForge CVS.
  • Warning! These are work in progress and probably unstable, use at your own risk.

Ya,

I was using 5.2.0 up until this morning.

My MAMP upgrade was logging errors to a file instead of printing them to screen. Currently set to 8MB max memory which is why it was failing upon upgrade.

I hadn’t had time to check the script with proper adjustments, but will do so this weekend when time permits.

Thanks!

[dac514@iMac][~/code/xrns-php/scripts]
[17:34:11]$ php -v
PHP 5.2.3 (cli) (built: Jul 6 2007 13:31:51)
Copyright © 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright © 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright © 2003-2007, by Zend Technologies
with Zend Optimizer v3.2.8, Copyright © 1998-2007, by Zend Technologies

Total execution time: 15.371 seconds

Hence, the problem was PHP, not your script. Sorry for the false alarm.

What do you mean with this? Changes in the PHP code should be reflected with each new execution of the script and GUI changes in the .cfg file are visible as soon as you switch to another script in the GUI and then back to it.

When PHP is running in SAFE mode this will have no effect. Maybe you should explicitly set it to OFF, just to be sure it works with other PHP installations.

That’s really odd. The PHP interpreter exits after the script was run, so i don’t see how it could cache files? Also tried it here and it works as expected. Might be something with your installation.

this is one of the issues for which I’ve been always doubtful about the possibility to perform a good XRNS-with-no-VSTi to MIDI translation.

poly aftertouch seems the only way to me.

I’m getting the second version with no retrigs here too with your testfile.

  
[dac514@iMac][~/code/xrns-php/scripts]  
[10:15:07]$ php xrns2midi.php ~/Desktop/test/retrig.xrns ~/Desktop/test/output.midi  
  
Current PHP version: 5.2.6  
  
---------------------------------------  
XRNS2MIDI v0.22 is working...  
Sun Feb 1 10:15:33 EST 2009  
---------------------------------------  
  
Using temporary directory: /private/var/tmp  
Input: /Users/dac514/Desktop/test/retrig.xrns   
Output: /Users/dac514/Desktop/test/output.midi (+.xml, +.txt)  
  
XRNS Document Version: 7  
Warning: schemas/RenoiseSong7.xsd not found, skipping XML validation.  
Document has succesfully passed validation.  
  
 Parsing pattern [0]: 0 ...   
__Collected events from Song.xml in 9ms   
  
Commited global events in 1ms   
  
 Sending events for MidiTrack 0...  
 Sending events for MidiTrack 1...  
__Completed sending events to MIDI Class in 3ms   
  
Exported to MIDI file in 2ms  
  
Total execution time: 0.388 seconds  
  
---------------------------------------  
xrns2midi.php is done!  
Sun Feb 1 10:15:33 EST 2009  
---------------------------------------  
  
  
MFile 1 2 96  
MTrk  
0 Meta Marker "Pattern [0]: 0 "  
0 Tempo 468750  
1537 Meta TrkEnd  
TrkEnd  
MTrk  
0 Meta 0x20 0  
0 Meta TrkName "00: Unnamed"  
0 Meta InstrName "00: Unnamed"  
0 On ch=1 n=64 v=127  
1536 Off ch=1 n=64 v=0  
1537 Meta TrkEnd  
TrkEnd  
  

I’m using the latest version from CVS. No changes in my CPU since 2005.

I’m not sure if this script is still being maintained.

In any case, to generate something from Renoise 2.5 modules, this change can be made:

  
  
// ================================================================  
// PARSE SEQUENCE  
// ================================================================  
  
$seq = array();  
if ($sx->PatternSequence->SequenceEntries->SequenceEntry) {  
 // Renoise XSD, doc_version 21  
 for ($i = 0; $i < count($sx->PatternSequence->SequenceEntries->SequenceEntry); ++$i) {  
 for ($j = 0; $j < count($sx->PatternSequence->SequenceEntries->SequenceEntry[$i]->Pattern); ++$j) {  
 $seq[] = (int)$sx->PatternSequence->SequenceEntries->SequenceEntry[$i]->Pattern[$j];  
 }  
 }  
}  
else  
{  
 foreach ($sx->PatternSequence->PatternSequence->Pattern as $p)  
 {  
 $seq[] = (int)$p;  
 }  
}  
  

Now, whether or not this change generates something useful is another discussion? But, it’s better than the empty file I was getting before.

I did not commit this to SVN. I await some sort of peer review.

Alright, fux it, I committed to SVN.

  • Updated PHP Midi Classes to 175
  • The hack above has been committed
  • Some more hacks to get correct BPM from Renoise 2 modules also done.

Just what I needed. Thanks, Conner.

PHP Midi Classes 175 can be found here: http://dasdeck.com/staff/valentin/midi/downloads/

XRNS-PHP and XRNS-SF 1.08 have been released.

Changes:
Fixed the XRNS2MIDI and XRNS_MERGE scripts to work with Renoise 2.5, unmaintained scripts are now in a separate “deprecated” directory, minor optimizations and bug fixes.

Shift-reload, grab it here:
http://xrns-php.sourceforge.net/

Hi everybody,

i got a problem while trying to convert xrns to midi with renoise 2.5.1

here is the following error message :

Exception occured System.NullReferenceException: La référence d’objet n’est pas définie à une instance d’un objet.
à NRenoiseTools.SongIterator.Iterate(SongIteratorEvent it)
à NRenoiseTools.SongIterator.prepareTempoForSong()
à NRenoiseTools.SongIterator.get_Tempos()
à NRenoiseTools.Xrns2MidiApp.Xrns2Midi.RenoiseMidiSong…ctor(Song song)
à NRenoiseTools.Xrns2MidiApp.Xrns2Midi.ConvertFile(String xrnsFile, String midiFile, TextWriter log)

i’ve tried to turn off automation and/or delete all dsp but nothing works,

Thanks for your help !

Dam

You are using .NET/C# code. This thread is about the PHP version. They are two completely separate apps. Try with this instead:

http://xrns-php.sourceforge.net/xrns2midi.html