| Hi
I have a strange problem that I had before, I even have a solution.
Still I'd like to get clever heads opinion on the problem and my solution.
I have the following instrument. It's a global fx that does delay with
delay time and feedback set from another instrument. I use macros for
the global vars to not have to hardcode it into the instrument, in case
you wonder why..
The problem is the final two lines, where the global arate vars are
reset. They should be reset to 0, but this will make csound go crazy
after a minute or so, using up 100% of cpu cycles. I wonder
1) why setting to zero doesn't work while a small number does?
2) if it's a bug in csound (behaviour was the same in 4.23) or in my
handling of global vars?
3) how small the number should be not to be heard or interfer with audio
(I guess it's actually introducing a small dc offset, right?)?
4) if there's a better solution to the problem than mine?
instr +fake_ping_pong_delay_tap
adelaytime = $FX_TAP_DELAY_TIME
kfeedback = $FX_TAP_DELAY_FEEDBACK
adelayl flanger $FX_TAP_DELAY_L * kfeedback, adelaytime,
kfeedback, 1
adelayr flanger $FX_TAP_DELAY_R * kfeedback, adelaytime,
kfeedback, 1
outs adelayl,adelayr
$FX_TAP_DELAY_L = .001
$FX_TAP_DELAY_R = .001
endin
The macros are defined like this:
#define FX_TAP_DELAY_TIME #gk_fx_tap_delay_time#
#define FX_TAP_DELAY_FEEDBACK #gk_fx_tap_delay_feedback#
#define FX_TAP_DELAY_L #ga_fx_tap_delay_l#
#define FX_TAP_DELAY_R #ga_fx_tap_delay_r#
$FX_TAP_DELAY_TIME init .55
$FX_TAP_DELAY_FEEDBACK init .3
$FX_TAP_DELAY_L init 0
$FX_TAP_DELAY_R init 0
And I send audio to the fx by another macro:
#define GLOBAL_FX_TAP_DELAY(IN_L'IN_R'WET) #
$FX_TAP_DELAY_L = $FX_TAP_DELAY_L + $IN_L * $WET
$FX_TAP_DELAY_R = $FX_TAP_DELAY_R + $IN_R * $WET
$IN_L = $IN_L * (1 - $WET)
$IN_R = $IN_R * (1 - $WET)
#
Which is used like this in regular instruments:
$GLOBAL_FX_TAP_DELAY(aoutl'aoutr'i_delay)
--
peace, love & harmony
Atte
http://www.atte.dk |