Csound Csound-dev Csound-tekno Search About

[Csnd] Doppler_in_multichannels

Date2009-10-07 20:55
FromEnrico Francioni
Subject[Csnd] Doppler_in_multichannels

	Hi to all.

One information for the doppler in four channels.

I wrote this csd in four channels, 
[the sound to move only for two channels (from right, to left)]

unfortunately the sound's the problem,
clips, click etc…

The reason is perhaps the use of lposcil3?

thanks to all!
:working:
e

;==============

…my csd example:




sr = 44100
ksmps=120
nchnls=4


gilen8	filelen	"filename.wav"
gi8		ftgen 		8, 0, 0, 1, "filename.wav", 0, 0, 0

;================
instr	1
print	gilen8
;		p1	p2	p3		p4		p5	p6	p7	p8	p9	p10
schedule	2,	0,	gilen8,	20000,   	1,   	8,    	1,	0,	0,	gilen8

endin

;================
instr 2

idlen init    .2

iphaz init    .05

kamp	= p4
kcps  = p5
ifn	= p6
ibas	= p7
imod1= p8
ibeg1	= p9
iend1	= p10 * sr - 1

asamp lposcil3 kamp, kcps, imod1, iend1, ifn

kpanl linseg  0, p3/3, .1, p3/3, .9, p3/3, 1
kpanr =	1-kpanl

kdopl expseg  idlen/3, p3/2, idlen/10, p3/2, idlen/3
kdist linseg  .1, p3/2, .7, p3/2, .01

adel1 delayr  idlen
atap1 deltapi idlen/2+kdopl
atap2 deltapi idlen/2+kdopl+iphaz
    	delayw  asamp*kdist

kamp	linen	1, .15, p3,.15

      outq    atap1*kpanl*kamp, atap2*kpanr*kamp, atap1*0, atap2*0

      endin




i1	0	8
e







-- 
View this message in context: http://www.nabble.com/Doppler_in_multichannels-tp25793281p25793281.html
Sent from the Csound - General mailing list archive at Nabble.com.



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-07 22:09
FromOeyvind Brandtsegg
Subject[Csnd] Re: Doppler_in_multichannels
Hello Enrico,

I'm not sure if this is the reason for your clicks, but it seems your
variable delay time exceeds the max delay time set for the delay loop.
I've tried to extract the relevant bits of your code here:

idlen init    .2
iphaz init    .05
kdopl (varies from idlen/3 to idlen/10, that is 0.066 to 0.02)
adel1 delayr  idlen   ; max delay time set to 0.2
atap2 deltapi idlen/2+kdopl+iphaz    ; variable delay time, maximum
time is : (0.2/2)+(0.2/3)+0.05 = 0.2166...

You could easily fix this by setting the max delay time to a larger
value, this does not affect the resulting sound, and does not affect
CPU or memory usage significantly.
for example
adel1 delayr  idlen+1   ; max delay time set to 1.2

I haven't actually run your code or listened to the output, so I might
be totally wrong of course.
best
Oeyvind


2009/10/7 Enrico Francioni :
>
>
>        Hi to all.
>
> One information for the doppler in four channels.
>
> I wrote this csd in four channels,
> [the sound to move only for two channels (from right, to left)]
>
> unfortunately the sound's the problem,
> clips, click etc…
>
> The reason is perhaps the use of lposcil3?
>
> thanks to all!
> :working:
> e
>
> ;==============
>
> …my csd example:
>
> 
> 
>
> sr = 44100
> ksmps=120
> nchnls=4
>
>
> gilen8  filelen "filename.wav"
> gi8             ftgen           8, 0, 0, 1, "filename.wav", 0, 0, 0
>
> ;================
> instr   1
> print   gilen8
> ;               p1      p2      p3              p4              p5      p6      p7      p8      p9      p10
> schedule        2,      0,      gilen8, 20000,          1,      8,      1,      0,      0,      gilen8
>
> endin
>
> ;================
> instr 2
>
> idlen init    .2
>
> iphaz init    .05
>
> kamp    = p4
> kcps  = p5
> ifn     = p6
> ibas    = p7
> imod1= p8
> ibeg1   = p9
> iend1   = p10 * sr - 1
>
> asamp lposcil3 kamp, kcps, imod1, iend1, ifn
>
> kpanl linseg  0, p3/3, .1, p3/3, .9, p3/3, 1
> kpanr = 1-kpanl
>
> kdopl expseg  idlen/3, p3/2, idlen/10, p3/2, idlen/3
> kdist linseg  .1, p3/2, .7, p3/2, .01
>
> adel1 delayr  idlen
> atap1 deltapi idlen/2+kdopl
> atap2 deltapi idlen/2+kdopl+iphaz
>        delayw  asamp*kdist
>
> kamp    linen   1, .15, p3,.15
>
>      outq    atap1*kpanl*kamp, atap2*kpanr*kamp, atap1*0, atap2*0
>
>      endin
>
> 
> 
>
> i1      0       8
> e
> 
>
> 
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Doppler_in_multichannels-tp25793281p25793281.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-08 22:21
FromEnrico Francioni
Subject[Csnd] Re: Doppler_in_multichannels
Thanks you Oeyvind!

my new csd's:


sr = 44100
ksmps=120
nchnls=4


gilen8	filelen		"filename.wav"
gilen9	filelen		 "filename.wav"

gi8		ftgen 		8, 0, 0, 1, "filename.wav", 0, 0, 0	; 65536
gi9		ftgen 		9, 0, 0, 1, "filename.wav", 0, 0, 0

;-------------------------------------------------------------

; Sample based doppler effects.

;-------------------------------------------------------------

instr	1
print	gilen9
;		p1	p2	p3		p4		p5	p6	p7	p8	p9	p10
schedule	2,	0,	gilen8,	20000,   	1,   	8,    	1,	0,	0;	gilen8

endin


instr 2

idlen init    .09

iphaz init    .05

kamp	= p4
kcps  = p5
ifn	= p6
ibas	= p7	;261.626
imod1= p8
ibeg1	= p9
iend1	= 55237-1;p10 * sr - 1


asamp lposcil3 kamp, kcps, imod1, iend1, ifn

kpanl linseg  0, p3/3, .1, p3/3, .9, p3/3, 1
kpanr =	1-kpanl

kdopl expseg  idlen/3, p3/2, idlen/15, p3/2, idlen/3
kdist linseg  .1, p3/2, 1.3, p3/2, .001

adel1 delayr  2
atap1 deltapi idlen/2+kdopl
atap2 deltapi idlen/2+kdopl+iphaz
    	delayw  asamp*kdist
at1	tonex	atap1, 8000, 6
at2	tonex	atap2, 8000, 6
;printk	 .1, kdopl+idlen/2+iphaz

kamp	linen	1, .15,p3,.15

      outq    at1*kpanl*kamp, at2*kpanr*kamp, atap1*0, atap2*0

      endin

best!
:handshake:
e






Oeyvind Brandtsegg-2 wrote:
> 
> Hello Enrico,
> 
> I'm not sure if this is the reason for your clicks, but it seems your
> variable delay time exceeds the max delay time set for the delay loop.
> I've tried to extract the relevant bits of your code here:
> 
> idlen init    .2
> iphaz init    .05
> kdopl (varies from idlen/3 to idlen/10, that is 0.066 to 0.02)
> adel1 delayr  idlen   ; max delay time set to 0.2
> atap2 deltapi idlen/2+kdopl+iphaz    ; variable delay time, maximum
> time is : (0.2/2)+(0.2/3)+0.05 = 0.2166...
> 
> You could easily fix this by setting the max delay time to a larger
> value, this does not affect the resulting sound, and does not affect
> CPU or memory usage significantly.
> for example
> adel1 delayr  idlen+1   ; max delay time set to 1.2
> 
> I haven't actually run your code or listened to the output, so I might
> be totally wrong of course.
> best
> Oeyvind
> 
> 
> 2009/10/7 Enrico Francioni :
>>
>>
>>        Hi to all.
>>
>> One information for the doppler in four channels.
>>
>> I wrote this csd in four channels,
>> [the sound to move only for two channels (from right, to left)]
>>
>> unfortunately the sound's the problem,
>> clips, click etc…
>>
>> The reason is perhaps the use of lposcil3?
>>
>> thanks to all!
>> :working:
>> e
>>
>> ;==============
>>
>> …my csd example:
>>
>> 
>> 
>>
>> sr = 44100
>> ksmps=120
>> nchnls=4
>>
>>
>> gilen8  filelen "filename.wav"
>> gi8             ftgen           8, 0, 0, 1, "filename.wav", 0, 0, 0
>>
>> ;================
>> instr   1
>> print   gilen8
>> ;               p1      p2      p3              p4              p5    
>>  p6      p7      p8      p9      p10
>> schedule        2,      0,      gilen8, 20000,          1,      8,    
>>  1,      0,      0,      gilen8
>>
>> endin
>>
>> ;================
>> instr 2
>>
>> idlen init    .2
>>
>> iphaz init    .05
>>
>> kamp    = p4
>> kcps  = p5
>> ifn     = p6
>> ibas    = p7
>> imod1= p8
>> ibeg1   = p9
>> iend1   = p10 * sr - 1
>>
>> asamp lposcil3 kamp, kcps, imod1, iend1, ifn
>>
>> kpanl linseg  0, p3/3, .1, p3/3, .9, p3/3, 1
>> kpanr = 1-kpanl
>>
>> kdopl expseg  idlen/3, p3/2, idlen/10, p3/2, idlen/3
>> kdist linseg  .1, p3/2, .7, p3/2, .01
>>
>> adel1 delayr  idlen
>> atap1 deltapi idlen/2+kdopl
>> atap2 deltapi idlen/2+kdopl+iphaz
>>        delayw  asamp*kdist
>>
>> kamp    linen   1, .15, p3,.15
>>
>>      outq    atap1*kpanl*kamp, atap2*kpanr*kamp, atap1*0, atap2*0
>>
>>      endin
>>
>> 
>> 
>>
>> i1      0       8
>> e
>> 
>>
>> 
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Doppler_in_multichannels-tp25793281p25793281.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
> 

-- 
View this message in context: http://www.nabble.com/Doppler_in_multichannels-tp25793281p25811854.html
Sent from the Csound - General mailing list archive at Nabble.com.



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"