Merge Songs

Edit this script has now been realised, alone with the randomiser, thanks to conner_bw and Beatslaughter. For new people coming into the thread I’ll keep this updated:

Original post:

I occasionally have the need to merge to songs, especially when merging seperately made verse and chorus ideas. Could a 3rd party xrns program handle this task?

The arrangement would be simple: You have file1 and file2. File1 is the selected host and file2 is considered as the import. The master effects of the host are retained. In the merge process the respective file2 amount of new channels and sends are made after the file1 channels and sends. All automations and send addresses are re-ordered to accommodate the file2 data. The pattern data from file2 is appended after the patterns of file1.

It is then up to the user and the new file to edit the merge manually to their liking, having all the data from both parent songs to meld at their fingertips.

I would program this if I had the skills, but I’m flat out being a composer. Any one think this is a juicy idea?

Hey mods, can we move this thread to the new xrns-dev forum?

Yep, it’s possible. Already started implementing it (to test the not-yet released prototype XRNS-Lib). Stay tuned.

ooooh my! this is exactly what i need!!!

i have so many things i would love to use something like this with!

Yes I’m very supportive of this idea. There are a good deal of restoration projects I’m doing that would benefit from this ability.

Also, used creatively, some wonderful mashups will be achieved.

i have an amen file 'O patterns that i always constantly want to update with new patterns, but it gets kinda mundane so i havent been keeping it up.

so this would really help for that !

atm the only way to do it really is to run 2 instances of renoise, which atm i dont have enough power for, but when i really need to do it, renoise will at least let me! ;) an that is sooo nice about 1.8!

i really need to research an look deeper into this xml stuff.

there is some code in sc3 that enables users to record the OSC timing/duration/notes… etc. basically the same as pattern data without instruments linked. all in realtime to a text file an i’m positive it could be told to write to the file in a xml compliant format.

so then we take that data being compliant then use what this thread is about, merge it with a renoise song!
give the patterns instrumentas an presto!
non realtime pseudo algorthymic compostition!

a rather strange way of cheating i guess, but eheheh!

i fully agree, we need this!

it will be fiture in renoise?
becouse really i want it to)

It would be a truly great option.

any news?
maybe any alpha or beta versions exists?)

I’ve started working on this in PHP5.

This is extremely early development. There is no code to unpack songs. I’m basically working with two renamed Song.xml files that only contain VSTi instruments, I am running php script.php > Song.xml at the bash prompt, zipping that file, renaming it .xrns and double clicking it to launch.

If I merge instruments, and only instruments, the above works fine. If I merge any other parts of the xml I am getting Kernel panics / Renoise crashes.

I’m obviously hacking my way through this, but if anyone familiar with the XML of Renoise and a copy of PHP5 with the SimpleXML extension can tell me where I am going wrong, it would be appreciated.

EDIT: Scroll Down...  

EDIT: I’ve added validation. My XML is valid (yay!) … but it still crashes Renoise.

Alright, I’ve spent a lot of time debuging this (thanks BeatSlaughter in IRC) and I’m at a loss. Merging my songs makes renoise crashes like nobody’s business…

Interested? Check out the above. Output.xml is the results of merging Song2.xml into Song1.xml. If you zip Song1 and Song2, they open (rename to Song.xml, zip, then rename to .xrns) but if you zip output.xml, my renoise crashes (again, rename to Song.xml, zip, then rename to .xrns).

I’ve spent 2 hours on this, so advice like “is it UTF-8” or “what about the order of the child nodes in Tracks” or “linebreaks between two tags” have all been tried…

Am I missing something? Thanks for your help.

The CDATA sections seem to be corrupt. In the original songs and the merged songs.

Also you must make sure that the number of tracks in all patterns is equal to the number of “global” tracks and that there is only one master track.

Contact me directly if you need more help (taktik @ … com ).

Cool, thanks a lot.

I’ll work on this during the week.

if you will finish it in php i can rewrite it to c# .net 2.0 version.
and i can help you with programming)

tomorrow i will contact you maybe we can create this as library or worked aplication.
but i am not good in xml and xsl(

I will publish the source code and people can do what they want with it. My intention is to make a shell script (unix/dos style) but that might not be appropriate everyone.

I re-read this… The original songs are the ones extracted from Renoise saved .XRNS files (on OS X)… so I’m having trouble understanding how they can be corrupted?

I’m using this thread as my own CVS/Subversion but, yes, I got rudimentary merge working! Now I need to: compensate for send tracks, load up more complex xrns files with samples, and sleep. Be back later this week.

EDIT: Scroll Down...  

maybe better look for xml merge code?
i will check it later)

to taktik
can you tell me how to extract files from xrns file?
becouse i want write applkication for merge songs not only xml.

XRNS files are simply ZIP files.

you can use any ZIP library in order to open them

ohh thanks

Give me a few days and my script will merge songs, not just xml. It’s one thing at a time. But yeah, if you want to program your own, go for it.