Csound Csound-dev Csound-tekno Search About

Re: simple pvsbuffer example - segment violation

Date2007-10-24 09:14
FromVictor Lazzarini
SubjectRe: simple pvsbuffer example - segment violation
Done. Now an error is issued if the
handle is not found. In CVS now.

Also min and max parameters are k-rate (they
were always like that, manual page could be
wrong).

Victor

>
> that's correct, because  a 0 handle will not
> find the buffer. I'll add a check to exit
> more gracefully.
>
> Victor
>
> >
> > I have done more tests,
> > fsb1  pvsbufread  0, khan1, 0, 2500 -> segment violation
> > fsb1  pvsbufread  2.1, khan1, 0, 2500 -> no violation,
> > but out of range  samples
> >
> > jean-pierre
> >
> > Steven Yi a écrit :
> > > I got a Segmentation Violation here on WinXP.  Latest
> > > compiled from CVS but for double precision.  Perhaps
> > > there is a hardcoaded float somewhere?
> > >
> > > On 10/23/07, Rory Walsh  wrote:
> > >
> > >> That's strange. I am using the latest build from the
> > CVS, float >> precision, winxp and it runs fine, so does
> > Victor's sample? >>
> > >> Jean-Pierre Lemoine wrote:
> > >>
> > >>> This example doesn't run on my system (Vista+csound
> > 5.07 double >>> precision). Segment violation!
> > >>> I have tried other examples posted on the list and
> > this is the same >>> error. I have tried to comment
> > lines for finding the culprit; and it >>> seems to be
> > pvsbufread. >>> CsOptions is -odac6 -b2048
> > >>> I have tried with a wav file, and also using vco2.
> > No way >>>
> > >>> jean-pierre
> > >>>
> > >>> Rory Walsh a écrit :
> > >>>
> > >>>> Here's another example. These opcodes are a lot of
> > fun. I've been >>>> playing around with a mic for this
> > one but a soundfile will work too... >>>>
> > >>>>
> > >>>> 
> > >>>> 
> > >>>> -odevaudio -b64 -idevaudio
> > >>>> 
> > >>>> 
> > >>>> sr = 44100
> > >>>> ksmps = 1
> > >>>> nchnls = 2
> > >>>>
> > >>>> instr 1
> > >>>> igain = 0.6
> > >>>>
> > >>>> afdb1 init 0
> > >>>> afdb2 init 0
> > >>>> afdb3 init 0
> > >>>>
> > >>>> asig inch 1
> > >>>> ;asig soundin
> > "D:/MyDocuments/csoundfiles/Old/Radiohead.wav" >>>>
> > >>>> k1 phasor 0.5
> > >>>>
> > >>>> kdel1 randi 1, 0.5, 0.2
> > >>>> kdel2 randi 1, 1,   0.4
> > >>>> kdel3 randi 1, 1.5, 0.5
> > >>>>
> > >>>> fsig1   pvsanal   asig+afdb1,1024, 512,1024,1
> > >>>> fsig2   pvsanal   asig+afdb2,1024, 512,1024,1
> > >>>> fsig3   pvsanal   asig+afdb3,1024, 512,1024,1
> > >>>>
> > >>>> ibuf1,kt1   pvsbuffer   fsig1, 2
> > >>>> ibuf2,kt1   pvsbuffer   fsig2, 2
> > >>>> ibuf3,kt1   pvsbuffer   fsig3, 2
> > >>>>
> > >>>> khan1 init ibuf1
> > >>>> khan2 init ibuf2
> > >>>> khan3 init ibuf3
> > >>>>
> > >>>> fsb1  pvsbufread  k1-kdel1, khan1, 0, 2500
> > >>>> fsb2  pvsbufread  k1-kdel2, khan2, 2500, 7000
> > >>>> fsb3  pvsbufread  k1-kdel3, khan3, 7000, 18000
> > >>>>
> > >>>> aout1  pvsynth   fsb1
> > >>>> aout2  pvsynth   fsb2
> > >>>> aout3  pvsynth   fsb3
> > >>>>
> > >>>> afdb1 = (afdb1+aout1)*igain
> > >>>> afdb2 = (afdb2+aout2)*igain
> > >>>> afdb3 = (afdb3+aout3)*igain
> > >>>>
> > >>>> aLeft = (afdb1*kdel1)+(afdb2*kdel2)+(afdb3*kdel3)
> > >>>> aRight =
> > (afdb1*(1-kdel1))+(afdb2*(1-kdel2))+(afdb3*(1-kdel3))
> > >>>> outs aLeft, aRight >>>>
> > >>>> endin
> > >>>>
> > >>>>
> > >>>> 
> > >>>> 
> > >>>> f1 0 1024 10 1
> > >>>> i1 0 100
> > >>>> 
> > >>>> 
> > >>>>
> > >>>
> > >>>
> > >> --
> > >> Send bugs reports to this list.
> > >> To unsubscribe, send email to
> > csound-unsubscribe@lists.bath.ac.uk >>
> > >>
> >
> >
> >
> > --
> > Send bugs reports to this list.
> > To unsubscribe, send email to
> > csound-unsubscribe@lists.bath.ac.uk
> --
> Send bugs reports to this list.
> To unsubscribe, send email to
> csound-unsubscribe@lists.bath.ac.uk

Date2007-10-24 10:18
FromRory Walsh
SubjectRe: simple pvsbuffer example - segment violation
Great, I'll check it out later...

Victor Lazzarini wrote:
> Done. Now an error is issued if the
> handle is not found. In CVS now.
> 
> Also min and max parameters are k-rate (they
> were always like that, manual page could be
> wrong).
> 
> Victor
> 
>> that's correct, because  a 0 handle will not
>> find the buffer. I'll add a check to exit
>> more gracefully.
>>
>> Victor
>>
>>> I have done more tests,
>>> fsb1  pvsbufread  0, khan1, 0, 2500 -> segment violation
>>> fsb1  pvsbufread  2.1, khan1, 0, 2500 -> no violation,
>>> but out of range  samples
>>>
>>> jean-pierre
>>>
>>> Steven Yi a écrit :
>>>> I got a Segmentation Violation here on WinXP.  Latest
>>>> compiled from CVS but for double precision.  Perhaps
>>>> there is a hardcoaded float somewhere?
>>>>
>>>> On 10/23/07, Rory Walsh  wrote:
>>>>
>>>>> That's strange. I am using the latest build from the
>>> CVS, float >> precision, winxp and it runs fine, so does
>>> Victor's sample? >>
>>>>> Jean-Pierre Lemoine wrote:
>>>>>
>>>>>> This example doesn't run on my system (Vista+csound
>>> 5.07 double >>> precision). Segment violation!
>>>>>> I have tried other examples posted on the list and
>>> this is the same >>> error. I have tried to comment
>>> lines for finding the culprit; and it >>> seems to be
>>> pvsbufread. >>> CsOptions is -odac6 -b2048
>>>>>> I have tried with a wav file, and also using vco2.
>>> No way >>>
>>>>>> jean-pierre
>>>>>>
>>>>>> Rory Walsh a écrit :
>>>>>>
>>>>>>> Here's another example. These opcodes are a lot of
>>> fun. I've been >>>> playing around with a mic for this
>>> one but a soundfile will work too... >>>>
>>>>>>> 
>>>>>>> 
>>>>>>> -odevaudio -b64 -idevaudio
>>>>>>> 
>>>>>>> 
>>>>>>> sr = 44100
>>>>>>> ksmps = 1
>>>>>>> nchnls = 2
>>>>>>>
>>>>>>> instr 1
>>>>>>> igain = 0.6
>>>>>>>
>>>>>>> afdb1 init 0
>>>>>>> afdb2 init 0
>>>>>>> afdb3 init 0
>>>>>>>
>>>>>>> asig inch 1
>>>>>>> ;asig soundin
>>> "D:/MyDocuments/csoundfiles/Old/Radiohead.wav" >>>>
>>>>>>> k1 phasor 0.5
>>>>>>>
>>>>>>> kdel1 randi 1, 0.5, 0.2
>>>>>>> kdel2 randi 1, 1,   0.4
>>>>>>> kdel3 randi 1, 1.5, 0.5
>>>>>>>
>>>>>>> fsig1   pvsanal   asig+afdb1,1024, 512,1024,1
>>>>>>> fsig2   pvsanal   asig+afdb2,1024, 512,1024,1
>>>>>>> fsig3   pvsanal   asig+afdb3,1024, 512,1024,1
>>>>>>>
>>>>>>> ibuf1,kt1   pvsbuffer   fsig1, 2
>>>>>>> ibuf2,kt1   pvsbuffer   fsig2, 2
>>>>>>> ibuf3,kt1   pvsbuffer   fsig3, 2
>>>>>>>
>>>>>>> khan1 init ibuf1
>>>>>>> khan2 init ibuf2
>>>>>>> khan3 init ibuf3
>>>>>>>
>>>>>>> fsb1  pvsbufread  k1-kdel1, khan1, 0, 2500
>>>>>>> fsb2  pvsbufread  k1-kdel2, khan2, 2500, 7000
>>>>>>> fsb3  pvsbufread  k1-kdel3, khan3, 7000, 18000
>>>>>>>
>>>>>>> aout1  pvsynth   fsb1
>>>>>>> aout2  pvsynth   fsb2
>>>>>>> aout3  pvsynth   fsb3
>>>>>>>
>>>>>>> afdb1 = (afdb1+aout1)*igain
>>>>>>> afdb2 = (afdb2+aout2)*igain
>>>>>>> afdb3 = (afdb3+aout3)*igain
>>>>>>>
>>>>>>> aLeft = (afdb1*kdel1)+(afdb2*kdel2)+(afdb3*kdel3)
>>>>>>> aRight =
>>> (afdb1*(1-kdel1))+(afdb2*(1-kdel2))+(afdb3*(1-kdel3))
>>>>>>> outs aLeft, aRight >>>>
>>>>>>> endin
>>>>>>>
>>>>>>>
>>>>>>> 
>>>>>>> 
>>>>>>> f1 0 1024 10 1
>>>>>>> i1 0 100
>>>>>>> 
>>>>>>> 
>>>>>>>
>>>>>>
>>>>> --
>>>>> Send bugs reports to this list.
>>>>> To unsubscribe, send email to
>>> csound-unsubscribe@lists.bath.ac.uk >>
>>>
>>>
>>> --
>>> Send bugs reports to this list.
>>> To unsubscribe, send email to
>>> csound-unsubscribe@lists.bath.ac.uk
>> --
>> Send bugs reports to this list.
>> To unsubscribe, send email to
>> csound-unsubscribe@lists.bath.ac.uk