| Hi, Dave,
Thanks for this code. It looks like quad pan should be fairly
straightforward. It's interesting that your (the Dashow) example places the
point of origin (0,0) at right rear, whereas johnff's pan code (Csound)
places it at left rear.
At any rate, I'd much appreciate some developer (johnff, istvan?) taking a
look at ioffset in the pan code. It seems to me that in normalized mode,
ioffset = 1 should simply add .5 to both kx and ky, thus centering the point
of origin.
(In raw index mode, ioffset = 1 would seemingly need to add .5 * maxval of
kx and ky to these values. Or so I'm assuming.)
Does this happen?
The two attached files (the same as before) don't require real-time or a
quad system. Their maxamp channel outputs tell the story. In pantest1, which
is correct, the max output levels are all about 9480. In pantest2, which
follows the manual but does not work, channels 1 and 4 max at about 4176,
channel 3 at full (10000), channel 2 at zero. Seems rather clear that
ioffset = 1 is doing something wrong - at least in this case of trying to
"draw a sonic circle".
Again, I've been testing on CsoundAV and Csound5beta.
Art Hunkins
----- Original Message -----
From: "David Akbari"
To:
Sent: Sunday, January 01, 2006 7:32 PM
Subject: Re: [Csnd] 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
>
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
|