Csound Csound-dev Csound-tekno Search About

[Csnd] 'spatialization' opcodes

Date2010-11-13 10:35
Frompeiman khosravi
Subject[Csnd] 'spatialization' opcodes
Hello,

I've been looking at the opcodes available for distributing the signal among 6 speakers. The only one seems to be vbap8 (by just ignoring two outputs).

But the problem is that this opcodes does not seem to allow arbitrary panning, meaning that for instance in order to move the source from the front left speaker to the rear  speaker one needs to pass through all the speakers in between. Is there an opcode that accepts x/y coordinates for 6-8 channel distribution?

Thanks in advance

Peiman 



Date2010-11-13 11:29
Frommenno
Subject[Csnd] Re: 'spatialization' opcodes
Have you tried the outh opcode?
http://www.csounds.com/manual/html/outh.html

greetings,
menno

--- On Sat, 11/13/10, peiman khosravi <peimankhosravi@gmail.com> wrote:

From: peiman khosravi <peimankhosravi@gmail.com>
Subject: [Csnd] 'spatialization' opcodes
To: csound@lists.bath.ac.uk
Date: Saturday, November 13, 2010, 11:35 AM

Hello,

I've been looking at the opcodes available for distributing the signal among 6 speakers. The only one seems to be vbap8 (by just ignoring two outputs).

But the problem is that this opcodes does not seem to allow arbitrary panning, meaning that for instance in order to move the source from the front left speaker to the rear  speaker one needs to pass through all the speakers in between. Is there an opcode that accepts x/y coordinates for 6-8 channel distribution?

Thanks in advance

Peiman 




Date2010-11-13 11:46
Frompeiman khosravi
Subject[Csnd] Re: Re: 'spatialization' opcodes
Hi Menno,

Yes I am using the outh opcode but that doesn't offer any panning. I am using vbap8 for panning but unfortunately vbap8 does not take x/y parameters for positioning the source.

Best,

Peiman 

On 13 November 2010 11:29, menno <nabob_cd@yahoo.com> wrote:
Have you tried the outh opcode?
http://www.csounds.com/manual/html/outh.html

greetings,
menno

--- On Sat, 11/13/10, peiman khosravi <peimankhosravi@gmail.com> wrote:

From: peiman khosravi <peimankhosravi@gmail.com>
Subject: [Csnd] 'spatialization' opcodes
To: csound@lists.bath.ac.uk
Date: Saturday, November 13, 2010, 11:35 AM


Hello,

I've been looking at the opcodes available for distributing the signal among 6 speakers. The only one seems to be vbap8 (by just ignoring two outputs).

But the problem is that this opcodes does not seem to allow arbitrary panning, meaning that for instance in order to move the source from the front left speaker to the rear  speaker one needs to pass through all the speakers in between. Is there an opcode that accepts x/y coordinates for 6-8 channel distribution?

Thanks in advance

Peiman 





Date2010-11-13 11:51
FromEnrico Francioni
Subject[Csnd] Re: 'spatialization' opcodes
space

Date2010-11-13 11:54
Frompeiman khosravi
Subject[Csnd] Re: Re: 'spatialization' opcodes
Thanks. But isn't space 4 channel only?



On 13 November 2010 11:51, Enrico Francioni <francioni61021@libero.it> wrote:

space


--
View this message in context: http://csound.1045644.n5.nabble.com/spatialization-opcodes-tp3263433p3263473.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 12:00
FromRichard Dobson
Subject[Csnd] Re: Re: Re: 'spatialization' opcodes
It's actually a very difficult thing to do - placing sounds inside the 
speaker array (which implies a soundfield in effect radiating out 
~towards~ the speakers in some directions) and having them pass (in 
effect) through the listener's head. Indeed, I am not sure to what 
extent it has yet been done in a technically rigorous way. You can do it 
"rhetorically" of course, by intensity panning from speaker to speaker 
across the circle, and if it is not too slow you may get an almost 
convincing result. What you hear when sitting other than in the centre 
is a very open question. One hears reports of technologies that create 
the sense of some phantom voice whispering in your ear, but ~if~ it 
works, I suspect the head has to be clamped immoveably in the sweet spot.

Richard Dobson

On 13/11/2010 11:46, peiman khosravi wrote:
> Hi Menno,
>
> Yes I am using the outh opcode but that doesn't offer any panning. I am
> using vbap8 for panning but unfortunately vbap8 does not take x/y
> parameters for positioning the source.
>
> Best,
>
> Peiman
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-11-13 12:30
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: 'spatialization' opcodes
Thanks Richard,

Yes I agree with you. My intention is not to do this rigorously, of course I will be judging by ear and moving around the room during the composition to minimize the loss of spatial image for non-centered listeners. At the moment I am working with Cmask to create some 'spatial' textures (with grain-by-grain 'panning'). I want for instance to do the following:

Use a gaussian random generator with a 'mean' value coresponding with the centre of the frontal stereo pair and a deviation width to cover more or less all 6 or 8 speakers (I still haven't decided about the numbers). I experimented with this last night and it works. I had to have a weird virtual speaker set up to allow this though (vbaplsinit       2, 6, 120, 180, 60, 240, 0, 300) In this case a mean value of 150 (coresponding to 0.5 if the degrees are scaled to fall within 0. and 1.) will be centered between the frontal stereo pair with this set-up:



                                                        1           2
                                                     
                                                   3                     4

                                                        5           6
     

Now I would like to be able to move the center ('mean') towards the back of the room in a straight line so that the grain dirtribution is concetrated in between the differet stereo pairs in turn. At the same time I woud like to have the ability to move the 'mean' in circles. I think with the right amount of spread among the speakers and the right textural density it should work. But the question is how do I realise the panning other than having to make my own UDO. I suspect a fair amount of maths is needed to make an 6 channel signal distributor with x/y parameters.

Thanks very much

Peiman

 

On 13 November 2010 12:00, Richard Dobson <richarddobson@blueyonder.co.uk> wrote:
It's actually a very difficult thing to do - placing sounds inside the speaker array (which implies a soundfield in effect radiating out ~towards~ the speakers in some directions) and having them pass (in effect) through the listener's head. Indeed, I am not sure to what extent it has yet been done in a technically rigorous way. You can do it "rhetorically" of course, by intensity panning from speaker to speaker across the circle, and if it is not too slow you may get an almost convincing result. What you hear when sitting other than in the centre is a very open question. One hears reports of technologies that create the sense of some phantom voice whispering in your ear, but ~if~ it works, I suspect the head has to be clamped immoveably in the sweet spot.

Richard Dobson


On 13/11/2010 11:46, peiman khosravi wrote:
Hi Menno,

Yes I am using the outh opcode but that doesn't offer any panning. I am
using vbap8 for panning but unfortunately vbap8 does not take x/y
parameters for positioning the source.

Best,

Peiman



Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 12:36
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: 'spatialization' opcodes
Thanks Richard,

Here's one without all the typos!!!

Yes I agree with you. My intention is not to do this rigorously, of course I will be judging by ear and moving around the room during the composition to minimize the loss of spatial image for non-centered listeners. At the moment I am working with Cmask to create some 'spatial' textures (with grain-by-grain 'panning'). I want for instance to do the following:

Use a Gaussian random generator with a 'mean' value corresponding with the centre of the frontal stereo pair and a deviation width to cover more or less all 6 or 8 speakers (I still haven't decided about the numbers). I experimented with this last night and it works. I had to have a weird virtual speaker set up to allow this though (vbaplsinit       2, 6, 120, 180, 60, 240, 0, 300) In this case a mean value of 150 (corresponding to 0.5 if the degrees are scaled to fall within 0. and 1.) will be centered between the frontal stereo pair with this set-up:



                              
                          1           2
                                                     
                      3                     4

                          5           6
     

Now I would like to be able to move the center ('mean') towards the back of the room in a straight line so that the grain distribution is concentrated in between the differed stereo pairs in turn. At the same time I would like to have the ability to move the 'mean' in circles. I think with the right amount of spread among the speakers and the right textural density it should work. But the question is how do I realise the panning other than having to make my own UDO. I suspect a fair amount of maths is needed to make an 6 channel signal distributor with x/y parameters.

Thanks very much


 

On 13 November 2010 12:00, Richard Dobson <richarddobson@blueyonder.co.uk> wrote:
It's actually a very difficult thing to do - placing sounds inside the speaker array (which implies a soundfield in effect radiating out ~towards~ the speakers in some directions) and having them pass (in effect) through the listener's head. Indeed, I am not sure to what extent it has yet been done in a technically rigorous way. You can do it "rhetorically" of course, by intensity panning from speaker to speaker across the circle, and if it is not too slow you may get an almost convincing result. What you hear when sitting other than in the centre is a very open question. One hears reports of technologies that create the sense of some phantom voice whispering in your ear, but ~if~ it works, I suspect the head has to be clamped immoveably in the sweet spot.

Richard Dobson


On 13/11/2010 11:46, peiman khosravi wrote:
Hi Menno,

Yes I am using the outh opcode but that doesn't offer any panning. I am
using vbap8 for panning but unfortunately vbap8 does not take x/y
parameters for positioning the source.

Best,

Peiman



Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2010-11-13 13:03
FromMichael Rhoades
Subject[Csnd] Re: 'spatialization' opcodes
Hello Peiman and all,

I have been working on this subject for many years now. Slowly I have 
been developing an instrument that provides a lot of versatility of 
spatialization to the point that now, spatialization is an important 
formal aspect in every composition. The instrument has been tailored to 
the use of cmask since I use that for all of my initial score 
generation... although I do sometimes modify scores after they have been 
generated using excel.

My goal is to render 8 channel wav files. In the csound rendering 
sequence of events, by the time a sound gets to the spatialization 
algorithms it is stereo (two channels) and it has a panning envelope 
applied. From there I send it through what I call distance algorithms, 
which are a set of envelopes that are meant to emulate the qualities of 
distance movement that I think are pertinent. I do not apply Doppler 
effects because I do not like the cliche glissando sounds that are heard 
in so many E/A music pieces. Basically, at this point, I want the sound 
to pan left to right from near to far, far to near, near to near and far 
to far... etc. So I use amplitude envelopes and reverb envelopes to 
accomplish it. This can sound very convincing to my ear.

Once I have applied those algorithms I then put the two channel sound 
into any combination of 8 speakers. So, for instance, the left sound 
might be on speakers 1, 3, 5 and the right sound might be on speaker 7. 
Then I provide additional panning envelopes so that as the left sound is 
panning to the right sound, it is also being panned across speakers 1, 
3, 5. To the listener this provides for a beautiful curve to the 
panning. Then if it is, for instance, from very far away to near... 
well... you can imagine the possibilities.

All of these choices are determined by cmask on an event by event basis 
in the score. I represent them with simple numbers and then let cmask 
choose them depending on the mask I am using for each individual parameter.

The bottom line is that I do not think there is a quick easy way to 
accomplish what you are after but with a little creativity you can come 
up with some very flexible and unique ways to instantiate your dreams...

I hope this helps,

Michael


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-11-13 13:36
Fromben hackbarth
Subject[Csnd] Re: Re: 'spatialization' opcodes
hi peiman,

questions of the efficacy of vbap aside, it sounds like you want to
convert cartesian coordinates to polar for use with vbap.  maybe this
will help.  i haven't looked it over in a while, so checking the math
may be in order...

opcode iXYCoor2Vbap, ii, ii
	;X and Y from -1->1
	iX, iY  xin	
	iDistance = ((iX^2)+(iY^2))^0.5
	iSpread = (sqrt(2)-iDistance)*100 ; get spread
	iPh  taninv2   iX, iY
	iDeg = ((iPh/(2*3.141))*360)  ; get angle
	xout iDeg, iSpread
	;iDeg from 0->360; spread from 0->100
endop


—  ben



On Sat, Nov 13, 2010 at 2:03 PM, Michael Rhoades
 wrote:
> Hello Peiman and all,
>
> I have been working on this subject for many years now. Slowly I have been
> developing an instrument that provides a lot of versatility of
> spatialization to the point that now, spatialization is an important formal
> aspect in every composition. The instrument has been tailored to the use of
> cmask since I use that for all of my initial score generation... although I
> do sometimes modify scores after they have been generated using excel.
>
> My goal is to render 8 channel wav files. In the csound rendering sequence
> of events, by the time a sound gets to the spatialization algorithms it is
> stereo (two channels) and it has a panning envelope applied. From there I
> send it through what I call distance algorithms, which are a set of
> envelopes that are meant to emulate the qualities of distance movement that
> I think are pertinent. I do not apply Doppler effects because I do not like
> the cliche glissando sounds that are heard in so many E/A music pieces.
> Basically, at this point, I want the sound to pan left to right from near to
> far, far to near, near to near and far to far... etc. So I use amplitude
> envelopes and reverb envelopes to accomplish it. This can sound very
> convincing to my ear.
>
> Once I have applied those algorithms I then put the two channel sound into
> any combination of 8 speakers. So, for instance, the left sound might be on
> speakers 1, 3, 5 and the right sound might be on speaker 7. Then I provide
> additional panning envelopes so that as the left sound is panning to the
> right sound, it is also being panned across speakers 1, 3, 5. To the
> listener this provides for a beautiful curve to the panning. Then if it is,
> for instance, from very far away to near... well... you can imagine the
> possibilities.
>
> All of these choices are determined by cmask on an event by event basis in
> the score. I represent them with simple numbers and then let cmask choose
> them depending on the mask I am using for each individual parameter.
>
> The bottom line is that I do not think there is a quick easy way to
> accomplish what you are after but with a little creativity you can come up
> with some very flexible and unique ways to instantiate your dreams...
>
> I hope this helps,
>
> Michael
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-11-13 13:37
FromSteven Yi
Subject[Csnd] Re: Re: Re: Re: Re: 'spatialization' opcodes
Hi Peiman,

I haven't been following this email too closely as I was reading it on
my phone, but I thought I'd mention that Jan Jacob Hofmann and I had
done a presentation at the LAC a couple years ago that discusses using
Ambisonics with blue/csound, particularly using CMask and JMask
(blue's graphical version of CMask) to do spatialized granular
synthesis:

http://lac.linuxaudio.org/2009/cdm/Thursday/04_Hofmann/index.html

Jan Jacob has written pieces using this technique to have each sound
grain have their own spatial location (x/y/z, distance clues) via
Ambisonics in addition to using doppler, local/global reverb, etc.

I'm not sure if this is what you're looking for, but I thought it
worth mentioning.

Thanks!
steven

On Sat, Nov 13, 2010 at 7:36 AM, peiman khosravi
 wrote:
> Thanks Richard,
>
> Here's one without all the typos!!!
>
> Yes I agree with you. My intention is not to do this rigorously, of course I
> will be judging by ear and moving around the room during the composition to
> minimize the loss of spatial image for non-centered listeners. At the moment
> I am working with Cmask to create some 'spatial' textures (with
> grain-by-grain 'panning'). I want for instance to do the following:
>
> Use a Gaussian random generator with a 'mean' value corresponding with the
> centre of the frontal stereo pair and a deviation width to cover more or
> less all 6 or 8 speakers (I still haven't decided about the numbers). I
> experimented with this last night and it works. I had to have a weird
> virtual speaker set up to allow this though (vbaplsinit       2, 6, 120,
> 180, 60, 240, 0, 300) In this case a mean value of 150 (corresponding to 0.5
> if the degrees are scaled to fall within 0. and 1.) will be centered between
> the frontal stereo pair with this set-up:
>
>
>
>
>                           1           2
>
>                       3                     4
>
>                           5           6
>
>
> Now I would like to be able to move the center ('mean') towards the back of
> the room in a straight line so that the grain distribution is concentrated
> in between the differed stereo pairs in turn. At the same time I would like
> to have the ability to move the 'mean' in circles. I think with the right
> amount of spread among the speakers and the right textural density it should
> work. But the question is how do I realise the panning other than having to
> make my own UDO. I suspect a fair amount of maths is needed to make an 6
> channel signal distributor with x/y parameters.
>
> Thanks very much
>
>>
>>
>> On 13 November 2010 12:00, Richard Dobson 
>> wrote:
>>>
>>> It's actually a very difficult thing to do - placing sounds inside the
>>> speaker array (which implies a soundfield in effect radiating out ~towards~
>>> the speakers in some directions) and having them pass (in effect) through
>>> the listener's head. Indeed, I am not sure to what extent it has yet been
>>> done in a technically rigorous way. You can do it "rhetorically" of course,
>>> by intensity panning from speaker to speaker across the circle, and if it is
>>> not too slow you may get an almost convincing result. What you hear when
>>> sitting other than in the centre is a very open question. One hears reports
>>> of technologies that create the sense of some phantom voice whispering in
>>> your ear, but ~if~ it works, I suspect the head has to be clamped immoveably
>>> in the sweet spot.
>>>
>>> Richard Dobson
>>>
>>> On 13/11/2010 11:46, peiman khosravi wrote:
>>>>
>>>> Hi Menno,
>>>>
>>>> Yes I am using the outh opcode but that doesn't offer any panning. I am
>>>> using vbap8 for panning but unfortunately vbap8 does not take x/y
>>>> parameters for positioning the source.
>>>>
>>>> Best,
>>>>
>>>> Peiman
>>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-11-13 13:39
FromMichael Rhoades
Subject[Csnd] Re: 'spatialization' opcodes - example
Here is an example of how I tailor panning envelopes in the orc to being 
determined by cmask in the score. In the cmask file (see bottom of this 
email)  I stipulate choices from 0 to 1 (to one decimal point) and then 
from 2 to 18. In the instrument I stipulate that if the kbal pfield is 
less than or equal to 1 then use the exact number for kbal. That is a 
static pan... no movement. But for a value above 1 use one of the 
envelopes. This is a simple way for cmask to determine the panning. To 
understand what is happening, begin at the bottom of the following orc 
code excerpt.

You may notice that it incorporates an oscili for one of the panning 
choices. If I understood correctly you were asking about this in a 
previous post.

This approach is very simplistic yet its output is quite dynamic... and 
it can easily be expanded or generalized for many other uses.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;panning algorithms (range 0 - 1 (prec 2), 2 - 18)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 


kenv101 linseg    0,    idur,    1
kenv102 linseg    1,    idur,    0

kenv103 linseg    0,    idur * .2,    1, idur * .8, 0
kenv104 linseg    1,    idur * .2,    .001, idur * .8, 1

kenv105 linseg    0,    idur * .15,    1,    idur * .15,    .2, idur * 
.3, .8, idur * .4, .4
kenv106 linseg    1,    idur * .15,    0,    idur * .15,    .8, idur * 
.3, .2, idur * .4, .6

kenv107 linseg    0,    idur * .5,    1,    idur * .15,    .2, idur * 
.15, .8, idur * .35, .6
kenv108 linseg    1,    idur * .5,    0,    idur * .15,    .8, idur * 
.15, .2, idur * .35, .4

kenv109 linseg    .4,    idur * .25,    .8,    idur * .75,    0
kenv110 linseg    .6,    idur * .25,    .2,    idur * .75,    1

kenv111 linseg    0,     idur * .8,    .15,    idur * .2,    1
kenv112 linseg    1,     idur * .8,    .85,    idur * .2,    0

kenv113 linseg    .25,     idur * .8,    .75,    idur * .2,    .5
kenv114 linseg    .75,     idur * .8,    .25,    idur * .2,    .5

kenv115 linseg    0, idur * .15, .6, idur * .15, .3, idur * .15, .8, 
idur * .15, .5, idur * .15, .9, idur * .25, 0
kenv116 linseg    1, idur * .15, .3, idur * .15, .6, idur * .15, .2, 
idur * .15, .5, idur * .15, .1, idur * .25, 1

kenv117 oscili    1,    kfreq,    1


kenv9      =    (kpan = 2   ? kenv102:kenv101)
kenv10    =    (kpan = 3   ? kenv103:kenv9)
kenv11    =    (kpan = 4   ? kenv104:kenv10)
kenv12    =    (kpan = 5   ? kenv105:kenv11)
kenv13    =    (kpan = 6   ? kenv106:kenv12)
kenv14    =    (kpan = 7   ? kenv107:kenv13)
kenv15    =    (kpan = 8   ? kenv108:kenv14)
kenv16    =    (kpan = 9   ? kenv109:kenv15)
kenv17    =    (kpan = 10  ? kenv109:kenv16)
kenv18    =    (kpan = 11  ? kenv110:kenv17)
kenv19    =    (kpan = 12  ? kenv111:kenv18)
kenv20    =    (kpan = 13  ? kenv112:kenv19)
kenv21    =    (kpan = 14  ? kenv113:kenv20)
kenv22    =    (kpan = 15  ? kenv114:kenv21)
kenv23    =    (kpan = 16  ? kenv115:kenv22)
kenv24    =    (kpan = 17  ? kenv116:kenv23)
kenv25    =    (kpan = 18  ? kenv117:kenv24)

kbal         =    (kpan <= 1  ? kpan:kenv25)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; example cmask code for that pfield although any other mask could be used
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 



p6                    ;kpan (range 0 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
item random (0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1, 2, 3, 4, 5, 6, 7, 
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-11-13 13:53
Frompeiman khosravi
Subject[Csnd] Re: Re: 'spatialization' opcodes - example
Hi Michael,

Thanks very much indeed. I am studying your instrument right now. It is exactly what I had in mind. And I also dislike the Doppler cliche!

All the best,

Peiman  

On 13 November 2010 13:39, Michael Rhoades <mrhoades@perceptionfactory.com> wrote:
Here is an example of how I tailor panning envelopes in the orc to being determined by cmask in the score. In the cmask file (see bottom of this email)  I stipulate choices from 0 to 1 (to one decimal point) and then from 2 to 18. In the instrument I stipulate that if the kbal pfield is less than or equal to 1 then use the exact number for kbal. That is a static pan... no movement. But for a value above 1 use one of the envelopes. This is a simple way for cmask to determine the panning. To understand what is happening, begin at the bottom of the following orc code excerpt.

You may notice that it incorporates an oscili for one of the panning choices. If I understood correctly you were asking about this in a previous post.

This approach is very simplistic yet its output is quite dynamic... and it can easily be expanded or generalized for many other uses.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;panning algorithms (range 0 - 1 (prec 2), 2 - 18)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

kenv101 linseg    0,    idur,    1
kenv102 linseg    1,    idur,    0

kenv103 linseg    0,    idur * .2,    1, idur * .8, 0
kenv104 linseg    1,    idur * .2,    .001, idur * .8, 1

kenv105 linseg    0,    idur * .15,    1,    idur * .15,    .2, idur * .3, .8, idur * .4, .4
kenv106 linseg    1,    idur * .15,    0,    idur * .15,    .8, idur * .3, .2, idur * .4, .6

kenv107 linseg    0,    idur * .5,    1,    idur * .15,    .2, idur * .15, .8, idur * .35, .6
kenv108 linseg    1,    idur * .5,    0,    idur * .15,    .8, idur * .15, .2, idur * .35, .4

kenv109 linseg    .4,    idur * .25,    .8,    idur * .75,    0
kenv110 linseg    .6,    idur * .25,    .2,    idur * .75,    1

kenv111 linseg    0,     idur * .8,    .15,    idur * .2,    1
kenv112 linseg    1,     idur * .8,    .85,    idur * .2,    0

kenv113 linseg    .25,     idur * .8,    .75,    idur * .2,    .5
kenv114 linseg    .75,     idur * .8,    .25,    idur * .2,    .5

kenv115 linseg    0, idur * .15, .6, idur * .15, .3, idur * .15, .8, idur * .15, .5, idur * .15, .9, idur * .25, 0
kenv116 linseg    1, idur * .15, .3, idur * .15, .6, idur * .15, .2, idur * .15, .5, idur * .15, .1, idur * .25, 1

kenv117 oscili    1,    kfreq,    1


kenv9      =    (kpan = 2   ? kenv102:kenv101)
kenv10    =    (kpan = 3   ? kenv103:kenv9)
kenv11    =    (kpan = 4   ? kenv104:kenv10)
kenv12    =    (kpan = 5   ? kenv105:kenv11)
kenv13    =    (kpan = 6   ? kenv106:kenv12)
kenv14    =    (kpan = 7   ? kenv107:kenv13)
kenv15    =    (kpan = 8   ? kenv108:kenv14)
kenv16    =    (kpan = 9   ? kenv109:kenv15)
kenv17    =    (kpan = 10  ? kenv109:kenv16)
kenv18    =    (kpan = 11  ? kenv110:kenv17)
kenv19    =    (kpan = 12  ? kenv111:kenv18)
kenv20    =    (kpan = 13  ? kenv112:kenv19)
kenv21    =    (kpan = 14  ? kenv113:kenv20)
kenv22    =    (kpan = 15  ? kenv114:kenv21)
kenv23    =    (kpan = 16  ? kenv115:kenv22)
kenv24    =    (kpan = 17  ? kenv116:kenv23)
kenv25    =    (kpan = 18  ? kenv117:kenv24)

kbal         =    (kpan <= 1  ? kpan:kenv25)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; example cmask code for that pfield although any other mask could be used
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


p6                    ;kpan (range 0 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
item random (0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)



Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 13:54
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: 'spatialization' opcodes
Thanks very much Ben. Let me try and work out what teh code is doing!

Best,

Peiman

On 13 November 2010 13:36, ben hackbarth <hackbarth@gmail.com> wrote:
hi peiman,

questions of the efficacy of vbap aside, it sounds like you want to
convert cartesian coordinates to polar for use with vbap.  maybe this
will help.  i haven't looked it over in a while, so checking the math
may be in order...

opcode iXYCoor2Vbap, ii, ii
       ;X and Y from -1->1
       iX, iY  xin
       iDistance = ((iX^2)+(iY^2))^0.5
       iSpread = (sqrt(2)-iDistance)*100 ; get spread
       iPh  taninv2   iX, iY
       iDeg = ((iPh/(2*3.141))*360)  ; get angle
       xout iDeg, iSpread
       ;iDeg from 0->360; spread from 0->100
endop


—  ben



On Sat, Nov 13, 2010 at 2:03 PM, Michael Rhoades
<mrhoades@perceptionfactory.com> wrote:
> Hello Peiman and all,
>
> I have been working on this subject for many years now. Slowly I have been
> developing an instrument that provides a lot of versatility of
> spatialization to the point that now, spatialization is an important formal
> aspect in every composition. The instrument has been tailored to the use of
> cmask since I use that for all of my initial score generation... although I
> do sometimes modify scores after they have been generated using excel.
>
> My goal is to render 8 channel wav files. In the csound rendering sequence
> of events, by the time a sound gets to the spatialization algorithms it is
> stereo (two channels) and it has a panning envelope applied. From there I
> send it through what I call distance algorithms, which are a set of
> envelopes that are meant to emulate the qualities of distance movement that
> I think are pertinent. I do not apply Doppler effects because I do not like
> the cliche glissando sounds that are heard in so many E/A music pieces.
> Basically, at this point, I want the sound to pan left to right from near to
> far, far to near, near to near and far to far... etc. So I use amplitude
> envelopes and reverb envelopes to accomplish it. This can sound very
> convincing to my ear.
>
> Once I have applied those algorithms I then put the two channel sound into
> any combination of 8 speakers. So, for instance, the left sound might be on
> speakers 1, 3, 5 and the right sound might be on speaker 7. Then I provide
> additional panning envelopes so that as the left sound is panning to the
> right sound, it is also being panned across speakers 1, 3, 5. To the
> listener this provides for a beautiful curve to the panning. Then if it is,
> for instance, from very far away to near... well... you can imagine the
> possibilities.
>
> All of these choices are determined by cmask on an event by event basis in
> the score. I represent them with simple numbers and then let cmask choose
> them depending on the mask I am using for each individual parameter.
>
> The bottom line is that I do not think there is a quick easy way to
> accomplish what you are after but with a little creativity you can come up
> with some very flexible and unique ways to instantiate your dreams...
>
> I hope this helps,
>
> Michael
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 13:56
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: 'spatialization' opcodes
Hi Steven,

I wil certainly read your paper. The only issue is that I am trying to avoide ambiosonics for now as I understand that the loudspeaker set-up for amb is not a trivial task and would be difficult to reproduce for different performances.

Nevertheless I am open to the idea. I may get back to you once I've read through the paper.

Best,

Peiman

On 13 November 2010 13:37, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I haven't been following this email too closely as I was reading it on
my phone, but I thought I'd mention that Jan Jacob Hofmann and I had
done a presentation at the LAC a couple years ago that discusses using
Ambisonics with blue/csound, particularly using CMask and JMask
(blue's graphical version of CMask) to do spatialized granular
synthesis:

http://lac.linuxaudio.org/2009/cdm/Thursday/04_Hofmann/index.html

Jan Jacob has written pieces using this technique to have each sound
grain have their own spatial location (x/y/z, distance clues) via
Ambisonics in addition to using doppler, local/global reverb, etc.

I'm not sure if this is what you're looking for, but I thought it
worth mentioning.

Thanks!
steven

On Sat, Nov 13, 2010 at 7:36 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Thanks Richard,
>
> Here's one without all the typos!!!
>
> Yes I agree with you. My intention is not to do this rigorously, of course I
> will be judging by ear and moving around the room during the composition to
> minimize the loss of spatial image for non-centered listeners. At the moment
> I am working with Cmask to create some 'spatial' textures (with
> grain-by-grain 'panning'). I want for instance to do the following:
>
> Use a Gaussian random generator with a 'mean' value corresponding with the
> centre of the frontal stereo pair and a deviation width to cover more or
> less all 6 or 8 speakers (I still haven't decided about the numbers). I
> experimented with this last night and it works. I had to have a weird
> virtual speaker set up to allow this though (vbaplsinit       2, 6, 120,
> 180, 60, 240, 0, 300) In this case a mean value of 150 (corresponding to 0.5
> if the degrees are scaled to fall within 0. and 1.) will be centered between
> the frontal stereo pair with this set-up:
>
>
>
>
>                           1           2
>
>                       3                     4
>
>                           5           6
>
>
> Now I would like to be able to move the center ('mean') towards the back of
> the room in a straight line so that the grain distribution is concentrated
> in between the differed stereo pairs in turn. At the same time I would like
> to have the ability to move the 'mean' in circles. I think with the right
> amount of spread among the speakers and the right textural density it should
> work. But the question is how do I realise the panning other than having to
> make my own UDO. I suspect a fair amount of maths is needed to make an 6
> channel signal distributor with x/y parameters.
>
> Thanks very much
>
>>
>>
>> On 13 November 2010 12:00, Richard Dobson <richarddobson@blueyonder.co.uk>
>> wrote:
>>>
>>> It's actually a very difficult thing to do - placing sounds inside the
>>> speaker array (which implies a soundfield in effect radiating out ~towards~
>>> the speakers in some directions) and having them pass (in effect) through
>>> the listener's head. Indeed, I am not sure to what extent it has yet been
>>> done in a technically rigorous way. You can do it "rhetorically" of course,
>>> by intensity panning from speaker to speaker across the circle, and if it is
>>> not too slow you may get an almost convincing result. What you hear when
>>> sitting other than in the centre is a very open question. One hears reports
>>> of technologies that create the sense of some phantom voice whispering in
>>> your ear, but ~if~ it works, I suspect the head has to be clamped immoveably
>>> in the sweet spot.
>>>
>>> Richard Dobson
>>>
>>> On 13/11/2010 11:46, peiman khosravi wrote:
>>>>
>>>> Hi Menno,
>>>>
>>>> Yes I am using the outh opcode but that doesn't offer any panning. I am
>>>> using vbap8 for panning but unfortunately vbap8 does not take x/y
>>>> parameters for positioning the source.
>>>>
>>>> Best,
>>>>
>>>> Peiman
>>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 14:05
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: 'spatialization' opcodes
PS that is exactly what I had in mind (converting Cartesian to polar coordinates)!

P

On 13 November 2010 13:36, ben hackbarth <hackbarth@gmail.com> wrote:
hi peiman,

questions of the efficacy of vbap aside, it sounds like you want to
convert cartesian coordinates to polar for use with vbap.  maybe this
will help.  i haven't looked it over in a while, so checking the math
may be in order...

opcode iXYCoor2Vbap, ii, ii
       ;X and Y from -1->1
       iX, iY  xin
       iDistance = ((iX^2)+(iY^2))^0.5
       iSpread = (sqrt(2)-iDistance)*100 ; get spread
       iPh  taninv2   iX, iY
       iDeg = ((iPh/(2*3.141))*360)  ; get angle
       xout iDeg, iSpread
       ;iDeg from 0->360; spread from 0->100
endop


—  ben



On Sat, Nov 13, 2010 at 2:03 PM, Michael Rhoades
<mrhoades@perceptionfactory.com> wrote:
> Hello Peiman and all,
>
> I have been working on this subject for many years now. Slowly I have been
> developing an instrument that provides a lot of versatility of
> spatialization to the point that now, spatialization is an important formal
> aspect in every composition. The instrument has been tailored to the use of
> cmask since I use that for all of my initial score generation... although I
> do sometimes modify scores after they have been generated using excel.
>
> My goal is to render 8 channel wav files. In the csound rendering sequence
> of events, by the time a sound gets to the spatialization algorithms it is
> stereo (two channels) and it has a panning envelope applied. From there I
> send it through what I call distance algorithms, which are a set of
> envelopes that are meant to emulate the qualities of distance movement that
> I think are pertinent. I do not apply Doppler effects because I do not like
> the cliche glissando sounds that are heard in so many E/A music pieces.
> Basically, at this point, I want the sound to pan left to right from near to
> far, far to near, near to near and far to far... etc. So I use amplitude
> envelopes and reverb envelopes to accomplish it. This can sound very
> convincing to my ear.
>
> Once I have applied those algorithms I then put the two channel sound into
> any combination of 8 speakers. So, for instance, the left sound might be on
> speakers 1, 3, 5 and the right sound might be on speaker 7. Then I provide
> additional panning envelopes so that as the left sound is panning to the
> right sound, it is also being panned across speakers 1, 3, 5. To the
> listener this provides for a beautiful curve to the panning. Then if it is,
> for instance, from very far away to near... well... you can imagine the
> possibilities.
>
> All of these choices are determined by cmask on an event by event basis in
> the score. I represent them with simple numbers and then let cmask choose
> them depending on the mask I am using for each individual parameter.
>
> The bottom line is that I do not think there is a quick easy way to
> accomplish what you are after but with a little creativity you can come up
> with some very flexible and unique ways to instantiate your dreams...
>
> I hope this helps,
>
> Michael
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 14:38
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: 'spatialization' opcodes
Hi Ben,

Just to follow up. I don't quite understand the math in your code but I get the idea.

However the udo is not returning what I expect it to return. For an x value of -1 and a y value of -1 I get iDeg = -135. Should there be any negative degrees? (csd bellow)

Thanks again

Peiman  

<CsoundSynthesizer>

<CsOptions>
-W -o dac
</CsOptions>

<CsInstruments>


sr     = 96000
ksmps  = 16
nchnls = 1
0dbfs  = 1


;    vbaplsinit          2, 8, 0, 45, 90, 135, 180, 225, 270, 315


opcode iXYCoor2Vbap, ii, ii
       ;X and Y from -1->1
       iX, iY  xin
       iDistance = ((iX^2)+(iY^2))^0.5
       iSpread = (sqrt(2)-iDistance)*100 ; get spread
       iPh  taninv2   iX, iY
       iDeg = ((iPh/(2*3.141))*360)  ; get angle
       xout iDeg, iSpread
       ;iDeg from 0->360; spread from 0->100
endop



    instr 1

ix = -1
iy = -1

iDeg, iSpread    iXYCoor2Vbap    ix, iy   

print iDeg, iSpread

;ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8 vbap8 a1, iDeg, 0, iSpread

 
;    outo ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8
endin

</CsInstruments>

<CsScore>

i1    0    1       

</CsScore>

</CsoundSynthesizer>

On 13 November 2010 13:36, ben hackbarth <hackbarth@gmail.com> wrote:
hi peiman,

questions of the efficacy of vbap aside, it sounds like you want to
convert cartesian coordinates to polar for use with vbap.  maybe this
will help.  i haven't looked it over in a while, so checking the math
may be in order...

opcode iXYCoor2Vbap, ii, ii
       ;X and Y from -1->1
       iX, iY  xin
       iDistance = ((iX^2)+(iY^2))^0.5
       iSpread = (sqrt(2)-iDistance)*100 ; get spread
       iPh  taninv2   iX, iY
       iDeg = ((iPh/(2*3.141))*360)  ; get angle
       xout iDeg, iSpread
       ;iDeg from 0->360; spread from 0->100
endop


—  ben



On Sat, Nov 13, 2010 at 2:03 PM, Michael Rhoades
<mrhoades@perceptionfactory.com> wrote:
> Hello Peiman and all,
>
> I have been working on this subject for many years now. Slowly I have been
> developing an instrument that provides a lot of versatility of
> spatialization to the point that now, spatialization is an important formal
> aspect in every composition. The instrument has been tailored to the use of
> cmask since I use that for all of my initial score generation... although I
> do sometimes modify scores after they have been generated using excel.
>
> My goal is to render 8 channel wav files. In the csound rendering sequence
> of events, by the time a sound gets to the spatialization algorithms it is
> stereo (two channels) and it has a panning envelope applied. From there I
> send it through what I call distance algorithms, which are a set of
> envelopes that are meant to emulate the qualities of distance movement that
> I think are pertinent. I do not apply Doppler effects because I do not like
> the cliche glissando sounds that are heard in so many E/A music pieces.
> Basically, at this point, I want the sound to pan left to right from near to
> far, far to near, near to near and far to far... etc. So I use amplitude
> envelopes and reverb envelopes to accomplish it. This can sound very
> convincing to my ear.
>
> Once I have applied those algorithms I then put the two channel sound into
> any combination of 8 speakers. So, for instance, the left sound might be on
> speakers 1, 3, 5 and the right sound might be on speaker 7. Then I provide
> additional panning envelopes so that as the left sound is panning to the
> right sound, it is also being panned across speakers 1, 3, 5. To the
> listener this provides for a beautiful curve to the panning. Then if it is,
> for instance, from very far away to near... well... you can imagine the
> possibilities.
>
> All of these choices are determined by cmask on an event by event basis in
> the score. I represent them with simple numbers and then let cmask choose
> them depending on the mask I am using for each individual parameter.
>
> The bottom line is that I do not think there is a quick easy way to
> accomplish what you are after but with a little creativity you can come up
> with some very flexible and unique ways to instantiate your dreams...
>
> I hope this helps,
>
> Michael
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 14:53
Frompeiman khosravi
Subject[Csnd] Re: Re: 'spatialization' opcodes - example

This is very inspiring.

Thanks

P

On 13 November 2010 13:39, Michael Rhoades <mrhoades@perceptionfactory.com> wrote:
Here is an example of how I tailor panning envelopes in the orc to being determined by cmask in the score. In the cmask file (see bottom of this email)  I stipulate choices from 0 to 1 (to one decimal point) and then from 2 to 18. In the instrument I stipulate that if the kbal pfield is less than or equal to 1 then use the exact number for kbal. That is a static pan... no movement. But for a value above 1 use one of the envelopes. This is a simple way for cmask to determine the panning. To understand what is happening, begin at the bottom of the following orc code excerpt.

You may notice that it incorporates an oscili for one of the panning choices. If I understood correctly you were asking about this in a previous post.

This approach is very simplistic yet its output is quite dynamic... and it can easily be expanded or generalized for many other uses.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;panning algorithms (range 0 - 1 (prec 2), 2 - 18)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

kenv101 linseg    0,    idur,    1
kenv102 linseg    1,    idur,    0

kenv103 linseg    0,    idur * .2,    1, idur * .8, 0
kenv104 linseg    1,    idur * .2,    .001, idur * .8, 1

kenv105 linseg    0,    idur * .15,    1,    idur * .15,    .2, idur * .3, .8, idur * .4, .4
kenv106 linseg    1,    idur * .15,    0,    idur * .15,    .8, idur * .3, .2, idur * .4, .6

kenv107 linseg    0,    idur * .5,    1,    idur * .15,    .2, idur * .15, .8, idur * .35, .6
kenv108 linseg    1,    idur * .5,    0,    idur * .15,    .8, idur * .15, .2, idur * .35, .4

kenv109 linseg    .4,    idur * .25,    .8,    idur * .75,    0
kenv110 linseg    .6,    idur * .25,    .2,    idur * .75,    1

kenv111 linseg    0,     idur * .8,    .15,    idur * .2,    1
kenv112 linseg    1,     idur * .8,    .85,    idur * .2,    0

kenv113 linseg    .25,     idur * .8,    .75,    idur * .2,    .5
kenv114 linseg    .75,     idur * .8,    .25,    idur * .2,    .5

kenv115 linseg    0, idur * .15, .6, idur * .15, .3, idur * .15, .8, idur * .15, .5, idur * .15, .9, idur * .25, 0
kenv116 linseg    1, idur * .15, .3, idur * .15, .6, idur * .15, .2, idur * .15, .5, idur * .15, .1, idur * .25, 1

kenv117 oscili    1,    kfreq,    1


kenv9      =    (kpan = 2   ? kenv102:kenv101)
kenv10    =    (kpan = 3   ? kenv103:kenv9)
kenv11    =    (kpan = 4   ? kenv104:kenv10)
kenv12    =    (kpan = 5   ? kenv105:kenv11)
kenv13    =    (kpan = 6   ? kenv106:kenv12)
kenv14    =    (kpan = 7   ? kenv107:kenv13)
kenv15    =    (kpan = 8   ? kenv108:kenv14)
kenv16    =    (kpan = 9   ? kenv109:kenv15)
kenv17    =    (kpan = 10  ? kenv109:kenv16)
kenv18    =    (kpan = 11  ? kenv110:kenv17)
kenv19    =    (kpan = 12  ? kenv111:kenv18)
kenv20    =    (kpan = 13  ? kenv112:kenv19)
kenv21    =    (kpan = 14  ? kenv113:kenv20)
kenv22    =    (kpan = 15  ? kenv114:kenv21)
kenv23    =    (kpan = 16  ? kenv115:kenv22)
kenv24    =    (kpan = 17  ? kenv116:kenv23)
kenv25    =    (kpan = 18  ? kenv117:kenv24)

kbal         =    (kpan <= 1  ? kpan:kenv25)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; example cmask code for that pfield although any other mask could be used
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


p6                    ;kpan (range 0 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
item random (0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)



Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 15:08
Fromben hackbarth
Subject[Csnd] Re: Re: Re: Re: 'spatialization' opcodes
sounds like it outputs iDeg between -180 to 180 then.  it should still
work with vbap.  if not, try using the wrap opcode.

—  ben



On Sat, Nov 13, 2010 at 3:38 PM, peiman khosravi
 wrote:
> Hi Ben,
>
> Just to follow up. I don't quite understand the math in your code but I get
> the idea.
>
> However the udo is not returning what I expect it to return. For an x value
> of -1 and a y value of -1 I get iDeg = -135. Should there be any negative
> degrees? (csd bellow)
>
> Thanks again
>
> Peiman
>
> 
>
> 
> -W -o dac
> 
>
> 
>
>
> sr     = 96000
> ksmps  = 16
> nchnls = 1
> 0dbfs  = 1
>
>
> ;    vbaplsinit          2, 8, 0, 45, 90, 135, 180, 225, 270, 315
>
>
> opcode iXYCoor2Vbap, ii, ii
>        ;X and Y from -1->1
>        iX, iY  xin
>        iDistance = ((iX^2)+(iY^2))^0.5
>        iSpread = (sqrt(2)-iDistance)*100 ; get spread
>        iPh  taninv2   iX, iY
>        iDeg = ((iPh/(2*3.141))*360)  ; get angle
>        xout iDeg, iSpread
>        ;iDeg from 0->360; spread from 0->100
> endop
>
>
>
>     instr 1
>
> ix = -1
> iy = -1
>
> iDeg, iSpread    iXYCoor2Vbap    ix, iy
>
> print iDeg, iSpread
>
> ;ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8 vbap8 a1, iDeg, 0, iSpread
>
>
> ;    outo ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8
> endin
>
> 
>
> 
>
> i1    0    1
>
> 
>
> 
>
> On 13 November 2010 13:36, ben hackbarth  wrote:
>>
>> hi peiman,
>>
>> questions of the efficacy of vbap aside, it sounds like you want to
>> convert cartesian coordinates to polar for use with vbap.  maybe this
>> will help.  i haven't looked it over in a while, so checking the math
>> may be in order...
>>
>> opcode iXYCoor2Vbap, ii, ii
>>        ;X and Y from -1->1
>>        iX, iY  xin
>>        iDistance = ((iX^2)+(iY^2))^0.5
>>        iSpread = (sqrt(2)-iDistance)*100 ; get spread
>>        iPh  taninv2   iX, iY
>>        iDeg = ((iPh/(2*3.141))*360)  ; get angle
>>        xout iDeg, iSpread
>>        ;iDeg from 0->360; spread from 0->100
>> endop
>>
>>
>> —  ben
>>
>>
>>
>> On Sat, Nov 13, 2010 at 2:03 PM, Michael Rhoades
>>  wrote:
>> > Hello Peiman and all,
>> >
>> > I have been working on this subject for many years now. Slowly I have
>> > been
>> > developing an instrument that provides a lot of versatility of
>> > spatialization to the point that now, spatialization is an important
>> > formal
>> > aspect in every composition. The instrument has been tailored to the use
>> > of
>> > cmask since I use that for all of my initial score generation...
>> > although I
>> > do sometimes modify scores after they have been generated using excel.
>> >
>> > My goal is to render 8 channel wav files. In the csound rendering
>> > sequence
>> > of events, by the time a sound gets to the spatialization algorithms it
>> > is
>> > stereo (two channels) and it has a panning envelope applied. From there
>> > I
>> > send it through what I call distance algorithms, which are a set of
>> > envelopes that are meant to emulate the qualities of distance movement
>> > that
>> > I think are pertinent. I do not apply Doppler effects because I do not
>> > like
>> > the cliche glissando sounds that are heard in so many E/A music pieces.
>> > Basically, at this point, I want the sound to pan left to right from
>> > near to
>> > far, far to near, near to near and far to far... etc. So I use amplitude
>> > envelopes and reverb envelopes to accomplish it. This can sound very
>> > convincing to my ear.
>> >
>> > Once I have applied those algorithms I then put the two channel sound
>> > into
>> > any combination of 8 speakers. So, for instance, the left sound might be
>> > on
>> > speakers 1, 3, 5 and the right sound might be on speaker 7. Then I
>> > provide
>> > additional panning envelopes so that as the left sound is panning to the
>> > right sound, it is also being panned across speakers 1, 3, 5. To the
>> > listener this provides for a beautiful curve to the panning. Then if it
>> > is,
>> > for instance, from very far away to near... well... you can imagine the
>> > possibilities.
>> >
>> > All of these choices are determined by cmask on an event by event basis
>> > in
>> > the score. I represent them with simple numbers and then let cmask
>> > choose
>> > them depending on the mask I am using for each individual parameter.
>> >
>> > The bottom line is that I do not think there is a quick easy way to
>> > accomplish what you are after but with a little creativity you can come
>> > up
>> > with some very flexible and unique ways to instantiate your dreams...
>> >
>> > I hope this helps,
>> >
>> > Michael
>> >
>> >
>> > Send bugs reports to the Sourceforge bug tracker
>> >           https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> > Discussions of bugs and features can be posted here
>> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> > csound"
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-11-13 15:19
Frompeiman khosravi
Subject[Csnd] Re: Re: Re: Re: Re: 'spatialization' opcodes
yes the wrap opcode does the job. Can't wait to hear the result in the studio on Monday!

Cheers

Peiman

On 13 November 2010 15:08, ben hackbarth <hackbarth@gmail.com> wrote:
sounds like it outputs iDeg between -180 to 180 then.  it should still
work with vbap.  if not, try using the wrap opcode.

—  ben



On Sat, Nov 13, 2010 at 3:38 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Hi Ben,
>
> Just to follow up. I don't quite understand the math in your code but I get
> the idea.
>
> However the udo is not returning what I expect it to return. For an x value
> of -1 and a y value of -1 I get iDeg = -135. Should there be any negative
> degrees? (csd bellow)
>
> Thanks again
>
> Peiman
>
> <CsoundSynthesizer>
>
> <CsOptions>
> -W -o dac
> </CsOptions>
>
> <CsInstruments>
>
>
> sr     = 96000
> ksmps  = 16
> nchnls = 1
> 0dbfs  = 1
>
>
> ;    vbaplsinit          2, 8, 0, 45, 90, 135, 180, 225, 270, 315
>
>
> opcode iXYCoor2Vbap, ii, ii
>        ;X and Y from -1->1
>        iX, iY  xin
>        iDistance = ((iX^2)+(iY^2))^0.5
>        iSpread = (sqrt(2)-iDistance)*100 ; get spread
>        iPh  taninv2   iX, iY
>        iDeg = ((iPh/(2*3.141))*360)  ; get angle
>        xout iDeg, iSpread
>        ;iDeg from 0->360; spread from 0->100
> endop
>
>
>
>     instr 1
>
> ix = -1
> iy = -1
>
> iDeg, iSpread    iXYCoor2Vbap    ix, iy
>
> print iDeg, iSpread
>
> ;ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8 vbap8 a1, iDeg, 0, iSpread
>
>
> ;    outo ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8
> endin
>
> </CsInstruments>
>
> <CsScore>
>
> i1    0    1
>
> </CsScore>
>
> </CsoundSynthesizer>
>
> On 13 November 2010 13:36, ben hackbarth <hackbarth@gmail.com> wrote:
>>
>> hi peiman,
>>
>> questions of the efficacy of vbap aside, it sounds like you want to
>> convert cartesian coordinates to polar for use with vbap.  maybe this
>> will help.  i haven't looked it over in a while, so checking the math
>> may be in order...
>>
>> opcode iXYCoor2Vbap, ii, ii
>>        ;X and Y from -1->1
>>        iX, iY  xin
>>        iDistance = ((iX^2)+(iY^2))^0.5
>>        iSpread = (sqrt(2)-iDistance)*100 ; get spread
>>        iPh  taninv2   iX, iY
>>        iDeg = ((iPh/(2*3.141))*360)  ; get angle
>>        xout iDeg, iSpread
>>        ;iDeg from 0->360; spread from 0->100
>> endop
>>
>>
>> —  ben
>>
>>
>>
>> On Sat, Nov 13, 2010 at 2:03 PM, Michael Rhoades
>> <mrhoades@perceptionfactory.com> wrote:
>> > Hello Peiman and all,
>> >
>> > I have been working on this subject for many years now. Slowly I have
>> > been
>> > developing an instrument that provides a lot of versatility of
>> > spatialization to the point that now, spatialization is an important
>> > formal
>> > aspect in every composition. The instrument has been tailored to the use
>> > of
>> > cmask since I use that for all of my initial score generation...
>> > although I
>> > do sometimes modify scores after they have been generated using excel.
>> >
>> > My goal is to render 8 channel wav files. In the csound rendering
>> > sequence
>> > of events, by the time a sound gets to the spatialization algorithms it
>> > is
>> > stereo (two channels) and it has a panning envelope applied. >From there
>> > I
>> > send it through what I call distance algorithms, which are a set of
>> > envelopes that are meant to emulate the qualities of distance movement
>> > that
>> > I think are pertinent. I do not apply Doppler effects because I do not
>> > like
>> > the cliche glissando sounds that are heard in so many E/A music pieces.
>> > Basically, at this point, I want the sound to pan left to right from
>> > near to
>> > far, far to near, near to near and far to far... etc. So I use amplitude
>> > envelopes and reverb envelopes to accomplish it. This can sound very
>> > convincing to my ear.
>> >
>> > Once I have applied those algorithms I then put the two channel sound
>> > into
>> > any combination of 8 speakers. So, for instance, the left sound might be
>> > on
>> > speakers 1, 3, 5 and the right sound might be on speaker 7. Then I
>> > provide
>> > additional panning envelopes so that as the left sound is panning to the
>> > right sound, it is also being panned across speakers 1, 3, 5. To the
>> > listener this provides for a beautiful curve to the panning. Then if it
>> > is,
>> > for instance, from very far away to near... well... you can imagine the
>> > possibilities.
>> >
>> > All of these choices are determined by cmask on an event by event basis
>> > in
>> > the score. I represent them with simple numbers and then let cmask
>> > choose
>> > them depending on the mask I am using for each individual parameter.
>> >
>> > The bottom line is that I do not think there is a quick easy way to
>> > accomplish what you are after but with a little creativity you can come
>> > up
>> > with some very flexible and unique ways to instantiate your dreams...
>> >
>> > I hope this helps,
>> >
>> > Michael
>> >
>> >
>> > Send bugs reports to the Sourceforge bug tracker
>> >           https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> > Discussions of bugs and features can be posted here
>> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> > csound"
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2010-11-13 17:04
FromMichael Rhoades
Subject[Csnd] Re: 'spatialization' opcodes - example
Peiman wrote:

This is very inspiring.

Thanks

P


I hope it is helpful to you. It is very simple....

Here is an excerpt showing how cmask decides which speakers get which 
signal... I reduce the amplitude sent to each speaker depending on how 
many speakers are used. So, for example, if 3 speakers are used for the 
right channel then I reduce the amplitude by 1/3 that goes to each... 
kampadj1 and 2.

So a1000 is the right channel and a2000 is the left. By this time in the 
orc parsing, all the distance and panning envelopes have been determined 
and so we are just sending those outputs to the speakers... outsel1 - 8.

As before an example cmask file excerpt is at the end. I repeat the 
values in it to determine the likelihood of a value occurring. Again a 
very simple approach and there are many other ways to do it... but as 
you can see, it is more likely that a speaker will carry signal than 
not... 1 and 10 are each in there 3 times ea and 0 only 2....  so by 
varying the cmask file, or I call it the sub-score, we can vary the 
density of speaker selection. It is possible, although highly unlikely, 
that all of the speakers could get, for example, the left signal and 
none of them get the right. I can either discard that sound file and try 
again or if it sounds right use it. That is the beauty of using masks 
for the score... you never know what you might get that surprises you...

Good luck!!

Michael


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;speaker select
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 


aspk11        =    (kspksel1 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel1    =    (kspksel1 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk11)

aspk21        =    (kspksel2 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel2    =    (kspksel2 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk21)

aspk31        =    (kspksel3 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel3    =    (kspksel3 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk31)

aspk41        =    (kspksel4 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel4    =    (kspksel4 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk41)

aspk51        =    (kspksel5 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel5    =    (kspksel5 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk51)

aspk61        =    (kspksel6 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel6    =    (kspksel6 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk61)

aspk71        =    (kspksel7 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel7    =    (kspksel7 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk71)

aspk81        =    (kspksel8 = 0   ?  a2000 * 0:(a2000 * (1-kbal) * 2) * 
kampadj2)
aoutsel8    =    (kspksel8 = 1   ?  ((a1000 * kbal) * 2) * kampadj1:aspk81)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

;Cmask excerpt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 


p16        ;ispksel1
item random (1 0 10 1 0 10 1 10)

p17        ;ispksel2
item random (1 0 10 1 0 10 1 10)

p18        ;ispksel3
item random (1 0 10 1 0 10 1 10)

p19        ;ispksel4
item random (1 0 10 1 0 10 1 10)

p20        ;ispksel5
item random (1 0 10 1 0 10 1 10)

p21        ;ispksel6
item random (1 0 10 1 0 10 1 10)

p22        ;ispksel7
item random (1 0 10 1 0 10 1 10)

p23        ;ispksel8
item random (1 0 10 1 0 10 1 10)


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-11-14 08:28
Fromjoachim heintz
Subject[Csnd] Re: 'spatialization' opcodes
AttachmentsStringsAsArraysOLD.zip  
hi peiman -

i once had the same desire, and realized it in an instrument which i  
called "universal panning". the idea is to have an input like
"1 5 2,3 3 1,3,4 2 4 1 1,2,3,4"
which means:
"start at channel 1 and go in 5 seconds to channel 2 and 3, then in 3  
seconds to channel 1, 3 and 4, ..."

this was my motivation to define soe UDOs for working with strings as  
arrays in csound, because i didn't like the use of function tables for  
an input like the one above. in the first version of my article for  
the csound journal i went this way to the universal panning  
instrument, well, very pedagogically. after the feedback of some  
friends i saw that i should more concentrate on the possibility of  
working with strings as arrays in general; and this was my  
contribution for the last csound journal.

if you want to have a look, just try "StrArr10.csd" in the .zip  
attached, which is the first (too long) version of my article. this  
csd can (and should) be simplified and written as a UDO, but it should  
work right now.

best -

	joachim


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Am 13.11.2010 um 11:35 schrieb peiman khosravi:

> Hello,
>
> I've been looking at the opcodes available for distributing the  
> signal among 6 speakers. The only one seems to be vbap8 (by just  
> ignoring two outputs).
>
> But the problem is that this opcodes does not seem to allow  
> arbitrary panning, meaning that for instance in order to move the  
> source from the front left speaker to the rear  speaker one needs to  
> pass through all the speakers in between. Is there an opcode that  
> accepts x/y coordinates for 6-8 channel distribution?
>
> Thanks in advance
>
> Peiman
>
>