# Experiment: Live Sample Morphing

**URL:** <https://forum.renoise.com/t/experiment-live-sample-morphing/30590>\
**Category:** Renoise Tools\
**Created:** [December 1, 2010, 12:53am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590 "2010-12-01T00:53:12Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [December 1, 2010, 12:53am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/1 "2010-12-01T00:53:12Z")

</div>

- Download and install the attached XRNX tool: 1487 [com.renoise.LiveSynth.xrnx](https://files.renoise.com/forum/uploads/1487-com.renoise.LiveSynth.xrnx)
- Download and open the attached XRNS song: 1480 [synth.xrns](https://files.renoise.com/forum/uploads/1480-synth.xrns)
- play the song
- Go to sample editor and watch for Instrument 00 - sample 00, called “Synth destination”.

note: it is recommended to turn off sample editor undo even when running the simple LiveSynth script

quoting manifest.xml:

```auto
  
  
 This script will scan any loaded song for:  
 - an instrument called "Synth";   
 - inside this instrument, samples which have the name "Synth source"  
 - inside this instrument, a sample which has the name "Synth destination"  
 - in the master track, a MidiCcDevice and will create it if not present  
  
 if everything is found/created successfully, the first parameters of the first MidiCcDevice found/created will control   
 the "weight" of each source sample in the creation of the synth destination sample, which will also used as the only   
 sample for the instrument (id est: its sample ordinal number will be set as the only  
 sample present into the notes split array).  
  
 Note that you can use this script inside an existing song by creating/renaming the instrument and samples as needed.  
  
  

```

of course, this same technique can be used to allow [Sample loop markers](https://forum.renoise.com/t/experiment-use-midi-knob-to-set-loop-markers/29587) to be moved using DSP sliders

TODO:

- complete support for more than one Synth instrument into the same song
- move the MidiCcDevice into a dedicated send track

---

<div class="post-metadata">

**Author:** ![danoise](https://forum.renoise.com/user_avatar/forum.renoise.com/danoise/32/64_2.png) [@danoise](https://forum.renoise.com/u/danoise)\
**Post date:** [December 1, 2010, 1:00am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/2 "2010-12-01T01:00:38Z")

</div>

Burning the midnight oil, eh? This is bloody AWESOME!!

---

<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:** [December 1, 2010, 1:01am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/3 "2010-12-01T01:01:45Z")

</div>

of course, this same technique can be used to allow [Sample loop markers to be moved](https://forum.renoise.com/t/experiment-use-midi-knob-to-set-loop-markers/29587) and [Sample data to be written](https://forum.renoise.com/t/experiment-use-midi-knob-to-write-a-sample/29585) using DSP sliders

---

<div class="post-metadata">

**Author:** ![rhowaldt](https://forum.renoise.com/user_avatar/forum.renoise.com/rhowaldt/32/1176_2.png) [@rhowaldt](https://forum.renoise.com/u/rhowaldt)\
**Post date:** [December 1, 2010, 8:44am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/4 "2010-12-01T08:44:45Z")

</div>

i get the feeling you are really pushing the boundaries of the current possibilities of Renoise scripting. great stuff!

---

<div class="post-metadata">

**Author:** ![bluszcz](https://forum.renoise.com/user_avatar/forum.renoise.com/bluszcz/32/951_2.png) [@bluszcz](https://forum.renoise.com/u/bluszcz)\
**Post date:** [December 1, 2010, 9:16am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/5 "2010-12-01T09:16:45Z")

</div>

> [@It-Alien](#):
>
> of course, this same technique can be used to allow [Sample loop markers to be moved](https://forum.renoise.com/t/experiment-use-midi-knob-to-set-loop-markers/29587)

Wow, I was looking for mooving Sample Loop Markers for long time… Nice!

---

<div class="post-metadata">

**Author:** ![00.1](https://forum.renoise.com/user_avatar/forum.renoise.com/00.1/32/542_2.png) [@00.1](https://forum.renoise.com/u/00.1)\
**Post date:** [December 6, 2010, 9:04am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/6 "2010-12-06T09:04:02Z")

</div>

Thank you ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

It took me a few tries to get it to work but will continue to experiment with this tool.

---

<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:** [December 6, 2010, 9:12am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/7 "2010-12-06T09:12:46Z")

</div>

I’m currently in the making of a much more flexible version. progresses may be slow because of lack of spare time, so keep on experimenting ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

---

<div class="post-metadata">

**Author:** ![dzieciak303](https://forum.renoise.com/user_avatar/forum.renoise.com/dzieciak303/32/1124_2.png) [@dzieciak303](https://forum.renoise.com/u/dzieciak303)\
**Post date:** [December 6, 2010, 11:40am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/8 "2010-12-06T11:40:32Z")

</div>

native sytnh it,s great idea:D

---

<div class="post-metadata">

**Author:** ![wakax](https://forum.renoise.com/user_avatar/forum.renoise.com/wakax/32/1003_2.png) [@wakax](https://forum.renoise.com/u/wakax)\
**Post date:** [December 6, 2010, 2:32pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/9 "2010-12-06T14:32:06Z")

</div>

is this morphing ( spectral way ) or sample fading ?

---

<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:** [December 6, 2010, 2:33pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/10 "2010-12-06T14:33:49Z")

</div>

it’s justing fading one sample into another. the idea is to use this tool (and its forecoming new incarnation) to work with simple waves

---

<div class="post-metadata">

**Author:** ![wakax](https://forum.renoise.com/user_avatar/forum.renoise.com/wakax/32/1003_2.png) [@wakax](https://forum.renoise.com/u/wakax)\
**Post date:** [December 6, 2010, 2:38pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/11 "2010-12-06T14:38:38Z")

</div>

if it’s not cpu hungry and if the fade curve could be automatized  
hurray ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

---

<div class="post-metadata">

**Author:** ![00.1](https://forum.renoise.com/user_avatar/forum.renoise.com/00.1/32/542_2.png) [@00.1](https://forum.renoise.com/u/00.1)\
**Post date:** [December 6, 2010, 3:49pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/12 "2010-12-06T15:49:17Z")

</div>

Morpher might be introducing some kind of undo bug, maybe it happens when I create new sample for “Morpher source 1” and “Morpher destination”. I think they’re suppose to be the same type of sample, so sometimes I just copy paste instead of creating the same exact sample twice (using ZynZilla). I’ll keep at it until I figure out the sequence of events in order to replicate this.

Basically I can no longer undo and the undo history is gone and when I try to manually undo by clicking on edit and highlighting undo, it says “undo change sample data”.

edit: i have an lfo -\> midi cc set up, the last quick debugging i did, i was messing around with the lfo and i was able to replicate the undo bug. prior to messing around with lfo, i was creating new samples for the three slots and changing them to the proper names. will test more later.

---

<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:** [December 7, 2010, 12:52am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/13 "2010-12-07T00:52:12Z")

</div>

update: I have managed to mix more than two sources and add more synths and sources “ad libitum” (currently limited to 2 synths with a maximum of 8 sources each per song), but I’m facing with a problem which I feared since the beginning: when using more than two sources, you need to set one parameter for each source to define how much that source will “count” into the destination sample, so you will need a DSP slider for each source and you have to put a notifier on each slider. Unfortunately, this means that the notifiers will try to work concurrently on the destination sample if more than one parameter gets changed at a time, causing hiccups. With two sources, the situation is good on my quite fast PC, but with three sources problems start to arise.

I will try to think more at a solution for this. I will probably avoid this concurrence with simple “semaphores” (programmers who are familiar with threading will understand)

note: it is recommended to turn off sample editor undo even when running the simple LiveMorpher script

---

<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:** [December 11, 2010, 2:57pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/14 "2010-12-11T14:57:43Z")

</div>

thanks to Taktik help, I have managed to finish another step: go on top of this page to download version 0.2 which now can mix more sources into a single one.

About concurrency: now the mixing of the samples happens in background. This is the only way to prevent GUI from being sluggish, but still does not solve a problem which cannot be solved anyway: the sample writing does not happen in real-time so, if you try rendering songs in real-time priority, the result won’t play well.

Next step: the code is almost ready to support more than one Synth instrument per song. To manage this scenario better, next version will create/search one MidiCcDevice for each Synth instrument, and the device must reside into a dedicated send track with a specific name. This way, you will be able to mix up to 16 samples together per Synth, and have more than Synth per song.

---

<div class="post-metadata">

**Author:** ![Jonas](https://forum.renoise.com/user_avatar/forum.renoise.com/jonas/32/6937_2.png) [@Jonas](https://forum.renoise.com/u/Jonas)\
**Post date:** [December 11, 2010, 4:41pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/15 "2010-12-11T16:41:43Z")

</div>

Wow, I somehow missed this, thnks!

---

<div class="post-metadata">

**Author:** ![Tarek-FM](https://forum.renoise.com/user_avatar/forum.renoise.com/tarek-fm/32/759_2.png) [@Tarek-FM](https://forum.renoise.com/u/Tarek-FM)\
**Post date:** [December 11, 2010, 4:49pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/16 "2010-12-11T16:49:17Z")

</div>

hey thx again 4 ur hardwork…unfortunately i can’t use your tool just yet as it automatically creates morpher destintation as expected but just a horizontal wave in the slot…plus it seems to crash whenever i use it…something to do with failing notifiers…would u like me to post the message i get?

leaving pc now but can do it tomorrow.  
thx again ![:walkman:](https://files.renoise.com/forum/emoticons/default/walkman.gif)

---

<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:** [December 11, 2010, 4:58pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/17 "2010-12-11T16:58:40Z")

</div>

tarek, yes, please show me the crash message, thanks

---

<div class="post-metadata">

**Author:** ![Jonas](https://forum.renoise.com/user_avatar/forum.renoise.com/jonas/32/6937_2.png) [@Jonas](https://forum.renoise.com/u/Jonas)\
**Post date:** [December 11, 2010, 6:14pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/18 "2010-12-11T18:14:51Z")

</div>

right mouse click clearing the destination sample gave me:

> [@](#):
>
> ‘C:\Documents and Settings\richard\Application Data\Renoise\V2.6.0\Scripts\Tools\com.renoise.LiveSynth.xrnx\main.lua’ failed in one of its notifiers.  
> The notifier will be disabled to prevent further errors.
> 
> Please contact the author (It-Alien (Fabio Napodano) of Renoise team) for assistance…
> 
> std::logic\_error: ‘trying to access a nil object of type ‘class InstrumentSample’. the object is not or no longer available.’  
> stack traceback:  
> [C]: ?  
> [C]: in function ‘\_\_index’  
> [string “do…”]:36: in function \<[string “do…”]:35\>  
> main.lua:131: in function ‘mix’  
> main.lua:431: in function main.lua:426

Trying to load a sample into the destination slot & then undoing using ctrl+z gives me:

> [@](#):
>
> oise\V2.6.0\Scripts\Tools\com.renoise.LiveSynth.xrnx\main.lua’ failed in one of its notifiers.  
> The notifier will be disabled to prevent further errors.
> 
> Please contact the author (It-Alien (Fabio Napodano) of Renoise team) for assistance…
> 
> std::logic\_error: ‘trying to access a nil object of type ‘class InstrumentSample’. the object is not or no longer available.’  
> stack traceback:  
> [C]: ?  
> [C]: in function ‘\_\_index’  
> [string “do…”]:12: in function \<[string “do…”]:11\>  
> main.lua:339: in function ‘look\_for\_synths’  
> main.lua:229: in function main.lua:228

---

<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:** [December 14, 2010, 1:21am UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/19 "2010-12-14T01:21:29Z")

</div>

thanks for reporting. this was quite a hell to sort, but should work now. Please download version 0.21 from the top of the thread. If everything works well now, I could start the last step. As far as I have tested it, it worked.

---

<div class="post-metadata">

**Author:** ![Tarek-FM](https://forum.renoise.com/user_avatar/forum.renoise.com/tarek-fm/32/759_2.png) [@Tarek-FM](https://forum.renoise.com/u/Tarek-FM)\
**Post date:** [December 15, 2010, 5:13pm UTC](https://forum.renoise.com/t/experiment-live-sample-morphing/30590/20 "2010-12-15T17:13:11Z")

</div>

soooo sorry, have not been feeling well, however, the message shown above looks very similar to the one i get…i will just download the new version and c if i still get the crash.

[Next page](https://forum.renoise.com/t/experiment-live-sample-morphing/30590.md?page=2)
