kX Automation...automation

Discussion in 'Effects and the DSP' started by Maddogg6, Aug 26, 2008.

  1. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    For the *.da - we can't get iKXPlugin instance for it, but we can use initial microcode info, get registers array through get_microcode and scan it for 'control' registers.
    (parameters for *.da are just 'control' gprs with min/max always being 0/0x7fffffff)

    I am fairly certain, parsing text from piped console output and/or - from files uses more than just printf() - no?
    sure, but we don't need any pipe of console i/o if "the tool" is doing everything
    (e.g. we don't need to analyse the output of kxctrl this way - do we?)
     
  2. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I see, yeah that makes sense...

    FxMix does not cause crash for me either (k1 (default config) 3545b)
     
    Last edited: Aug 26, 2008
  3. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    my bad - FXMix Happens to be the last plugin on my first card...

    I wrongly assumed it would query the selected device/card... But it still shows no controls on a few plugins - Are the ones missing '.da'?

    I thought they were all .kxl (MX6..?) ..??


    Code:
    -----------------------------------------------------------
     1: FXBus 12/13 (6e302861-0df9-4b21-b91a-6631220da97d)
        Parameters (name [index] [min max]):
            "Source" [0] [0 126]
    
    -----------------------------------------------------------
     2: FXBus 10/11 (6e302861-0df9-4b21-b91a-6631220da97d)
        Parameters (name [index] [min max]):
            "Source" [0] [0 126]
    
    -----------------------------------------------------------
     3: Reverb R (80100009-0ADF-11D6-BFBC-D4F706E10C52)
        Parameters (name [index] [min max]):
            "Bypass" [0] [0 1]
            "Mute" [1] [0 1]
            "Dry On/Off" [2] [0 1]
            "DryMix" [3] [99 3]
            "Wet On/Off" [4] [0 1]
            "WetMix" [5] [99 3]
            "Early On/Off" [6] [0 1]
            "Rev On/Off" [7] [0 1]
            "Early/Rev" [8] [0 100]
    
    -----------------------------------------------------------
     4: Stereo Chorus (80100003-0ADF-11D6-BFBC-D4F706E10C52)
        Parameters (name [index] [min max]):
            "Level" [0] [0 100]
            "InWidth" [1] [-50 50]
            "OutWidth" [2] [-50 50]
            "Feedback" [3] [0 99]
            "Delay" [4] [0 200]
            "Mod Depth" [5] [0 100]
            "Phase" [6] [-180 180]
            "Mod Rate" [7] [0 1000]
            "Invert Feedback" [8] [0 1]
    
    -----------------------------------------------------------
     5: Delay A (80100006-0999-11D6-BFBC-D4F706E10C52)
    
    -----------------------------------------------------------
     6: Phaser (ab0284b2-3caf-4850-84ca-6eb772cd68a4)
        Parameters (name [index] [min max]):
            "Dry" [0] [0 20]
            "Wet" [1] [0 20]
            "Feedback" [2] [-9 9]
            "CrossFeed" [3] [0 100]
            "Sweep Rate" [4] [1 100]
            "Sweep Range" [5] [0 52]
            "Frequency" [6] [50 1500]
            "Stages" [7] [0 2]
    
    -----------------------------------------------------------
     7: MX6 (f02fc662-a8b0-45fa-bde5-459c23549314)
    
    -----------------------------------------------------------
     8: k1lt (fc2acf07-5b4b-4c80-a157-1e6fd59909b6)
        Parameters (name [index] [min max]):
            "Out1/2" [0] [0 126]
            "Out3/4" [1] [0 126]
            "Out5/6" [2] [0 126]
            "Out7/8" [3] [0 126]
            "Out9/10" [4] [0 126]
            "Out11/12" [5] [0 126]
            "Out13/14" [6] [0 126]
            "DOO" [7] [0 1]
    
    -----------------------------------------------------------
     9: FXBus 0/1 (6e302861-0df9-4b21-b91a-6631220da97d)
        Parameters (name [index] [min max]):
            "Source" [0] [0 126]
    
    -----------------------------------------------------------
    10: FXMix (2bfd1db1-46ca-4848-b690-c8fe4944370b)
    Ok - I see - I would use this in leu of kxctrl.exe - ok that makes sense... all this C/C++ code - makes my brain hurt/ makes me stupider :D My original idea probably put blinders on me, along with not understand the C stuff completely.

    I still dont see how we make the .kx file guid_x (its not the same as the one seen by editing a plugin - its shorter...

    They are the same for multiple instances of plugins.

    edit: but this will make the table a lot faster, I can just add the guid_x manually later.
     
    Last edited: Aug 26, 2008
  4. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    It seems that MX6 needs plugin->init() call before it returns valid parameters count
    - but also it crashes within plugin->init() - probably trying to access plugin->ikx or something.
     
  5. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    It also seems to be missing params for stuff like prolog/epilog/xrouting...
     
  6. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    OK, updated the sources and the binary with workaround for MX6/MX8

    looks like they should be treated as plain *.da plugins (e.g. by searching for 'control' registers; though they have iKXPlugin code - they don't inplement get_param_count/describe_param functions)

    Well, not a big deal - we'll add support for such stuff (raw da) in next series :)
     
  7. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    The guid_x item is a mistery for me too - i can't see anything related to it anywhere.
    Seems to be some internal undocumented stuff (will ask E.)
     
  8. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Hmm, I did create a little test plugin to do this, and it does work with those plugins, so they must be implementing those functions, no?
     
  9. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    inside kxmixer - probably (if get_param_count() is not implemented then the base of iKXPlugin counts control registers on its own and then maintains anything related).
    But it requires (well, i suppose) calling plugin->init() and plugin->request_microcode() and then will cause (in our enviroment) more plugins (Surrounder for example) to crash.

    Well, of course it's a bit complicated - there're a lot of such tricks there - but workarounds possible (just not all at once :))
     
    Last edited: Aug 27, 2008
  10. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    And as you said, all of those plugin do use "control" registers, so it should be easy enough to get the info for those plugins (the harder part is probably just bringing everything together, such that the program knows when to do it one way versus another way).
     
  11. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    OK, updated the stuff (same link).
    Changes:
    * added support for "da" and "half-da" plugins (well, yet a bit hackish - but less code then non hackish would need)
    * added crash protection
    * other minor modifications

    known issue: newer (24-bit) prolog/epilog use "0...0x80000000" control range
    but the tool reports "0....0x7fffffff" - i'll investigate a solution later (for the moment i don't know how kxmixer handles this)
     
  12. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    That works better :)

    My test plugin returns 0x7fffffff for the max value for epilog, so it seems kX functions have not been fully updated yet to use new values anyway.

    One issue with the new code, it seems to loop forever on MX6 (this seems to depend on load order)
     
    Last edited: Aug 27, 2008
  13. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    >One issue with the new code, it seems to loop forever on MX6 (this seems to depends on load order)

    aha, this is because of a garbage in parameters counter
    (line 187 and below)

    replace
    Code:
    if (n < -1)
        n = 64;
    with something like:
    Code:
    if ((n < -1) || (n > 99))
        n = 64;
    
    edit: i hate 8-chars tabs!
     
    Last edited: Aug 27, 2008
  14. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Yup that stopped the looping :)

    BTW: What compiler are you using?
     
    Last edited: Aug 27, 2008
  15. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    msvc14 (e.g. the one from visual 2005 w/o SP)
    But it is set up to complie and link using WDK
    (WDK itself has the same but a bit limited vc14 compiler)
     
  16. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Ok, thanks for the info. VC6 choked on a few of the functions but I was able to compile it using VC .Net (2003).
     
  17. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63

    >known issue: newer (24-bit) prolog/epilog use "0...0x80000000" control range

    doh! looking at plugins sources i start to suspect that kmixer distinguish between "classic" (max = +1.0) and "inverted" (max = -1.0) controls by the first character of the name (+ the name of the plugin itself)
    e.g.:
    uppercase -> inverted
    lowercase -> classic
    :duh:

    The only other way i can image is just that the driver has some hardcoded table with plugin/parameter name pairs for such controls (it makes sence too as many of such parameters are also exposed as "driver" parameters).
     
  18. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Maybe, but I am pretty sure that the same registers had the 1st letter capitalized back before the 24 bit stuff was added. I would guess that the plugin itself does it's calculations using positive values, and just inverts the values before updating the plugin's registers (so driver still uses same 0-1 range and plugin(s) takes care of the rest). "Control" registers do not have to be 0-1 do they (when used with kxl)? I seem to recall seeing some plugins (kxl) that use "control" registers with other ranges (but I never really tried it myself).
     
    Last edited: Aug 27, 2008
  19. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63

    >I would guess that the plugin itself does it's calculations using positive values, and just inverts the values before updating the plugin's registers

    but xrouting/epilog code is available and there's no such code ;)
    e.g. the hocus-pocus is somewhere inside kxmixer or driver.

    edit: removed 'control' range comments as erroneous (i've missed "when used with kxl" remark)
     
    Last edited: Aug 27, 2008
  20. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    True, but the code does not include the set_param stuff at all, so I just figured that it is done somewhere else, but using same basic method that other plugins use. (and again describe_param does return 0x7fffffff as max value for MasterL/MasterR of epilog, etc (then again, they are stored as 0x80000000 under hW_params in the registry, so I do not know)).
     

Share This Page

visited