[LAU] tool to invert left channel and mix it to right

Julien Claassen julien at c-lab.de
Tue Jul 31 04:01:38 EDT 2007


Hi!
  I's say ecasound or csound. For csound I have a one-step idea:
vim test.orc
sr = 44100 ; your samplerate
kr = 4410 ; your controller rate
ksmps = 10 ; sr/kr
nchnls =1 ; number of output-channels

instr 1
  a1, a2 soundin "in.wav"
  a1 = a1 * -1 ; invert left channel
  out a1*.5 + a2*.5 ; add left and right channels with half volume
endin

vim test.sco
i1 0 30 ; perform instrument 1 for 30 seconds

csound -W -o out.wav test.orc test.sco

  With ecasound I can only think of a multi-step solution, which can, on the 
other hand be scripted:
ecasound -f:16,2,44100 -i in.wav -chcopy:1,2 -f:16,1,44100 -o tmp1.wav
# now its mono, I copied left channel to right, to make sure we don't get any 
left channel mixed in, because I'm not sure about this stereo to mono 
conversion.
ecasound -i tmp1.wav -o tmp2.wav -ea:-110
# invert file, apply volume of -100
ecasound -f:16,2,44100 -i in.wav -chcopy:2,1 -f:16,1,44100 -o tmp3.wav
# now created mono-file with only right-channel
ecasound -a:1 -i tmp2.wav -ea:50 -a:2 -i tmp3.wav -ea:50 -a:all -o out.wav 
-z:mixmode,sum
# mix inverted left to right channel.
  I probably did this more complicated than it could be. But this should work.
  Hope that helps!
  Kindest regards
         Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net
the Linux TextBased Studio guide
======= AND MY PERSONAL PAGES AT: =======
http://www.juliencoder.de



More information about the Linux-audio-user mailing list