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
    (continuing on control ranges) well, actually they don't have only if kxl provides describe_param() function.
    But if plugin does not override default describe_param() then the default implemetation (iKXPlugin code itself) generates parameter list with default "0...+1" ranges.
    Hense it is still 0x7fffffff returned in your test. But (for these "system" plugns) kxmixer/driver do not use either of these functions (including set_parameter) - they just manupulate directly on registers instead (finally the driver can't load a plugin) - hense when we moving the faders in mixer we get correct "0...-1" for these controls.
    Well, not a big deal - just a set of little tricks :sleep:
     
  2. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    @Maddogg6
    Did your head explode yet? :D
     
  3. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    WOW - you guys really know how to make a guy feel dumb:x

    j/k - but really.....

    Looking at Max's code - I would have never in this decade come up with these 'little tricks' - you either dont credit your self, or you give me waaaaaay to much credit to think I could have done that...

    I mean - wtf is 'asynchronous exceptions' anyway (re: googled 'compile with /EHa') nvrmnd - like I would even begin to understand it more than I do from the explanation I already got.... shheesh.

    well any way - thanks a ton... this will make the task a whole lot easier.

    Thanks to you too Russ of course - you guys are always very cool :cool:
     
  4. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0

    I just cleaned up thanks for asking.... :D
     
  5. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Well do not feel too bad, I do think I would have have either...
     
  6. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    OK, and the final update for today (re-uploaded) :drool::duh:
    (found a clean way to get rid of all dirty workarounds)
    also added "plugin/parameter" black-list example (as "*"/"----Do not use! ----")

    Maddogg6

    Do not be afraid, actually the only (almost) function of your interest there is the "print_plugin"
    one - this is where plugin parameters actually output to console. It's just 20 lines of code ;)

    Btw. such sources (little single cpp console sceletones) are better to read from the bottom to the top (there bottom is most high level stuff and topmost are mostly low level goodies)
     
    Last edited: Aug 27, 2008
  7. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    heh - I cant get it to compile - I have a bunch of presumable linker errors - which is crazy - because I deliberately left the old kX SDK I compiled that SRC (to use all 64 FXBus') plugin in tact - PLUS - I updated the includes and Library locations to the new kX (in case big changes didnt like the old SDK....

    and one wonders why I dislike MSVC so much... lol

    Code:
    Compiling...
    Autohack.cpp
    Linking...
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::load_plugin_settings(class kSettings &)" (?load_plugin_settings@iKXPlugin@@UAEHAAVkSettings@@@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::save_plugin_settings(class kSettings &)" (?save_plugin_settings@iKXPlugin@@UAEHAAVkSettings@@@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual class iKXDSPWindow * __thiscall iKXPlugin::create_dsp_wnd(class kDialog *,class kWindow *,class kFile *)" (?create_dsp_wnd@iKXPlugin@@UAEPAViKXDSPWindow@@PAVkDialog@@PAVkWindow@@PAVkFile@@@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual class iKXPluginGUI * __thiscall iKXPlugin::create_cp(class kDialog *,class kFile *)" (?create_cp@iKXPlugin@@UAEPAViKXPluginGUI@@PAVkDialog@@PAVkFile@@@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::get_user_interface(void)" (?get_user_interface@iKXPlugin@@UAEHXZ)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::get_all_params(int *)" (?get_all_params@iKXPlugin@@UAEHPAH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::set_all_params(int *)" (?set_all_params@iKXPlugin@@UAEHPAH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::get_param(int,int *)" (?get_param@iKXPlugin@@UAEHHPAH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::set_param(int,int)" (?set_param@iKXPlugin@@UAEHHH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::set_defaults(void)" (?set_defaults@iKXPlugin@@UAEHXZ)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::event_ex(int,void *)" (?event_ex@iKXPlugin@@UAEHHPAX@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::event(int)" (?event@iKXPlugin@@UAEHH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::import_presets(char *)" (?import_presets@iKXPlugin@@UAEHPAD@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::export_presets(char *)" (?export_presets@iKXPlugin@@UAEHPAD@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::get_current_preset(char *)" (?get_current_preset@iKXPlugin@@UAEHPAD@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::delete_preset(char *)" (?delete_preset@iKXPlugin@@UAEHPAD@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::save_preset(char *)" (?save_preset@iKXPlugin@@UAEHPAD@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::apply_preset(int)" (?apply_preset@iKXPlugin@@UAEHH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual char * __thiscall iKXPlugin::get_plugin_presets(void)" (?get_plugin_presets@iKXPlugin@@UAEPADXZ)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual char * __thiscall iKXPlugin::get_plugin_description(int)" (?get_plugin_description@iKXPlugin@@UAEPADH@Z)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::request_microcode(void)" (?request_microcode@iKXPlugin@@UAEHXZ)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::close(void)" (?close@iKXPlugin@@UAEHXZ)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::init(void)" (?init@iKXPlugin@@UAEHXZ)
    Autohack.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iKXPlugin::get_version(void)" (?get_version@iKXPlugin@@UAEHXZ)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall iKXPlugin::~iKXPlugin(void)" (__imp_??1iKXPlugin@@UAE@XZ) referenced in function $L61272
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall iKX::get_microcode(int,struct dsp_code *,int,struct dsp_register_info *,int)" (__imp_?get_microcode@iKX@@QAEHHPAUdsp_code@@HPAUdsp_register_info@@H@Z) referenced in function "public: __thiscall `class iKXPlugin * __cdecl alloc_da_plugin(class iKX &,struct microcode_t const &)'::`2'::DummyPlugin::DummyPlugin(class iKX &,struct microcode_t const &)" (??0DummyPlugin@?1??alloc_da_plugin@@YAPAViKXPlugin@@AAViKX@@ABUmicrocode_t@@@Z@QAE@01@Z)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall iKXPlugin::iKXPlugin(void)" (__imp_??0iKXPlugin@@QAE@XZ) referenced in function "public: __thiscall `class iKXPlugin * __cdecl alloc_da_plugin(class iKX &,struct microcode_t const &)'::`2'::DummyPlugin::DummyPlugin(class iKX &,struct microcode_t const &)" (??0DummyPlugin@?1??alloc_da_plugin@@YAPAViKXPlugin@@AAViKX@@ABUmicrocode_t@@@Z@QAE@01@Z)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall iKX::close(void)" (__imp_?close@iKX@@QAEHXZ) referenced in function "int __cdecl query_loaded_plugins(void)" (?query_loaded_plugins@@YAHXZ)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall iKX::enum_microcode(int,struct microcode_t *)" (__imp_?enum_microcode@iKX@@QAEHHPAUmicrocode_t@@@Z) referenced in function "int __cdecl query_loaded_plugins(void)" (?query_loaded_plugins@@YAHXZ)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall iKX::~iKX(void)" (__imp_??1iKX@@QAE@XZ) referenced in function "int __cdecl query_loaded_plugins(void)" (?query_loaded_plugins@@YAHXZ)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall iKX::init(int,int)" (__imp_?init@iKX@@QAEHHH@Z) referenced in function "int __cdecl query_loaded_plugins(void)" (?query_loaded_plugins@@YAHXZ)
    Autohack.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall iKX::iKX(void)" (__imp_??0iKX@@QAE@XZ) referenced in function "int __cdecl query_loaded_plugins(void)" (?query_loaded_plugins@@YAHXZ)
    Release/Autohack.exe : fatal error LNK1120: 32 unresolved externals
    I see its kX related stuff - but - if I remove the references - it says it cant find the headers.... and the help file shows a couple of densly written pages of 'possible' problems.... arg!:confused: Its that type of stuff that makes me want to throw my PC at Billy. :D
     
  8. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    you need to link to "kxapi.lib" (this setting is a bit different for either version of msvc - for example in vs2005 - it's in "Project"->"Properties"->"Configuration Properties"->"Linker"->"Input"->"Additional Dependencies" - just type your full path to "kxapi.lib" there)
     
  9. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I usually just use relative paths (i.e. "..\lib\kxapi.lib") so that I do not have to modify anything when recompiling for different SDK versions, etc.

    I can email you my project files (for VC .NET 2003) if you want (might be easier for you).
     
    Last edited: Aug 27, 2008
  10. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    That was it! Thanks Max :D

    @ Russ
    I simply added the reference and copied the .lib file to the project file.
    I have the SDK in Program Files and VC projects in My Docs... so it would probably not have worked I would presume... ???

    But... I just dont understand the IDE, which is probably 75% of my frustration with MSVC - combine that with the language its self and..well - for a casual programmer its a lot to have to learn for occasional use.

    Anyway... from here I can edit it to make parsing easier to make the kx/Sonar files. Max's autohack tool makes it a whole lot easier.

    Thanks to Both yous guys - as always yur the Mostest Awesomest :cool:

    I'll post the the rest shortly... well - Im not as fast as you guys in any language... lol
     
  11. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Yup, it wouldn't have worked.
     
  12. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    I figured as much... now I have a question...

    Shouldnt 'plugin->kxdevice = 0;' allow me to choose what device? (it does not seem to)

    I see in the kXplugin.h header :
    But I tried declaring:
    I dont see how to select devices.
     
  13. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    device is selected with api.init() call (see in query_loaded_plugins() function)
    by default it's 0 - replace it with api.init(#device);
    then, yes, you will need to change
    plugin->kxdevice = 0;
    to
    plugin->kxdevice = api.device_num;
    (to make the plugin to use same device as we inited the api for)
     
  14. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    Thanks - it works when I hard code the device number...but...

    Throws this errror...
    error C2248: 'iKX::device_num' : cannot access private member declared in class 'iKX'

    But thats not really my problem atm (hard coding the device # works, and shows the second device)...
    I am trying to accept command line arguments..
    int selectedDevice = argv[1]

    But...
    1) it seems line those have to be declared in a main() function, which isn't used....
    2) examples show it as: char *argv[] - which I take it, is a pointer to an array of chars - so I need to cast to integer, but I get errors when I cast the pointer... I though something like selectedDevice = INT(@argv[]) would work... but I get nowhere.

    I need to get some sleep for now... my eyes are getting bug-like...

    Thanks again.
     
  15. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    ah, sorry - it should be:
    plugin->kxdevice = api.get_device_num();

    command line & device - something like that:
    Code:
    int query_loaded_plugins(int device_index)
    {
        iKX api;
        int ret = api.init(device_index);
    
        ...
    }
    
    // .........................................................
    
    int main(int argc, char* argv[])
    {
        int device_index = 0;
        if (argc > 1)
            device_index = atoi(argv[1]);
    
        ...
    
        return query_loaded_plugins(device_index);
    }
    (just in case i re-uploaded sources with these changes, there're also some minor bug fixes)
     
    Last edited: Aug 27, 2008
  16. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    no problem... its the stuff that should be way simpler that kills me...

    like 'atoi' = wtf.... scouring google and the MSVC help never once mentioned..I searched 'char conversion', 'string conversion', 'type conversion'... but with 500 results (every fricken time) found in MSVC - no wonder I missed it. lol (*in a 'going mad' tone*) :D

    this is what I had - and it compiles with warnings, I never did run it to see if it worked, but ffs... the VC help system is quite the PITA.
    Code:
    int main(char *argv[1])
    {
        int myDevice = (int)*argv[1];
    	_set_se_translator(exception_translator);
        // struct pause {~pause() {system("pause");}} pause;
        return query_loaded_plugins(myDevice);
    Thanks again Max
     
  17. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    @Max
    I take it that the blacklisted GUID is just there to serve an an example?

    Out of curiosity, (with .da plugins) why set the param type to KX_FXPARAM_USER instead of KX_FXPARAM_LEVEL (which is what kX seems to use for these). Any particular reason?

    @Maddogg6
    There are many ways to convert string to int, thus many possible results.
    Also, the default filters tend to bring up results that you might not expect to be included (i.e. SQL server stuff), so once you get the hang of things, you might want to make your own custom search filters (to narrow down the results a bit). Also, take notice of some common patterns used for function names as often you can guess what the function you are looking for might be called, which can help with searching for such info.

    BTW: You might want to check out stuff like the CodeGuru FAQ's for answers to some common questions, etc: http://www.codeguru.com/forum/forumdisplay.php?f=72
     
    Last edited: Aug 27, 2008
  18. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    BTW: I tested kX Automation with epilog MasterL/MasterR and the resulting values were in the 0...+1 range, so I guess E. has not updated that code to use the new values as of yet.
     
  19. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    I tested kX Automation with epilog MasterL/MasterR and the resulting values were in the 0...+1 range

    yep, this what i was trying to say. He did not update the code because it's no code there :). The only "standard" solution would be if these plugins do override describe_param(). But assuming there're too many of them, they are continiuosly changing and also have a lot of hardware dependencies (involving a lot of macro hacks inside) - the 'standard' way would be overkilling - so i guess he'll just come up with some hack (if come up at all).
    So, for a moment - we have the automation a bit broken for these plugins - it's still working but the phase is inverted + no bit-2-bit pass through at the nominal level -
    and, actually, maybe (taking the big picture) it is so unsignficant that it's no worth to fix at all (phase is irrelevant and we're still getting 23 of 24 bits) :).
     
  20. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    I take it that the blacklisted GUID is just there to serve an an example?

    Yep.

    KX_FXPARAM_USER instead of KX_FXPARAM_LEVEL (which is what kX seems to use for these). Any particular reason?

    Nope, no reason. Just a personal favour. (It's more like 'whatever' or 'N/A' in the context)
     

Share This Page

visited