Reputation: 4534
I am trying to reproduce a SoX script using ChucK which creates brown noise with a slight oscillation (tremolo).
The SoX script is:
set -u
set -e
minutes=${1:-'59'}
repeats=$(( minutes - 1 ))
center=${2:-'1786'}
wave=${3:-'0.0333333'}
noise='brown'
len='01:00'
if [ $minutes -eq 1 ] ; then
progress='--show-progress'
else
progress='--no-show-progress'
fi
echo " :: Please stand-by... sox will 'play' $noise noise for $minutes minute(s)."
play $progress -c 2 --null -t alsa synth $len ${noise}noise \
band -n $center 499 \
tremolo $wave 43 reverb 19 \
bass -11 treble -1 \
vol 14dB \
repeat $repeats
exit 0
The following ChucK script, modified from the wind2.ck example, creates brown noise of the desired frequency:
Noise n => BiQuad f => dac;
0.99 => f.prad;
0.0333333 => f.gain;
1 => f.eqzs;
0.00 => float t;
while(true)
5::ms => now;
I am unable to reproduce the effect that the SoX tremolo option creates.
It seems like I should be able to add a Sine wave to the main chain and then oscillate that parameter. I am trying variations of FM.ck frequency modulation example without success:
SinOsc m => Noise n => BiQuad f => dac;
20 => m.freq;
200 => m.gain;
0.99 => f.prad;
0.0333333 => f.gain;
1 => f.eqzs;
0.00 => float t;
while(true)
30 + ( Math.sin(t) + 1.0 ) * 10000.0 => m.sfreq;
t + .004 => t;
5::ms => now;
I expect to hear some fluctuation in the tone, but instead, no sound appears to be produced.
How can I add a low frequency amplitude modulation to the brown noise I've generated?
Upvotes: 1
Views: 111