1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

How should I crossfade 3 sources?

Discussion in 'Building With Reaktor' started by mmower, Dec 16, 2009.

Thread Status:
Not open for further replies.
  1. mmower

    mmower NI Product Owner

    Messages:
    729
    Hi.

    I have 3 stereo pairs, representing 3 loopers, that I want to blend together.

    If I had 2 I would use a crossfade, set to 0.5, on the L and R channels of each pair. But the crossfade doesn't seem to allow me to specify 3 channels.

    Can anyone tell me the right way to go about this?

    Thanks.

    Matt
    ---
    Not having any idea if the crossfade module is doing anything clever I just built a macro to multiple the 3 inputs by 1/3 and sum them to the output.

    If there's a better approach I'd welcome some guidance.

    Matt.
     
  2. herw

    herw NI Product Owner

    Messages:
    6,421
    As you are mixing audio-signals you have to use dB-ranges.
    Here is a calculator for addition of several audio sources:
    http://www.sengpielaudio.com/calculator-spl.htm

    ciao herw
     
  3. mmower

    mmower NI Product Owner

    Messages:
    729
    Thanks for the link Herw.

    I'm a little confused now though because I thought (based on observation) that audio signals in Reaktor wires were linear, not dB. Was I wrong about that?

    Or do you mean that you can't simply sum linear amplitudes? That I should convert them to dB, sum them according to that calculator, then convert them back to pass on?

    M.
    ---
    Skimming that page this is not such a simple subject.

    For a start, are my sources coherent or incoherent? Well, they're arbitrary samples being looped, but it's the same sample looped 3 times, however the samples drift in and out of phase. Really I've no clue what that implies.

    Treating them as incoherent I assume then I'd use the formula:

    L = 10 * log( ( a1^2 + a2^2 + a3^2 ) / a0 )

    Although I'm not entirely clear on a value for a0. My copy of Theory & Technique of Electronic Music says a good choice for a0 is 10^-5. I'm not sure if that's what Reaktor uses. It occurs to me that there may also be macros for this.

    Then I have to convert back:

    a = 10^(L/10) * a0

    Am I anywhere close to the mark?

    M.
     
  4. herw

    herw NI Product Owner

    Messages:
    6,421
    As you talked about sample loop i think you are talking about audio loops?
    Sample loops are incoherent so that's ok. They would be coherent only if you use the same sample with synchronized starting point.
    I think you want to mix the three samples to get always same volume sum.
    Our ears are „thinking” in logarithmic scales so you have to use dB.
    If you have two sources and want to mix them with the same volume as for one source you have to lower both to -3dB.
    Three sources to mix is not simple indeed because there are complex interconnections.
    I would try to get experiences with linear mixing first and after that construct a similar mixing algorithm with dB.
    BTW ABSYNTH uses such a mixing concept.

    ciao herw
     
    Last edited: Dec 16, 2009
  5. mmower

    mmower NI Product Owner

    Messages:
    729
    Three grain resynth modules. They are playing the same sample with (generally) a synchronised starting point. However at different speeds so that they drift in and out of phase with each other.

    I think maybe I have a better understanding now of what you are addressing, i.e. using the logarithmic nature of our hearing to get the same sum volume level.

    At the moment my simplistic sum & divide by 3 approach seems to work well enough for my purposes, at least with the material I am working with right now. I'll take another look at logarithmic summing when that begins to break down.

    Thanks again for your advice.

    Matt





    ciao herw[/QUOTE]
     
  6. herw

    herw NI Product Owner

    Messages:
    6,421
    yes - a wise decision
     
  7. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    Here's a possible panel element for your crossfader; no maths included yet, but I can build it if you like...
     

    Attached Files:

  8. mmower

    mmower NI Product Owner

    Messages:
    729
    Carlos that's totally cool, what a really nifty approach to the problem. If you're happy to build it I'd love to include it in my ensemble (which is actually getting pretty close to releasable).

    Thanks.

    Matt.
     
  9. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    Ok, I'm on it! Not sure though if I succeed the perfect class solution (discarding the space inside the mouse area but outside of the triangle) but I'll come up with some "multiplying according to distance" approach, or a two crossfader- approach. Or maybe both.
     
  10. mmower

    mmower NI Product Owner

    Messages:
    729
    Carlos that's fantastic, thank you.

    Here is a track I made last night with the ensemble in question, just so you know what you'd be contributing to!

    M.
     
  11. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    Ok here's a version where the 3 values add up to 1. Unless you get outside of the triangle, where the sum might significantly rise! Sorry I couldn't fix it, you can always put a new clipper further in your structure. To fix the graphics so that you cannot get outside of the triangle is a bit too hard right now, at least I don't see an elegant way to do it. But maybe some good builder comes up with a nice idea...
     

    Attached Files:

  12. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    mmower, have a look at this latest version. It is definitely getting there. If you draw into the triangle you see what it is supposed to do. (not always succeeding though)

    If someone is interested in helping, the logic about pulling back the mouse inside the triangle is located in the macro called "square->triangle". I am a bit afraid the problem from here needs to be addressed on core level, inside the ClipMinMax core cell. And if it is so, I am not sure I am ready:eek:
     

    Attached Files:

  13. mmower

    mmower NI Product Owner

    Messages:
    729
    Carlos that's pretty impressive work.

    I hope someone can help with the last half mile. I had a quick look inside but it's beyond me.

    M.
     
  14. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    I am glad if you guys like it. Actually this is the first time I build something with a polydisplay, it was precisely the multidisplay that I wanted to avoid, since in present case it would have meant iterations on each new coordinate. In this case to work with polydisplay was rather easy, you basically just use toVoice and merge modules for something else than polyphony. And good thing is: the instrument where the polydisplay is nested needs to have equal, but can also have larger number of voices than what the polydisp needs (in this case 3).

    For the crossfader, it is clear that there are some more dynamic possibilites than linear crossfading. But I think that they can all be implemented on top of the data corresponding to the distance(s), like in case of a simple crossfader between 2 sources.

    Herw's attachement is really interesting by the way. Raising by 3dB = raising as if you had two sources playing the same: this is something you can visualize!
     
Thread Status:
Not open for further replies.