# Non linear summing



## hastoy (Aug 6, 2013)

Hi, I would need a script for Kontakt that does non linear summing. Kontakt mixes (summs) voices with a simple addition which means if 2 frequencies within the voices are in opposite phase (180°) they will cancel each other resulting in silence (for that frequency). To avoid that I would need Kontakt to summ in this specific way:

- this script would be used for a piano Kontakt instrument (a multi 
instrument for ease of programmation)
- at any moment in a song Kontakt produces a polyphonic sound wich I will 
call "the mix".
- then comes a new note which I will call the new "voice"
- 1st you add this new voice to the mix normally (the way Kontakt would do 
it) but you don't make it sound, the result will be called A
- then you shift the phase of the same voice 90° and then you add it to the 
same mix, still don't make it sound, this will be called B
- then you average A and B (add them and divide by 2), and then you make 
this sound, it's the final result
- I've tested this in Audition CS6 and it works, I just need it to work 
realtime in Kontakt.

Does this make sense (to at least someone  ?

Cheers 

Guillaume


----------



## polypx (Aug 6, 2013)

You can't do this.


----------



## hastoy (Aug 6, 2013)

thank you so much polypx, exactly what I was looking for !


----------



## TGV (Aug 6, 2013)

Polypx is probably right that Kontakt can't do this for all situations, but you might be able to achieve it, _if_ it's a fixed sample set.

The recipe is very simple: you prepare the mixed samples beforehand. You seem to have done it in Audition, so you'll only (ahem) have to repeat it a few hundred times.

PS Shifting something 90° is a bit ambiguous. There are filters that can shift all sines in a signal by 90°, but that's not the same as shifting the entire signal.


----------



## hastoy (Aug 6, 2013)

ok TGV let's say I have all original samples + a 90° shifted set of those samples. What do I do next ?


----------



## TGV (Aug 6, 2013)

You can mix them in an external program (like Audition), export them to wav, and import them in Kontakt. Or you can load both the original and the shifted samples in Kontakt, and make them play simultaneously.


----------



## mk282 (Aug 7, 2013)

You just cannot change something that is coded internally into Kontakt, like voice summing engine, via scripting. Scripting was not made for such purposes.


----------



## hastoy (Aug 7, 2013)

TGV, it's more complex than just mixing the instrument with its 90° shifted version. If you do that, frequencies that are originally 90° shifted will become 180° and cancel out, it won't work !

Every new voice must be mixed twice with the old voices: once normally and once 90° shifted and then average the 2 new mixes.

What kind of control does scripting have over voices and polyphony ? Any expert knows the commands ?

Guillaume


----------



## TGV (Aug 7, 2013)

Averaging is not an issue: that's the same as lowering the total volume by 3dB to 6dB.

But your description explicitly states: mix a sound and the 90° shift of the sound. If that's not what you're after, what is?


----------



## Luca Capozzi (Aug 7, 2013)

all of that reminds me of quadrature mixing or single side band modulation. is useful to add harmonic content... you can try some "tricks" that will work, someway, with simple sounds but with complex ones simply nothing useful happens. 

To do this kind of real time processing you need a proper environment, such Reaktor, PD or Max/MSP.

Cheers,
Luca


----------

