|
 |
|
Feb 20, 2007, 08:59 PM
|
#1 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
Auto Mute plugin?
Is there a plugin - that exists that will act as a sort of binary 'ducker'.
Binary in that - it acts as a switch (on or off only, not mix amount like a traditional ducker would do with say a sidechannel input of a compressor)
What Im looking to do is...
Say I am using Prologica to upmix stereo signals. Which I send FXBuss 0/1 to.
I mix the REAR outputs of prologica with FXBuss 6/7 - and output to epilogs rear outputs.
This works fine EXCEPT - that when I say, use foobar to UPMIX - or play a DVD, I would like so way to automatically mute the prologica REAR from going to epilog - so FXBUSS 6/7 is ONLY heard..
I realize this may be possible with dynamics processor, I havent tried yet, but its kinda a resource hog to as I dont want compression/expansion - just a simple ON or OFF 'ducker'.
Does this exist, if not - how is 'ON or OFF' figured in KX DSP (more precisely, DANE ONLY).
*Hopes that made sense*
Thanks,
Mark
|
|
|
Feb 20, 2007, 09:26 PM
|
#2 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Assuming that the audio to FxBus 6/7 is not gated (so that when something is playing, there is always some minimum level to use for detection), then it should be pretty easy to do using conditional logic (use skip instructions).
Something like (pseudocode):
if (abs(in2) > 0)
out = in2
else
out = in1
Is this something that you want to try and make yourself?
<edit>
Actually the abs (above) is not even necessary, since you can just check for a non-zero value at the input (use a skip instruction using 0x100 as the test_value) .
i.e.
if (in2 != 0)
out = in2
else
out = in1
</edit>
Last edited by Russ : Feb 20, 2007 at 09:53 PM.
Reason: typo
|
|
|
Feb 20, 2007, 10:10 PM
|
#3 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
Quote:
Originally Posted by Russ
Is this something that you want to try and make yourself?
<edit>
Actually the abs (above) is not even necessary, since you can just check for a non-zero value at the input (use a skip instruction using 0x100 as the test_value) .
i.e.
if (in2 != 0)
out = in2
else
out = in1
</edit>
|
Ahh - ok the skip instruction - yes I would like to make this myself in DANE - I guess I was making sure I didnt set out on an impossible quest. 
(I wasnt sure if it was possible with DANE only)
Thank you sir...
|
|
|
Feb 20, 2007, 10:19 PM
|
#4 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Just remember that the skip instruction, skips if the test condition is true (sort of the opposite of using if..then).
Let me know if you need any help with it.
|
|
|
Feb 20, 2007, 11:13 PM
|
#5 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
Ok - here it is, I added level controls too.
edit:
Description: If signal is present on FXBIn - then mute PL inputs. With level controls
Code:
input FXBInL, FXBInR, PLInL, PLInR
output OutL, OutR
control FXB=1, PL =1
temp t1, t2
; code
macs t1, 0, FXBInL, FXB ; t1 = T1 + PLInL * PL
macs t2, 0, FXBInR, FXB ; t2 = T2 + PLInR * PL
skip t1, ccr, 0x100, 2 ; if FXBInL = 0.. then Skip next 2 instructions
macs t1, 0, PLInL, PL ; t1 = T1 + PLInL * PL
macs t2, 0, PLInR, PL ; t2 = T2 + PLInR * PL
macs OutL, 0, t1, 1 ;
macs OutR, 0, t2, 1 ;
Edit: Fixed as per Russ' keen eye - pointing out this dumb guy. 
(Now!) Seems to work as I expect - but any suggestions to optimize or potential problems please post em...
Thanks again Russ.
Last edited by Maddogg6 : Feb 21, 2007 at 01:12 AM.
|
|
|
Feb 20, 2007, 11:56 PM
|
#6 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Ok, there are some optimizations that you can do:
Use Outputs instead of temp registers when possible (save gprs).
Add the 2 channels together so that it is triggered if there is a signal from either channel.
Your code was not working for me, and I am not sure why, I will have to take a closer look at it.
In the mean time, here is the code I used while I was waiting (to show another (very similar) way of doing it)...
input in1_left, in1_right;
input in2_left, in2_right;
output out_left, out_right;
macs out_left, in2_left, 0, 0;
macs out_right, in2_right, 0, 0;
acc3 0, out_left, out_right, 0;
skip ccr, ccr, 0x100, 2;
macs out_left, in1_left, 0, 0;
macs out_right, in1_right, 0, 0;
To add volume controls, you would just change the first 2 and last 2 instructions to apply the volumes.
Ok, now let me figure out why your code is not working for me...
Last edited by Russ : Feb 21, 2007 at 03:35 PM.
|
|
|
Feb 21, 2007, 12:36 AM
|
#7 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Ok, I see what the problem is, you have the conditions backwards (those skip instructions can be confusing).
i.e.
if (in1 != 0)
out = in2 // in2 only plays when a signal is at in1
else
out = in1 // only gets here if in1 is 0, so nothing plays at all if it gets here
BTW:
Why use this:
-----------
macs OutL, 0x0, t1, 0x7fffffff;
macs OutR, 0x0, t2, 0x7fffffff;
-----------
instead of:
-----------
macs OutL, t1, 0, 0;
macs OutR, t2, 0, 0;
-----------
Not that it really matters, I am just curious...
<edit>
One more thing...
I would swap the positions of your volume controls, such that top slider controls volume for the top inputs, and the bottom slider controls the volume for the bottom inputs. Just because it is what I am used to with plugins like Stereo Mix, GainHQ, etc (I kept adjusting the wrong slider).
</edit>
Last edited by Russ : Feb 21, 2007 at 01:38 AM.
|
|
|
Feb 21, 2007, 01:01 AM
|
#8 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
I fixed the post - Ok - NOW it works - Im positively 100% sure - I think.
hehe.
Anyway - I have a question:
Quote:
acc3 0, out_left, out_right, 0;
skip ccr, ccr, 0x100, 2;
|
I was wondering why testing this wasn't good?
Quote:
macs out_right, in2_right, 0, 0;
skip out_right, ccr, 0x100, 2;
|
?? - beside the fact you multiplied by zero (which would always = zero, no??)
(edit: nevermind the above Q - DoH out=in+(0 *0) /end edit)
But the question is more on why you added an extra instruction for the test - does that reset a value or something.
Edit - I gotya - My way is ONLY testing RIGHT - your test the combination of L+R...
Sorry - I dum ....
But then agian - Im saving an instruction - so - 'I dum like skunk'.
Last edited by Maddogg6 : Feb 21, 2007 at 01:21 AM.
|
|
|
Feb 21, 2007, 01:14 AM
|
#9 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
MACS instructions takes the form: R = A + (X * Y)
(order of operations does multiplication before addition)
MACS R, A, 0, 0; R = A + (0 * 0) or R = A
MACS R, A, 0, 1; R = A + (0 * 1) or R = A
The above instruction has the same result as the previous one, the 1 does nothing (1 * 0 = 0) except make it confusing as to what the code is supposed to do when reading it.
skip out_right, ccr, 0x100, 2;
Why are you saving the result of the skip instrcution in out_right?
You do not need to save it at all, and further it is modfying the value of out_right.
You did the same thing in your code with your tmp variable, so that when t1 is fed to the output, it is the result of the skip instruction instead on the input. You need to fix that.
Just make it:
skip ccr, ccr, 0x100, 2;
Give me a min and I will look at your update and see if there is anything else.
|
|
|
Feb 21, 2007, 01:25 AM
|
#10 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Ok, the only problem that I see with your new code is with the skip instruction:
Code:
skip t1, ccr, 0x100, 2 ; if FXBInL = 0.. then Skip next 2 instructions
Remove 't1' and use 'ccr' instead as I said in my previous post.
The comment is wrong, should read:
if FXBInR != 0.. then Skip next 2 instructions
(note the 'R' and the "!=")
The rest would just be optimizations to get rid of the temp variables, etc.
The only problem with such a plugin, is with audio sources that have parts in them that are completely silent (i.e. value of 0). With no noise floor (digital material), such silences can cause it to act up. It would be good to add a timer of some sort to keep it from unmuting the other input during short periods of silence, etc.
Last edited by Russ : Feb 21, 2007 at 01:36 AM.
|
|
|
Feb 21, 2007, 01:31 AM
|
#11 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
Ok I tried yur optimizations and I think the FIRST macs that SET output registers are causing them to be set for PLIN then AGAIN for FXB - when signal is present on both... so I think the temp registers are needed.
|
|
|
Feb 21, 2007, 01:45 AM
|
#12 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
Ok - I got it this time - poor Russ, puttin up with my idiotic ways..
Code:
input FXBInL, FXBInR, PLInL, PLInR
output OutL, OutR
control FXB=1, PL =1
; code
macs OutL, 0, FXBInL, FXB ; OutL = 0 + PLInL * PL
macs OutR, 0, FXBInR, FXB ; OutR = 0 + PLInR * PL
acc3 0, FXBInL, FXBInR,0 ; Add BOTH inputs to test BOTH L & R for any signal
skip ccr, ccr, 0x100, 2 ; If FXBInL+FXBInR != 0.. then Skip next 2 instructions
macs OutL, 0, PLInL, PL ; OutL = 0 + PLInL * PL
macs OutR, 0, PLInR, PL ; OutR = 0 + PLInR * PL
I should have beed using headphones for test this whole time to more accurately hear what was happening.
Anyway - its working 100% now - no really - it is...
Thanks again Russ for your patients and suggestions - I'll find that cliff right away... Now did you say I should leap forwards or backwards ?? lolz
edit: I added your suggested ACC3 - as it clicks less durring fade outs when signal id onFXBIn.
Now - 1 more Q - I'm thinking of using iTram (say 10 samples) and adding FXBIn's and sending the sum to that iTram, and adding that as well to the ACC3 instruction - to get a sort of delay in muting - to reduce the artifacts - as we're always crossing 0)
An I still being dum with this idea??
Last edited by Maddogg6 : Feb 21, 2007 at 01:59 AM.
|
|
|
Feb 21, 2007, 01:48 AM
|
#13 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Quote:
Originally Posted by Maddogg6
Ok I tried yur optimizations and I think the FIRST macs that SET output registers are causing them to be set for PLIN then AGAIN for FXB - when signal is present on both... so I think the temp registers are needed.
|
I am not sure what you mean, I would have to see how you coded it. It works for me (except my code mutes in1 when a signal is presnt at in2).
<edit>
Just saw your last post... that looks better 
</edit>
Last edited by Russ : Feb 21, 2007 at 01:57 AM.
|
|
|
Feb 21, 2007, 02:04 AM
|
#14 (permalink)
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 3,875
|
Quote:
Originally Posted by Maddogg6
Now - 1 more Q - I'm thinking of using iTram (say 10 samples) and adding FXBIn's and sending the sum to that iTram, and adding that as well to the ACC3 instruction - to get a sort of delay in muting - to reduce the artifacts - as we're always crossing 0)
An I still being dum with this idea??
|
Sounds ok to me... Give it a try, that is part of the fun with making your own plugins, trying out ideas and seeing if/how well they work.
|
|
|
Feb 21, 2007, 02:04 AM
|
#15 (permalink)
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,580
|
Something like this...
Code:
itramsize 10
; xtramsize 0
input FXBInL, FXBInR, PLInL, PLInR
output OutL, OutR
control FXB=1, PL =1
; code
idelay write dw at 0x0
macs OutL, 0, FXBInL, FXB ; t1 = T1 + PLInL * PL
macs OutR, 0, FXBInR, FXB ; t2 = T2 + PLInR * PL
acc3 0, FXBInL, FXBInR, dw
skip ccr, ccr, 0x100, 2 ; FXBInR != 0.. then Skip next 2 instructions
macs OutL, 0, PLInL, PL ; t1 = T1 + PLInL * PL
macs OutR, 0, PLInR, PL ; t2 = T2 + PLInR * PL
So far seems to work
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|