Csound Csound-dev Csound-tekno Search About

[Csnd] Probable bug in ATSadd

Date2011-06-28 04:31
FromErnesto Illescas
Subject[Csnd] Probable bug in ATSadd
Attachmentsoriginal.ats  
Dear All,

First of all thanks for the great source of information this list is. I
hope soon I can contribute with solutions...

Anyway to the issue: I believe I've found a bug with the ATSadd opcode.
I'm working on Debian Squeeze (adm64) with "Csound version 5.12 (double
samples) Aug  5 2010" (quoting from my terminal). I ignore if this
happens on other architectures-builds.

What I've been able to establish is that if I can reduce the number of
partials for the re-synthesis (p4 in my score), but once I got to a
value, I can't increment it without getting an error. This is evidenced
by commeting-uncommenting the last score-statement in my .sco (the
commented statement shows no error). From what I've read on the internet
about the error, it seems that once I reduce the number of partials I
use, memory is freed, and I can't access it again; but Iḿ not sure.

Here is the error message, the .orc, the and .sco. I'm also attaching
my .ats analysis file.

The error:

PortAudio real-time audio module for Csound
PortMIDI real time MIDI plugin for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.12 (double samples) Aug  5 2010
libsndfile-1.0.21
Reading options from $CSOUNDRC: /home/ernesto/csound/.csoundrc
orchname:  temp.orc
scorename: temp.sco
rtaudio: ALSA module enabled
RAWWAVE_PATH: /usr/share/stk/rawwaves/
rtmidi: PortMIDI module enabled
orch compiler:
Macro definition for AtsNumPartials
Macro definition for AtsDur
    instr    1   
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.000s
Csound version 5.12 (double samples) Aug  5 2010
0dBFS level = 1.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts
to /home/ernesto/csound/soundfiles/test.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
file original.ats (791640 bytes) loaded into memory
instr 1:  iAtsNumPartials = 77.000
B  0.000 ..  2.482 T  2.482 TT  2.482 M:  0.85321
instr 1:  iAtsNumPartials = 77.000
B  2.482 ..  4.964 T  4.964 TT  4.964 M:  0.85063
instr 1:  iAtsNumPartials = 77.000
B  4.964 ..  7.446 T  7.446 TT  7.446 M:123786381.31152
*** glibc detected *** csound: malloc(): memory corruption:
0x00000000007a61c0 ***


The orchestra:

sr        = 44100
kr        = 4410
ksmps    = 10
nchnls    = 1
0dbfs    = 1.0

; Macro definitions

#define AtsNumPartials #3#
#define AtsDur #7#

    instr 1
SAtsfile = "original.ats"
; Extract data from header of ATS anlysis.
iAtsNumPartials    ATSinfo SAtsfile, $AtsNumPartials
iAtsDur            ATSinfo SAtsfile, $AtsDur
print iAtsNumPartials

iDur            = p3
if p4 > 0 then
    iNumPartials    = p4
else
    iNumPartials    = iAtsNumPartials
endif

kTimePointer    line 0, iDur, iAtsDur - .01
aSig    ATSadd kTimePointer, 1, SAtsfile, 1, iNumPartials, 0
    out    aSig
    endin


The score:

f1 0 16384 10 1                ; a sine wave

i1 0 2.482 0
i1 + 2.482 50
i1 + 2.482 60


I hope this helps better the code, apart from helping me ;~).

Best,

Ernesto

Date2011-06-28 12:41
FromVictor Lazzarini
SubjectRe: [Csnd] Probable bug in ATSadd
Thanks, this is fixed now in GIT.

Victor
On 28 Jun 2011, at 04:31, Ernesto Illescas wrote:

Dear All,

First of all thanks for the great source of information this list is. I
hope soon I can contribute with solutions...

Anyway to the issue: I believe I've found a bug with the ATSadd opcode.
I'm working on Debian Squeeze (adm64) with "Csound version 5.12 (double
samples) Aug  5 2010" (quoting from my terminal). I ignore if this
happens on other architectures-builds.

What I've been able to establish is that if I can reduce the number of
partials for the re-synthesis (p4 in my score), but once I got to a
value, I can't increment it without getting an error. This is evidenced
by commeting-uncommenting the last score-statement in my .sco (the
commented statement shows no error). From what I've read on the internet
about the error, it seems that once I reduce the number of partials I
use, memory is freed, and I can't access it again; but Iḿ not sure.

Here is the error message, the .orc, the and .sco. I'm also attaching
my .ats analysis file.

The error:

PortAudio real-time audio module for Csound
PortMIDI real time MIDI plugin for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.12 (double samples) Aug  5 2010
libsndfile-1.0.21
Reading options from $CSOUNDRC: /home/ernesto/csound/.csoundrc
orchname:  temp.orc
scorename: temp.sco
rtaudio: ALSA module enabled
RAWWAVE_PATH: /usr/share/stk/rawwaves/
rtmidi: PortMIDI module enabled
orch compiler:
Macro definition for AtsNumPartials
Macro definition for AtsDur
    instr    1   
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.000s
Csound version 5.12 (double samples) Aug  5 2010
0dBFS level = 1.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts
to /home/ernesto/csound/soundfiles/test.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
file original.ats (791640 bytes) loaded into memory
instr 1:  iAtsNumPartials = 77.000
B  0.000 ..  2.482 T  2.482 TT  2.482 M:  0.85321
instr 1:  iAtsNumPartials = 77.000
B  2.482 ..  4.964 T  4.964 TT  4.964 M:  0.85063
instr 1:  iAtsNumPartials = 77.000
B  4.964 ..  7.446 T  7.446 TT  7.446 M:123786381.31152
*** glibc detected *** csound: malloc(): memory corruption:
0x00000000007a61c0 ***


The orchestra:

sr        = 44100
kr        = 4410
ksmps    = 10
nchnls    = 1
0dbfs    = 1.0

; Macro definitions

#define AtsNumPartials #3#
#define AtsDur #7#

    instr 1
SAtsfile = "original.ats"
; Extract data from header of ATS anlysis.
iAtsNumPartials    ATSinfo SAtsfile, $AtsNumPartials
iAtsDur            ATSinfo SAtsfile, $AtsDur
print iAtsNumPartials

iDur            = p3
if p4 > 0 then
    iNumPartials    = p4
else
    iNumPartials    = iAtsNumPartials
endif

kTimePointer    line 0, iDur, iAtsDur - .01
aSig    ATSadd kTimePointer, 1, SAtsfile, 1, iNumPartials, 0
    out    aSig
    endin


The score:

f1 0 16384 10 1                ; a sine wave

i1 0 2.482 0
i1 + 2.482 50
i1 + 2.482 60


I hope this helps better the code, apart from helping me ;~).

Best,

Ernesto
<original.ats>

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




Date2011-06-29 02:06
FromErnesto Illescas
SubjectRe: [Csnd] Probable bug in ATSadd
Dear Victor,

Thanks for your fast response. I guess I'll have to download the sources from Guitorius, and use the development version. With my skills, this seems like a free-weekend project. One thing wasn't clear, though. Was the bug already fixed, or was it a simple correction that you just made? I ask this because I ignore if it is relevant that I report bugs from v5.02 (the stable Debian repos must be months behind, at the least).

If sending bugs from this version is relevant, I also found a bug in ATSsinnoi: the  ipartialincr parameter gives a segmentation fault if set to anything but 1. If it is useful, I'll send a simple .orc and .sco that reproduce the bug.

Best,

Ernesto


De: Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Para: csound@lists.bath.ac.uk
Enviado: martes, 28 de junio, 2011 6:41:58
Asunto: Re: [Csnd] Probable bug in ATSadd

Thanks, this is fixed now in GIT.

Victor
On 28 Jun 2011, at 04:31, Ernesto Illescas wrote:

Dear All,

First of all thanks for the great source of information this list is. I
hope soon I can contribute with solutions...

Anyway to the issue: I believe I've found a bug with the ATSadd opcode.
I'm working on Debian Squeeze (adm64) with "Csound version 5.12 (double
samples) Aug  5 2010" (quoting from my terminal). I ignore if this
happens on other architectures-builds.

What I've been able to establish is that if I can reduce the number of
partials for the re-synthesis (p4 in my score), but once I got to a
value, I can't increment it without getting an error. This is evidenced
by commeting-uncommenting the last score-statement in my .sco (the
commented statement shows no error). From what I've read on the internet
about the error, it seems that once I reduce the number of partials I
use, memory is freed, and I can't access it again; but Iḿ not sure.

Here is the error message, the .orc, the and .sco. I'm also attaching
my .ats analysis file.

The error:

PortAudio real-time audio module for Csound
PortMIDI real time MIDI plugin for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.12 (double samples) Aug  5 2010
libsndfile-1.0.21
Reading options from $CSOUNDRC: /home/ernesto/csound/.csoundrc
orchname:  temp.orc
scorename: temp.sco
rtaudio: ALSA module enabled
RAWWAVE_PATH: /usr/share/stk/rawwaves/
rtmidi: PortMIDI module enabled
orch compiler:
Macro definition for AtsNumPartials
Macro definition for AtsDur
    instr    1   
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.000s
Csound version 5.12 (double samples) Aug  5 2010
0dBFS level = 1.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts
to /home/ernesto/csound/soundfiles/test.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
file original.ats (791640 bytes) loaded into memory
instr 1:  iAtsNumPartials = 77.000
B  0.000 ..  2.482 T  2.482 TT  2.482 M:  0.85321
instr 1:  iAtsNumPartials = 77.000
B  2.482 ..  4.964 T  4.964 TT  4.964 M:  0.85063
instr 1:  iAtsNumPartials = 77.000
B  4.964 ..  7.446 T  7.446 TT  7.446 M:123786381.31152
*** glibc detected *** csound: malloc(): memory corruption:
0x00000000007a61c0 ***


The orchestra:

sr        = 44100
kr        = 4410
ksmps    = 10
nchnls    = 1
0dbfs    = 1.0

; Macro definitions

#define AtsNumPartials #3#
#define AtsDur #7#

    instr 1
SAtsfile = "original.ats"
; Extract data from header of ATS anlysis.
iAtsNumPartials    ATSinfo SAtsfile, $AtsNumPartials
iAtsDur            ATSinfo SAtsfile, $AtsDur
print iAtsNumPartials

iDur            = p3
if p4 > 0 then
    iNumPartials    = p4
else
    iNumPartials    = iAtsNumPartials
endif

kTimePointer    line 0, iDur, iAtsDur - .01
aSig    ATSadd kTimePointer, 1, SAtsfile, 1, iNumPartials, 0
    out    aSig
    endin


The score:

f1 0 16384 10 1                ; a sine wave

i1 0 2.482 0
i1 + 2.482 50
i1 + 2.482 60


I hope this helps better the code, apart from helping me ;~).

Best,

Ernesto
<original.ats>

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






Date2011-06-29 05:35
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Probable bug in ATSadd
> Dear Victor,
>
> Thanks for your fast response. I guess I'll have to download the sources
> from Guitorius, and use the development version. With my skills, this
> seems like a free-weekend project. One thing wasn't clear, though. Was the
> bug already fixed, or was it a simple correction that you just made? I ask
> this because I ignore if it is relevant that I report bugs from v5.02 (the
> stable Debian repos must be months behind, at the least).
>
> If sending bugs from this version is relevant, I also found a bug in
> ATSsinnoi: the  ipartialincr parameter gives a segmentation fault if set
> to anything but 1. If it is useful, I'll send a simple .orc and .sco that
> reproduce the bug.
>
> Best,
>
> Ernesto
>

Just a small reminder; there is a fresh build from GIT for Debian intel
32bit processr) every (UK) night availble from

htto://codemist.co.uk/jpff/Debian_Snapshot.tgz

==John ff




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"

Date2011-06-29 15:04
FromErnesto Illescas
SubjectRe: [Csnd] Probable bug in ATSadd
Thanks for the tip, John! I didn't know about the nightly builds. I guess I can force the 32-bit into my architecture with dpkg.
Regards,

Ernesto




De: "jpff@cs.bath.ac.uk" <jpff@cs.bath.ac.uk>
Para: csound@lists.bath.ac.uk
Enviado: martes, 28 de junio, 2011 23:35:52
Asunto: Re: [Csnd] Probable bug in ATSadd

> Dear Victor,
>
> Thanks for your fast response. I guess I'll have to download the sources
> from Guitorius, and use the development version. With my skills, this
> seems like a free-weekend project. One thing wasn't clear, though. Was the
> bug already fixed, or was it a simple correction that you just made? I ask
> this because I ignore if it is relevant that I report bugs from v5.02 (the
> stable Debian repos must be months behind, at the least).
>
> If sending bugs from this version is relevant, I also found a bug in
> ATSsinnoi: the  ipartialincr parameter gives a segmentation fault if set
> to anything but 1. If it is useful, I'll send a simple .orc and .sco that
> reproduce the bug.
>
> Best,
>
> Ernesto
>

Just a small reminder; there is a fresh build from GIT for Debian intel
32bit processr) every (UK) night availble from

htto://codemist.co.uk/jpff/Debian_Snapshot.tgz

==John ff




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"




Date2011-06-29 16:06
FromVictor Lazzarini
SubjectRe: [Csnd] Probable bug in ATSadd
Please send bugs, some of them have been fixed, but others (like the one you reported) have not.

Victor


On 29 Jun 2011, at 02:06, Ernesto Illescas wrote:

Dear Victor,

Thanks for your fast response. I guess I'll have to download the sources from Guitorius, and use the development version. With my skills, this seems like a free-weekend project. One thing wasn't clear, though. Was the bug already fixed, or was it a simple correction that you just made? I ask this because I ignore if it is relevant that I report bugs from v5.02 (the stable Debian repos must be months behind, at the least).

If sending bugs from this version is relevant, I also found a bug in ATSsinnoi: the  ipartialincr parameter gives a segmentation fault if set to anything but 1. If it is useful, I'll send a simple .orc and .sco that reproduce the bug.

Best,

Ernesto


De: Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Para: csound@lists.bath.ac.uk
Enviado: martes, 28 de junio, 2011 6:41:58
Asunto: Re: [Csnd] Probable bug in ATSadd

Thanks, this is fixed now in GIT.

Victor
On 28 Jun 2011, at 04:31, Ernesto Illescas wrote:

Dear All,

First of all thanks for the great source of information this list is. I
hope soon I can contribute with solutions...

Anyway to the issue: I believe I've found a bug with the ATSadd opcode.
I'm working on Debian Squeeze (adm64) with "Csound version 5.12 (double
samples) Aug  5 2010" (quoting from my terminal). I ignore if this
happens on other architectures-builds.

What I've been able to establish is that if I can reduce the number of
partials for the re-synthesis (p4 in my score), but once I got to a
value, I can't increment it without getting an error. This is evidenced
by commeting-uncommenting the last score-statement in my .sco (the
commented statement shows no error). From what I've read on the internet
about the error, it seems that once I reduce the number of partials I
use, memory is freed, and I can't access it again; but Iḿ not sure.

Here is the error message, the .orc, the and .sco. I'm also attaching
my .ats analysis file.

The error:

PortAudio real-time audio module for Csound
PortMIDI real time MIDI plugin for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.12 (double samples) Aug  5 2010
libsndfile-1.0.21
Reading options from $CSOUNDRC: /home/ernesto/csound/.csoundrc
orchname:  temp.orc
scorename: temp.sco
rtaudio: ALSA module enabled
RAWWAVE_PATH: /usr/share/stk/rawwaves/
rtmidi: PortMIDI module enabled
orch compiler:
Macro definition for AtsNumPartials
Macro definition for AtsDur
    instr    1   
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.000s
Csound version 5.12 (double samples) Aug  5 2010
0dBFS level = 1.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts
to /home/ernesto/csound/soundfiles/test.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
file original.ats (791640 bytes) loaded into memory
instr 1:  iAtsNumPartials = 77.000
B  0.000 ..  2.482 T  2.482 TT  2.482 M:  0.85321
instr 1:  iAtsNumPartials = 77.000
B  2.482 ..  4.964 T  4.964 TT  4.964 M:  0.85063
instr 1:  iAtsNumPartials = 77.000
B  4.964 ..  7.446 T  7.446 TT  7.446 M:123786381.31152
*** glibc detected *** csound: malloc(): memory corruption:
0x00000000007a61c0 ***


The orchestra:

sr        = 44100
kr        = 4410
ksmps    = 10
nchnls    = 1
0dbfs    = 1.0

; Macro definitions

#define AtsNumPartials #3#
#define AtsDur #7#

    instr 1
SAtsfile = "original.ats"
; Extract data from header of ATS anlysis.
iAtsNumPartials    ATSinfo SAtsfile, $AtsNumPartials
iAtsDur            ATSinfo SAtsfile, $AtsDur
print iAtsNumPartials

iDur            = p3
if p4 > 0 then
    iNumPartials    = p4
else
    iNumPartials    = iAtsNumPartials
endif

kTimePointer    line 0, iDur, iAtsDur - .01
aSig    ATSadd kTimePointer, 1, SAtsfile, 1, iNumPartials, 0
    out    aSig
    endin


The score:

f1 0 16384 10 1                ; a sine wave

i1 0 2.482 0
i1 + 2.482 50
i1 + 2.482 60


I hope this helps better the code, apart from helping me ;~).

Best,

Ernesto
<original.ats>

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






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




Date2011-07-21 01:22
FromErnesto Illescas
SubjectRe: [Csnd] Probable bug in ATSadd
Dear Victor,

I was finally able to build the development version and test the fix. I'll post information that could be useful for Debianers in another thread. The thing that might be relevant for this post is that I'm now on testing (I just could not build without errors on stable). I ran the example score I sent in the development version, and it does run, however I'm still observing strange behaviour.

The problem now is with the amplitudes. The first note sounds alright, but at the beginning of the second and third notes the amplitude goes to the moon for 10 samples. here's the output from the terminal:


ernesto@studio:~$ csound test.orc test.sco
time resolution is 1000.000 ns
0dBFS level = 32768.0
Csound version 5.13 beta (double samples) Jul 20 2011
libsndfile-1.0.24
Reading options from $CSOUNDRC: /home/ernesto/nube9/csound/.csoundrc
orchname:  test.orc
scorename: test.sco
rtaudio: ALSA module enabled
graph init
orch compiler:
Macro definition for AtsNumPartials
Macro definition for AtsDur
30 (31) lines read
    instr    1   
Elapsed time at end of orchestra compile: real: 0.002s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.002s, CPU: 0.000s
Csound version 5.13 beta (double samples) Jul 20 2011
0dBFS level = 1.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts to /home/ernesto/nube9/csound/soundfiles/test.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
file original.ats (791640 bytes) loaded into memory
instr 1:  iAtsNumPartials = 77.000
B  0.000 ..  2.482 T  2.482 TT  2.482 M:  0.85000
instr 1:  iAtsNumPartials = 77.000
B  2.482 ..  4.964 T  4.964 TT  4.964 M:171150994.93107
     number of samples out of range:       10
instr 1:  iAtsNumPartials = 77.000
B  4.964 ..  7.446 T  7.446 TT  7.446 M:123639702.91078
     number of samples out of range:       10
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.           overall amps:171150994.93107
       overall samples out of range:       20
0 errors in performance
Elapsed time at end of performance: real: 0.190s, CPU: 0.150s
1283 512-byte soundblks of shorts written to /home/ernesto/nube9/csound/soundfiles/test.wav (WAV)
Removing temporary file /tmp/csound-mcXeYN.srt ...



Best,

Ernesto


De: Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Para: csound@lists.bath.ac.uk
Enviado: miércoles, 29 de junio, 2011 10:06:12
Asunto: Re: [Csnd] Probable bug in ATSadd

Please send bugs, some of them have been fixed, but others (like the one you reported) have not.

Victor


On 29 Jun 2011, at 02:06, Ernesto Illescas wrote:

Dear Victor,

Thanks for your fast response. I guess I'll have to download the sources from Guitorius, and use the development version. With my skills, this seems like a free-weekend project. One thing wasn't clear, though. Was the bug already fixed, or was it a simple correction that you just made? I ask this because I ignore if it is relevant that I report bugs from v5.02 (the stable Debian repos must be months behind, at the least).

If sending bugs from this version is relevant, I also found a bug in ATSsinnoi: the  ipartialincr parameter gives a segmentation fault if set to anything but 1. If it is useful, I'll send a simple .orc and .sco that reproduce the bug.

Best,

Ernesto


De: Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Para: csound@lists.bath.ac.uk
Enviado: martes, 28 de junio, 2011 6:41:58
Asunto: Re: [Csnd] Probable bug in ATSadd

Thanks, this is fixed now in GIT.

Victor
On 28 Jun 2011, at 04:31, Ernesto Illescas wrote:

Dear All,

First of all thanks for the great source of information this list is. I
hope soon I can contribute with solutions...

Anyway to the issue: I believe I've found a bug with the ATSadd opcode.
I'm working on Debian Squeeze (adm64) with "Csound version 5.12 (double
samples) Aug  5 2010" (quoting from my terminal). I ignore if this
happens on other architectures-builds.

What I've been able to establish is that if I can reduce the number of
partials for the re-synthesis (p4 in my score), but once I got to a
value, I can't increment it without getting an error. This is evidenced
by commeting-uncommenting the last score-statement in my .sco (the
commented statement shows no error). From what I've read on the internet
about the error, it seems that once I reduce the number of partials I
use, memory is freed, and I can't access it again; but Iḿ not sure.

Here is the error message, the .orc, the and .sco. I'm also attaching
my .ats analysis file.

The error:

PortAudio real-time audio module for Csound
PortMIDI real time MIDI plugin for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.12 (double samples) Aug  5 2010
libsndfile-1.0.21
Reading options from $CSOUNDRC: /home/ernesto/csound/.csoundrc
orchname:  temp.orc
scorename: temp.sco
rtaudio: ALSA module enabled
RAWWAVE_PATH: /usr/share/stk/rawwaves/
rtmidi: PortMIDI module enabled
orch compiler:
Macro definition for AtsNumPartials
Macro definition for AtsDur
    instr    1   
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.000s
Csound version 5.12 (double samples) Aug  5 2010
0dBFS level = 1.0
orch now loaded
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts
to /home/ernesto/csound/soundfiles/test.wav (WAV)
SECTION 1:
ftable 1:
new alloc for instr 1:
file original.ats (791640 bytes) loaded into memory
instr 1:  iAtsNumPartials = 77.000
B  0.000 ..  2.482 T  2.482 TT  2.482 M:  0.85321
instr 1:  iAtsNumPartials = 77.000
B  2.482 ..  4.964 T  4.964 TT  4.964 M:  0.85063
instr 1:  iAtsNumPartials = 77.000
B  4.964 ..  7.446 T  7.446 TT  7.446 M:123786381.31152
*** glibc detected *** csound: malloc(): memory corruption:
0x00000000007a61c0 ***


The orchestra:

sr        = 44100
kr        = 4410
ksmps    = 10
nchnls    = 1
0dbfs    = 1.0

; Macro definitions

#define AtsNumPartials #3#
#define AtsDur #7#

    instr 1
SAtsfile = "original.ats"
; Extract data from header of ATS anlysis.
iAtsNumPartials    ATSinfo SAtsfile, $AtsNumPartials
iAtsDur            ATSinfo SAtsfile, $AtsDur
print iAtsNumPartials

iDur            = p3
if p4 > 0 then
    iNumPartials    = p4
else
    iNumPartials    = iAtsNumPartials
endif

kTimePointer    line 0, iDur, iAtsDur - .01
aSig    ATSadd kTimePointer, 1, SAtsfile, 1, iNumPartials, 0
    out    aSig
    endin


The score:

f1 0 16384 10 1                ; a sine wave

i1 0 2.482 0
i1 + 2.482 50
i1 + 2.482 60


I hope this helps better the code, apart from helping me ;~).

Best,

Ernesto
<original.ats>

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






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