Csound Csound-dev Csound-tekno Search About

[Csnd] pvsbufread crashes csound?

Date2009-05-21 23:17
Fromjoachim heintz
Subject[Csnd] pvsbufread crashes csound?
I'm experimenting with pvsbuffer / pvsbufread. pvsbuffer seems to be  
okay, but pvsbufread crashes Csound. This is an example extract:



-odac


sr = 44100
ksmps = 16
nchnls = 1
0dbfs = 1
instr 50; recording
ift			=			1
ain			inch			1
fsigin		pvsanal		ain, 1024, 256, 1024, 0
ift, ktime		pvsbuffer		fsigin, 5
endin
instr 60; reading and crashing
ibuf			=			1
ktime		linseg		0, p3, p3
fsig  			pvsbufread   	ktime, ibuf
aout			pvsynth		fsig
			outch		1, aout
endin


i 50 0 5
i 60 6 5
e



Am I doing something wrong? Thanks for any help -

	joachim

Date2009-05-21 23:54
FromIain McCurdy
Subject[Csnd] RE: pvsbufread crashes csound?
Hi Joachim,

I think the problem is how you are dealing with the handle variable. It is an output argument from pvsbuffer so to use the same handle with pvsbufread in another instrument it needs to be a global variable. There is no point in assigning ift a value in instr 50.
You might also need to set audio input in your CsOptions.
Try this, it works for me:

<CsoundSynthesizer>
<CsOptions>
-idevaudio -odevaudio
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
nchnls = 1
0dbfs = 1
instr 50; recording
ain            inch            1
fsigin        pvsanal        ain, 1024, 256, 1024, 0
gift, ktime        pvsbuffer        fsigin, 5
endin
instr 60; reading and crashing
ibuf            =            1
ktime        linseg        0, p3, p3
fsig              pvsbufread       ktime, gift
aout            pvsynth        fsig
            outch        1, aout
endin
</CsInstruments>
<CsScore>
i 50 0 5
i 60 6 5
e
</CsScore>
</CsoundSynthesizer>




> From: jh@joachimheintz.de
> To: csound@lists.bath.ac.uk
> Date: Fri, 22 May 2009 00:17:55 +0200
> Subject: [Csnd] pvsbufread crashes csound?
>
> I'm experimenting with pvsbuffer / pvsbufread. pvsbuffer seems to be
> okay, but pvsbufread crashes Csound. This is an example extract:
>
> <CsoundSynthesizer>
> <CsOptions>
> -odac
> </CsOptions>
> <CsInstruments>
> sr = 44100
> ksmps = 16
> nchnls = 1
> 0dbfs = 1
> instr 50; recording
> ift = 1
> ain inch 1
> fsigin pvsanal ain, 1024, 256, 1024, 0
> ift, ktime pvsbuffer fsigin, 5
> endin
> instr 60; reading and crashing
> ibuf = 1
> ktime linseg 0, p3, p3
> fsig pvsbufread ktime, ibuf
> aout pvsynth fsig
> outch 1, aout
> endin
> </CsInstruments>
> <CsScore>
> i 50 0 5
> i 60 6 5
> e
> </CsScore>
> </CsoundSynthesizer>
>
> Am I doing something wrong? Thanks for any help -
>
> joachim
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Hotmail® goes with you. Get it on your BlackBerry or iPhone.

Date2009-05-22 00:08
Fromjoachim heintz
Subject[Csnd] Re: RE: pvsbufread crashes csound?
Thanks a lot, Ian. That's the point. I didn't see that ihandle is  
produced by pvsbuffer, not set before. It's working now!
Best -
	joachim



Am 22.05.2009 um 00:54 schrieb Iain McCurdy:

> Hi Joachim,
>
> I think the problem is how you are dealing with the handle variable.  
> It is an output argument from pvsbuffer so to use the same handle  
> with pvsbufread in another instrument it needs to be a global  
> variable. There is no point in assigning ift a value in instr 50.
> You might also need to set audio input in your CsOptions.
> Try this, it works for me:
>
> 
> 
> -idevaudio -odevaudio
> 
> 
> sr = 44100
> ksmps = 16
> nchnls = 1
> 0dbfs = 1
> instr 50; recording
> ain            inch            1
> fsigin        pvsanal        ain, 1024, 256, 1024, 0
> gift, ktime        pvsbuffer        fsigin, 5
> endin
> instr 60; reading and crashing
> ibuf            =            1
> ktime        linseg        0, p3, p3
> fsig              pvsbufread       ktime, gift
> aout            pvsynth        fsig
>             outch        1, aout
> endin
> 
> 
> i 50 0 5
> i 60 6 5
> e
> 
> 
>
>
>
>
> > From: jh@joachimheintz.de
> > To: csound@lists.bath.ac.uk
> > Date: Fri, 22 May 2009 00:17:55 +0200
> > Subject: [Csnd] pvsbufread crashes csound?
> >
> > I'm experimenting with pvsbuffer / pvsbufread. pvsbuffer seems to be
> > okay, but pvsbufread crashes Csound. This is an example extract:
> >
> > 
> > 
> > -odac
> > 
> > 
> > sr = 44100
> > ksmps = 16
> > nchnls = 1
> > 0dbfs = 1
> > instr 50; recording
> > ift	 =	 1
> > ain	 inch	 1
> > fsigin	 pvsanal	 ain, 1024, 256, 1024, 0
> > ift, ktime	 pvsbuffer	 fsigin, 5
> > endin
> > instr 60; reading and crashing
> > ibuf	 =	 1
> > ktime	 linseg	 0, p3, p3
> > fsig pvsbufread ktime, ibuf
> > aout	 pvsynth	 fsig
> > outch	 1, aout
> > endin
> > 
> > 
> > i 50 0 5
> > i 60 6 5
> > e
> > 
> > 
> >
> > Am I doing something wrong? Thanks for any help -
> >
> > joachim
> >
> >
> > Send bugs reports to this list.
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>
> HotmailĀ® goes with you. Get it on your BlackBerry or iPhone.