Hi! I’m trying to record my drum instrument with the fout upcode, however it only gives me an error where it can’t open the sound file. Can anyone help me with this issue?
Edit: Hope this helps
<Cabbage>
form caption("Drum´n´Samp") size(320, 200), guiMode("queue"), pluginId("1002") colour(100, 150, 170), bundle("Clap.wav", "GlitchSnare.wav", "Jacku.wav")
keyboard bounds(14, 228, 326, 74) channel("keyboard3")
vslider bounds(10, 24, 50, 150) channel("Kick") range(0, 1, 0.5, 0.8, 0.01) text("Kick") trackerColour(0, 255, 255, 255) fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
vslider bounds(60, 24, 50, 150) channel("Snare") range(0, 1, 0.5, 0.8, 0.01) text("Snare") trackerColour(0, 255, 255, 255) fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
vslider bounds(110, 24, 50, 150) channel("HH") range(0, 1, 0.5, 0.8, 0.01) text("Hi-Hat") trackerColour(0, 255, 255, 255) fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
vslider bounds(160, 24, 50, 150) channel("Clap") range(0, 1, 0.5, 0.8, 0.01) text("Clap") trackerColour(0, 255, 255, 255) fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
vslider bounds(210, 24, 50, 150) channel("GlitchSnare") range(0, 1, 0.5, 0.8, 0.01) text("Glitch") trackerColour(0, 255, 255, 255) fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
vslider bounds(260, 24, 50, 150) channel("Jacku") range(0, 1, 0.5, 0.8, 0.01) text("Jacku") trackerColour(0, 255, 255, 255) fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialiserer globale verdier
ksmps = 32
nchnls = 2
0dbfs = 1
; Distortion Table
gifn ftgen 0, 0, 257, 9, 0.5, 1, 270
instr 1
; Initialiserer i-variabler
iNote = p4
iAmp = p5
; Initialiserer k-variabler
kKick cabbageGetValue "Kick"
kSnare cabbageGetValue "Snare"
kHH cabbageGetValue "HH"
kClap cabbageGetValue "Clap"
kGlitch cabbageGetValue "GlitchSnare"
kJacku cabbageGetValue "Jacku"
; EGENGENERERTE LYDER
; KICK
if iNote == 36 then
kOscEnv expon 1, 0.15, 0.00001
kPitchEnv expon 150, 0.5, 50
aOsc oscil kOscEnv, kPitchEnv
kNoiseEnv expon 0.1, 0.05, 0.00001
aNoise rand kNoiseEnv * iAmp
aKick = aOsc + aNoise
aMix distort aKick, 0.3, gifn
aMaster = aMix * kKick
outs aMaster, aMaster
; SNARE
elseif iNote == 38 then
kOscEnv expon 0.4, 0.1, 0.00001
aOsc oscil kOscEnv, 150
kOscEnv2 expon 0.7, 0.02, 0.00001
aOsc2 vco2 kOscEnv2, 300
aOsc3 oscil kOscEnv, 300
kNoiseEnv expon 0.4, 0.2, 0.00001
aNoise rand kNoiseEnv * iAmp
aKick = aOsc + aOsc2 + aOsc3 + aNoise
aMix distort aKick, 0.3, gifn
aMaster = aMix * kSnare
outs aMaster, aMaster
; HIGH-HAT
elseif iNote == 40 then
kOscEnv2 expon 0.2, 0.02, 0.00001
aOsc2 vco2 kOscEnv2, 500
kNoiseEnv expon 0.3, 0.1, 0.00001
aNoise rand kNoiseEnv * iAmp
aKick = aOsc + aOsc2 + aNoise
aMix distort aKick, 0.3, gifn
aMaster = aMix * kHH
outs aMaster, aMaster
; SAMPLES
; SAMPLE 1
elseif iNote == 41 then
aSampleL, aSampleR diskin2 "Clap.wav", 1, 0, 0
iLen filelen "Clap.wav"
xtratim iLen
aMaster = (aSampleL * iAmp) * kClap
outs aMaster, aMaster
; SAMPLE 2
elseif iNote == 43 then
aSampleL, aSampleR diskin2 "GlitchSnare.wav", 1, 0, 0
iLen filelen "GlitchSnare.wav"
xtratim iLen
aMaster = (aSampleL * iAmp) * kGlitch
outs aMaster, aMaster
; SAMPLE 3
elseif iNote == 45 then
aSampleL, aSampleR diskin2 "Jacku.wav", 1, 0, 0
iLen filelen "Jacku.wav"
xtratim iLen
aMaster = (aSampleL * iAmp) * kJacku
outs aMaster, aMaster
endif
fout "hello.wav", 18, aMaster, aMaster
endin
</CsInstruments>
<CsScore>
f0 z
</CsScore>
</CsoundSynthesizer>