i reversed the ins and outs on the crossfader but there's no gui for me to test it

Discussion in 'Effects and the DSP' started by laserbeak, Sep 7, 2006.

  1. laserbeak

    laserbeak New Member

    Joined:
    Jul 3, 2003
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    hi
    i am experimenting with dane and i reversed the crosfader to fade to two sepreate outputs.
    but after saving the .da file and registering it i have no gui. so i compared the code in dane and they look the same to me.. then i exprted c++ code and compared them in visual c++ and they still look the same. what am i missing?
     
  2. Tril

    Tril Triple screen racing ftw

    Joined:
    Sep 26, 2004
    Messages:
    1,665
    Likes Received:
    19
    Trophy Points:
    48
    I'm not sure I understand what you are trying to do. Can you give your Dane code, it will make it clear what you are trying to accomplish.

    The plugin called "crossfade" is a C++ plugin. It uses crossfade.cpp, crossfade.h and da_crossfade.cpp in the folder "C:\Program Files\kX Audio Driver\SDK 3538\fx_pack" and the .da file that you get by saving the code of the plugin.

    You need to recompile the C++ code. I can tell you how if you have a Microsoft C++ compiler.
     
    Last edited: Sep 7, 2006
    laserbeak likes this.
  3. laserbeak

    laserbeak New Member

    Joined:
    Jul 3, 2003
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    ok then i did it wrong i thought i needed to do everything in dane. so then there's no need to look at my code but to just make a fool of me LOL :D:uhoh::uhoh:

    but yeah if you could help i'd greatly apreciate it. is c++ 2005 good or shoul i use 6.0?
     
  4. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I am not quite sure what you are trying to do either...
    Are you trying to make a regular fader plugin?

    If you tell us specifically what you are looking for, maybe we can point you to a plugin that allready does it, or help you to make something to do it, etc.

    BTW: On my download page there is a 'Stereo Balance + Fade' plugin, if that is what you are looking for (it works like the balance / fade controls that you find on a typical car stereo (it does not do any decoding or anything like that, it is just for basic balance / fade stuff)).

    -Russ
     
    Last edited: Nov 9, 2009
  5. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Here is an example (Dane only code) of one way of doing fade control.

    Code:
    input in_left, in_right;
    output out_1l, out_1r;
    output out_2l, out_2r;
    control fade = 0.5;
               
    macs out_1l, in_left, 0, 0;
    macs out_1r, in_right, 0, 0;
    interp out_2l, 0, fade, out_1l;
    interp out_1l, out_1l, fade, 0;
    interp out_2r, 0, fade, out_1r;
    interp out_1r, out_1r, fade, 0;
    
     
  6. laserbeak

    laserbeak New Member

    Joined:
    Jul 3, 2003
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    could u put some comments in there?:duh: :drool:

    original dane code

    Code:
    ; Generated by kX DSP Editor - microcode dump
    name "crossfade";
    copyright "Copyright (c) kX Project, 2003-2004. All rights reserved";
    ; NOTE The present DSP microcode dump is protected by the 
    ; license agreement bundled with the appropriate software 
    ; package containing this microcode,
    ; regardless the particular copyright notice is present in the dump.
    engine "kX";
    created "03/14/2003";
    guid "2f0ef3c1-87cd-4469-9d05-caa78687c703";
    ; Registers
     input i1L, i1R, i2L;
     input i2R;
     output L, R;
     static k1=0x7fffffff, k2=0x7fffffff
    ; Code
      macs   L,  0x0,  i1L,  k1;
      macs   L,  L,  i2L,  k2;
      macs   R,  0x0,  i1R,  k1;
      macs   R,  R,  i2R,  k2;
    end
    
    my reverse dane code:

    Code:
    ; Generated by kX DSP Editor - microcode dump
    name "revcrossfade";
    copyright "Copyright (c) kX Project, 2003-2004. All rights reserved";
    ; NOTE The present DSP microcode dump is protected by the 
    ; license agreement bundled with the appropriate software 
    ; package containing this microcode,
    ; regardless the particular copyright notice is present in the dump.
    engine "kX";
    created "03/14/2003";
    guid "8b7ecb23-fd53-4f68-98ba-b1949ed64e2f";
    ; Registers
     input L, R;
     output o1L, o1R, o2L;
     output o2R;
     static k1=0x7fffffff, k2=0x7fffffff
    ; Code
      macs   L,  0x0,  o1L,  k1;
      macs   L,  L,  o2L,  k2;
      macs   R,  0x0,  o1R,  k1;
      macs   R,  R,  o2R,  k2;
    end
    
     
  7. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Your reversed code is not going to work.

    The instructions take the format:
    INSTRUCTION RESULT, A_PARAM, X_PARAM, Y_PARAM;

    In your code, none of the outputs are used for RESULT, so nothing will be sent to the outputs. Also, you should not change the value of inputs directly (i.e. inputs should not be used as the RESULT register, think of them as a read-only register), use a different register to do this. Also, you should not use inputs more then once, copy them to another register and use that register instead.

    Here is what that code is really doing:

    macs L, 0x0, o1L, k1;
    ; L (input) = o1L (output) * k1;
    macs L, L, o2L, k2;
    ; L (input) = L (input) + (o2L (output) * k2);
    macs R, 0x0, o1R, k1;
    ; R (input) = o1R (output) * k1;
    macs R, R, o2R, k2;
    ; R (input) = R (input) + (o1R (output) * k2);

    Give me a min and I will add comments to the code I posted.
     
  8. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    One drawback of this code, is that the volume is reduced by half, when the fade is centered.
    In the 'Stereo Balance + Fade' plugin, I did it a little differently (and used C++ code), to correct this.

    input in_left, in_right;
    ; inputs

    output out_1l, out_1r;
    output out_2l, out_2r;
    ; outputs

    control fade = 0.5;
    ; slider intialized to 0.5


    macs out_1l, in_left, 0, 0;
    ; out_1l = in_left
    ; out_1l is basically used for temporary storage (of the input) here.

    macs out_1r, in_right, 0, 0;
    ; out_1r = in_right
    ; out_1r is basically used for temporary storage (of the input) here.

    interp out_2l, 0, fade, out_1l;
    ; The interp instruction is a little hard to explain...
    ; For how it is used here, think of it as panning/scaling/mixing between the
    ; A_PARAM and the Y_PARAM depending on the value of the X_PARAM.
    ; So a value of 0.5 for the X_PARAM, basically has it panned in the middle.
    ; Since we are panning between the 0 and the input, the result is basically
    ; half of the input.
    ; As the value of X_PARAM goes down (below 0.5), it is panned more toward
    ; the A_PARAM (0 here).
    ; As the value of X_PARAM goes up (above 0.5), it is panned more toward
    ; the Y_PARAM (the input here).
    ; Since the RESULT register is output 2l, the higher the value of the
    ; X_PARAM, the more the signal (input_left) is sent to output 2l.
    ; See the Beginner's Guide and the As10k1 manual for more info.

    interp out_1l, out_1l, fade, 0;
    ; Same as above, except, that the A_PARAM and Y_PARAM are reversed,
    ; and the RESULT register is output 1l (so it does the opposite of the above).

    interp out_2r, 0, fade, out_1r;
    interp out_1r, out_1r, fade, 0;
    ; These do the same thing as the previous instructions
    ; for the right channel.

    It is a little hard to explain, but hopefully you get the jist of it, and again, it is just one way of doing it.
     
    Last edited: Sep 7, 2006
  9. laserbeak

    laserbeak New Member

    Joined:
    Jul 3, 2003
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    wow
    a bit more complicated than i thought
    gonna lok through the manual and the guide for more info before i even compile this
     
  10. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Use mainly the GUIDE, as that is written for Dane (the manual is not). Use the manual for a little extra info about some of the instructions, and for some info about the processor, etc.
     
  11. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
  12. laserbeak

    laserbeak New Member

    Joined:
    Jul 3, 2003
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    thanks guys, will do.
     

Share This Page

visited