Go Back   DriverHeaven > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP
Register Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old Dec 13, 2007, 12:59 AM   #1 (permalink)
Pablop
DriverHeaven Newbie
 
Join Date: Dec 2007
Posts: 2
Pablop is on a distinguished road

Tiny plugins, new member

Hello everybody!

I'm new to the forum, but not new at all at Kx! I've been using it since the "modified" APS drivers didnīt work anymore (WinXP).
So, first of all, my big, big thanks to all of the team that let me make so many years of audio and music production using my Live!

I've done two little dsp plugins yesterday, after reading some code. Theyīre not a big thing, just consider them a tiny collaboration to the cause.

First one, I call it "Distributor". It routes a stereo signal to either two stereo outputs, but it makes a crossfade from out1(LR) to out2(LR). You could see it as the Crossfade plugin the other way around. I needed it to make a smooth transition between my two outputs, each one feeding a different power amp.

The second, is named "Karaoke Crossfade". It uses the principle of summing the left and right channels with inverted phases to cancel the "central channel", that is, everything that is the same in both channels.
The crossfade lets you choose the signal completely "Dry" at right, or completely "Karaoked" at left. This due to the fact that, depending on the audio material, the effect can be too extreme, leaving just a little of the original audio.

Theyīre given "as it is" . I mean, there must be other ways to program this, and Iīd like your commentaries and suggestions.

My first question (what do you think this is all about?) is,
To develop any gui itīs necessary to combine this with c++, isntīt it?
Even in simple cases i've seen code without "Control" keyword in it (for faders, etc.)

Thank you,

Pablo

PD: Crop the file name so that it finishes in .da (I had to add the .txt extension to upload files)
Attached Files
File Type: txt Distributor.da.txt (624 Bytes, 7 views)
File Type: txt karaoke con crossfade.da.txt (946 Bytes, 10 views)
Pablop is offline   Reply With Quote
Old Dec 13, 2007, 08:20 AM   #2 (permalink)
Russ
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 3,875
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Welcome to the forum .

Yes, C++ is needed to make any GUI controls beyond the basic 0 to 100% slider that the "control" keyword gives you.

Regarding your plugin code:

Distributor:
I do not think this is gonna do exactly what you want. The problem is that you are not just doing a fade, you are also increasing the volume of the side you are fading to, when (I think) what you wanna do is keep the volume at 100% at one output and decrease the volume to the other based on the slider position.

This is one of those plugins might be better to do in C++, since you can set different parameters based on the position of the slider. What you probably want is something like the following:

(psuedo-code)
Code:
if (slider_value = 0.5)
{
    vol1 = 1;
    vol2 = 1;
}

if (slider_value < 0.5)
{
    vol1 = 1;
    vol2 = slider_value * 2;
}

if (slider_value > 0.5)
{
     vol1 = (1 - slider_value) * 2;
     vol2 = 1;
}
You could do it without C++ (using similar microcode logic), but C++ would probably be more efficient (plus you can change the range of the slider and label it as you want, etc).

Karaoke Crossfade:
As a general rule, you do not want to use input registers more than once in your code.
You might consider using the "interp" instruction for Wet/Dry mixing.

Last edited by Russ : Dec 14, 2007 at 11:09 PM.
Russ is offline   Reply With Quote
Old Dec 13, 2007, 09:46 AM   #3 (permalink)
Russ
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 3,875
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

BTW: My "Stereo Balance Plus Fade" plugin does similar to what you are trying to do with the "Distributor" plugin (except it includes balance as well). Check it out if you want. You can download it here.
Russ is offline   Reply With Quote
Old Dec 13, 2007, 09:53 AM   #4 (permalink)
Max M.
d/h member-shmember
 
Join Date: Dec 2002
Location: from the edge of the deep green sea
Posts: 2,097
Max M. is on a distinguished road

Wow! with all these years in C/C++, i have completely forgotten that "Out-AB" is a valid variable name in the Dane. I even could not believe it first (had to check the sources) - and... yes! - even if it looks more like easter egg - Dane allows to use "+", "-" and "." characters in symbol names
Max M. is offline   Reply With Quote
Old Dec 13, 2007, 12:37 PM   #5 (permalink)
Russ
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 3,875
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Regarding the "Distributor" plugin:

Here is a hint that should make it work more like how (I think) you want it to (using Dane only):

Instead of multiplying the input by 2, try the following logic:

Volume for the first output is: slider_value * 2.
Volume for the second output is: (1 - slider_value) * 2.

Factoring in saturation, the above should do the job (without the need for any conditional logic).

Last edited by Russ : Dec 14, 2007 at 11:06 PM.
Russ is offline   Reply With Quote
Old Dec 14, 2007, 04:56 PM   #6 (permalink)
Pablop
DriverHeaven Newbie
 
Join Date: Dec 2007
Posts: 2
Pablop is on a distinguished road

Thanx for the quick answer. Russ, yeah, youīre completely right. After using it a few minutes i figured out that it should work as a "balance" knob in a mixer, and it was not. Just as you say.

I think Iīll instruct myself on how to interface c++ and dane and then keep trying other things. C++ is much human-friendly, of course!!

I once adventured into programming z80's assembler, and remember those huge codes for simple tasks!

If I canīt find the info about c++ and dane, iīll ask. Donīt have much time now.

Thx again
Pablop is offline   Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

 
Powered by: vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
Artwork by Allan 'Zardon' Campbell, vBulletin implementation by Craig '5320' Humphreys based on original artwork by Ratchet.

All times are GMT -5. The time now is 04:33 PM. Copyright ©2008 DriverHeaven.net