|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Dane and KX Register Access
Hello,
Ok so I'm reading a thread between Max and Lex and my heart dropped 10 feet (thats abut 3 meters) - when I read something about Lex dropping ProFx/SRC (maybe just joking.. ??) But it got me thinking about how an average Joe (read: using Dane) be able to make plugins for things like I2S Inputs (that are accessed with SRC as well as FXBuss) ? I see in SRC dane with Coax/Optical selected 'KX_IN(0x6)' and 'KX_IN(0x7)' The KX_IN shows as a keyword in dane editor - BUT if I try to compile that, Dane gives an error because of the '('. Is this something that can only be accessed with C++? Or are the KX_IN and KX_FX translated from something else.? Thanks in advance, Mark |
|
|
|
|
|
#2 |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66 ![]() ![]() ![]() ![]() ![]() ![]() |
>Is this something that can only be accessed with C++?
yep. |
|
|
|
|
|
#3 | ||
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Quote:
No not joking. More like "why bother changing it". Quote:
but there used to be a very old SRC source code in the sdk. Although that code really sucks you can see how it's done in principle. PS: hmm,.. to be honest, I cant remember for sure if it was *that* code that sucked. All I know is that the older (included) profx , mx6 code etc. etc. sucked
Last edited by Lex Nahumury; Mar 15, 2007 at 08:39 PM. |
||
|
|
|
|
|
#4 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
|
|
|
|
|
|
#5 |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66 ![]() ![]() ![]() ![]() ![]() ![]() |
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
LOL - Thanks guys
lol - I told you 100,000,000,000,000 times - no more exaggerations. ![]() Quote:
Maybe hacking prolog would be easier to grasp if so.. ?? but then theres the dane stuff to deal with... ??? wheres that tylonol at now..??
|
|
|
|
|
|
|
#7 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Only bare minimum C++ is needed. To use these hardware registers, you really only need to make changes to the da_yourplugin.cpp file, otherwise it is the same as any other C++ plugin (it can be as complicated or simple as you want).
i.e. If you do not need a GUI, or parameters (and you are not checking for model specific stuff), etc (i.e more like Dane only plugin), then much of the C++ code can be eliminated. IIRC, you only need the following: request_microcode() get_plugin_description() Last edited by Russ; Mar 16, 2007 at 11:43 PM. |
|
|
|
|
|
#8 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Accessing those 'special I/O registers' has nothing to do with the GUI part of a plugin, hence nothing to do with "skinning" code at all.
EDIT: ah, Russ posted approx at the same time
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Thanks Russ
Quote:
I'll need to play around more with that tho.. edit: Im still struglling trying to understand the C++ stuff - not to mention much of the dane too.. Like how do I export to C++ from dane editor - if I cant rely on the code being correct - it wont compile. as a for instance - I'm still not grasping stuff like that as well. /edit Thanks again guys. Mark |
|
|
|
|
|
|
#10 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
If the Dane code is valid (i.e. works as a Dane only plugin) then exporting from Dane should produce the correct code. The only issue is with the plugin name, as it auto-generates the C++ name using the plugin name. For this reason it is easier to name your plugin using C++ naming conventions (use the name your C++ code uses (using correct case, etc), and only for the purpose of exporting the code), and then change the name where it appears in quotes, to the name you want the plugin to use (or change it as Lex suggested in the other thread, either way minor editing of the da_yourPlugin.cpp is needed).
i.e. Code:
char *[COLOR=DeepSkyBlue]PluginName[/COLOR]_copyright="plain text here";
char *[COLOR=DeepSkyBlue]PluginName[/COLOR]_engine="plain text here";
char *[COLOR=DeepSkyBlue]PluginName[/COLOR]_comment="mostly plain text here ($nobypass, etc. being exceptions)";
char *[COLOR=DeepSkyBlue]PluginName[/COLOR]_created="plain text here (date)";
char *[COLOR=DeepSkyBlue]PluginName[/COLOR]_guid="the plugin's GUID";
char *[COLOR=DeepSkyBlue]PluginName[/COLOR]_name="the plugin's name in plain text";
int [COLOR=DeepSkyBlue]PluginName[/COLOR]_itramsize=0,[COLOR=DeepSkyBlue]PluginName[/COLOR]_xtramsize=0;
dsp_register_info [COLOR=DeepSkyBlue]PluginName[/COLOR]_info[]={...};
dsp_code [COLOR=DeepSkyBlue]PluginName[/COLOR]_code[]={...};
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
|
|
|
|
|
|
|
#12 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Yes, but that is not Dane only code. For that you would have to use different registers (or better, use 0) in place of the hardware registers in order to export it, and then manually edit the da_... file to add the hardware registers.
i.e. SRC set to FxBus 0/1 (just as an example): Code:
macs Left, 0x0, [COLOR=DeepSkyBlue]KX_FX(0x0)[/COLOR], 0x7fffffff; macs Right, 0x0, [COLOR=DeepSkyBlue]KX_FX(0x1)[/COLOR], 0x7fffffff; ; change to macs Left, 0x0, [COLOR=DeepSkyBlue]0[/COLOR], 0x7fffffff; macs Right, 0x0, [COLOR=DeepSkyBlue]0[/COLOR], 0x7fffffff; Code:
dsp_code src_code[]={
/* { instruction, R, A, X, Y } */
{ 0x0,0x8000,0x2040,[COLOR=DeepSkyBlue]0x2040[/COLOR],0x204f }, /* first instruction */
{ 0x0,0x8001,0x2040,[COLOR=DeepSkyBlue]0x2040[/COLOR],0x204f }, /* second instruction */
};
// change to
dsp_code src_code[]={
/* { instruction, R, A, X, Y } */
{ 0x0,0x8000,0x2040,[COLOR=DeepSkyBlue]KX_FX(0x0)[/COLOR],0x204f }, /* first instruction */
{ 0x0,0x8001,0x2040,[COLOR=DeepSkyBlue]KX_FX(0x1)[/COLOR],0x204f }, /* second instruction */
};
BTW: The above is usually written using the value instead of the 'KX_FX(0x0)', etc, but either way should work. i.e. Code:
dsp_code src_code[]={
/* { instruction, R, A, X, Y } */
{ 0x0,0x8000,0x2040,[COLOR=DeepSkyBlue]0x2400[/COLOR],0x204f }, /* first instruction */
{ 0x0,0x8001,0x2040,[COLOR=DeepSkyBlue]0x2401[/COLOR],0x204f }, /* second instruction */
};
Last edited by Russ; Mar 16, 2007 at 03:41 AM. Reason: oops, sorry for double post... hit quote instead of edit... |
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
* scratches nogin *
Err - thanks, I guess I'll have to come back to all this when I get a better handle on all this - but I gotta say - its not a simple thing. - for me anyway. I think I get the jist of what your saying - I gotta change a dummy # with the HW register after I export to C++ from dane. So I guess I need to trust the dane is correct - or need to re-compile DLL for every attempt in dane changes. It looks like dsp.h is the 'road-map' the dane compiler uses to change all the reg's to when export to C++... or maybe all compile dane even... Thanks Russ. |
|
|
|
|
|
#14 |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66 ![]() ![]() ![]() ![]() ![]() ![]() |
>It looks like dsp.h is the 'road-map' the dane compiler uses to change all the reg's to when export to C++...
a sort of... btw. you can use all those definitions to have a bit more human-readable stuff when editing 'C++ exported code' e.g. Code:
#include "dsp.h"
{
{MACS, 0x8000, C_0, KX_FX(0x0), C_7fffffff},
{MACS, 0x8001, C_0, KX_FX(0x1), C_7fffffff},
}
Code:
{
{0x0, 0x8000, 0x2040, 0x2400, 0x204f},
{0x0, 0x8001, 0x2040, 0x2401, 0x204f},
}
Last edited by Max M.; Mar 16, 2007 at 04:11 AM. |
|
|
|
|
|
#15 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
That is generally the way it is done (although some plugins do it a little differently (prolog, epilog, Surrounder+, etc).
i.e. If you change Dane code, re-export to C++, re-compile (any changes to a C++ plugin need to be re-compiled anyway). If it is only a few instructions you could probably just edit the da_file easily enough, but with more instructions and more registers, re-exporting would be easier (and helps to ensure that your register names are mapped correctly, etc (if any of that was changed)). |
|
|
|
|
|
#16 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Quote:
Same as the included kxlt versions which btw also use those I/O register 'tricks'. ProFx v3.x source code (the skinned one) is not included in any distro! 2. Follow Russ's instructions. In other words; Since we can not enter stuff like; [COLOR="Blue"]macs Left, 0x0, KX_FX(0x0), 0x7fffffff;[/COLOR] into dane editor, we simply enter 'dummy' Dane code instead; [COLOR="Blue"]macs Left, 0x0, 0, 0x7fffffff;[/COLOR] were in this case the '0' acts as a placeholder for KX_FX(0x0). So after exporting to C++ just substitute that '0' with KX_FX(0x0) in the da_plug.cpp file. This is just one way of doing it. EDIT: Ah, more help is/was on the way. Lol maddog, you can't go wrong now
Last edited by Lex Nahumury; Mar 16, 2007 at 04:13 AM. |
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
Just not very intuitive for my limited programming-able brain
|
|
|
|
|
|
|
#18 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Quote:
And even if you would use those regs in a 'big' plugin, the code lines containing them are simple per definition. |
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
that most likely meant 'not so simple' dane AND HW registers too... but I'll wait on that one too I guess .. lolBaby steps suck!!!!!
|
|
|
|
|
|
|
#20 | ||
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
However, for the situation that you describe: Quote:
Again, once you start to actually do this stuff, things become clearer and you will figure out which tricks work the best for you (and maybe figure out some of your own), etc. <edit> If the above completely confused you (sorry), in other words, just use regular inputs/outputs for testing, and connect them to another plugin that gives access to the hardware I/O registers that you want to use. </edit> Last edited by Russ; Mar 16, 2007 at 06:14 AM. |
||
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Woot!!!
I was able to successfully rip off Lex's SRC code and rename it to be my own... J/K - I left the copyright notice... Anyway - I did it from saving my own da_plugin.cpp exported from Dane editor. The code is still all greek to me - but I hope to add FXBuss 32-63 to the list - at least I can compile it. Thanks again guys... maybe you should sell your tylonol stocks now. Naaa - I wouldn't either ![]() Mark |
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Woot!..
Mission Accomplished... I now have a SRC plugin that gives me all FXBuss lines now.. If any one is interested...Its on my MD6 Music Esnips page. READ THE 'READ_ME_OR_DIE_.txt' file to avoid 'invalid plugin version' or what ever error pops up with out that dll I added. *Hopes Lex wont be mad * Last edited by Maddogg6; Mar 16, 2007 at 09:57 PM. Reason: Fixed bug in da plug and needed new URL (again) |
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
Thanks for all your help - just 1 more question tho... Whats responsible for automatic translation? - my plugin asks everytime I add one to the DSP screen - and I don't like that behaviour... I obviously changed something I should not have here Code:
case KXPLUGIN_INSTANTIATE:
if(param<sizeof(plugin_list)/sizeof(kxplugin_list_t))
{
// to avoid numbering stuff
instantiate_plugin(DSPSource,iDSPSourcePlugin);
}
break;
}
*ret=0;
return -1;
}
|
|
|
|
|
|
|
#24 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
I never noticed what that did before... *scratches head and shrugs* |
|
|
|
|
|
|
#26 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
>>Mission Accomplished... I now have a SRC plugin that gives me all FXBuss lines now..
Well, my memory is very bad and I don't do kX stuff anymore but IIRC those >15 or >31 fxbuss numbers are just copies, so I fail to see the use of them. >>*Hopes Lex wont be mad * LoL no ..use whatever you want. Anyway, nice to see you are making progress! |
|
|
|
|
|
|
|||
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
I've played with FXBuss2 before and had happy results too - so I already was confident it was possible. Must have been something that E. fixed somewhere along the line.. I want to say I played with FXBuss2 in 3538H and they worked ?? but I guess maybe it was 3538J - now Im not sure. But I do notice I created a problem - I allowed SBLives to select up to FXBuss 31 - but KX Router for my Live only allows up to FXBuss 15... I thought lives had 32 FXBUss lines. Quote:
Quote:
![]() You too Russ. Thanks again for all the patients and guidance. Last edited by Maddogg6; Mar 16, 2007 at 09:55 PM. Reason: moved D/L link |
|||
|
|
|
|
|
#28 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
What 38xyz^2 version did you compiled it for??
I just installed MMMMMMMMMM!! (boy, am i fed up with this idiotic version incompatibility crap )
|
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
Quote:
If you send me a zip of the SDK you have - maybe I can recompile for it.. ?? Id be more than happy to try anyway... PM me and Ill give ya an email to send it to if you'd like. |
|
|
|
|
|
|
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50 ![]() ![]() |
oh hell - maybe sending the source to ya would be easier.. ?? its for MSVC2003 tho.. ??
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|