Hi everyone! Long time no see, finally got around to making small progress in my attempt to recreate one of the Tascam 4 track machines in Cabbage. So I got started with just one channel strip + the pitch control and eq and a little noise for character. (More processing will probably come, but for now wanted to tackle some of the controls)
I ran into some issues with the pareq opcode and don’t know what’s going on.
So, if I’m not mistaken the syntax for the opcode is as follows:
ares pareq asig, kc, kv, kq
I’m obtaining the kv value using cabbageGetValue, and every number lower that 0 should be a cut… well… I’m running into an issue where values lower than -3 (approx) seem to be boosting frequencies, which is just baffling.
Additionally, when trying to use shelving filters (which is what I need if I don’t want to use a peak with a VERY wide Q for a similar effect) and attempt to do a cut, my audio file just stops without any error messages in the console.
Here’s my code if anyone’s willing to take a peek. I’d appreciate any insight.
<Cabbage>
form size(600, 600), colour(58, 110, 182), pluginId("sfi1"), guiMode("queue")
vslider bounds(8, 356, 50, 226) channel("Gain") range(0, 10, 0.3, 1, 0.001) text("GAIN")
textColour(22, 22, 22, 255) valueTextBox(1)
button bounds(372, 460, 114, 91) channel("start") text("Start Playback", "Start Playback"
popupText("Start Playback")
rslider bounds(512, 28, 60, 60) channel("Pitch") range(0.5, 1.5, 0, 1, 0.001) text("Pitch")
textColour(36, 36, 36, 255)
rslider bounds(6, 124, 60, 60) channel("High") range(-10, 10, 0, 1, 0.001) text("High")
textColour(36, 36, 36, 255)
rslider bounds(10, 196, 56, 56) channel("Low") range(-10, 10, 0, 1, 0.001) text("Low"
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-o dac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1
instr 1
; VARIABLES
cabbageSetValue "Gain", 5
cabbageSetValue "Low", 0
cabbageSetValue "High", 0
kStart init 0
kStart cabbageGetValue "start"
kGain cabbageGetValue "Gain"
kLow cabbageGetValue "Low"
kHigh cabbageGetValue "High"
cabbageSetValue "Pitch", 1
kPitch cabbageGetValue "Pitch"
; inserting audio files using diskin2 opcode
a1, a2 diskin2 "./sonifi.wav", kPitch, 0, 0, 1
aFile = a1 + a2
; Tape emulation using a simple low-pass filter
aFile = aFile * kGain + 0.2
aLP = moogladder(aFile, 16000, 0.5)
;the equalizer
aLow1 pareq aLP, 100, kLow, 1.4, 0
aLow2 pareq aLP, 100, kLow, 1.4, 0
aLowMix = aLow1 + aLow2
aHigh1 pareq aLP, 1000, kHigh, 1.4, 0
aHigh2 pareq aLP, 1000, kHigh, 1.4, 0
aHighMix = aHigh1+ aHigh2
aEQ = aLowMix + aHighMix
; Output the signal only when the button is pressed
if kStart == 1 then
outs aEQ, aEQ
endif
endin
instr 2
kStart init 0
kStart cabbageGetValue "start"
aNoise noise .01, 0.6
aNoise clip aNoise, 0, .9 ;clip signal
if kStart == 1 then
outs aNoise, aNoise
endif
endin
</CsInstruments>
<CsScore>
f0 z
i1 0 z if (kStart == 1) f0 = 1, 0
i2 0 z if (kStart == 1) f0 = 1, 0
</CsScore>
</CsoundSynthesizer>