|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
dsp programming help~
eh~hello!
i've written a plugin to do signal based channel selection: Code:
; New microcode
name "sound ctrl sound";
copyright "Copyright (c) 2004.";
created "02/06/2010";
engine "kX";
; comment "";
guid "9687fa8a-8657-4179-86f2-1b36227579d8";
; -- generated GUID
; code
input in1L, in1R, in2L, in2R;
input in_ctrl;
output outL, outR;
temp in_t;
acc3 in_t, in_ctrl, 0x0, 0x0;
skip ccr, ccr, 0x100, 0x2;
acc3 outL, 0x0, 0x0, in1L;
acc3 outR, 0x0, 0x0, in1R;
acc3 in_t, in_ctrl, 0x0, 0x0;
skip ccr, ccr, 0x8, 0x2;
acc3 outL, 0x0, 0x0, in2L;
acc3 outR, 0x0, 0x0, in2R;
end
when the in_ctrl has signal, the plug should only send in2L/in2R to output the plugin seems working, but if the in_ctrl reach the peak(i turn the player's volume to max, maybe it reached 0x80000000??), the first skip code sometimes doesn't work, thus marks the final output has some clicks/pops what's the matter? can someone help me out? very thanks! regards, jo~
__________________
|
|
|
|
|
|
#2 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: dsp programming help~
Testing for zero directly on the signal is not the best way to go. The signal is a periodic waveform and it instantaneous value could be anything at some point in the cycle. Additionally, kX divides all signals that enter the DSP by 4 (to make headroom for plugins, etc... it is multiplied by 4 again when leaving the DSP), which increases the chances that the instantaneous value will be zero more frequently at lower volume levels.
You are better off taking an average signal level (e.g. envelope detector) and maybe testing for some threshold level (e.g. try adding a noise gate to the control signal and see if you get different results). Last edited by Russ; Feb 6, 2010 at 05:56 PM. |
|
|
|
|
|
|
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
Re: dsp programming help~
eh~ seems the problem was that the signal reach the peak, the mono input was connected to the output from a media player, if i didn't turn the volume to max(even in 99%), everything is ok, but when the volume was set to 100%, the first skip code sometimes fail to work, that's why i'm wondering...
ps:i've tried to do a simple noise gate by using macsn to subtract a given level from the input signal, but it dosen't help
__________________
|
|
|
|
|
|
#4 | |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: dsp programming help~
I do not know about that... Are you sure the code is not working or could it just be a noise issue (What OS are you using? People have reported noise issues with Vista/7 that may be effected by volume levels.)? Are you sure it is not something your media player is doing when it's volume is set to 100? (e.g. What does it sound like without your plugin?)
Quote:
Also take a look here: Envelope detector (Note: The interp instruction can be useful here) Last edited by Russ; Feb 6, 2010 at 06:38 PM. |
|
|
|
|
|
|
#5 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: dsp programming help~
BTW: You might consider using a compressor w/side chain inputs and a noise gate to do what you want.
i.e. Something like this. Last edited by Russ; Feb 6, 2010 at 07:28 PM. |
|
|
|
|
|
|
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
Re: dsp programming help~
hey Russ, you've just save my work, very thanks
the interp instruction is very useful indeed
__________________
|
|
|
|
|
|
|
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
Re: dsp programming help~
ps:the compress w/sidein plus noise gate should work, but they eat to much GPRs
__________________
|
|
|
|
![]() |
| Thread Tools | |
|
|