|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Echo plugins
Hi all,
One of the first plugins I ever tried to make in kX, was a basic echo plugin, and since I do not see any basic echo plugins included with kx, I thought I would make that plugin available for anyone else that might want to use such a thing. There are two versions, one is a basic echo (echo with feedback/multiple echo), and the other is a slapback (single echo). Also, I made a few different versions of each to suit different needs (different max delays (250/500/1000ms), and differrent mono/stereo versions (1000ms versions are mono only)). They are small so I put them all in one zip file. Both versions (echo and slapback) have a basic slider, to control the amount of delay (a setting of 0 means no delay, thus no echo), and the echo plugins also have a feedback slider. You can download the zip file (echo.zip) here: -Russ |
|
|
|
|
|
#2 |
|
Apple Fanboy?
|
what version of kX are these compiled for?
__________________
Chris - The Aussie Super Mod
Hardwareheaven Rules - Sig Request Thread How you can help HardwareHeaven by using Digg! Hardwareheaven Super-Moderator |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
They are not .dll's, they are just .da's, so they are not limited to any specific kX version.
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
I added another plugin to this group. It is called SlapbackFX and is a version of the Slapback plugin, and can be used in place of all of the previous Slapback plugins. What is different about this one, is that it presents you with an options dialog, where you can choose whether it should be mono or stereo, and allows you to choose the maximum delay (per channel if stereo) that you would like to have (in samples or milliseconds). This allows you to customize the plugin to suit your needs and eliminates the need for multiple versions of the same plugin in order to have a mono/stereo option, and different delay amounts, etc. Let me know if you like the idea of using an options dialog like this, etc. This one is compiled for kX 3538 and is available at the same (above) link (SlapbackFX.zip).
-Russ |
|
|
|
|
|
#5 |
|
S-3D enthusiast
|
The options dialog is a good idea.
I think you should write microseconds instead of ultraseconds. 10^-6 in SI units is micro. |
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
Thanks, Russ |
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
I noticed a small bug in the code (I had made a change in one part of the code and forgot to make the change in another part of the code) that could cause the calculation of the Tram address to be wrong. I fixed the bug, and also made a version of the regular (multi) Echo plugins that use the options dialog as well (EchoFX, availalble at the same link, also compiled for kX 3538).
Last edited by Russ; May 21, 2005 at 08:31 AM. |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
I found a bug with the Options dialog. I create the dialog during request_microcode(), and it turns out that if the tweak window is open when you unload the plugin, that request_microcode() is called 2 more times causing the Options dialog to be created twice before unloading. I am not sure why it does this, but I should be able to code a workaround for that problem.
-Russ |
|
|
|
|
|
#9 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Quote:
It is called before request_microcode(). Maybe helps. /LeMury |
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks for the suggestion, I tried that as well and unfortunatley the same thing happens in init(). I wonder why it does this, I mean why would iKXPlugin::init() get called when unloading the plugin if the tweak window is open? Anyone have any other thoughts/ideas?
Thanks, -Russ |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Currently the only workaround I have is to use a global BOOL variable initialized to FALSE, that I set to TRUE at the IKX_UNLOAD event, and then I only create the dialog if that variable is FALSE. It seems to work, but I do not like using a global variable like this (I would prefer to use a member variable, but I am not sure where I could initialize it, as it will not work in init().). Additionally, I would still like to know the reason behind why init() and request_microcode() is called in this situation as it seems non-logical. Do you think that is a bug?
-Russ BTW: I have not updated the files for download as of yet, as I am still doing some testing. |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
I updated the files.
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
BTW: I added 3537 versions of my plugins to the download page (although they are untested as I am using 3538).
|
|
|
|
|
|
#14 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Quote:
This causes kX driver to output debug error msg. /LeMury |
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Are you going to contact Eugene about this?
|
|
|
|
|
|
#16 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Quote:
I'm not shure but IIRC it was reported before. Can't remember. Anyway; Just tried your echo plugs. Nice option dialog! How about ; - slider readout in ms - slider mouse scroll - de-click on delaytime slider adjust - stereo ping-pong echo - MTC->Tempo(bpm)->delaytime (just some ideas) /LeMury |
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks for the feedback and ideas. My first goal was getting the options dialog to work, and the effect stuff was second, so they are just very basic at the moment. I was thinking that using a dialog like this would be useful for something like an individual outputs plugin (for testing, etc), like we talked about before (rather than having several seperate plugins for each output, you have one and just choose which output you want in the option dialog, etc), and for conserving resources in general. I would definitley like to make the slider adjustments smoother if nothing else (any tips on that?) and I was planning on changing the readout to be in ms, once I moved the controls to C++ code. Ultimately, I was hoping to add a pitch shift option for the echo, but I not sure I am going to be able to do it, as I still have a long way to go with my reading on digital filter theory and the math that goes along with it.
![]() -Russ |
|
|
|
|
|
#18 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Yep, I understood that the options dialog had priority in your echo plugin.
btw; You may want to store settings once user selection has been made thereby avoiding the options dialog to re-appear on reboot/restart kxmixer.exe. /LeMury |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Ahh, I missed that one. Thanks.
|
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Do you (or anyone else) know of an event or flag that I can use to determine whether the plugin is being loaded by the user or by kX? I see the flag in the registry that stores the plugins last state but that is only updated when you exit kxmixer, and not when the plugins are loaded/unloaded. I have some ideas I can try, but I thought I would first check and see if there is something that I may have overlooked.
-Russ |
|
|
|
|
|
#21 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
Easiest way is to use a kSettings object and write/read to/from registry.
/LeMury |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Could you please explain a bit more. I do not see any examples that use kSettings within a plugin. Isn't it just a wrapper class for registry access or is there more to it? (i.e. I am not sure if you are offering a tip for accessing the registry, or if you are speaking about a way to determine how the plugin was loaded/unloaded).
-Russ |
|
|
|
|
|
#23 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62 ![]() ![]() ![]() ![]() |
I don't know if it fits your needs, but you could save a flag/settings or whatever in reg,
which you read back on plug load and then do a conditional dialog popup. (just a thought) /LeMury |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
The underlying problem is still how to determine that kX is restoring settings (from a saved config or at startup, etc). To use such a flag, I would need a specific function/event/condition to tell the plugin to set the flag, but I know of no such function/event/condition. In other words, to use such a flag, I would need some event that would make using such a flag unnecessary (i.e. an On_Restore_Settings event or similair, that only fires when kX is loading a saved configuration from file, or at startup, etc.)).
In any case, thanks for the reply, I know you are busy with your own stuff. -Russ |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Here is a .da verison of a ping pong echo plugin. It is mono in, stereo ping pong out. This one is set for 250 ms max delay.
Code:
name "Echo_PP"; copyright "Copyright (c) 2004 by Russ."; created "06/20/2005"; engine "kX"; ; comment "echo - mono in - stereo ping pong out - max delay 250 msec"; guid "5ed9be6b-21d3-491d-9168-8007f3a2ae9d"; xtramsize 24001 ; Registers input in; output out_L, out_R; control Delay=0x0, Feedback=0x0; temp tmp, tmp_in; xdelay write wd0 at 0x0; xdelay read rd0 at 0x0; xdelay write wd1 at 12001; xdelay read rd1 at 12001; ; Code macs tmp_in, in, 0x0, 0x0; acc3 out_L, tmp_in, 0x0, 0x0; acc3 out_R, tmp_in, 0x0, 0x0; macs wd0, tmp_in, rd1, Feedback; macs wd1, rd0, 0x0, 0x0; acc3 tmp, Delay, 0x0, 0x0; skip ccr, ccr, 0x8, 0x1; macs tmp, 0x7fffffff, 0x0, 0x0; macs out_L, out_L, rd0, tmp; macs out_R, out_R, rd1, tmp; macs &rd0, &wd0, 0x1770000, Delay; macs &rd1, &wd1, 0x1770000, Delay; end For a 500 ms version, make the following changes: ---------------------------------------------- xtramsize 48001 ... xdelay write wd1 at 24001 xdelay read rd1 at 24001 ... macs &rd0, &wd0, 0x2EE0000, Delay macs &rd1, &wd1, 0x2EE0000, Delay ---------------------------------------------- I will add the ping pong version as an option to the EchoFX plugin, once I am able to resolve the restore settings issue. -Russ |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Another issue related to the restore settings problem, is that I also have no way to determine which plugin instance it is trying to restore, as pgm_id is only filled in after the microcode is loaded, and thus it cannot be used as an instance flag in this case. As it stands now, in order to get this working as I intended, I would need some sort of notification that it is restoring settings, and included with that notification, I would need something that indicates what pgm_id it *wants* to use, and I need this information before request_microcode() is called. It is beginning to look like it is not going to be possible with the current kX SDK.
![]() -Russ |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
Well it seems that the new SDK (with 3538i) does include plugin notifications for when a plugin is loaded from a saved config (as well as the notification for when it is saved in that config), but unfortunatley it occurs too late in the loading process to be able to use for the options dialog (to be able to load dynamic microcode based on those settings). Since previous 3538 plugins need to be recompiled to work with 3538i anyway, and since it seems I am not going to be able to get it to work as I had hoped, I am not going to bother updating these plugins, and I will probably remove them all together from my download page (as they are not really all that useful in thier current state).
BTW: I would need to know the saved settings as early in the loading process as possible (i.e. before request_microcode), so that I can read those settings and fill in the dsp_code/dsp_register_info arrays accordingly, etc. Last edited by Russ; Aug 9, 2005 at 12:32 PM. |
|
|
|
|
|
#28 |
|
kX Project Lead Programmer and Coordinator
Join Date: Dec 2002
Posts: 3,106
Rep Power: 73 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
>> I would need to know the saved settings as early in the loading process as possible
you can try calling update_microcode() right after receiving 'RESTORE_SETTINGS' event -- before connections are restored E. |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
I had thought about that and wasn't sure if it would work because I noticed it didn't always work as expected in Dane. i.e. Adding inputs/outputs did not always work when updating microcode through Dane. If you think it might work, I will give it a try.
Thanks, -Russ <<<before connections are restored That sounds promising... Last edited by Russ; Aug 29, 2005 at 10:46 PM. |
|
|
|
|
|
|
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61 ![]() ![]() ![]() ![]() ![]() ![]() |
I did some quick tests, and and think that is going to work.
![]() thanks again, -Russ |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|