Csound Csound-dev Csound-tekno Search About

[Cs-dev] parser issue pconvolve

Date2011-05-29 12:38
Frommenno
Subject[Cs-dev] parser issue pconvolve
Hi,

i can not run the following csd with the new parser. It is a completed
example from the manual. 
There is no error but Csound just quits.
With the old parser eneabled the csd works perfectly.

greetings
Menno



; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
-iadc    ;;;uncomment -iadc if real audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o pconvolve.wav -W ;;; for file output any platform



sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr   1

kmix = .5	; Wet/dry mix. Vary as desired.
kvol  = .05*kmix	; Overall volume level of reverb. May need to adjust
		; when wet/dry mix is changed, to avoid clipping.
                     			
; do some safety checking to make sure we the parameters a good
kmix = (kmix < 0 || kmix > 1 ? .5 : kmix)
kvol  = (kvol < 0 ? 0 : .5*kvol*kmix)

; size of each convolution partion -- for best performance, this parameter
needs to be tweaked
ipartitionsize = p4

; calculate latency of pconvolve opcode
idel = (ksmps < ipartitionsize ? ipartitionsize + ksmps : ipartitionsize)/sr
prints "Convolving with a latency of %f seconds%n", idel

; actual processing
al, ar ins	;get live input
awetl, awetr pconvolve kvol*(al+ar), "kickroll.wav", ipartitionsize
; Delay dry signal, to align it with the convoled sig
adryl delay (1-kmix)*al, idel
adryr delay (1-kmix)*al, idel
      outs adryl+awetl, adryr+awetr

endin
    
instr 2

imix = 0.5          	; Wet/dry mix. Vary as desired.
ivol = .05*imix     	; Overall volume level of reverb. May need to adjust
                	; when wet/dry mix is changed, to avoid clipping.
ipartitionsize = 1024	; size of each convolution partion
idel = (ksmps < ipartitionsize ? ipartitionsize + ksmps : ipartitionsize)/sr  
; latency of pconvolve opcode

kcount	init	idel*kr
; since we are using a soundin [instead of ins] we can
; do a kind of "look ahead" by looping during one k-pass
; without output, creating zero-latency
loop:
    asig soundin p4, 0
    awetl, awetr pconvolve
ivol*(asig),"/home/menno/manual/examples/rv_stereo.wav", ipartitionsize
    adry delay	(1-imix)*asig,idel  ; Delay dry signal, to align it with
    kcount = kcount - 1
 if kcount > 0 kgoto loop
    outs awetl+adry, awetr+adry
		
endin



i 1 0 20 1024		;play live for 20 seconds

i 2 20 5 "fox.wav"
i 2 25 5 "flute.aiff"

e




--
View this message in context: http://csound.1045644.n5.nabble.com/parser-issue-pconvolve-tp4436876p4436876.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-05-29 13:51
FromVictor Lazzarini
SubjectRe: [Cs-dev] parser issue pconvolve
The problem does not concern pconvolve but expressions of type (a <  
b ? a : b). Comment them out and you'll see it disappear.
I think John had mentioned before that these weren't working yet.  
Thanks for reporting.

Victor
On 29 May 2011, at 12:38, menno wrote:

> Hi,
>
> i can not run the following csd with the new parser. It is a completed
> example from the manual.
> There is no error but Csound just quits.
> With the old parser eneabled the csd works perfectly.
>
> greetings
> Menno
>
> 
> 
> ; Select audio/midi flags here according to platform
> -odac  ;;;realtime audio out
> -iadc    ;;;uncomment -iadc if real audio input is needed too
> ; For Non-realtime ouput leave only the line below:
> ; -o pconvolve.wav -W ;;; for file output any platform
> 
> 
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs  = 1
>
> instr   1
>
> kmix = .5	; Wet/dry mix. Vary as desired.
> kvol  = .05*kmix	; Overall volume level of reverb. May need to adjust
> 		; when wet/dry mix is changed, to avoid clipping.
>                     			
> ; do some safety checking to make sure we the parameters a good
> kmix = (kmix < 0 || kmix > 1 ? .5 : kmix)
> kvol  = (kvol < 0 ? 0 : .5*kvol*kmix)
>
> ; size of each convolution partion -- for best performance, this  
> parameter
> needs to be tweaked
> ipartitionsize = p4
>
> ; calculate latency of pconvolve opcode
> idel = (ksmps < ipartitionsize ? ipartitionsize + ksmps :  
> ipartitionsize)/sr
> prints "Convolving with a latency of %f seconds%n", idel
>
> ; actual processing
> al, ar ins	;get live input
> awetl, awetr pconvolve kvol*(al+ar), "kickroll.wav", ipartitionsize
> ; Delay dry signal, to align it with the convoled sig
> adryl delay (1-kmix)*al, idel
> adryr delay (1-kmix)*al, idel
>      outs adryl+awetl, adryr+awetr
>
> endin
>
> instr 2
>
> imix = 0.5          	; Wet/dry mix. Vary as desired.
> ivol = .05*imix     	; Overall volume level of reverb. May need to  
> adjust
>                	; when wet/dry mix is changed, to avoid clipping.
> ipartitionsize = 1024	; size of each convolution partion
> idel = (ksmps < ipartitionsize ? ipartitionsize + ksmps :  
> ipartitionsize)/sr
> ; latency of pconvolve opcode
>
> kcount	init	idel*kr
> ; since we are using a soundin [instead of ins] we can
> ; do a kind of "look ahead" by looping during one k-pass
> ; without output, creating zero-latency
> loop:
>    asig soundin p4, 0
>    awetl, awetr pconvolve
> ivol*(asig),"/home/menno/manual/examples/rv_stereo.wav",  
> ipartitionsize
>    adry delay	(1-imix)*asig,idel  ; Delay dry signal, to align it with
>    kcount = kcount - 1
> if kcount > 0 kgoto loop
>    outs awetl+adry, awetr+adry
> 		
> endin
> 
> 
>
> i 1 0 20 1024		;play live for 20 seconds
>
> i 2 20 5 "fox.wav"
> i 2 25 5 "flute.aiff"
>
> e
> 
> 
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/parser-issue-pconvolve-tp4436876p4436876.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-05-29 19:41
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] parser issue pconvolve
> The problem does not concern pconvolve but expressions of type (a <
> b ? a : b). Comment them out and you'll see it disappear.
> I think John had mentioned before that these weren't working yet.
> Thanks for reporting.
>
> Victor

It seems OK except OI have the test exactly backwards.  Will check

==John ff


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net