Csound Csound-dev Csound-tekno Search About

Quad Pan

Date2006-01-01 19:36
From"Art Hunkins"
SubjectQuad Pan
AttachmentsPANTEST1.CSD  PANTEST2.CSD  
I'm still having a problem with the (quad) pan opcode. ioffset doesn't seem
to work correctly. The two attached .csd's illustrate. (I asked about this
some time ago and didn't get any responses.)

Pantest2 is straight from the manual. It should give a nice circular
single-rotation quad pan over 10 seconds, but doesn't. The amplitudes for
channels 1 and 4 are correct, but channel 2 is zero and channel 3 is double.

Pantest1 - which is only different in the pan opcode - defaults ioffset to
zero and compensates by adding +.5 to both x and y axes. It works fine, and
I *thought* this was what setting ioffset to 1 was supposed to do.

I've done this workaround in many of my pieces, but would really like to
know whether I'm just missing something, or if ioffset is buggy.

BTW, I've tested this in Windows, both on CsoundAV and Csound5beta
(Gogins) - realtime. (Since this is quad, I'm limited to AV and CS5.)

TIA -

Art Hunkins

Date2006-01-02 00:32
FromDavid Akbari
SubjectRe: Quad Pan
Hi Art,

Maybe something has gone wrong with the pan opcode ?

Here's how I like to approach the idea of quad panning, in 3 ways:

According to the manual, the formula for pan opcode and the following 
implementation (based on the work of James Dashow) should be similar in 
their audible effect. See what you think; this may or may not help but 
reading this thread sparked an association with this .csd file :)


-David

ps. uses FLTK graphics for an interface - will work without it and 
should work with it wherever FLTK is successfully built and working.




sr		=	44100
kr		=	441
ksmps	=	100
nchnls	=	4

/*=== ===*/

	FLpanel "Quadraphonic", 640, 480, 128, 256
gihvx   FLvalue " ", 64, 16, 150, 452
gihvy   FLvalue " ", 64, 16, 400, 452
gkx, gky, ihx, ihy FLjoy "Quad Spatializer ", 1, 0, 0, 1, 0, 0, gihvx, 
gihvy, 610, 420, 10, 10
	FLsetVal_i  0, gihvx
	FLsetVal_i  0, gihvy
	FLpanelEnd
   FLrun

/*=== ===*/

		instr	1	;  STATIC PANNING MODE

; FLTK GUI X axis = X position
; FLTK GUI Y axis = Y position

a1	in
;a1	diskin2	"/loops/dl_break1.aif", 1, 0, 1

kx	=	gkx
ky	=	gky

/*
Front Left(1,1) = (CTRL1 * CTRL2) * SIG
Front Right(0,1) = ((1-CTRL1)* CTRL2) * SIG
Rear Left(1,0) = (CTRL1 * (1-CTRL2)) * SIG
Rear Right(0,0) = (1-CTRL1) * (1-CTRL2) * SIG
*/

	outch	1, a1 * (kx * ky)
	outch	2, a1 * ((1-kx)*ky)
	outch	3, a1 * (kx*(1-ky))
	outch	4, a1 * ((1-kx)*(1-ky))

		endin

/*--- ---*/

		instr	2	;  DIRECT PANNING MODE

; Mod Wheel = X position
; Vol Slider = Y position

ky	ctrl7		1, 7, 0, 1
kx	ctrl7		1, 1, 0, 1

a1	in
;a1	diskin2	"/loops/dl_break1.aif", 1, 0, 1

/*
Front Left(1,1) = (CTRL1 * CTRL2) * SIG
Front Right(0,1) = ((1-CTRL1)* CTRL2) * SIG
Rear Left(1,0) = (CTRL1 * (1-CTRL2)) * SIG
Rear Right(0,0) = (1-CTRL1) * (1-CTRL2) * SIG
*/

	outch	1, a1 * (kx * ky)
	outch	3, a1 * ((1-kx)*ky)
	outch	2, a1 * (kx*(1-ky))
	outch	4, a1 * ((1-kx)*(1-ky))

		endin

/*--- ---*/

		instr	3	;  AUTO PANNING MODE

; No direct control over X, Y position -
;   Favors random number generation in "auto" mode.

a1	in
;a1	diskin2	"/loops/dl_break1.aif", 1, 0, 1

kx	random	0, 1
kx	port	kx, 0.5

ky	random	0, 1
ky	port	ky, 0.5

/*
Front Left(1,1) = (CTRL1 * CTRL2) * SIG
Front Right(0,1) = ((1-CTRL1)* CTRL2) * SIG
Rear Left(1,0) = (CTRL1 * (1-CTRL2)) * SIG
Rear Right(0,0) = (1-CTRL1) * (1-CTRL2) * SIG
*/

	outch	1, a1 * (kx * ky)
	outch	3, a1 * ((1-kx)*ky)
	outch	2, a1 * (kx*(1-ky))
	outch	4, a1 * ((1-kx)*(1-ky))

		endin

/*--- ---*/


i1	0	1000
;i2	0	1000
;i3	0	1000

e




On Jan 1, 2006, at 1:36 PM, Art Hunkins wrote:

> I'm still having a problem with the (quad) pan opcode. ioffset doesn't 
> seem
> to work correctly. The two attached .csd's illustrate. (I asked about 
> this
> some time ago and didn't get any responses.)
>
> Pantest2 is straight from the manual. It should give a nice circular
> single-rotation quad pan over 10 seconds, but doesn't. The amplitudes 
> for
> channels 1 and 4 are correct, but channel 2 is zero and channel 3 is 
> double.
>
> Pantest1 - which is only different in the pan opcode - defaults 
> ioffset to
> zero and compensates by adding +.5 to both x and y axes. It works 
> fine, and
> I *thought* this was what setting ioffset to 1 was supposed to do.
>
> I've done this workaround in many of my pieces, but would really like 
> to
> know whether I'm just missing something, or if ioffset is buggy.
>
> BTW, I've tested this in Windows, both on CsoundAV and Csound5beta
> (Gogins) - realtime. (Since this is quad, I'm limited to AV and CS5.)
>
> TIA -
>
> Art Hunkins