# Merge Songs

**URL:** <https://forum.renoise.com/t/merge-songs/18643>\
**Category:** Renoise XML Fileformats & Tools\
**Created:** [January 4, 2007, 2:36am UTC](https://forum.renoise.com/t/merge-songs/18643 "2007-01-04T02:36:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foo](https://forum.renoise.com/user_avatar/forum.renoise.com/foo/32/80_2.png) [@Foo](https://forum.renoise.com/u/Foo)\
**Post date:** [January 4, 2007, 2:36am UTC](https://forum.renoise.com/t/merge-songs/18643/1 "2007-01-04T02:36:51Z")

</div>

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:

> [@](#):
>
> Download: [XRNS-PHP download | SourceForge.net](https://sourceforge.net/projects/xrns-php/)
> 
> It should work out of the box (for Windows users), so to speak. Do not follow any of my advice about moving shit around when using this, it works as a standalone.
> 
> If you still experience problems, cut & paste from the console so I can debug it.
> 
> Thanks.

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?

---

<div class="post-metadata">

**Author:** ![Foo](https://forum.renoise.com/user_avatar/forum.renoise.com/foo/32/80_2.png) [@Foo](https://forum.renoise.com/u/Foo)\
**Post date:** [January 9, 2007, 11:45pm UTC](https://forum.renoise.com/t/merge-songs/18643/2 "2007-01-09T23:45:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ambivalence](https://forum.renoise.com/user_avatar/forum.renoise.com/ambivalence/32/358_2.png) [@Ambivalence](https://forum.renoise.com/u/Ambivalence)\
**Post date:** [January 22, 2007, 12:36am UTC](https://forum.renoise.com/t/merge-songs/18643/3 "2007-01-22T00:36:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![choice](https://forum.renoise.com/letter_avatar/choice/32/6_449c533f586939b6e5f246632a46421f.png) [@choice](https://forum.renoise.com/u/choice)\
**Post date:** [January 22, 2007, 7:45pm UTC](https://forum.renoise.com/t/merge-songs/18643/4 "2007-01-22T19:45:52Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Foo](https://forum.renoise.com/user_avatar/forum.renoise.com/foo/32/80_2.png) [@Foo](https://forum.renoise.com/u/Foo)\
**Post date:** [January 22, 2007, 11:36pm UTC](https://forum.renoise.com/t/merge-songs/18643/5 "2007-01-22T23:36:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![choice](https://forum.renoise.com/letter_avatar/choice/32/6_449c533f586939b6e5f246632a46421f.png) [@choice](https://forum.renoise.com/u/choice)\
**Post date:** [January 23, 2007, 8:17pm UTC](https://forum.renoise.com/t/merge-songs/18643/6 "2007-01-23T20:17:45Z")

</div>

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! ![;)](https://files.renoise.com/forum/emoticons/default/wink.gif) 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!

---

<div class="post-metadata">

**Author:** ![Belkin](https://forum.renoise.com/user_avatar/forum.renoise.com/belkin/32/407_2.png) [@Belkin](https://forum.renoise.com/u/Belkin)\
**Post date:** [May 3, 2007, 10:07am UTC](https://forum.renoise.com/t/merge-songs/18643/7 "2007-05-03T10:07:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kizzume](https://forum.renoise.com/user_avatar/forum.renoise.com/kizzume/32/9616_2.png) [@Kizzume](https://forum.renoise.com/u/Kizzume)\
**Post date:** [May 5, 2007, 3:42am UTC](https://forum.renoise.com/t/merge-songs/18643/8 "2007-05-05T03:42:47Z")

</div>

It would be a truly great option.

---

<div class="post-metadata">

**Author:** ![Belkin](https://forum.renoise.com/user_avatar/forum.renoise.com/belkin/32/407_2.png) [@Belkin](https://forum.renoise.com/u/Belkin)\
**Post date:** [May 27, 2007, 5:13pm UTC](https://forum.renoise.com/t/merge-songs/18643/9 "2007-05-27T17:13:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [May 27, 2007, 11:33pm UTC](https://forum.renoise.com/t/merge-songs/18643/10 "2007-05-27T23:33:13Z")

</div>

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.

```auto
EDIT: Scroll Down...  

```

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

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [May 28, 2007, 1:22am UTC](https://forum.renoise.com/t/merge-songs/18643/11 "2007-05-28T01:22:46Z")

</div>

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…

[http://www.nullwhore.com/dactemp/Archive.zip](http://www.nullwhore.com/dactemp/Archive.zip)

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.

---

<div class="post-metadata">

**Author:** ![taktik](https://forum.renoise.com/user_avatar/forum.renoise.com/taktik/32/3823_2.png) [@taktik](https://forum.renoise.com/u/taktik)\
**Post date:** [May 28, 2007, 2:24pm UTC](https://forum.renoise.com/t/merge-songs/18643/12 "2007-05-28T14:24:31Z")

</div>

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 ).

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [May 28, 2007, 2:47pm UTC](https://forum.renoise.com/t/merge-songs/18643/13 "2007-05-28T14:47:35Z")

</div>

Cool, thanks a lot.

I’ll work on this during the week.

---

<div class="post-metadata">

**Author:** ![Belkin](https://forum.renoise.com/user_avatar/forum.renoise.com/belkin/32/407_2.png) [@Belkin](https://forum.renoise.com/u/Belkin)\
**Post date:** [May 28, 2007, 8:10pm UTC](https://forum.renoise.com/t/merge-songs/18643/14 "2007-05-28T20:10:15Z")

</div>

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(

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [May 28, 2007, 9:13pm UTC](https://forum.renoise.com/t/merge-songs/18643/15 "2007-05-28T21:13:26Z")

</div>

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.

> [@taktik](#):
>
> The CDATA sections seem to be corrupt. In the original songs and the merged songs.

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?

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [May 29, 2007, 3:57am UTC](https://forum.renoise.com/t/merge-songs/18643/16 "2007-05-29T03:57:54Z")

</div>

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.

```auto
EDIT: Scroll Down...  

```

---

<div class="post-metadata">

**Author:** ![Belkin](https://forum.renoise.com/user_avatar/forum.renoise.com/belkin/32/407_2.png) [@Belkin](https://forum.renoise.com/u/Belkin)\
**Post date:** [May 29, 2007, 10:46am UTC](https://forum.renoise.com/t/merge-songs/18643/17 "2007-05-29T10:46:19Z")

</div>

maybe better look for xml merge code?

[http://support.microsoft.com/kb/311530](http://support.microsoft.com/kb/311530)  
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.  
thanks

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [May 29, 2007, 10:56am UTC](https://forum.renoise.com/t/merge-songs/18643/18 "2007-05-29T10:56:39Z")

</div>

XRNS files are simply ZIP files.

you can use any ZIP library in order to open them

---

<div class="post-metadata">

**Author:** ![Belkin](https://forum.renoise.com/user_avatar/forum.renoise.com/belkin/32/407_2.png) [@Belkin](https://forum.renoise.com/u/Belkin)\
**Post date:** [May 29, 2007, 11:22am UTC](https://forum.renoise.com/t/merge-songs/18643/19 "2007-05-29T11:22:24Z")

</div>

ohh thanks

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [May 29, 2007, 1:34pm UTC](https://forum.renoise.com/t/merge-songs/18643/20 "2007-05-29T13:34:09Z")

</div>

> [@Belkin](#):
>
> can you tell me how to extract files from xrns file?  
> becouse i want write applkication for merge songs not only xml.

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.

[Next page](https://forum.renoise.com/t/merge-songs/18643.md?page=2)
