Cabbage Logo
Back to Cabbage Site

Applying separate effects to a stereo file

I want to make an application that will open a stereo file (stereo.wav), and apply a pitchshift up 5hz to only the right channel and then be able to play it back. I am somewhat new to csound and I would greatly appreciate any help provided!

Thank you in advance!

If you I think what you’ll need to do is read the file with diskin2, then analyse one channel using pvsanal. Once you have the fsig you can repitch it in real time using pvshift. That should do it.

1 Like

Thanks Rory Walsh! I went to the links you sent, but I am still struggling with the syntax. This is now what I have so far from the tutorials you sent:

instr 1

a1, a2 diskin2 “Enter Sandman.wav”, 1, 0, 1

ifftsize = p4
ioverlap = ifftsize / 4
iwinsize = ifftsize
iwinshape = 1

ffta1 pvsanal a1, ifftsize, ioverlap, iwinsize, iwinshape
ffta2 pvsanal a2, ifftsize, ioverlap, iwinsize, iwinshape
; pvsanal ???
;pvshift ???
outs a1, a2

Something like this will work, just swap out the sound file. I added a slider to control the amount of detuning:

form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginid("def1")
rslider bounds(26, 22, 100, 100), channel("freqShift"), range(-20, 20, 0, 1, 0.01), text("Freq Shift"), 

-n -d -+rtmidi=NULL -M0 -m0d 
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
    a1, a2 diskin2 "pianoMood.wav", 1, 0, 1
    ifftSize = 1024
    ioverlap = ifftSize / 4
    iwinsize = ifftSize
    iwinshape = 1
    ffta1 pvsanal a1, ifftSize, ioverlap, iwinsize, iwinshape
    fShifted pvshift ffta1, chnget:k("freqShift"), 100
    a2 pvsynth fShifted
    outs a1, a2

;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7] 

p.s. can you format any code you post, it just makes it easier to read :+1: