How to compile kx Effects

Discussion in 'Effects and the DSP' started by Violoncello, Sep 27, 2011.

  1. Violoncello

    Violoncello New Member

    Joined:
    Jun 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Hello Guys,
    my problem is the following: I'm in the need of a quite large number of parametric EQs. The standard out-of-the-box peaking eq plugin works just fine, but when using it multiple times I run out of DSP resources.

    Using UFX is no option for me, cause I'm using Win7 x64 (Master Mixer works like a charm btw.).

    So I looked at the source of the Peaking EQ Plugin and found, that it should be possible to create a new plugin based on the existing, which offers 5 or even more single peaking eqs (in mono) while saving many registers.

    I think I understand the things (in the code) I would need for doing this. I used to program some little tools back in my youth.

    But this is long ago and now I need help at the basic point: How to compile the EQ_Peaking.cpp along with the bunch of related h-files? In the end, I guess, I would need to get a *.kxl-file to load into kx-drivers?

    I have an old Visual C++ 6 on my PC and gave it a shot, but compiling didn't work. So I would like to know: Which program I must use (in which way) to get working effect plugins?

    Thanks for your help
     
  2. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Your best bet is to use VCExpress along with the WDK/WinDDK.

    See here (posts 53 and 55).
    The above info will need to be modified to reflect whatever version of VCExpress and WDK you use (path's, etc).
     
  3. jaromanda

    jaromanda Active Member

    Joined:
    Aug 12, 2007
    Messages:
    222
    Likes Received:
    3
    Trophy Points:
    28
    VCExpress doesn't (easily) compile 64bit ...
     
  4. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Re: How to compile kx Effects

    WDK compiler does. You will need WDK anyway if you're for VCExpress because of MFC headers/libraries (basicaly VCExpress is just a GUI IDE for WDK compiler in our case)
     
  5. jaromanda

    jaromanda Active Member

    Joined:
    Aug 12, 2007
    Messages:
    222
    Likes Received:
    3
    Trophy Points:
    28
    Re: Îòâåò: Re: How to compile kx Effects

    I did not know that - will have to look into all of that so i can shuffle off this 32bit coil ;)
     
  6. Violoncello

    Violoncello New Member

    Joined:
    Jun 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    AW: How to compile kx Effects

    Firstly, thank you for your advices! I tried them out, but I didn't get along very well. But for the moment it's ok - maybe I will jump into this when I have some boring time (unlikely).

    I now wrote my own IIR-Plugin in Dane and tuned the performance; it now needs just 5 + (7 * [Number of filter steps]) Registers and 6*[Number of filter steps]) Instructions (mono - stereo would be just 2 additional Registers per step).
    That gives me a decent number of Peaking EQs in the 512 registers of my Audigy2ZS, which was my goal.

    There's no frontend to the filter; I have created a little Excel sheet which calculates the filter coefficients. Then I copy them directly into the filter code file. That's ok for me.

    If someone would code a frontend for DSP to choose from IIR Filters and calculate the coefficients, we would have one more decent KX Plugin :D.

    In case someone's interested in the code:

    Code:
        input in;
        output out;
        
        ;filter coefficients
        static b0_1=0.481211083877581, b1_1=-0.943019938328317, b2_1=0.463832264803109, a1_1=0.943019938328317, a2_1=-0.445043348680689;
        static b0_2=0.500190892419578, b1_2=-0.999423819761777, b2_2=0.499318557741597, a1_2=0.999423819761777, a2_2=-0.499509450161175;
        static b0_3=0.391705873203728, b1_3=-0.066878090382742, b2_3=-0.133308774349389, a1_3=0.066878090382742, a2_3=0.241602901145660;
        
        ;buffers
        static x1_1=0, x2_1=0;
        static x1_2=0, x2_2=0;
        static x1_3=0, x2_3=0;
        static y2=0;
        
        static scal=2;
    
        temp t;
    
    ; Code
         ;Filter #1
         macs      0, 0, in, b0_1; accum = in * b0
         macmv      x2_1, x1_1, x2_1, b2_1; accum += x2 * b2
         macmv   x1_1, in, x1_1, b1_1; accum += x1 * b1
         macmv      0, 0, x2_2, a2_1; accum += (y2 * a2)
         macs      t, accum, x1_2, a1_1; t = accum + (y1 * a1)
         macints t, 0, t, scal; t *= scal
         
         ;Filter #2
         macs      0, 0, t, b0_2; 
         macmv      x2_2, x1_2, x2_2, b2_2;
         macmv   x1_2, t, x1_2, b1_2;
         macmv      0, 0, x2_3, a2_2;
         macs      t, accum, x1_3, a1_2;
         macints t, 0, t, scal;
         
         ;Filter #3
         macs      0, 0, t, b0_3;
         macmv      x2_3, x1_3, x2_3, b2_3;
         macmv   x1_3, t, x1_3, b1_3;
         macmv      y2, out, y2, a2_3;
         macs      t, accum, out, a1_3;
         macints out, 0, t, scal;
    
    
    More filter steps can be added by multiplying Filter #2 and adjusting the Register names.

    Cheers
     
  7. Violoncello

    Violoncello New Member

    Joined:
    Jun 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    AW: How to compile kx Effects

    Update:
    I learned that Excel is not as precise as required for the coefficient calculation. As I was tired of copying so many coefficients anyway I wrote some little tool in Basic which does all the calculations and generates the complete DSP-Code for any number of filters. So I just need to copy and paste the code in Dane, save it and load it into KX.

    So I need not to worry about some strange compilers required for making KX Plugins ;).

    If someone else is in the need of huge numbers of IIR-Filters and is interested in my code generator tool, feel free to PM me.
     

    Attached Files:

  8. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    Re: AW: How to compile kx Effects

    nice little program.

    if your solution works fine for you, why not. we all are doing different things to make the dsp do things that we want. i used an excel table to calculate some delay times for my reverb. the first adsr- envelope of kx- modular was a crazy if-then-jump- code in dane, the keyboard unit used kx- automation for mapping midi to note values. (i thought i had found out a new dsp- feature "lookup table", while using a delay line for that. nobody was notably exited, except myself. :) )

    beside that: for compiling i use win xp with sp3, vcexpress edition 2008 (free), wdk7 (free).
    to compile something you should start with the demo- plugin in the demo folder of your kx- driver version. it makes a simple volume controller. later you can study some filter plugins for calculating some coefficients and learn how to push them to dsp- registers using set_dsp_register();

    stylus
     
    Last edited: Nov 14, 2011
  9. WxMan1

    WxMan1 Active Member

    Joined:
    Dec 26, 2007
    Messages:
    307
    Likes Received:
    11
    Trophy Points:
    28
    You guys should be gut-enuff w/what you got. If you can get your hands on a licensed copy of VS 2005 you be smokin' hot (with the IDE).

    :cool:

    One of these days I'm going to finger out what you guys be talkin' 'bout.

    :hmm:

    Compile issues pertain to the particular platform you want to compile to. The more capability and knowlege you have concerning the IDE the greater the likelyhood of success.

    :cool:

    You will need to understand what the target platform will be (32x, 64x and what OS). You will need to understand whether a "module" will need to be compiled as DLL in order for your code to be portable and to make that DLL portable across platform / OS (and whether that DLL will need exporting or not).

    Thanx for the code you presented. :hmm:

    My current project is sieving through the registry bee-hive w/respect to installed programs, finding WAU installations; move associated files to another location and create reparse points back in the Windows directory (as if nothing happen).

    None of that is an issue (all done). What is at issue is the sieving through the regisry and finding the associated reg links to those files being moved.

    O.k.. I don't understand what you're doing and neither do you me. So we're even, eh?

    :hmm:

    It would seem to me that the issue is that we're working on differing scales, i.e., hdw vs registry entries....
     
  10. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    do you talk about registry entrys of kx dll's?

    what we talking about is the "making of a kx - plugin" or compiling it (how a programmer would say).
     

Share This Page

visited