Csound Csound-dev Csound-tekno Search About

Newbee: Volume and panning in SCO-file

Date2007-08-05 00:16
FromJonas Nyström
SubjectNewbee: Volume and panning in SCO-file
AttachmentsNone  None  

Date2007-08-05 01:30
Frompeiman
SubjectRe: Newbee: Volume and panning in SCO-file
Yes, but you have to define the parameters in your orchestra file first.
EG:

sr = 44100
kr = 44100
ksmps = 1
nchnls = 2

instr 60

ivol = p4 ;this is the volume: multipling the signal
ipan = p5 ; this is the paning: float numbers range between 0-1  

  aleft, aright diskin "60.wav", 1
  aleft = aleft * ivol
  aright = aright * ivol 
  outs aleft*ipan, aright*(1 - ipan)  

endin


+++++++++++++++++++++++++++++++++++++++++++++

	       ;vol	;pan (0.0 to 1.0)
i60 0   2    1 	      1 
i60 3   2    1 	      0
i60 6   2    1 	      .5  
i60 9   2    2 	      .5 
i60 12  2   .5       .5 



Cambiata wrote:
> 
> Hi!
> 
> I'm compiling a new wavefile from wave fragments (16 bit, 44.1, stereo)
> defined as instruments in a ORC-file, like this:
> 
> sr = 44100
> kr = 44100
> ksmps = 1
> nchnls = 2
> 
> instr 60
>   aleft, aright diskin "60.wav", 1
>   outs aleft, aright
> endin
> 
> instr 61
>   aleft, aright diskin "61.wav", 1
>   outs aleft, aright
> endin
> 
> etc...
> 
> Question:
> Can I specify the volume and panning for each of the "events" in the
> SCO-file?
> 
> i60 0 2  <-- Can I set volume and panning for this "instance" of i60?
> i61 3 2  <-- The same for this one?
> etc...
> 
> 
> 
> Thank you in advance! /
> Jonas Nyström
> 
> 

-- 
View this message in context: http://www.nabble.com/Newbee%3A-Volume-and-panning-in-SCO-file-tf4218261.html#a12001232
Sent from the Csound - General mailing list archive at Nabble.com.

Date2007-08-05 01:44
FromJonas Nyström
SubjectRe: Newbee: Volume and panning in SCO-file
AttachmentsNone  None  

Date2007-08-05 05:29
Fromluis jure
SubjectRe: Newbee: Volume and panning in SCO-file
El Sat, 4 Aug 2007 17:30:35 -0700 (PDT)
peiman  escribió:

>   outs aleft*ipan, aright*(1 - ipan)  

linear amplitude panning works, but not very well, due to the "hole in
the middle" effect (the signal has less power when it's positioned in
the center). a better solution is constant power panning, using
sinusoidal functions to control the amplitudes.

for example, if asig is your signal, and p5 is the panning value between
0 (left) and 1 (right), i guess something like this should work better:

ipan	=	p5*1.570796327	; pi/2

aleft	=	asig*cos(ipan)
aright	=	asig*sin(ipan)

best,

lj

Date2007-08-05 09:01
FromJonas Nyström
SubjectRe: Newbee: Volume and panning in SCO-file
AttachmentsNone  None  

Date2007-08-05 12:35
Fromluis jure
SubjectRe: Newbee: Volume and panning in SCO-file
El Sun, 5 Aug 2007 10:01:16 +0200
"Jonas Nyström"  escribió:

> Using both volume and sinusodial panning would result in something
> like this, wouldn't it?

the code looks all right to me, but you are in a better position to
answer your own question: does it compile (i didn't test it)? does it
do what you want (you know that better than me)? if the answer is yes
to both questions, then in must be all right...

good luck with your csounding, jonas.

lj

Date2007-08-05 18:11
From"Steven Yi"
SubjectRe: Newbee: Volume and panning in SCO-file
AttachmentsNone  

Date2007-08-05 18:45
From"Chuckk Hubbard"
SubjectRe: Newbee: Volume and panning in SCO-file
AttachmentsNone  None  

Date2007-08-05 21:41
FromJonas Nyström
SubjectRe: Newbee: Volume and panning in SCO-file
AttachmentsNone  None