Csound Csound-dev Csound-tekno Search About

How to use String filenames, filelen and diskin2 with OSC?

Date2016-01-22 15:33
FromAnton Kholomiov
SubjectHow to use String filenames, filelen and diskin2 with OSC?
Attachmentsflow.csd  test_flow.py  
I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the 
length of crossfade. 

On receive it should stop playing any previous wavs
and start a loop that plays next wav file. 
The two loops should crossfade. 

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC. 
I receive a string-field then assign it to a global String var.
But when I try to use it with diskin2 or filelen I get INIT errors
like this

INIT ERROR in instr 100: diskinfo cannot open 
ilen filelen gSFile 1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-22 15:45
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 22 Jan 2016, at 15:33, Anton Kholomiov  wrote:
> 
> I'm trying to write an OSC-server with Csound.
> The service should receive the name of the wav-file and the 
> length of crossfade. 
> 
> On receive it should stop playing any previous wavs
> and start a loop that plays next wav file. 
> The two loops should crossfade. 
> 
> While trying to write such a thing I'm getting into trouble
> with receiving String message with OSC. 
> I receive a string-field then assign it to a global String var.
> But when I try to use it with diskin2 or filelen I get INIT errors
> like this
> 
> INIT ERROR in instr 100: diskinfo cannot open 
> ilen	filelen	gSFile	1
> 
> What can be wrong with my code?
> 
> I attach the two files.
> csd with server and python with client to test the server.
> The python uses pyOSC library
> 
> Thanks,
> Anton
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-22 15:52
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
> I'm trying to write an OSC-server with Csound.
> The service should receive the name of the wav-file and the
> length of crossfade.
>
> On receive it should stop playing any previous wavs
> and start a loop that plays next wav file.
> The two loops should crossfade.
>
> While trying to write such a thing I'm getting into trouble
> with receiving String message with OSC.
> I receive a string-field then assign it to a global String var.
> But when I try to use it with diskin2 or filelen I get INIT errors
> like this
>
> INIT ERROR in instr 100: diskinfo cannot open
> ilen  filelen gSFile  1
>
> What can be wrong with my code?
>
> I attach the two files.
> csd with server and python with client to test the server.
> The python uses pyOSC library
>
> Thanks,
> Anton
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-22 15:56
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 22 Jan 2016, at 15:52, Anton Kholomiov  wrote:
> 
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
> 
> Anton
> 
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini :
> String assignment is i-time only. Use strcpyk
> 
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 22 Jan 2016, at 15:33, Anton Kholomiov  wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 21:54
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Attachmentsflow.csd  test_flow.py  
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 21:55
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:06
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:07
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:20
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd 

when it crashes you can try using the
backtrace command to show where it stopped.
On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:24
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd 

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:32
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>, 
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
#12 0x00000000004013b0 in _start ()

2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd 

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:33
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:

Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>, 
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
#12 0x00000000004013b0 in _start ()

2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd 

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:36
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Here I'm reading the same file with diskin2 in the two instances of the same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:

Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>, 
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
#12 0x00000000004013b0 in _start ()

2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd 

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:58
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

And another message:

diskin2: opened '/home/anton/music/raga/samples/pad/test-drone-2-E.wav':
         44100 Hz, 2 channel(s), 18521984 sample frames
  rtevent:       T1022.420 TT1022.420 M:  0.66498  0.56583
instr 80:  p1 = 80.001
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T1026.048 TT1026.048 M:  0.54265  0.50304
instr 80:  p1 = 80.002
csound: malloc.c:3700: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff73760d8 in __GI_abort () at abort.c:89
#2  0x00007ffff73b97fd in __malloc_assert (
    assertion=assertion@entry=0x7ffff74bdf70 "victim->fd_nextsize->bk_nextsize == victim", file=file@entry=0x7ffff74b9b80 "malloc.c", line=line@entry=3700, 
    function=function@entry=0x7ffff74b9f08 <__func__.11522> "_int_malloc")
    at malloc.c:293
#3  0x00007ffff73bd0ea in _int_malloc (av=0x7ffff76fa760 <main_arena>, 
    bytes=120) at malloc.c:3700
#4  0x00007ffff73be7b0 in __GI___libc_malloc (bytes=120) at malloc.c:2891
#5  0x00007ffff79719c3 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff795d289 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff799b640 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#10 0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#11 0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
#12 0x0000000000401358 in ?? ()
#13 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=3, 
    argv=0x7fffffffd7b8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7a8) at libc-start.c:287
#14 0x00000000004013b0 in _start ()

2016-01-24 1:36 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here I'm reading the same file with diskin2 in the two instances of the same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:

Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>, 
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
#12 0x00000000004013b0 in _start ()

2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd 

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfortunately after several minutes of playing the service breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files 
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played with xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the service
from the code. There are some test remnants of file names you can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special provisions for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> So the assignment operation works only at init time
> and for k-rate we should use strcpyk.
>
> Anton
>
> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> String assignment is i-time only. Use strcpyk
>
> gSFile strcpyk SFile
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > I'm trying to write an OSC-server with Csound.
> > The service should receive the name of the wav-file and the
> > length of crossfade.
> >
> > On receive it should stop playing any previous wavs
> > and start a loop that plays next wav file.
> > The two loops should crossfade.
> >
> > While trying to write such a thing I'm getting into trouble
> > with receiving String message with OSC.
> > I receive a string-field then assign it to a global String var.
> > But when I try to use it with diskin2 or filelen I get INIT errors
> > like this
> >
> > INIT ERROR in instr 100: diskinfo cannot open
> > ilen  filelen gSFile  1
> >
> > What can be wrong with my code?
> >
> > I attach the two files.
> > csd with server and python with client to test the server.
> > The python uses pyOSC library
> >
> > Thanks,
> > Anton
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here





Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 22:59
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Can you post the Csound code? I see no global arrays in your earlier flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 22:36, Anton Kholomiov  wrote:
> 
> Here I'm reading the same file with diskin2 in the two instances of the same instrument.
> It's triggered with fractional numbers. 80.001 and 80.005
> 
> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
> 
> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> Here is message from gdb:
> 
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>      number of samples out of range:        2        2
> new alloc for instr 80:
> instr 80:  p1 = 80.005
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>      number of samples out of range:     1315      451
> instr 80:  p1 = 80.001
> 
> Program received signal SIGSEGV, Segmentation fault.
> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at malloc.c:4163
> 4163    malloc.c: No such file or directory.
> (gdb) bt
> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>     at malloc.c:4163
> #1  0x00007ffff73bbdf8 in _int_malloc (
>     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>     at malloc.c:3423
> #2  0x00007ffff73bf2cc in __libc_calloc (n=, 
>     elem_size=) at malloc.c:3219
> #3  0x00007ffff70df5f2 in sf_open ()
>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #10 0x0000000000401358 in ?? ()
> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
>     argv=0x7fffffffd7c8, init=, fini=, 
>     rtld_fini=, stack_end=0x7fffffffd7b8) at libc-start.c:287
> #12 0x00000000004013b0 in _start ()
> 
> 
> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> Thanks for the quick reply, Victor.
> I'll report back if I encounter the problem again!
> Though I'm not that good with gdb
> 
> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> Use gdb. Are you using the csound command? Do gdb csound, then
> use the run command with the arguments you need eg
> 
> run mycsd.csd 
> 
> when it crashes you can try using the
> backtrace command to show where it stopped.
> 
> On 23 Jan 2016, at 22:07, Anton Kholomiov  wrote:
> 
>> How to do it?
>> 
>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
>> Can you run it under a debugger?
>> 
>> On 23 Jan 2016, at 21:55, Anton Kholomiov  wrote:
>> 
>>> Unfortunately after several minutes of playing the service breaks
>>> with the message
>>> 
>>> diskin2: opened '/home/anton/Seashore.wav':
>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
>>> Csound tidy up: Aborted
>>> 
>>> Any ideas?
>>> 
>>> 
>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
>>> It's done. Just in case if anyone interested in the end result.
>>> I post a code for service. It can play continuously wav files 
>>> on several channels. Channels are identified by numbers.
>>> 
>>> User can for the given channel
>>> 
>>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
>>>    so that user percieves it like a continuous flow.
>>> 
>>> * stop playing a file
>>> 
>>> * resume playback
>>> 
>>> * set the volume for the given channel
>>> 
>>> * set a global fade in/out time
>>> 
>>> Also there is a python file that makes it easy to trigger the service
>>> from the code. There are some test remnants of file names you can
>>> substitute it with your own files.
>>> 
>>> This combo of OSC service and python client makes it easy
>>> to livecode with python.
>>> 
>>> 
>>> Anton
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini :
>>> Strings are updated generally at i-time, but with special provisions for perf-time.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>> > On 22 Jan 2016, at 15:52, Anton Kholomiov  wrote:
>>> >
>>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
>>> > So the assignment operation works only at init time
>>> > and for k-rate we should use strcpyk.
>>> >
>>> > Anton
>>> >
>>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini :
>>> > String assignment is i-time only. Use strcpyk
>>> >
>>> > gSFile strcpyk SFile
>>> > ========================
>>> > Dr Victor Lazzarini
>>> > Dean of Arts, Celtic Studies and Philosophy,
>>> > Maynooth University,
>>> > Maynooth, Co Kildare, Ireland
>>> > Tel: 00 353 7086936
>>> > Fax: 00 353 1 7086952
>>> >
>>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov  wrote:
>>> > >
>>> > > I'm trying to write an OSC-server with Csound.
>>> > > The service should receive the name of the wav-file and the
>>> > > length of crossfade.
>>> > >
>>> > > On receive it should stop playing any previous wavs
>>> > > and start a loop that plays next wav file.
>>> > > The two loops should crossfade.
>>> > >
>>> > > While trying to write such a thing I'm getting into trouble
>>> > > with receiving String message with OSC.
>>> > > I receive a string-field then assign it to a global String var.
>>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>>> > > like this
>>> > >
>>> > > INIT ERROR in instr 100: diskinfo cannot open
>>> > > ilen  filelen gSFile  1
>>> > >
>>> > > What can be wrong with my code?
>>> > >
>>> > > I attach the two files.
>>> > > csd with server and python with client to test the server.
>>> > > The python uses pyOSC library
>>> > >
>>> > > Thanks,
>>> > > Anton
>>> > >
>>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here 
>>> >
>>> > Csound mailing list
>>> > Csound@listserv.heanet.ie
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> 
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> 
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:00
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d 
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""    
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime    
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:    
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel    
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime    
    kgoto nxtmsg
ex:    
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime        
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:    
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:    
endin

instr   SetFadeMsg
    kFade   init 0    
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:    
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime) 
    iChannel  = p4    
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1    
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif
    
    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0, iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05
    
    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100   
    iChannel  = p4 
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))  
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0 
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1        
        kCount = kCount + 1
    od        
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1 
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your earlier flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> Here I'm reading the same file with diskin2 in the two instances of the same instrument.
> It's triggered with fractional numbers. 80.001 and 80.005
>
> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
>
> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Here is message from gdb:
>
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>      number of samples out of range:        2        2
> new alloc for instr 80:
> instr 80:  p1 = 80.005
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>      number of samples out of range:     1315      451
> instr 80:  p1 = 80.001
>
> Program received signal SIGSEGV, Segmentation fault.
> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
> 4163    malloc.c: No such file or directory.
> (gdb) bt
> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>     at malloc.c:4163
> #1  0x00007ffff73bbdf8 in _int_malloc (
>     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>     at malloc.c:3423
> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>     elem_size=<optimized out>) at malloc.c:3219
> #3  0x00007ffff70df5f2 in sf_open ()
>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #10 0x0000000000401358 in ?? ()
> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
> #12 0x00000000004013b0 in _start ()
>
>
> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Thanks for the quick reply, Victor.
> I'll report back if I encounter the problem again!
> Though I'm not that good with gdb
>
> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> Use gdb. Are you using the csound command? Do gdb csound, then
> use the run command with the arguments you need eg
>
> run mycsd.csd
>
> when it crashes you can try using the
> backtrace command to show where it stopped.
>
> On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
>> How to do it?
>>
>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> Can you run it under a debugger?
>>
>> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>
>>> Unfortunately after several minutes of playing the service breaks
>>> with the message
>>>
>>> diskin2: opened '/home/anton/Seashore.wav':
>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
>>> Csound tidy up: Aborted
>>>
>>> Any ideas?
>>>
>>>
>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>> It's done. Just in case if anyone interested in the end result.
>>> I post a code for service. It can play continuously wav files
>>> on several channels. Channels are identified by numbers.
>>>
>>> User can for the given channel
>>>
>>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
>>>    so that user percieves it like a continuous flow.
>>>
>>> * stop playing a file
>>>
>>> * resume playback
>>>
>>> * set the volume for the given channel
>>>
>>> * set a global fade in/out time
>>>
>>> Also there is a python file that makes it easy to trigger the service
>>> from the code. There are some test remnants of file names you can
>>> substitute it with your own files.
>>>
>>> This combo of OSC service and python client makes it easy
>>> to livecode with python.
>>>
>>>
>>> Anton
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> Strings are updated generally at i-time, but with special provisions for perf-time.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>> > On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>> >
>>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
>>> > So the assignment operation works only at init time
>>> > and for k-rate we should use strcpyk.
>>> >
>>> > Anton
>>> >
>>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> > String assignment is i-time only. Use strcpyk
>>> >
>>> > gSFile strcpyk SFile
>>> > ========================
>>> > Dr Victor Lazzarini
>>> > Dean of Arts, Celtic Studies and Philosophy,
>>> > Maynooth University,
>>> > Maynooth, Co Kildare, Ireland
>>> > Tel: 00 353 7086936
>>> > Fax: 00 353 1 7086952
>>> >
>>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>> > >
>>> > > I'm trying to write an OSC-server with Csound.
>>> > > The service should receive the name of the wav-file and the
>>> > > length of crossfade.
>>> > >
>>> > > On receive it should stop playing any previous wavs
>>> > > and start a loop that plays next wav file.
>>> > > The two loops should crossfade.
>>> > >
>>> > > While trying to write such a thing I'm getting into trouble
>>> > > with receiving String message with OSC.
>>> > > I receive a string-field then assign it to a global String var.
>>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>>> > > like this
>>> > >
>>> > > INIT ERROR in instr 100: diskinfo cannot open
>>> > > ilen  filelen gSFile  1
>>> > >
>>> > > What can be wrong with my code?
>>> > >
>>> > > I attach the two files.
>>> > > csd with server and python with client to test the server.
>>> > > The python uses pyOSC library
>>> > >
>>> > > Thanks,
>>> > > Anton
>>> > >
>>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>>> >
>>> > Csound mailing list
>>> > Csound@listserv.heanet.ie
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>>
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
>
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:02
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
If you are building Csound, you should set theCMAKE_BUILD_TYPE to Debug so we can see 
better diagnostics. Otherwise you could post your CSD here and give me instructions on how it crashes.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 22:58, Anton Kholomiov  wrote:
> 
> And another message:
> 
> diskin2: opened '/home/anton/music/raga/samples/pad/test-drone-2-E.wav':
>          44100 Hz, 2 channel(s), 18521984 sample frames
>   rtevent:       T1022.420 TT1022.420 M:  0.66498  0.56583
> instr 80:  p1 = 80.001
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T1026.048 TT1026.048 M:  0.54265  0.50304
> instr 80:  p1 = 80.002
> csound: malloc.c:3700: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.
> 
> Program received signal SIGABRT, Aborted.
> 0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0  0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1  0x00007ffff73760d8 in __GI_abort () at abort.c:89
> #2  0x00007ffff73b97fd in __malloc_assert (
>     assertion=assertion@entry=0x7ffff74bdf70 "victim->fd_nextsize->bk_nextsize == victim", file=file@entry=0x7ffff74b9b80 "malloc.c", line=line@entry=3700, 
>     function=function@entry=0x7ffff74b9f08 <__func__.11522> "_int_malloc")
>     at malloc.c:293
> #3  0x00007ffff73bd0ea in _int_malloc (av=0x7ffff76fa760 , 
>     bytes=120) at malloc.c:3700
> #4  0x00007ffff73be7b0 in __GI___libc_malloc (bytes=120) at malloc.c:2891
> #5  0x00007ffff79719c3 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff795d289 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff799b640 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #10 0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #11 0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #12 0x0000000000401358 in ?? ()
> #13 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=3, 
>     argv=0x7fffffffd7b8, init=, fini=, 
>     rtld_fini=, stack_end=0x7fffffffd7a8) at libc-start.c:287
> #14 0x00000000004013b0 in _start ()
> 
> 
> 2016-01-24 1:36 GMT+03:00 Anton Kholomiov :
> Here I'm reading the same file with diskin2 in the two instances of the same instrument.
> It's triggered with fractional numbers. 80.001 and 80.005
> 
> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
> 
> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> Here is message from gdb:
> 
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>      number of samples out of range:        2        2
> new alloc for instr 80:
> instr 80:  p1 = 80.005
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>      number of samples out of range:     1315      451
> instr 80:  p1 = 80.001
> 
> Program received signal SIGSEGV, Segmentation fault.
> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at malloc.c:4163
> 4163    malloc.c: No such file or directory.
> (gdb) bt
> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>     at malloc.c:4163
> #1  0x00007ffff73bbdf8 in _int_malloc (
>     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>     at malloc.c:3423
> #2  0x00007ffff73bf2cc in __libc_calloc (n=, 
>     elem_size=) at malloc.c:3219
> #3  0x00007ffff70df5f2 in sf_open ()
>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #10 0x0000000000401358 in ?? ()
> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
>     argv=0x7fffffffd7c8, init=, fini=, 
>     rtld_fini=, stack_end=0x7fffffffd7b8) at libc-start.c:287
> #12 0x00000000004013b0 in _start ()
> 
> 
> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> Thanks for the quick reply, Victor.
> I'll report back if I encounter the problem again!
> Though I'm not that good with gdb
> 
> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> Use gdb. Are you using the csound command? Do gdb csound, then
> use the run command with the arguments you need eg
> 
> run mycsd.csd 
> 
> when it crashes you can try using the
> backtrace command to show where it stopped.
> 
> On 23 Jan 2016, at 22:07, Anton Kholomiov  wrote:
> 
>> How to do it?
>> 
>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
>> Can you run it under a debugger?
>> 
>> On 23 Jan 2016, at 21:55, Anton Kholomiov  wrote:
>> 
>>> Unfortunately after several minutes of playing the service breaks
>>> with the message
>>> 
>>> diskin2: opened '/home/anton/Seashore.wav':
>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
>>> Csound tidy up: Aborted
>>> 
>>> Any ideas?
>>> 
>>> 
>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
>>> It's done. Just in case if anyone interested in the end result.
>>> I post a code for service. It can play continuously wav files 
>>> on several channels. Channels are identified by numbers.
>>> 
>>> User can for the given channel
>>> 
>>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
>>>    so that user percieves it like a continuous flow.
>>> 
>>> * stop playing a file
>>> 
>>> * resume playback
>>> 
>>> * set the volume for the given channel
>>> 
>>> * set a global fade in/out time
>>> 
>>> Also there is a python file that makes it easy to trigger the service
>>> from the code. There are some test remnants of file names you can
>>> substitute it with your own files.
>>> 
>>> This combo of OSC service and python client makes it easy
>>> to livecode with python.
>>> 
>>> 
>>> Anton
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini :
>>> Strings are updated generally at i-time, but with special provisions for perf-time.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>> > On 22 Jan 2016, at 15:52, Anton Kholomiov  wrote:
>>> >
>>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
>>> > So the assignment operation works only at init time
>>> > and for k-rate we should use strcpyk.
>>> >
>>> > Anton
>>> >
>>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini :
>>> > String assignment is i-time only. Use strcpyk
>>> >
>>> > gSFile strcpyk SFile
>>> > ========================
>>> > Dr Victor Lazzarini
>>> > Dean of Arts, Celtic Studies and Philosophy,
>>> > Maynooth University,
>>> > Maynooth, Co Kildare, Ireland
>>> > Tel: 00 353 7086936
>>> > Fax: 00 353 1 7086952
>>> >
>>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov  wrote:
>>> > >
>>> > > I'm trying to write an OSC-server with Csound.
>>> > > The service should receive the name of the wav-file and the
>>> > > length of crossfade.
>>> > >
>>> > > On receive it should stop playing any previous wavs
>>> > > and start a loop that plays next wav file.
>>> > > The two loops should crossfade.
>>> > >
>>> > > While trying to write such a thing I'm getting into trouble
>>> > > with receiving String message with OSC.
>>> > > I receive a string-field then assign it to a global String var.
>>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>>> > > like this
>>> > >
>>> > > INIT ERROR in instr 100: diskinfo cannot open
>>> > > ilen  filelen gSFile  1
>>> > >
>>> > > What can be wrong with my code?
>>> > >
>>> > > I attach the two files.
>>> > > csd with server and python with client to test the server.
>>> > > The python uses pyOSC library
>>> > >
>>> > > Thanks,
>>> > > Anton
>>> > >
>>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here 
>>> >
>>> > Csound mailing list
>>> > Csound@listserv.heanet.ie
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> 
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> 
> 
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:06
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Could you try this again, but now commenting out the array assignment? If it does not
crash, then that’s the problem.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 22:33, Anton Kholomiov  wrote:
> 
> The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
> 
> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> Here is message from gdb:
> 
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>      number of samples out of range:        2        2
> new alloc for instr 80:
> instr 80:  p1 = 80.005
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>      number of samples out of range:     1315      451
> instr 80:  p1 = 80.001
> 
> Program received signal SIGSEGV, Segmentation fault.
> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at malloc.c:4163
> 4163    malloc.c: No such file or directory.
> (gdb) bt
> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>     at malloc.c:4163
> #1  0x00007ffff73bbdf8 in _int_malloc (
>     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>     at malloc.c:3423
> #2  0x00007ffff73bf2cc in __libc_calloc (n=, 
>     elem_size=) at malloc.c:3219
> #3  0x00007ffff70df5f2 in sf_open ()
>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #10 0x0000000000401358 in ?? ()
> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2, 
>     argv=0x7fffffffd7c8, init=, fini=, 
>     rtld_fini=, stack_end=0x7fffffffd7b8) at libc-start.c:287
> #12 0x00000000004013b0 in _start ()
> 
> 
> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> Thanks for the quick reply, Victor.
> I'll report back if I encounter the problem again!
> Though I'm not that good with gdb
> 
> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> Use gdb. Are you using the csound command? Do gdb csound, then
> use the run command with the arguments you need eg
> 
> run mycsd.csd 
> 
> when it crashes you can try using the
> backtrace command to show where it stopped.
> 
> On 23 Jan 2016, at 22:07, Anton Kholomiov  wrote:
> 
>> How to do it?
>> 
>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
>> Can you run it under a debugger?
>> 
>> On 23 Jan 2016, at 21:55, Anton Kholomiov  wrote:
>> 
>>> Unfortunately after several minutes of playing the service breaks
>>> with the message
>>> 
>>> diskin2: opened '/home/anton/Seashore.wav':
>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
>>> Csound tidy up: Aborted
>>> 
>>> Any ideas?
>>> 
>>> 
>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
>>> It's done. Just in case if anyone interested in the end result.
>>> I post a code for service. It can play continuously wav files 
>>> on several channels. Channels are identified by numbers.
>>> 
>>> User can for the given channel
>>> 
>>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
>>>    so that user percieves it like a continuous flow.
>>> 
>>> * stop playing a file
>>> 
>>> * resume playback
>>> 
>>> * set the volume for the given channel
>>> 
>>> * set a global fade in/out time
>>> 
>>> Also there is a python file that makes it easy to trigger the service
>>> from the code. There are some test remnants of file names you can
>>> substitute it with your own files.
>>> 
>>> This combo of OSC service and python client makes it easy
>>> to livecode with python.
>>> 
>>> 
>>> Anton
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini :
>>> Strings are updated generally at i-time, but with special provisions for perf-time.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>> > On 22 Jan 2016, at 15:52, Anton Kholomiov  wrote:
>>> >
>>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
>>> > So the assignment operation works only at init time
>>> > and for k-rate we should use strcpyk.
>>> >
>>> > Anton
>>> >
>>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini :
>>> > String assignment is i-time only. Use strcpyk
>>> >
>>> > gSFile strcpyk SFile
>>> > ========================
>>> > Dr Victor Lazzarini
>>> > Dean of Arts, Celtic Studies and Philosophy,
>>> > Maynooth University,
>>> > Maynooth, Co Kildare, Ireland
>>> > Tel: 00 353 7086936
>>> > Fax: 00 353 1 7086952
>>> >
>>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov  wrote:
>>> > >
>>> > > I'm trying to write an OSC-server with Csound.
>>> > > The service should receive the name of the wav-file and the
>>> > > length of crossfade.
>>> > >
>>> > > On receive it should stop playing any previous wavs
>>> > > and start a loop that plays next wav file.
>>> > > The two loops should crossfade.
>>> > >
>>> > > While trying to write such a thing I'm getting into trouble
>>> > > with receiving String message with OSC.
>>> > > I receive a string-field then assign it to a global String var.
>>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>>> > > like this
>>> > >
>>> > > INIT ERROR in instr 100: diskinfo cannot open
>>> > > ilen  filelen gSFile  1
>>> > >
>>> > > What can be wrong with my code?
>>> > >
>>> > > I attach the two files.
>>> > > csd with server and python with client to test the server.
>>> > > The python uses pyOSC library
>>> > >
>>> > > Thanks,
>>> > > Anton
>>> > >
>>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here 
>>> >
>>> > Csound mailing list
>>> > Csound@listserv.heanet.ie
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> 
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:09
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Attachmentsflow.csd  test_flow.py  
I'm sorry I don't know how to build csound. 
There are two files. One flow.csd with osc-server.
and second one is test_flow.py with client.
The py-file makes it easy to test the csound file.

You can just run 

> csound flow.csd

It will start the OSC-listener on the prort 7700 with 8 channels. 

Then you can start to send messages with python:

> python
> from test_flow import *
> c = Flow(7700, 8)
> c.play(0, wav_file_name)
> c.play(1, another_wav_file_name)
> c.set_volume(0, 0.2)
> c.stop(0)
..etc..








2016-01-24 2:02 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
If you are building Csound, you should set theCMAKE_BUILD_TYPE to Debug so we can see
better diagnostics. Otherwise you could post your CSD here and give me instructions on how it crashes.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 22:58, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
> And another message:
>
> diskin2: opened '/home/anton/music/raga/samples/pad/test-drone-2-E.wav':
>          44100 Hz, 2 channel(s), 18521984 sample frames
>   rtevent:       T1022.420 TT1022.420 M:  0.66498  0.56583
> instr 80:  p1 = 80.001
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T1026.048 TT1026.048 M:  0.54265  0.50304
> instr 80:  p1 = 80.002
> csound: malloc.c:3700: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.
>
> Program received signal SIGABRT, Aborted.
> 0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0  0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1  0x00007ffff73760d8 in __GI_abort () at abort.c:89
> #2  0x00007ffff73b97fd in __malloc_assert (
>     assertion=assertion@entry=0x7ffff74bdf70 "victim->fd_nextsize->bk_nextsize == victim", file=file@entry=0x7ffff74b9b80 "malloc.c", line=line@entry=3700,
>     function=function@entry=0x7ffff74b9f08 <__func__.11522> "_int_malloc")
>     at malloc.c:293
> #3  0x00007ffff73bd0ea in _int_malloc (av=0x7ffff76fa760 <main_arena>,
>     bytes=120) at malloc.c:3700
> #4  0x00007ffff73be7b0 in __GI___libc_malloc (bytes=120) at malloc.c:2891
> #5  0x00007ffff79719c3 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff795d289 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff799b640 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #10 0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #11 0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #12 0x0000000000401358 in ?? ()
> #13 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=3,
>     argv=0x7fffffffd7b8, init=<optimized out>, fini=<optimized out>,
>     rtld_fini=<optimized out>, stack_end=0x7fffffffd7a8) at libc-start.c:287
> #14 0x00000000004013b0 in _start ()
>
>
> 2016-01-24 1:36 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Here I'm reading the same file with diskin2 in the two instances of the same instrument.
> It's triggered with fractional numbers. 80.001 and 80.005
>
> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
>
> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Here is message from gdb:
>
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>      number of samples out of range:        2        2
> new alloc for instr 80:
> instr 80:  p1 = 80.005
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>      number of samples out of range:     1315      451
> instr 80:  p1 = 80.001
>
> Program received signal SIGSEGV, Segmentation fault.
> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
> 4163    malloc.c: No such file or directory.
> (gdb) bt
> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>     at malloc.c:4163
> #1  0x00007ffff73bbdf8 in _int_malloc (
>     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>     at malloc.c:3423
> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>     elem_size=<optimized out>) at malloc.c:3219
> #3  0x00007ffff70df5f2 in sf_open ()
>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #10 0x0000000000401358 in ?? ()
> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
> #12 0x00000000004013b0 in _start ()
>
>
> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Thanks for the quick reply, Victor.
> I'll report back if I encounter the problem again!
> Though I'm not that good with gdb
>
> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> Use gdb. Are you using the csound command? Do gdb csound, then
> use the run command with the arguments you need eg
>
> run mycsd.csd
>
> when it crashes you can try using the
> backtrace command to show where it stopped.
>
> On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
>> How to do it?
>>
>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> Can you run it under a debugger?
>>
>> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>
>>> Unfortunately after several minutes of playing the service breaks
>>> with the message
>>>
>>> diskin2: opened '/home/anton/Seashore.wav':
>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
>>> Csound tidy up: Aborted
>>>
>>> Any ideas?
>>>
>>>
>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>> It's done. Just in case if anyone interested in the end result.
>>> I post a code for service. It can play continuously wav files
>>> on several channels. Channels are identified by numbers.
>>>
>>> User can for the given channel
>>>
>>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
>>>    so that user percieves it like a continuous flow.
>>>
>>> * stop playing a file
>>>
>>> * resume playback
>>>
>>> * set the volume for the given channel
>>>
>>> * set a global fade in/out time
>>>
>>> Also there is a python file that makes it easy to trigger the service
>>> from the code. There are some test remnants of file names you can
>>> substitute it with your own files.
>>>
>>> This combo of OSC service and python client makes it easy
>>> to livecode with python.
>>>
>>>
>>> Anton
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> Strings are updated generally at i-time, but with special provisions for perf-time.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>> > On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>> >
>>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
>>> > So the assignment operation works only at init time
>>> > and for k-rate we should use strcpyk.
>>> >
>>> > Anton
>>> >
>>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> > String assignment is i-time only. Use strcpyk
>>> >
>>> > gSFile strcpyk SFile
>>> > ========================
>>> > Dr Victor Lazzarini
>>> > Dean of Arts, Celtic Studies and Philosophy,
>>> > Maynooth University,
>>> > Maynooth, Co Kildare, Ireland
>>> > Tel: 00 353 7086936
>>> > Fax: 00 353 1 7086952
>>> >
>>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>> > >
>>> > > I'm trying to write an OSC-server with Csound.
>>> > > The service should receive the name of the wav-file and the
>>> > > length of crossfade.
>>> > >
>>> > > On receive it should stop playing any previous wavs
>>> > > and start a loop that plays next wav file.
>>> > > The two loops should crossfade.
>>> > >
>>> > > While trying to write such a thing I'm getting into trouble
>>> > > with receiving String message with OSC.
>>> > > I receive a string-field then assign it to a global String var.
>>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>>> > > like this
>>> > >
>>> > > INIT ERROR in instr 100: diskinfo cannot open
>>> > > ilen  filelen gSFile  1
>>> > >
>>> > > What can be wrong with my code?
>>> > >
>>> > > I attach the two files.
>>> > > csd with server and python with client to test the server.
>>> > > The python uses pyOSC library
>>> > >
>>> > > Thanks,
>>> > > Anton
>>> > >
>>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>>> >
>>> > Csound mailing list
>>> > Csound@listserv.heanet.ie
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>>
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
>
>
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:09
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Which array assignment should I comment out?

2016-01-24 2:09 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I'm sorry I don't know how to build csound. 
There are two files. One flow.csd with osc-server.
and second one is test_flow.py with client.
The py-file makes it easy to test the csound file.

You can just run 

> csound flow.csd

It will start the OSC-listener on the prort 7700 with 8 channels. 

Then you can start to send messages with python:

> python
> from test_flow import *
> c = Flow(7700, 8)
> c.play(0, wav_file_name)
> c.play(1, another_wav_file_name)
> c.set_volume(0, 0.2)
> c.stop(0)
..etc..








2016-01-24 2:02 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
If you are building Csound, you should set theCMAKE_BUILD_TYPE to Debug so we can see
better diagnostics. Otherwise you could post your CSD here and give me instructions on how it crashes.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 22:58, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
> And another message:
>
> diskin2: opened '/home/anton/music/raga/samples/pad/test-drone-2-E.wav':
>          44100 Hz, 2 channel(s), 18521984 sample frames
>   rtevent:       T1022.420 TT1022.420 M:  0.66498  0.56583
> instr 80:  p1 = 80.001
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T1026.048 TT1026.048 M:  0.54265  0.50304
> instr 80:  p1 = 80.002
> csound: malloc.c:3700: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.
>
> Program received signal SIGABRT, Aborted.
> 0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0  0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1  0x00007ffff73760d8 in __GI_abort () at abort.c:89
> #2  0x00007ffff73b97fd in __malloc_assert (
>     assertion=assertion@entry=0x7ffff74bdf70 "victim->fd_nextsize->bk_nextsize == victim", file=file@entry=0x7ffff74b9b80 "malloc.c", line=line@entry=3700,
>     function=function@entry=0x7ffff74b9f08 <__func__.11522> "_int_malloc")
>     at malloc.c:293
> #3  0x00007ffff73bd0ea in _int_malloc (av=0x7ffff76fa760 <main_arena>,
>     bytes=120) at malloc.c:3700
> #4  0x00007ffff73be7b0 in __GI___libc_malloc (bytes=120) at malloc.c:2891
> #5  0x00007ffff79719c3 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff795d289 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff799b640 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #10 0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #11 0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #12 0x0000000000401358 in ?? ()
> #13 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=3,
>     argv=0x7fffffffd7b8, init=<optimized out>, fini=<optimized out>,
>     rtld_fini=<optimized out>, stack_end=0x7fffffffd7a8) at libc-start.c:287
> #14 0x00000000004013b0 in _start ()
>
>
> 2016-01-24 1:36 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Here I'm reading the same file with diskin2 in the two instances of the same instrument.
> It's triggered with fractional numbers. 80.001 and 80.005
>
> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
>
> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Here is message from gdb:
>
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>      number of samples out of range:        2        2
> new alloc for instr 80:
> instr 80:  p1 = 80.005
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>      number of samples out of range:     1315      451
> instr 80:  p1 = 80.001
>
> Program received signal SIGSEGV, Segmentation fault.
> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at malloc.c:4163
> 4163    malloc.c: No such file or directory.
> (gdb) bt
> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>     at malloc.c:4163
> #1  0x00007ffff73bbdf8 in _int_malloc (
>     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>     at malloc.c:3423
> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>     elem_size=<optimized out>) at malloc.c:3219
> #3  0x00007ffff70df5f2 in sf_open ()
>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> #10 0x0000000000401358 in ?? ()
> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at libc-start.c:287
> #12 0x00000000004013b0 in _start ()
>
>
> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> Thanks for the quick reply, Victor.
> I'll report back if I encounter the problem again!
> Though I'm not that good with gdb
>
> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> Use gdb. Are you using the csound command? Do gdb csound, then
> use the run command with the arguments you need eg
>
> run mycsd.csd
>
> when it crashes you can try using the
> backtrace command to show where it stopped.
>
> On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
>> How to do it?
>>
>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> Can you run it under a debugger?
>>
>> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>
>>> Unfortunately after several minutes of playing the service breaks
>>> with the message
>>>
>>> diskin2: opened '/home/anton/Seashore.wav':
>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
>>> Csound tidy up: Aborted
>>>
>>> Any ideas?
>>>
>>>
>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>> It's done. Just in case if anyone interested in the end result.
>>> I post a code for service. It can play continuously wav files
>>> on several channels. Channels are identified by numbers.
>>>
>>> User can for the given channel
>>>
>>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
>>>    so that user percieves it like a continuous flow.
>>>
>>> * stop playing a file
>>>
>>> * resume playback
>>>
>>> * set the volume for the given channel
>>>
>>> * set a global fade in/out time
>>>
>>> Also there is a python file that makes it easy to trigger the service
>>> from the code. There are some test remnants of file names you can
>>> substitute it with your own files.
>>>
>>> This combo of OSC service and python client makes it easy
>>> to livecode with python.
>>>
>>>
>>> Anton
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> Strings are updated generally at i-time, but with special provisions for perf-time.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>> > On 22 Jan 2016, at 15:52, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>> >
>>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
>>> > So the assignment operation works only at init time
>>> > and for k-rate we should use strcpyk.
>>> >
>>> > Anton
>>> >
>>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> > String assignment is i-time only. Use strcpyk
>>> >
>>> > gSFile strcpyk SFile
>>> > ========================
>>> > Dr Victor Lazzarini
>>> > Dean of Arts, Celtic Studies and Philosophy,
>>> > Maynooth University,
>>> > Maynooth, Co Kildare, Ireland
>>> > Tel: 00 353 7086936
>>> > Fax: 00 353 1 7086952
>>> >
>>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>> > >
>>> > > I'm trying to write an OSC-server with Csound.
>>> > > The service should receive the name of the wav-file and the
>>> > > length of crossfade.
>>> > >
>>> > > On receive it should stop playing any previous wavs
>>> > > and start a loop that plays next wav file.
>>> > > The two loops should crossfade.
>>> > >
>>> > > While trying to write such a thing I'm getting into trouble
>>> > > with receiving String message with OSC.
>>> > > I receive a string-field then assign it to a global String var.
>>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>>> > > like this
>>> > >
>>> > > INIT ERROR in instr 100: diskinfo cannot open
>>> > > ilen  filelen gSFile  1
>>> > >
>>> > > What can be wrong with my code?
>>> > >
>>> > > I attach the two files.
>>> > > csd with server and python with client to test the server.
>>> > > The python uses pyOSC library
>>> > >
>>> > > Thanks,
>>> > > Anton
>>> > >
>>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here <flow.csd><test_flow.py>
>>> >
>>> > Csound mailing list
>>> > Csound@listserv.heanet.ie
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>>
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
>
>
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:10
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
 wrote:
> Here is the code
>
> ~~~
> 
> 
> -odac   -d
> 
> 
>
> sr = 44100
> ksmps = 64
> nchnls = 2
> 0dbfs  = 1
>
> #ifndef PORT
>     #define PORT        # 7700 #
> #end
>
> #ifndef SIZE
>     #define SIZE        # 8 #
> #end
>
> gkVolume   init 1
> gSFile     init ""
>
> gSFiles[]   init $SIZE
> gkVolumes[] init $SIZE
>
> gaL init 0
> gaR init 0
>
> gihandle OSCinit $PORT
>
> gkFadeTime init 1
>
> opcode FracInstr, k, ik
>     iInstrNum, kChannel xin
>     kres = iInstrNum + ((kChannel + 1) / 1000)
>     xout kres
> endop
>
> instr   PlayMsg
>     SFile = ""
>     kVolume   init 0
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>
>     printk 0,kSched
>      printk 0,kRun
>
>
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     gSFiles[kChannel] strcpyk SFile
>     event "i", kSched, 0, -1, kChannel
>     kgoto nxtmsg
> ex:
> endin
>
> instr StopMsg
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/stop", "i", kChannel
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     kgoto nxtmsg
> ex:
> endin
>
> instr ResumeMsg
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/resume", "i", kChannel
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     event "i", kSched, 0, -1, kChannel
>     kgoto nxtmsg
> ex:
> endin
>
>
> instr   SetVolMsg
>     kVolume   init 0
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     gkVolumes[kChannel] = kVolume
>     kgoto nxtmsg
> ex:
> endin
>
> instr   SetFadeMsg
>     kFade   init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/set_fade", "f", kFade
> if (kk == 0) goto ex
>     gkFadeTime = kFade
>     kgoto nxtmsg
> ex:
> endin
>
> instr 80
>     print p1
>     idur    = p3
>     iFadeTime = i(gkFadeTime)
>     iChannel  = p4
>     ichan filenchnls gSFiles[iChannel]
>     if (ichan == 1) then
>         al diskin2 gSFiles[iChannel], 1
>         ar = al
>     else
>         al, ar diskin2 gSFiles[iChannel], 1
>     endif
>
>     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> iFadeTime, 0
>     kvol    port gkVolumes[iChannel], 0.05
>
>     gaL  = gaL + kenv * kvol * al
>     gaR  = gaR + kenv * kvol * ar
> endin
>
> instr 100
>     iChannel  = p4
>     iFadeTime = i(gkFadeTime)
>     ilen  filelen gSFiles[iChannel]
>     km    metro (1 / (ilen - iFadeTime))
>     kRun FracInstr 80, iChannel
>     if (km == 1)  then
>         event "i", kRun, 0, ilen, iChannel
>     endif
> endin
>
> instr 110
>     outs gaL, gaR
>     gaL = 0
>     gaR = 0
> endin
>
> instr Init
>     kCount = 0
>     until (kCount == lenarray(gkVolumes)) do
>         gkVolumes[kCount] = 1
>         kCount = kCount + 1
>     od
> endin
>
>
> 
> 
>
> f0 1000000
>
> i "Init" 0 0.01
>
> i   "PlayMsg"    0 -1
> i   "SetVolMsg"  0 -1
> i   "SetFadeMsg" 0 -1
> i   "StopMsg"    0 -1
> i   "ResumeMsg"  0 -1
>
> i 110 0 -1
> e
> 
> 
> ~~~
>
> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
>>
>> Can you post the Csound code? I see no global arrays in your earlier
>> flow.csd
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>> > On 23 Jan 2016, at 22:36, Anton Kholomiov 
>> > wrote:
>> >
>> > Here I'm reading the same file with diskin2 in the two instances of the
>> > same instrument.
>> > It's triggered with fractional numbers. 80.001 and 80.005
>> >
>> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
>> > The last message I've sent was to set the volume on channel. It assigns
>> > a value to the cell of global array.
>> >
>> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
>> > Here is message from gdb:
>> >
>> > diskin2: opened '/home/anton/Seashore.wav':
>> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >      number of samples out of range:        2        2
>> > new alloc for instr 80:
>> > instr 80:  p1 = 80.005
>> > diskin2: opened '/home/anton/Seashore.wav':
>> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >      number of samples out of range:     1315      451
>> > instr 80:  p1 = 80.001
>> >
>> > Program received signal SIGSEGV, Segmentation fault.
>> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>> > malloc.c:4163
>> > 4163    malloc.c: No such file or directory.
>> > (gdb) bt
>> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>> >     at malloc.c:4163
>> > #1  0x00007ffff73bbdf8 in _int_malloc (
>> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>> >     at malloc.c:3423
>> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>> >     elem_size=) at malloc.c:3219
>> > #3  0x00007ffff70df5f2 in sf_open ()
>> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #9  0x00007ffff7a8bb5e in csoundPerform () from
>> > /usr/lib/libcsound64.so.6.0
>> > #10 0x0000000000401358 in ?? ()
>> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>> >     argv=0x7fffffffd7c8, init=, fini=,
>> >     rtld_fini=, stack_end=0x7fffffffd7b8) at
>> > libc-start.c:287
>> > #12 0x00000000004013b0 in _start ()
>> >
>> >
>> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
>> > Thanks for the quick reply, Victor.
>> > I'll report back if I encounter the problem again!
>> > Though I'm not that good with gdb
>> >
>> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
>> > Use gdb. Are you using the csound command? Do gdb csound, then
>> > use the run command with the arguments you need eg
>> >
>> > run mycsd.csd
>> >
>> > when it crashes you can try using the
>> > backtrace command to show where it stopped.
>> >
>> > On 23 Jan 2016, at 22:07, Anton Kholomiov 
>> > wrote:
>> >
>> >> How to do it?
>> >>
>> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
>> >> Can you run it under a debugger?
>> >>
>> >> On 23 Jan 2016, at 21:55, Anton Kholomiov 
>> >> wrote:
>> >>
>> >>> Unfortunately after several minutes of playing the service breaks
>> >>> with the message
>> >>>
>> >>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>          44100 Hz, 2 channel(s), 546731 sample frames
>> >>> *** Error in `csound': double free or corruption (out):
>> >>> 0x00000000014bfd70 ***
>> >>> Csound tidy up: Aborted
>> >>>
>> >>> Any ideas?
>> >>>
>> >>>
>> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
>> >>> It's done. Just in case if anyone interested in the end result.
>> >>> I post a code for service. It can play continuously wav files
>> >>> on several channels. Channels are identified by numbers.
>> >>>
>> >>> User can for the given channel
>> >>>
>> >>> * start playing a wav file in the loop. The wav files are played with
>> >>> xfade at the ends
>> >>>    so that user percieves it like a continuous flow.
>> >>>
>> >>> * stop playing a file
>> >>>
>> >>> * resume playback
>> >>>
>> >>> * set the volume for the given channel
>> >>>
>> >>> * set a global fade in/out time
>> >>>
>> >>> Also there is a python file that makes it easy to trigger the service
>> >>> from the code. There are some test remnants of file names you can
>> >>> substitute it with your own files.
>> >>>
>> >>> This combo of OSC service and python client makes it easy
>> >>> to livecode with python.
>> >>>
>> >>>
>> >>> Anton
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >>> :
>> >>> Strings are updated generally at i-time, but with special provisions
>> >>> for perf-time.
>> >>> ========================
>> >>> Dr Victor Lazzarini
>> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >>> Maynooth University,
>> >>> Maynooth, Co Kildare, Ireland
>> >>> Tel: 00 353 7086936
>> >>> Fax: 00 353 1 7086952
>> >>>
>> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >>> >  wrote:
>> >>> >
>> >>> > Thank you for clarification. It was a blind spot for me is S behaves
>> >>> > like I or like K.
>> >>> > So the assignment operation works only at init time
>> >>> > and for k-rate we should use strcpyk.
>> >>> >
>> >>> > Anton
>> >>> >
>> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >>> > :
>> >>> > String assignment is i-time only. Use strcpyk
>> >>> >
>> >>> > gSFile strcpyk SFile
>> >>> > ========================
>> >>> > Dr Victor Lazzarini
>> >>> > Dean of Arts, Celtic Studies and Philosophy,
>> >>> > Maynooth University,
>> >>> > Maynooth, Co Kildare, Ireland
>> >>> > Tel: 00 353 7086936
>> >>> > Fax: 00 353 1 7086952
>> >>> >
>> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >>> > >  wrote:
>> >>> > >
>> >>> > > I'm trying to write an OSC-server with Csound.
>> >>> > > The service should receive the name of the wav-file and the
>> >>> > > length of crossfade.
>> >>> > >
>> >>> > > On receive it should stop playing any previous wavs
>> >>> > > and start a loop that plays next wav file.
>> >>> > > The two loops should crossfade.
>> >>> > >
>> >>> > > While trying to write such a thing I'm getting into trouble
>> >>> > > with receiving String message with OSC.
>> >>> > > I receive a string-field then assign it to a global String var.
>> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>> >>> > > like this
>> >>> > >
>> >>> > > INIT ERROR in instr 100: diskinfo cannot open
>> >>> > > ilen  filelen gSFile  1
>> >>> > >
>> >>> > > What can be wrong with my code?
>> >>> > >
>> >>> > > I attach the two files.
>> >>> > > csd with server and python with client to test the server.
>> >>> > > The python uses pyOSC library
>> >>> > >
>> >>> > > Thanks,
>> >>> > > Anton
>> >>> > >
>> >>> > > Csound mailing list Csound@listserv.heanet.ie
>> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> > > be posted here 
>> >>> >
>> >>> > Csound mailing list
>> >>> > Csound@listserv.heanet.ie
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> > Send bugs reports to
>> >>> >         https://github.com/csound/csound/issues
>> >>> > Discussions of bugs and features can be posted here
>> >>> >
>> >>> > Csound mailing list Csound@listserv.heanet.ie
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> > be posted here
>> >>>
>> >>> Csound mailing list
>> >>> Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>>
>> >>>
>> >>> Csound mailing list Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> be posted here
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>> >
>> >
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:16
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Steven Then I get 

Maybe it's better to create two separate instruments for mono and stereo diskins

~~~
INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
~~~


2016-01-24 2:10 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> Here is the code
>
> ~~~
> <CsoundSynthesizer>
> <CsOptions>
> -odac   -d
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 64
> nchnls = 2
> 0dbfs  = 1
>
> #ifndef PORT
>     #define PORT        # 7700 #
> #end
>
> #ifndef SIZE
>     #define SIZE        # 8 #
> #end
>
> gkVolume   init 1
> gSFile     init ""
>
> gSFiles[]   init $SIZE
> gkVolumes[] init $SIZE
>
> gaL init 0
> gaR init 0
>
> gihandle OSCinit $PORT
>
> gkFadeTime init 1
>
> opcode FracInstr, k, ik
>     iInstrNum, kChannel xin
>     kres = iInstrNum + ((kChannel + 1) / 1000)
>     xout kres
> endop
>
> instr   PlayMsg
>     SFile = ""
>     kVolume   init 0
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>
>     printk 0,kSched
>      printk 0,kRun
>
>
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     gSFiles[kChannel] strcpyk SFile
>     event "i", kSched, 0, -1, kChannel
>     kgoto nxtmsg
> ex:
> endin
>
> instr StopMsg
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/stop", "i", kChannel
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     kgoto nxtmsg
> ex:
> endin
>
> instr ResumeMsg
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/resume", "i", kChannel
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     event "i", kSched, 0, -1, kChannel
>     kgoto nxtmsg
> ex:
> endin
>
>
> instr   SetVolMsg
>     kVolume   init 0
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     gkVolumes[kChannel] = kVolume
>     kgoto nxtmsg
> ex:
> endin
>
> instr   SetFadeMsg
>     kFade   init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/set_fade", "f", kFade
> if (kk == 0) goto ex
>     gkFadeTime = kFade
>     kgoto nxtmsg
> ex:
> endin
>
> instr 80
>     print p1
>     idur    = p3
>     iFadeTime = i(gkFadeTime)
>     iChannel  = p4
>     ichan filenchnls gSFiles[iChannel]
>     if (ichan == 1) then
>         al diskin2 gSFiles[iChannel], 1
>         ar = al
>     else
>         al, ar diskin2 gSFiles[iChannel], 1
>     endif
>
>     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> iFadeTime, 0
>     kvol    port gkVolumes[iChannel], 0.05
>
>     gaL  = gaL + kenv * kvol * al
>     gaR  = gaR + kenv * kvol * ar
> endin
>
> instr 100
>     iChannel  = p4
>     iFadeTime = i(gkFadeTime)
>     ilen  filelen gSFiles[iChannel]
>     km    metro (1 / (ilen - iFadeTime))
>     kRun FracInstr 80, iChannel
>     if (km == 1)  then
>         event "i", kRun, 0, ilen, iChannel
>     endif
> endin
>
> instr 110
>     outs gaL, gaR
>     gaL = 0
>     gaR = 0
> endin
>
> instr Init
>     kCount = 0
>     until (kCount == lenarray(gkVolumes)) do
>         gkVolumes[kCount] = 1
>         kCount = kCount + 1
>     od
> endin
>
>
> </CsInstruments>
> <CsScore>
>
> f0 1000000
>
> i "Init" 0 0.01
>
> i   "PlayMsg"    0 -1
> i   "SetVolMsg"  0 -1
> i   "SetFadeMsg" 0 -1
> i   "StopMsg"    0 -1
> i   "ResumeMsg"  0 -1
>
> i 110 0 -1
> e
> </CsScore>
> </CsoundSynthesizer>
> ~~~
>
> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>
>> Can you post the Csound code? I see no global arrays in your earlier
>> flow.csd
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>> > On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
>> > wrote:
>> >
>> > Here I'm reading the same file with diskin2 in the two instances of the
>> > same instrument.
>> > It's triggered with fractional numbers. 80.001 and 80.005
>> >
>> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> > The last message I've sent was to set the volume on channel. It assigns
>> > a value to the cell of global array.
>> >
>> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> > Here is message from gdb:
>> >
>> > diskin2: opened '/home/anton/Seashore.wav':
>> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >      number of samples out of range:        2        2
>> > new alloc for instr 80:
>> > instr 80:  p1 = 80.005
>> > diskin2: opened '/home/anton/Seashore.wav':
>> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >      number of samples out of range:     1315      451
>> > instr 80:  p1 = 80.001
>> >
>> > Program received signal SIGSEGV, Segmentation fault.
>> > malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> > malloc.c:4163
>> > 4163    malloc.c: No such file or directory.
>> > (gdb) bt
>> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >     at malloc.c:4163
>> > #1  0x00007ffff73bbdf8 in _int_malloc (
>> >     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>> >     at malloc.c:3423
>> > #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >     elem_size=<optimized out>) at malloc.c:3219
>> > #3  0x00007ffff70df5f2 in sf_open ()
>> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #9  0x00007ffff7a8bb5e in csoundPerform () from
>> > /usr/lib/libcsound64.so.6.0
>> > #10 0x0000000000401358 in ?? ()
>> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>> >     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>> >     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> > libc-start.c:287
>> > #12 0x00000000004013b0 in _start ()
>> >
>> >
>> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> > Thanks for the quick reply, Victor.
>> > I'll report back if I encounter the problem again!
>> > Though I'm not that good with gdb
>> >
>> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> > Use gdb. Are you using the csound command? Do gdb csound, then
>> > use the run command with the arguments you need eg
>> >
>> > run mycsd.csd
>> >
>> > when it crashes you can try using the
>> > backtrace command to show where it stopped.
>> >
>> > On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> > wrote:
>> >
>> >> How to do it?
>> >>
>> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> Can you run it under a debugger?
>> >>
>> >> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >>> Unfortunately after several minutes of playing the service breaks
>> >>> with the message
>> >>>
>> >>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>          44100 Hz, 2 channel(s), 546731 sample frames
>> >>> *** Error in `csound': double free or corruption (out):
>> >>> 0x00000000014bfd70 ***
>> >>> Csound tidy up: Aborted
>> >>>
>> >>> Any ideas?
>> >>>
>> >>>
>> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> >>> It's done. Just in case if anyone interested in the end result.
>> >>> I post a code for service. It can play continuously wav files
>> >>> on several channels. Channels are identified by numbers.
>> >>>
>> >>> User can for the given channel
>> >>>
>> >>> * start playing a wav file in the loop. The wav files are played with
>> >>> xfade at the ends
>> >>>    so that user percieves it like a continuous flow.
>> >>>
>> >>> * stop playing a file
>> >>>
>> >>> * resume playback
>> >>>
>> >>> * set the volume for the given channel
>> >>>
>> >>> * set a global fade in/out time
>> >>>
>> >>> Also there is a python file that makes it easy to trigger the service
>> >>> from the code. There are some test remnants of file names you can
>> >>> substitute it with your own files.
>> >>>
>> >>> This combo of OSC service and python client makes it easy
>> >>> to livecode with python.
>> >>>
>> >>>
>> >>> Anton
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >>> <Victor.Lazzarini@nuim.ie>:
>> >>> Strings are updated generally at i-time, but with special provisions
>> >>> for perf-time.
>> >>> ========================
>> >>> Dr Victor Lazzarini
>> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >>> Maynooth University,
>> >>> Maynooth, Co Kildare, Ireland
>> >>> Tel: 00 353 7086936
>> >>> Fax: 00 353 1 7086952
>> >>>
>> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >>> > <anton.kholomiov@gmail.com> wrote:
>> >>> >
>> >>> > Thank you for clarification. It was a blind spot for me is S behaves
>> >>> > like I or like K.
>> >>> > So the assignment operation works only at init time
>> >>> > and for k-rate we should use strcpyk.
>> >>> >
>> >>> > Anton
>> >>> >
>> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >>> > <Victor.Lazzarini@nuim.ie>:
>> >>> > String assignment is i-time only. Use strcpyk
>> >>> >
>> >>> > gSFile strcpyk SFile
>> >>> > ========================
>> >>> > Dr Victor Lazzarini
>> >>> > Dean of Arts, Celtic Studies and Philosophy,
>> >>> > Maynooth University,
>> >>> > Maynooth, Co Kildare, Ireland
>> >>> > Tel: 00 353 7086936
>> >>> > Fax: 00 353 1 7086952
>> >>> >
>> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >>> > > <anton.kholomiov@GMAIL.COM> wrote:
>> >>> > >
>> >>> > > I'm trying to write an OSC-server with Csound.
>> >>> > > The service should receive the name of the wav-file and the
>> >>> > > length of crossfade.
>> >>> > >
>> >>> > > On receive it should stop playing any previous wavs
>> >>> > > and start a loop that plays next wav file.
>> >>> > > The two loops should crossfade.
>> >>> > >
>> >>> > > While trying to write such a thing I'm getting into trouble
>> >>> > > with receiving String message with OSC.
>> >>> > > I receive a string-field then assign it to a global String var.
>> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>> >>> > > like this
>> >>> > >
>> >>> > > INIT ERROR in instr 100: diskinfo cannot open
>> >>> > > ilen  filelen gSFile  1
>> >>> > >
>> >>> > > What can be wrong with my code?
>> >>> > >
>> >>> > > I attach the two files.
>> >>> > > csd with server and python with client to test the server.
>> >>> > > The python uses pyOSC library
>> >>> > >
>> >>> > > Thanks,
>> >>> > > Anton
>> >>> > >
>> >>> > > Csound mailing list Csound@listserv.heanet.ie
>> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> > > be posted here <flow.csd><test_flow.py>
>> >>> >
>> >>> > Csound mailing list
>> >>> > Csound@listserv.heanet.ie
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> > Send bugs reports to
>> >>> >         https://github.com/csound/csound/issues
>> >>> > Discussions of bugs and features can be posted here
>> >>> >
>> >>> > Csound mailing list Csound@listserv.heanet.ie
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> > be posted here
>> >>>
>> >>> Csound mailing list
>> >>> Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>>
>> >>>
>> >>> Csound mailing list Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> be posted here
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>> >
>> >
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:17
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
The one with the volume message. 

btw I’ve run your code here with no crashes so far. Does it take long to crash?
I’ve used play and set_volume messages. 
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:09, Anton Kholomiov  wrote:
> 
> Which array assignment should I comment out?
> 
> 2016-01-24 2:09 GMT+03:00 Anton Kholomiov :
> I'm sorry I don't know how to build csound. 
> There are two files. One flow.csd with osc-server.
> and second one is test_flow.py with client.
> The py-file makes it easy to test the csound file.
> 
> You can just run 
> 
> > csound flow.csd
> 
> It will start the OSC-listener on the prort 7700 with 8 channels. 
> 
> Then you can start to send messages with python:
> 
> > python
> > from test_flow import *
> > c = Flow(7700, 8)
> > c.play(0, wav_file_name)
> > c.play(1, another_wav_file_name)
> > c.set_volume(0, 0.2)
> > c.stop(0)
> ..etc..
> 
> 
> 
> 
> 
> 
> 
> 
> 2016-01-24 2:02 GMT+03:00 Victor Lazzarini :
> If you are building Csound, you should set theCMAKE_BUILD_TYPE to Debug so we can see
> better diagnostics. Otherwise you could post your CSD here and give me instructions on how it crashes.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 23 Jan 2016, at 22:58, Anton Kholomiov  wrote:
> >
> > And another message:
> >
> > diskin2: opened '/home/anton/music/raga/samples/pad/test-drone-2-E.wav':
> >          44100 Hz, 2 channel(s), 18521984 sample frames
> >   rtevent:       T1022.420 TT1022.420 M:  0.66498  0.56583
> > instr 80:  p1 = 80.001
> > diskin2: opened '/home/anton/Seashore.wav':
> >          44100 Hz, 2 channel(s), 546731 sample frames
> >   rtevent:       T1026.048 TT1026.048 M:  0.54265  0.50304
> > instr 80:  p1 = 80.002
> > csound: malloc.c:3700: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.
> >
> > Program received signal SIGABRT, Aborted.
> > 0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
> >     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> > 56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> > (gdb) bt
> > #0  0x00007ffff7372cc9 in __GI_raise (sig=sig@entry=6)
> >     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> > #1  0x00007ffff73760d8 in __GI_abort () at abort.c:89
> > #2  0x00007ffff73b97fd in __malloc_assert (
> >     assertion=assertion@entry=0x7ffff74bdf70 "victim->fd_nextsize->bk_nextsize == victim", file=file@entry=0x7ffff74b9b80 "malloc.c", line=line@entry=3700,
> >     function=function@entry=0x7ffff74b9f08 <__func__.11522> "_int_malloc")
> >     at malloc.c:293
> > #3  0x00007ffff73bd0ea in _int_malloc (av=0x7ffff76fa760 ,
> >     bytes=120) at malloc.c:3700
> > #4  0x00007ffff73be7b0 in __GI___libc_malloc (bytes=120) at malloc.c:2891
> > #5  0x00007ffff79719c3 in ?? () from /usr/lib/libcsound64.so.6.0
> > #6  0x00007ffff795d289 in ?? () from /usr/lib/libcsound64.so.6.0
> > #7  0x00007ffff799b640 in ?? () from /usr/lib/libcsound64.so.6.0
> > #8  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > #9  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > #10 0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > #11 0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> > #12 0x0000000000401358 in ?? ()
> > #13 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=3,
> >     argv=0x7fffffffd7b8, init=, fini=,
> >     rtld_fini=, stack_end=0x7fffffffd7a8) at libc-start.c:287
> > #14 0x00000000004013b0 in _start ()
> >
> >
> > 2016-01-24 1:36 GMT+03:00 Anton Kholomiov :
> > Here I'm reading the same file with diskin2 in the two instances of the same instrument.
> > It's triggered with fractional numbers. 80.001 and 80.005
> >
> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> > The last message I've sent was to set the volume on channel. It assigns a value to the cell of global array.
> >
> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> > Here is message from gdb:
> >
> > diskin2: opened '/home/anton/Seashore.wav':
> >          44100 Hz, 2 channel(s), 546731 sample frames
> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> >      number of samples out of range:        2        2
> > new alloc for instr 80:
> > instr 80:  p1 = 80.005
> > diskin2: opened '/home/anton/Seashore.wav':
> >          44100 Hz, 2 channel(s), 546731 sample frames
> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> >      number of samples out of range:     1315      451
> > instr 80:  p1 = 80.001
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at malloc.c:4163
> > 4163    malloc.c: No such file or directory.
> > (gdb) bt
> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
> >     at malloc.c:4163
> > #1  0x00007ffff73bbdf8 in _int_malloc (
> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
> >     at malloc.c:3423
> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
> >     elem_size=) at malloc.c:3219
> > #3  0x00007ffff70df5f2 in sf_open ()
> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > #9  0x00007ffff7a8bb5e in csoundPerform () from /usr/lib/libcsound64.so.6.0
> > #10 0x0000000000401358 in ?? ()
> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> >     argv=0x7fffffffd7c8, init=, fini=,
> >     rtld_fini=, stack_end=0x7fffffffd7b8) at libc-start.c:287
> > #12 0x00000000004013b0 in _start ()
> >
> >
> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> > Thanks for the quick reply, Victor.
> > I'll report back if I encounter the problem again!
> > Though I'm not that good with gdb
> >
> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> > Use gdb. Are you using the csound command? Do gdb csound, then
> > use the run command with the arguments you need eg
> >
> > run mycsd.csd
> >
> > when it crashes you can try using the
> > backtrace command to show where it stopped.
> >
> > On 23 Jan 2016, at 22:07, Anton Kholomiov  wrote:
> >
> >> How to do it?
> >>
> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
> >> Can you run it under a debugger?
> >>
> >> On 23 Jan 2016, at 21:55, Anton Kholomiov  wrote:
> >>
> >>> Unfortunately after several minutes of playing the service breaks
> >>> with the message
> >>>
> >>> diskin2: opened '/home/anton/Seashore.wav':
> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> >>> *** Error in `csound': double free or corruption (out): 0x00000000014bfd70 ***
> >>> Csound tidy up: Aborted
> >>>
> >>> Any ideas?
> >>>
> >>>
> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
> >>> It's done. Just in case if anyone interested in the end result.
> >>> I post a code for service. It can play continuously wav files
> >>> on several channels. Channels are identified by numbers.
> >>>
> >>> User can for the given channel
> >>>
> >>> * start playing a wav file in the loop. The wav files are played with xfade at the ends
> >>>    so that user percieves it like a continuous flow.
> >>>
> >>> * stop playing a file
> >>>
> >>> * resume playback
> >>>
> >>> * set the volume for the given channel
> >>>
> >>> * set a global fade in/out time
> >>>
> >>> Also there is a python file that makes it easy to trigger the service
> >>> from the code. There are some test remnants of file names you can
> >>> substitute it with your own files.
> >>>
> >>> This combo of OSC service and python client makes it easy
> >>> to livecode with python.
> >>>
> >>>
> >>> Anton
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini :
> >>> Strings are updated generally at i-time, but with special provisions for perf-time.
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov  wrote:
> >>> >
> >>> > Thank you for clarification. It was a blind spot for me is S behaves like I or like K.
> >>> > So the assignment operation works only at init time
> >>> > and for k-rate we should use strcpyk.
> >>> >
> >>> > Anton
> >>> >
> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini :
> >>> > String assignment is i-time only. Use strcpyk
> >>> >
> >>> > gSFile strcpyk SFile
> >>> > ========================
> >>> > Dr Victor Lazzarini
> >>> > Dean of Arts, Celtic Studies and Philosophy,
> >>> > Maynooth University,
> >>> > Maynooth, Co Kildare, Ireland
> >>> > Tel: 00 353 7086936
> >>> > Fax: 00 353 1 7086952
> >>> >
> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov  wrote:
> >>> > >
> >>> > > I'm trying to write an OSC-server with Csound.
> >>> > > The service should receive the name of the wav-file and the
> >>> > > length of crossfade.
> >>> > >
> >>> > > On receive it should stop playing any previous wavs
> >>> > > and start a loop that plays next wav file.
> >>> > > The two loops should crossfade.
> >>> > >
> >>> > > While trying to write such a thing I'm getting into trouble
> >>> > > with receiving String message with OSC.
> >>> > > I receive a string-field then assign it to a global String var.
> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> >>> > > like this
> >>> > >
> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> >>> > > ilen  filelen gSFile  1
> >>> > >
> >>> > > What can be wrong with my code?
> >>> > >
> >>> > > I attach the two files.
> >>> > > csd with server and python with client to test the server.
> >>> > > The python uses pyOSC library
> >>> > >
> >>> > > Thanks,
> >>> > > Anton
> >>> > >
> >>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here 
> >>> >
> >>> > Csound mailing list
> >>> > Csound@listserv.heanet.ie
> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> > Send bugs reports to
> >>> >         https://github.com/csound/csound/issues
> >>> > Discussions of bugs and features can be posted here
> >>> >
> >>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>         https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>>
> >>>
> >>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >
> >
> >
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:20
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Victor

It takes 5 to 15 minutes....
It takes some time to make it crash. Thank you for the help
I'll try it tomorrow. 

Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?

2016-01-24 2:16 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
@Steven Then I get 

Maybe it's better to create two separate instruments for mono and stereo diskins

~~~
INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
~~~


2016-01-24 2:10 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> Here is the code
>
> ~~~
> <CsoundSynthesizer>
> <CsOptions>
> -odac   -d
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 64
> nchnls = 2
> 0dbfs  = 1
>
> #ifndef PORT
>     #define PORT        # 7700 #
> #end
>
> #ifndef SIZE
>     #define SIZE        # 8 #
> #end
>
> gkVolume   init 1
> gSFile     init ""
>
> gSFiles[]   init $SIZE
> gkVolumes[] init $SIZE
>
> gaL init 0
> gaR init 0
>
> gihandle OSCinit $PORT
>
> gkFadeTime init 1
>
> opcode FracInstr, k, ik
>     iInstrNum, kChannel xin
>     kres = iInstrNum + ((kChannel + 1) / 1000)
>     xout kres
> endop
>
> instr   PlayMsg
>     SFile = ""
>     kVolume   init 0
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>
>     printk 0,kSched
>      printk 0,kRun
>
>
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     gSFiles[kChannel] strcpyk SFile
>     event "i", kSched, 0, -1, kChannel
>     kgoto nxtmsg
> ex:
> endin
>
> instr StopMsg
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/stop", "i", kChannel
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     kgoto nxtmsg
> ex:
> endin
>
> instr ResumeMsg
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/resume", "i", kChannel
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     kSched FracInstr 100, kChannel
>     kRun   FracInstr 80,  kChannel
>     turnoff2 kSched, 4, 0
>     turnoff2 kRun,  4, gkFadeTime
>     event "i", kSched, 0, -1, kChannel
>     kgoto nxtmsg
> ex:
> endin
>
>
> instr   SetVolMsg
>     kVolume   init 0
>     kChannel  init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> if (kk == 0 || kChannel >= $SIZE) goto ex
>     gkVolumes[kChannel] = kVolume
>     kgoto nxtmsg
> ex:
> endin
>
> instr   SetFadeMsg
>     kFade   init 0
>     kk init 0
>
> nxtmsg:
>     kk  OSClisten gihandle, "/set_fade", "f", kFade
> if (kk == 0) goto ex
>     gkFadeTime = kFade
>     kgoto nxtmsg
> ex:
> endin
>
> instr 80
>     print p1
>     idur    = p3
>     iFadeTime = i(gkFadeTime)
>     iChannel  = p4
>     ichan filenchnls gSFiles[iChannel]
>     if (ichan == 1) then
>         al diskin2 gSFiles[iChannel], 1
>         ar = al
>     else
>         al, ar diskin2 gSFiles[iChannel], 1
>     endif
>
>     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> iFadeTime, 0
>     kvol    port gkVolumes[iChannel], 0.05
>
>     gaL  = gaL + kenv * kvol * al
>     gaR  = gaR + kenv * kvol * ar
> endin
>
> instr 100
>     iChannel  = p4
>     iFadeTime = i(gkFadeTime)
>     ilen  filelen gSFiles[iChannel]
>     km    metro (1 / (ilen - iFadeTime))
>     kRun FracInstr 80, iChannel
>     if (km == 1)  then
>         event "i", kRun, 0, ilen, iChannel
>     endif
> endin
>
> instr 110
>     outs gaL, gaR
>     gaL = 0
>     gaR = 0
> endin
>
> instr Init
>     kCount = 0
>     until (kCount == lenarray(gkVolumes)) do
>         gkVolumes[kCount] = 1
>         kCount = kCount + 1
>     od
> endin
>
>
> </CsInstruments>
> <CsScore>
>
> f0 1000000
>
> i "Init" 0 0.01
>
> i   "PlayMsg"    0 -1
> i   "SetVolMsg"  0 -1
> i   "SetFadeMsg" 0 -1
> i   "StopMsg"    0 -1
> i   "ResumeMsg"  0 -1
>
> i 110 0 -1
> e
> </CsScore>
> </CsoundSynthesizer>
> ~~~
>
> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>
>> Can you post the Csound code? I see no global arrays in your earlier
>> flow.csd
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>> > On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
>> > wrote:
>> >
>> > Here I'm reading the same file with diskin2 in the two instances of the
>> > same instrument.
>> > It's triggered with fractional numbers. 80.001 and 80.005
>> >
>> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> > The last message I've sent was to set the volume on channel. It assigns
>> > a value to the cell of global array.
>> >
>> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> > Here is message from gdb:
>> >
>> > diskin2: opened '/home/anton/Seashore.wav':
>> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >      number of samples out of range:        2        2
>> > new alloc for instr 80:
>> > instr 80:  p1 = 80.005
>> > diskin2: opened '/home/anton/Seashore.wav':
>> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >      number of samples out of range:     1315      451
>> > instr 80:  p1 = 80.001
>> >
>> > Program received signal SIGSEGV, Segmentation fault.
>> > malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> > malloc.c:4163
>> > 4163    malloc.c: No such file or directory.
>> > (gdb) bt
>> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >     at malloc.c:4163
>> > #1  0x00007ffff73bbdf8 in _int_malloc (
>> >     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>> >     at malloc.c:3423
>> > #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >     elem_size=<optimized out>) at malloc.c:3219
>> > #3  0x00007ffff70df5f2 in sf_open ()
>> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> > #9  0x00007ffff7a8bb5e in csoundPerform () from
>> > /usr/lib/libcsound64.so.6.0
>> > #10 0x0000000000401358 in ?? ()
>> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>> >     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>> >     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> > libc-start.c:287
>> > #12 0x00000000004013b0 in _start ()
>> >
>> >
>> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> > Thanks for the quick reply, Victor.
>> > I'll report back if I encounter the problem again!
>> > Though I'm not that good with gdb
>> >
>> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> > Use gdb. Are you using the csound command? Do gdb csound, then
>> > use the run command with the arguments you need eg
>> >
>> > run mycsd.csd
>> >
>> > when it crashes you can try using the
>> > backtrace command to show where it stopped.
>> >
>> > On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> > wrote:
>> >
>> >> How to do it?
>> >>
>> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> Can you run it under a debugger?
>> >>
>> >> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >>> Unfortunately after several minutes of playing the service breaks
>> >>> with the message
>> >>>
>> >>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>          44100 Hz, 2 channel(s), 546731 sample frames
>> >>> *** Error in `csound': double free or corruption (out):
>> >>> 0x00000000014bfd70 ***
>> >>> Csound tidy up: Aborted
>> >>>
>> >>> Any ideas?
>> >>>
>> >>>
>> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> >>> It's done. Just in case if anyone interested in the end result.
>> >>> I post a code for service. It can play continuously wav files
>> >>> on several channels. Channels are identified by numbers.
>> >>>
>> >>> User can for the given channel
>> >>>
>> >>> * start playing a wav file in the loop. The wav files are played with
>> >>> xfade at the ends
>> >>>    so that user percieves it like a continuous flow.
>> >>>
>> >>> * stop playing a file
>> >>>
>> >>> * resume playback
>> >>>
>> >>> * set the volume for the given channel
>> >>>
>> >>> * set a global fade in/out time
>> >>>
>> >>> Also there is a python file that makes it easy to trigger the service
>> >>> from the code. There are some test remnants of file names you can
>> >>> substitute it with your own files.
>> >>>
>> >>> This combo of OSC service and python client makes it easy
>> >>> to livecode with python.
>> >>>
>> >>>
>> >>> Anton
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >>> <Victor.Lazzarini@nuim.ie>:
>> >>> Strings are updated generally at i-time, but with special provisions
>> >>> for perf-time.
>> >>> ========================
>> >>> Dr Victor Lazzarini
>> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >>> Maynooth University,
>> >>> Maynooth, Co Kildare, Ireland
>> >>> Tel: 00 353 7086936
>> >>> Fax: 00 353 1 7086952
>> >>>
>> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >>> > <anton.kholomiov@gmail.com> wrote:
>> >>> >
>> >>> > Thank you for clarification. It was a blind spot for me is S behaves
>> >>> > like I or like K.
>> >>> > So the assignment operation works only at init time
>> >>> > and for k-rate we should use strcpyk.
>> >>> >
>> >>> > Anton
>> >>> >
>> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >>> > <Victor.Lazzarini@nuim.ie>:
>> >>> > String assignment is i-time only. Use strcpyk
>> >>> >
>> >>> > gSFile strcpyk SFile
>> >>> > ========================
>> >>> > Dr Victor Lazzarini
>> >>> > Dean of Arts, Celtic Studies and Philosophy,
>> >>> > Maynooth University,
>> >>> > Maynooth, Co Kildare, Ireland
>> >>> > Tel: 00 353 7086936
>> >>> > Fax: 00 353 1 7086952
>> >>> >
>> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >>> > > <anton.kholomiov@GMAIL.COM> wrote:
>> >>> > >
>> >>> > > I'm trying to write an OSC-server with Csound.
>> >>> > > The service should receive the name of the wav-file and the
>> >>> > > length of crossfade.
>> >>> > >
>> >>> > > On receive it should stop playing any previous wavs
>> >>> > > and start a loop that plays next wav file.
>> >>> > > The two loops should crossfade.
>> >>> > >
>> >>> > > While trying to write such a thing I'm getting into trouble
>> >>> > > with receiving String message with OSC.
>> >>> > > I receive a string-field then assign it to a global String var.
>> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
>> >>> > > like this
>> >>> > >
>> >>> > > INIT ERROR in instr 100: diskinfo cannot open
>> >>> > > ilen  filelen gSFile  1
>> >>> > >
>> >>> > > What can be wrong with my code?
>> >>> > >
>> >>> > > I attach the two files.
>> >>> > > csd with server and python with client to test the server.
>> >>> > > The python uses pyOSC library
>> >>> > >
>> >>> > > Thanks,
>> >>> > > Anton
>> >>> > >
>> >>> > > Csound mailing list Csound@listserv.heanet.ie
>> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> > > be posted here <flow.csd><test_flow.py>
>> >>> >
>> >>> > Csound mailing list
>> >>> > Csound@listserv.heanet.ie
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> > Send bugs reports to
>> >>> >         https://github.com/csound/csound/issues
>> >>> > Discussions of bugs and features can be posted here
>> >>> >
>> >>> > Csound mailing list Csound@listserv.heanet.ie
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> > be posted here
>> >>>
>> >>> Csound mailing list
>> >>> Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>>
>> >>>
>> >>> Csound mailing list Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>> be posted here
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>> >
>> >
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:23
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Interesting, that's the opposite of what I was expecting. I guess I
need to review what's happening there.  I had thought that maybe both
diskin's were getting used somehow in the i-rate if-then.  Anyways,
can cross that idea off.

Trying separate instruments for mono and stereo could be interesting
to have more information.



On Sat, Jan 23, 2016 at 6:16 PM, Anton Kholomiov
 wrote:
> @Steven Then I get
>
> Maybe it's better to create two separate instruments for mono and stereo
> diskins
>
> ~~~
> INIT ERROR in instr 80: diskin2: number of output args inconsistent with
> number of file channels
> ~~~
>
>
> 2016-01-24 2:10 GMT+03:00 Steven Yi :
>>
>> A couple of things that may (or may not) be useful:
>>
>> 1. This post discusses the victim error message:
>>
>> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>>
>> 2. There is an i-time if-then used that wraps perf-time code (the
>> diskin's). Could you try:
>>
>>     ichan filenchnls gSFiles[iChannel]
>>     kchan init ichan
>>     if (kchan == 1) then
>>
>>
>>
>> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>>  wrote:
>> > Here is the code
>> >
>> > ~~~
>> > 
>> > 
>> > -odac   -d
>> > 
>> > 
>> >
>> > sr = 44100
>> > ksmps = 64
>> > nchnls = 2
>> > 0dbfs  = 1
>> >
>> > #ifndef PORT
>> >     #define PORT        # 7700 #
>> > #end
>> >
>> > #ifndef SIZE
>> >     #define SIZE        # 8 #
>> > #end
>> >
>> > gkVolume   init 1
>> > gSFile     init ""
>> >
>> > gSFiles[]   init $SIZE
>> > gkVolumes[] init $SIZE
>> >
>> > gaL init 0
>> > gaR init 0
>> >
>> > gihandle OSCinit $PORT
>> >
>> > gkFadeTime init 1
>> >
>> > opcode FracInstr, k, ik
>> >     iInstrNum, kChannel xin
>> >     kres = iInstrNum + ((kChannel + 1) / 1000)
>> >     xout kres
>> > endop
>> >
>> > instr   PlayMsg
>> >     SFile = ""
>> >     kVolume   init 0
>> >     kChannel  init 0
>> >     kk init 0
>> >
>> > nxtmsg:
>> >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> > if (kk == 0 || kChannel >= $SIZE) goto ex
>> >     kSched FracInstr 100, kChannel
>> >     kRun   FracInstr 80,  kChannel
>> >
>> >     printk 0,kSched
>> >      printk 0,kRun
>> >
>> >
>> >     turnoff2 kSched, 4, 0
>> >     turnoff2 kRun,  4, gkFadeTime
>> >     gSFiles[kChannel] strcpyk SFile
>> >     event "i", kSched, 0, -1, kChannel
>> >     kgoto nxtmsg
>> > ex:
>> > endin
>> >
>> > instr StopMsg
>> >     kChannel  init 0
>> >     kk init 0
>> >
>> > nxtmsg:
>> >     kk  OSClisten gihandle, "/stop", "i", kChannel
>> > if (kk == 0 || kChannel >= $SIZE) goto ex
>> >     kSched FracInstr 100, kChannel
>> >     kRun   FracInstr 80,  kChannel
>> >     turnoff2 kSched, 4, 0
>> >     turnoff2 kRun,  4, gkFadeTime
>> >     kgoto nxtmsg
>> > ex:
>> > endin
>> >
>> > instr ResumeMsg
>> >     kChannel  init 0
>> >     kk init 0
>> >
>> > nxtmsg:
>> >     kk  OSClisten gihandle, "/resume", "i", kChannel
>> > if (kk == 0 || kChannel >= $SIZE) goto ex
>> >     kSched FracInstr 100, kChannel
>> >     kRun   FracInstr 80,  kChannel
>> >     turnoff2 kSched, 4, 0
>> >     turnoff2 kRun,  4, gkFadeTime
>> >     event "i", kSched, 0, -1, kChannel
>> >     kgoto nxtmsg
>> > ex:
>> > endin
>> >
>> >
>> > instr   SetVolMsg
>> >     kVolume   init 0
>> >     kChannel  init 0
>> >     kk init 0
>> >
>> > nxtmsg:
>> >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> > if (kk == 0 || kChannel >= $SIZE) goto ex
>> >     gkVolumes[kChannel] = kVolume
>> >     kgoto nxtmsg
>> > ex:
>> > endin
>> >
>> > instr   SetFadeMsg
>> >     kFade   init 0
>> >     kk init 0
>> >
>> > nxtmsg:
>> >     kk  OSClisten gihandle, "/set_fade", "f", kFade
>> > if (kk == 0) goto ex
>> >     gkFadeTime = kFade
>> >     kgoto nxtmsg
>> > ex:
>> > endin
>> >
>> > instr 80
>> >     print p1
>> >     idur    = p3
>> >     iFadeTime = i(gkFadeTime)
>> >     iChannel  = p4
>> >     ichan filenchnls gSFiles[iChannel]
>> >     if (ichan == 1) then
>> >         al diskin2 gSFiles[iChannel], 1
>> >         ar = al
>> >     else
>> >         al, ar diskin2 gSFiles[iChannel], 1
>> >     endif
>> >
>> >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime,
>> > 0,
>> > iFadeTime, 0
>> >     kvol    port gkVolumes[iChannel], 0.05
>> >
>> >     gaL  = gaL + kenv * kvol * al
>> >     gaR  = gaR + kenv * kvol * ar
>> > endin
>> >
>> > instr 100
>> >     iChannel  = p4
>> >     iFadeTime = i(gkFadeTime)
>> >     ilen  filelen gSFiles[iChannel]
>> >     km    metro (1 / (ilen - iFadeTime))
>> >     kRun FracInstr 80, iChannel
>> >     if (km == 1)  then
>> >         event "i", kRun, 0, ilen, iChannel
>> >     endif
>> > endin
>> >
>> > instr 110
>> >     outs gaL, gaR
>> >     gaL = 0
>> >     gaR = 0
>> > endin
>> >
>> > instr Init
>> >     kCount = 0
>> >     until (kCount == lenarray(gkVolumes)) do
>> >         gkVolumes[kCount] = 1
>> >         kCount = kCount + 1
>> >     od
>> > endin
>> >
>> >
>> > 
>> > 
>> >
>> > f0 1000000
>> >
>> > i "Init" 0 0.01
>> >
>> > i   "PlayMsg"    0 -1
>> > i   "SetVolMsg"  0 -1
>> > i   "SetFadeMsg" 0 -1
>> > i   "StopMsg"    0 -1
>> > i   "ResumeMsg"  0 -1
>> >
>> > i 110 0 -1
>> > e
>> > 
>> > 
>> > ~~~
>> >
>> > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
>> >>
>> >> Can you post the Csound code? I see no global arrays in your earlier
>> >> flow.csd
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 22:36, Anton Kholomiov 
>> >> > wrote:
>> >> >
>> >> > Here I'm reading the same file with diskin2 in the two instances of
>> >> > the
>> >> > same instrument.
>> >> > It's triggered with fractional numbers. 80.001 and 80.005
>> >> >
>> >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> > :
>> >> > The last message I've sent was to set the volume on channel. It
>> >> > assigns
>> >> > a value to the cell of global array.
>> >> >
>> >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> > :
>> >> > Here is message from gdb:
>> >> >
>> >> > diskin2: opened '/home/anton/Seashore.wav':
>> >> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >      number of samples out of range:        2        2
>> >> > new alloc for instr 80:
>> >> > instr 80:  p1 = 80.005
>> >> > diskin2: opened '/home/anton/Seashore.wav':
>> >> >          44100 Hz, 2 channel(s), 546731 sample frames
>> >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >      number of samples out of range:     1315      451
>> >> > instr 80:  p1 = 80.001
>> >> >
>> >> > Program received signal SIGSEGV, Segmentation fault.
>> >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>> >> > malloc.c:4163
>> >> > 4163    malloc.c: No such file or directory.
>> >> > (gdb) bt
>> >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>> >> >     at malloc.c:4163
>> >> > #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>> >> >     at malloc.c:3423
>> >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>> >> >     elem_size=) at malloc.c:3219
>> >> > #3  0x00007ffff70df5f2 in sf_open ()
>> >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> > /usr/lib/libcsound64.so.6.0
>> >> > #10 0x0000000000401358 in ?? ()
>> >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>> >> >     argv=0x7fffffffd7c8, init=, fini=,
>> >> >     rtld_fini=, stack_end=0x7fffffffd7b8) at
>> >> > libc-start.c:287
>> >> > #12 0x00000000004013b0 in _start ()
>> >> >
>> >> >
>> >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> > :
>> >> > Thanks for the quick reply, Victor.
>> >> > I'll report back if I encounter the problem again!
>> >> > Though I'm not that good with gdb
>> >> >
>> >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> > :
>> >> > Use gdb. Are you using the csound command? Do gdb csound, then
>> >> > use the run command with the arguments you need eg
>> >> >
>> >> > run mycsd.csd
>> >> >
>> >> > when it crashes you can try using the
>> >> > backtrace command to show where it stopped.
>> >> >
>> >> > On 23 Jan 2016, at 22:07, Anton Kholomiov 
>> >> > wrote:
>> >> >
>> >> >> How to do it?
>> >> >>
>> >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >> :
>> >> >> Can you run it under a debugger?
>> >> >>
>> >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >> 
>> >> >> wrote:
>> >> >>
>> >> >>> Unfortunately after several minutes of playing the service breaks
>> >> >>> with the message
>> >> >>>
>> >> >>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>> *** Error in `csound': double free or corruption (out):
>> >> >>> 0x00000000014bfd70 ***
>> >> >>> Csound tidy up: Aborted
>> >> >>>
>> >> >>> Any ideas?
>> >> >>>
>> >> >>>
>> >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>> :
>> >> >>> It's done. Just in case if anyone interested in the end result.
>> >> >>> I post a code for service. It can play continuously wav files
>> >> >>> on several channels. Channels are identified by numbers.
>> >> >>>
>> >> >>> User can for the given channel
>> >> >>>
>> >> >>> * start playing a wav file in the loop. The wav files are played
>> >> >>> with
>> >> >>> xfade at the ends
>> >> >>>    so that user percieves it like a continuous flow.
>> >> >>>
>> >> >>> * stop playing a file
>> >> >>>
>> >> >>> * resume playback
>> >> >>>
>> >> >>> * set the volume for the given channel
>> >> >>>
>> >> >>> * set a global fade in/out time
>> >> >>>
>> >> >>> Also there is a python file that makes it easy to trigger the
>> >> >>> service
>> >> >>> from the code. There are some test remnants of file names you can
>> >> >>> substitute it with your own files.
>> >> >>>
>> >> >>> This combo of OSC service and python client makes it easy
>> >> >>> to livecode with python.
>> >> >>>
>> >> >>>
>> >> >>> Anton
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>> :
>> >> >>> Strings are updated generally at i-time, but with special
>> >> >>> provisions
>> >> >>> for perf-time.
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>> >  wrote:
>> >> >>> >
>> >> >>> > Thank you for clarification. It was a blind spot for me is S
>> >> >>> > behaves
>> >> >>> > like I or like K.
>> >> >>> > So the assignment operation works only at init time
>> >> >>> > and for k-rate we should use strcpyk.
>> >> >>> >
>> >> >>> > Anton
>> >> >>> >
>> >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>> > :
>> >> >>> > String assignment is i-time only. Use strcpyk
>> >> >>> >
>> >> >>> > gSFile strcpyk SFile
>> >> >>> > ========================
>> >> >>> > Dr Victor Lazzarini
>> >> >>> > Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> > Maynooth University,
>> >> >>> > Maynooth, Co Kildare, Ireland
>> >> >>> > Tel: 00 353 7086936
>> >> >>> > Fax: 00 353 1 7086952
>> >> >>> >
>> >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>> > >  wrote:
>> >> >>> > >
>> >> >>> > > I'm trying to write an OSC-server with Csound.
>> >> >>> > > The service should receive the name of the wav-file and the
>> >> >>> > > length of crossfade.
>> >> >>> > >
>> >> >>> > > On receive it should stop playing any previous wavs
>> >> >>> > > and start a loop that plays next wav file.
>> >> >>> > > The two loops should crossfade.
>> >> >>> > >
>> >> >>> > > While trying to write such a thing I'm getting into trouble
>> >> >>> > > with receiving String message with OSC.
>> >> >>> > > I receive a string-field then assign it to a global String var.
>> >> >>> > > But when I try to use it with diskin2 or filelen I get INIT
>> >> >>> > > errors
>> >> >>> > > like this
>> >> >>> > >
>> >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
>> >> >>> > > ilen  filelen gSFile  1
>> >> >>> > >
>> >> >>> > > What can be wrong with my code?
>> >> >>> > >
>> >> >>> > > I attach the two files.
>> >> >>> > > csd with server and python with client to test the server.
>> >> >>> > > The python uses pyOSC library
>> >> >>> > >
>> >> >>> > > Thanks,
>> >> >>> > > Anton
>> >> >>> > >
>> >> >>> > > Csound mailing list Csound@listserv.heanet.ie
>> >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>> > > reports to
>> >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>> > > features can
>> >> >>> > > be posted here 
>> >> >>> >
>> >> >>> > Csound mailing list
>> >> >>> > Csound@listserv.heanet.ie
>> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> > Send bugs reports to
>> >> >>> >         https://github.com/csound/csound/issues
>> >> >>> > Discussions of bugs and features can be posted here
>> >> >>> >
>> >> >>> > Csound mailing list Csound@listserv.heanet.ie
>> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>> > to
>> >> >>> > https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>> > features can
>> >> >>> > be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>         https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>>
>> >> >>>
>> >> >>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>> to
>> >> >>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>> features can
>> >> >>> be posted here
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> > Csound mailing list Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> > https://github.com/csound/csound/issues Discussions of bugs and
>> >> > features can
>> >> > be posted here
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > Csound mailing list Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> > https://github.com/csound/csound/issues Discussions of bugs and
>> >> > features can
>> >> > be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:23
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I think the if-then gets translated into an i & perf time check (cggoto).

But I am thinking here the crash might be to do with accessing arrays out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:10, Steven Yi  wrote:
> 
> A couple of things that may (or may not) be useful:
> 
> 1. This post discusses the victim error message:
> 
> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> 
> 2. There is an i-time if-then used that wraps perf-time code (the
> diskin's). Could you try:
> 
>    ichan filenchnls gSFiles[iChannel]
>    kchan init ichan
>    if (kchan == 1) then
> 
> 
> 
> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>  wrote:
>> Here is the code
>> 
>> ~~~
>> 
>> 
>> -odac   -d
>> 
>> 
>> 
>> sr = 44100
>> ksmps = 64
>> nchnls = 2
>> 0dbfs  = 1
>> 
>> #ifndef PORT
>>    #define PORT        # 7700 #
>> #end
>> 
>> #ifndef SIZE
>>    #define SIZE        # 8 #
>> #end
>> 
>> gkVolume   init 1
>> gSFile     init ""
>> 
>> gSFiles[]   init $SIZE
>> gkVolumes[] init $SIZE
>> 
>> gaL init 0
>> gaR init 0
>> 
>> gihandle OSCinit $PORT
>> 
>> gkFadeTime init 1
>> 
>> opcode FracInstr, k, ik
>>    iInstrNum, kChannel xin
>>    kres = iInstrNum + ((kChannel + 1) / 1000)
>>    xout kres
>> endop
>> 
>> instr   PlayMsg
>>    SFile = ""
>>    kVolume   init 0
>>    kChannel  init 0
>>    kk init 0
>> 
>> nxtmsg:
>>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    kSched FracInstr 100, kChannel
>>    kRun   FracInstr 80,  kChannel
>> 
>>    printk 0,kSched
>>     printk 0,kRun
>> 
>> 
>>    turnoff2 kSched, 4, 0
>>    turnoff2 kRun,  4, gkFadeTime
>>    gSFiles[kChannel] strcpyk SFile
>>    event "i", kSched, 0, -1, kChannel
>>    kgoto nxtmsg
>> ex:
>> endin
>> 
>> instr StopMsg
>>    kChannel  init 0
>>    kk init 0
>> 
>> nxtmsg:
>>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    kSched FracInstr 100, kChannel
>>    kRun   FracInstr 80,  kChannel
>>    turnoff2 kSched, 4, 0
>>    turnoff2 kRun,  4, gkFadeTime
>>    kgoto nxtmsg
>> ex:
>> endin
>> 
>> instr ResumeMsg
>>    kChannel  init 0
>>    kk init 0
>> 
>> nxtmsg:
>>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    kSched FracInstr 100, kChannel
>>    kRun   FracInstr 80,  kChannel
>>    turnoff2 kSched, 4, 0
>>    turnoff2 kRun,  4, gkFadeTime
>>    event "i", kSched, 0, -1, kChannel
>>    kgoto nxtmsg
>> ex:
>> endin
>> 
>> 
>> instr   SetVolMsg
>>    kVolume   init 0
>>    kChannel  init 0
>>    kk init 0
>> 
>> nxtmsg:
>>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    gkVolumes[kChannel] = kVolume
>>    kgoto nxtmsg
>> ex:
>> endin
>> 
>> instr   SetFadeMsg
>>    kFade   init 0
>>    kk init 0
>> 
>> nxtmsg:
>>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> if (kk == 0) goto ex
>>    gkFadeTime = kFade
>>    kgoto nxtmsg
>> ex:
>> endin
>> 
>> instr 80
>>    print p1
>>    idur    = p3
>>    iFadeTime = i(gkFadeTime)
>>    iChannel  = p4
>>    ichan filenchnls gSFiles[iChannel]
>>    if (ichan == 1) then
>>        al diskin2 gSFiles[iChannel], 1
>>        ar = al
>>    else
>>        al, ar diskin2 gSFiles[iChannel], 1
>>    endif
>> 
>>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
>> iFadeTime, 0
>>    kvol    port gkVolumes[iChannel], 0.05
>> 
>>    gaL  = gaL + kenv * kvol * al
>>    gaR  = gaR + kenv * kvol * ar
>> endin
>> 
>> instr 100
>>    iChannel  = p4
>>    iFadeTime = i(gkFadeTime)
>>    ilen  filelen gSFiles[iChannel]
>>    km    metro (1 / (ilen - iFadeTime))
>>    kRun FracInstr 80, iChannel
>>    if (km == 1)  then
>>        event "i", kRun, 0, ilen, iChannel
>>    endif
>> endin
>> 
>> instr 110
>>    outs gaL, gaR
>>    gaL = 0
>>    gaR = 0
>> endin
>> 
>> instr Init
>>    kCount = 0
>>    until (kCount == lenarray(gkVolumes)) do
>>        gkVolumes[kCount] = 1
>>        kCount = kCount + 1
>>    od
>> endin
>> 
>> 
>> 
>> 
>> 
>> f0 1000000
>> 
>> i "Init" 0 0.01
>> 
>> i   "PlayMsg"    0 -1
>> i   "SetVolMsg"  0 -1
>> i   "SetFadeMsg" 0 -1
>> i   "StopMsg"    0 -1
>> i   "ResumeMsg"  0 -1
>> 
>> i 110 0 -1
>> e
>> 
>> 
>> ~~~
>> 
>> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
>>> 
>>> Can you post the Csound code? I see no global arrays in your earlier
>>> flow.csd
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>>> On 23 Jan 2016, at 22:36, Anton Kholomiov 
>>>> wrote:
>>>> 
>>>> Here I'm reading the same file with diskin2 in the two instances of the
>>>> same instrument.
>>>> It's triggered with fractional numbers. 80.001 and 80.005
>>>> 
>>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
>>>> The last message I've sent was to set the volume on channel. It assigns
>>>> a value to the cell of global array.
>>>> 
>>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
>>>> Here is message from gdb:
>>>> 
>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>>>>     number of samples out of range:        2        2
>>>> new alloc for instr 80:
>>>> instr 80:  p1 = 80.005
>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>>>>     number of samples out of range:     1315      451
>>>> instr 80:  p1 = 80.001
>>>> 
>>>> Program received signal SIGSEGV, Segmentation fault.
>>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>>>> malloc.c:4163
>>>> 4163    malloc.c: No such file or directory.
>>>> (gdb) bt
>>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>>>>    at malloc.c:4163
>>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>>>>    av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>>>>    at malloc.c:3423
>>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>>>>    elem_size=) at malloc.c:3219
>>>> #3  0x00007ffff70df5f2 in sf_open ()
>>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>>>> /usr/lib/libcsound64.so.6.0
>>>> #10 0x0000000000401358 in ?? ()
>>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>>>>    argv=0x7fffffffd7c8, init=, fini=,
>>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
>>>> libc-start.c:287
>>>> #12 0x00000000004013b0 in _start ()
>>>> 
>>>> 
>>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
>>>> Thanks for the quick reply, Victor.
>>>> I'll report back if I encounter the problem again!
>>>> Though I'm not that good with gdb
>>>> 
>>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
>>>> Use gdb. Are you using the csound command? Do gdb csound, then
>>>> use the run command with the arguments you need eg
>>>> 
>>>> run mycsd.csd
>>>> 
>>>> when it crashes you can try using the
>>>> backtrace command to show where it stopped.
>>>> 
>>>> On 23 Jan 2016, at 22:07, Anton Kholomiov 
>>>> wrote:
>>>> 
>>>>> How to do it?
>>>>> 
>>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
>>>>> Can you run it under a debugger?
>>>>> 
>>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov 
>>>>> wrote:
>>>>> 
>>>>>> Unfortunately after several minutes of playing the service breaks
>>>>>> with the message
>>>>>> 
>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>>> *** Error in `csound': double free or corruption (out):
>>>>>> 0x00000000014bfd70 ***
>>>>>> Csound tidy up: Aborted
>>>>>> 
>>>>>> Any ideas?
>>>>>> 
>>>>>> 
>>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
>>>>>> It's done. Just in case if anyone interested in the end result.
>>>>>> I post a code for service. It can play continuously wav files
>>>>>> on several channels. Channels are identified by numbers.
>>>>>> 
>>>>>> User can for the given channel
>>>>>> 
>>>>>> * start playing a wav file in the loop. The wav files are played with
>>>>>> xfade at the ends
>>>>>>   so that user percieves it like a continuous flow.
>>>>>> 
>>>>>> * stop playing a file
>>>>>> 
>>>>>> * resume playback
>>>>>> 
>>>>>> * set the volume for the given channel
>>>>>> 
>>>>>> * set a global fade in/out time
>>>>>> 
>>>>>> Also there is a python file that makes it easy to trigger the service
>>>>>> from the code. There are some test remnants of file names you can
>>>>>> substitute it with your own files.
>>>>>> 
>>>>>> This combo of OSC service and python client makes it easy
>>>>>> to livecode with python.
>>>>>> 
>>>>>> 
>>>>>> Anton
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>>>>>> :
>>>>>> Strings are updated generally at i-time, but with special provisions
>>>>>> for perf-time.
>>>>>> ========================
>>>>>> Dr Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>> 
>>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>>>>>>>  wrote:
>>>>>>> 
>>>>>>> Thank you for clarification. It was a blind spot for me is S behaves
>>>>>>> like I or like K.
>>>>>>> So the assignment operation works only at init time
>>>>>>> and for k-rate we should use strcpyk.
>>>>>>> 
>>>>>>> Anton
>>>>>>> 
>>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>>>>>>> :
>>>>>>> String assignment is i-time only. Use strcpyk
>>>>>>> 
>>>>>>> gSFile strcpyk SFile
>>>>>>> ========================
>>>>>>> Dr Victor Lazzarini
>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>> Maynooth University,
>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>> Tel: 00 353 7086936
>>>>>>> Fax: 00 353 1 7086952
>>>>>>> 
>>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>>>>>>>>  wrote:
>>>>>>>> 
>>>>>>>> I'm trying to write an OSC-server with Csound.
>>>>>>>> The service should receive the name of the wav-file and the
>>>>>>>> length of crossfade.
>>>>>>>> 
>>>>>>>> On receive it should stop playing any previous wavs
>>>>>>>> and start a loop that plays next wav file.
>>>>>>>> The two loops should crossfade.
>>>>>>>> 
>>>>>>>> While trying to write such a thing I'm getting into trouble
>>>>>>>> with receiving String message with OSC.
>>>>>>>> I receive a string-field then assign it to a global String var.
>>>>>>>> But when I try to use it with diskin2 or filelen I get INIT errors
>>>>>>>> like this
>>>>>>>> 
>>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>>>>>>>> ilen  filelen gSFile  1
>>>>>>>> 
>>>>>>>> What can be wrong with my code?
>>>>>>>> 
>>>>>>>> I attach the two files.
>>>>>>>> csd with server and python with client to test the server.
>>>>>>>> The python uses pyOSC library
>>>>>>>> 
>>>>>>>> Thanks,
>>>>>>>> Anton
>>>>>>>> 
>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>>> be posted here 
>>>>>>> 
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>        https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> 
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>> be posted here
>>>>>> 
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>        https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>> 
>>>>>> 
>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>> be posted here
>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>> be posted here
>>>>> 
>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>> be posted here
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>> 
>> 
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:25
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
There have to be no out of bounds array assignment. Since I check the messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check (cggoto).

But I am thinking here the crash might be to do with accessing arrays out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>
> A couple of things that may (or may not) be useful:
>
> 1. This post discusses the victim error message:
>
> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>
> 2. There is an i-time if-then used that wraps perf-time code (the
> diskin's). Could you try:
>
>    ichan filenchnls gSFiles[iChannel]
>    kchan init ichan
>    if (kchan == 1) then
>
>
>
> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> <anton.kholomiov@gmail.com> wrote:
>> Here is the code
>>
>> ~~~
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac   -d
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 64
>> nchnls = 2
>> 0dbfs  = 1
>>
>> #ifndef PORT
>>    #define PORT        # 7700 #
>> #end
>>
>> #ifndef SIZE
>>    #define SIZE        # 8 #
>> #end
>>
>> gkVolume   init 1
>> gSFile     init ""
>>
>> gSFiles[]   init $SIZE
>> gkVolumes[] init $SIZE
>>
>> gaL init 0
>> gaR init 0
>>
>> gihandle OSCinit $PORT
>>
>> gkFadeTime init 1
>>
>> opcode FracInstr, k, ik
>>    iInstrNum, kChannel xin
>>    kres = iInstrNum + ((kChannel + 1) / 1000)
>>    xout kres
>> endop
>>
>> instr   PlayMsg
>>    SFile = ""
>>    kVolume   init 0
>>    kChannel  init 0
>>    kk init 0
>>
>> nxtmsg:
>>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    kSched FracInstr 100, kChannel
>>    kRun   FracInstr 80,  kChannel
>>
>>    printk 0,kSched
>>     printk 0,kRun
>>
>>
>>    turnoff2 kSched, 4, 0
>>    turnoff2 kRun,  4, gkFadeTime
>>    gSFiles[kChannel] strcpyk SFile
>>    event "i", kSched, 0, -1, kChannel
>>    kgoto nxtmsg
>> ex:
>> endin
>>
>> instr StopMsg
>>    kChannel  init 0
>>    kk init 0
>>
>> nxtmsg:
>>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    kSched FracInstr 100, kChannel
>>    kRun   FracInstr 80,  kChannel
>>    turnoff2 kSched, 4, 0
>>    turnoff2 kRun,  4, gkFadeTime
>>    kgoto nxtmsg
>> ex:
>> endin
>>
>> instr ResumeMsg
>>    kChannel  init 0
>>    kk init 0
>>
>> nxtmsg:
>>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    kSched FracInstr 100, kChannel
>>    kRun   FracInstr 80,  kChannel
>>    turnoff2 kSched, 4, 0
>>    turnoff2 kRun,  4, gkFadeTime
>>    event "i", kSched, 0, -1, kChannel
>>    kgoto nxtmsg
>> ex:
>> endin
>>
>>
>> instr   SetVolMsg
>>    kVolume   init 0
>>    kChannel  init 0
>>    kk init 0
>>
>> nxtmsg:
>>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>    gkVolumes[kChannel] = kVolume
>>    kgoto nxtmsg
>> ex:
>> endin
>>
>> instr   SetFadeMsg
>>    kFade   init 0
>>    kk init 0
>>
>> nxtmsg:
>>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> if (kk == 0) goto ex
>>    gkFadeTime = kFade
>>    kgoto nxtmsg
>> ex:
>> endin
>>
>> instr 80
>>    print p1
>>    idur    = p3
>>    iFadeTime = i(gkFadeTime)
>>    iChannel  = p4
>>    ichan filenchnls gSFiles[iChannel]
>>    if (ichan == 1) then
>>        al diskin2 gSFiles[iChannel], 1
>>        ar = al
>>    else
>>        al, ar diskin2 gSFiles[iChannel], 1
>>    endif
>>
>>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
>> iFadeTime, 0
>>    kvol    port gkVolumes[iChannel], 0.05
>>
>>    gaL  = gaL + kenv * kvol * al
>>    gaR  = gaR + kenv * kvol * ar
>> endin
>>
>> instr 100
>>    iChannel  = p4
>>    iFadeTime = i(gkFadeTime)
>>    ilen  filelen gSFiles[iChannel]
>>    km    metro (1 / (ilen - iFadeTime))
>>    kRun FracInstr 80, iChannel
>>    if (km == 1)  then
>>        event "i", kRun, 0, ilen, iChannel
>>    endif
>> endin
>>
>> instr 110
>>    outs gaL, gaR
>>    gaL = 0
>>    gaR = 0
>> endin
>>
>> instr Init
>>    kCount = 0
>>    until (kCount == lenarray(gkVolumes)) do
>>        gkVolumes[kCount] = 1
>>        kCount = kCount + 1
>>    od
>> endin
>>
>>
>> </CsInstruments>
>> <CsScore>
>>
>> f0 1000000
>>
>> i "Init" 0 0.01
>>
>> i   "PlayMsg"    0 -1
>> i   "SetVolMsg"  0 -1
>> i   "SetFadeMsg" 0 -1
>> i   "StopMsg"    0 -1
>> i   "ResumeMsg"  0 -1
>>
>> i 110 0 -1
>> e
>> </CsScore>
>> </CsoundSynthesizer>
>> ~~~
>>
>> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>
>>> Can you post the Csound code? I see no global arrays in your earlier
>>> flow.csd
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
>>>> wrote:
>>>>
>>>> Here I'm reading the same file with diskin2 in the two instances of the
>>>> same instrument.
>>>> It's triggered with fractional numbers. 80.001 and 80.005
>>>>
>>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>>> The last message I've sent was to set the volume on channel. It assigns
>>>> a value to the cell of global array.
>>>>
>>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>>> Here is message from gdb:
>>>>
>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>>>>     number of samples out of range:        2        2
>>>> new alloc for instr 80:
>>>> instr 80:  p1 = 80.005
>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>>>>     number of samples out of range:     1315      451
>>>> instr 80:  p1 = 80.001
>>>>
>>>> Program received signal SIGSEGV, Segmentation fault.
>>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>>>> malloc.c:4163
>>>> 4163    malloc.c: No such file or directory.
>>>> (gdb) bt
>>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>>>>    at malloc.c:4163
>>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>>>>    av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>>>>    at malloc.c:3423
>>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>>>>    elem_size=<optimized out>) at malloc.c:3219
>>>> #3  0x00007ffff70df5f2 in sf_open ()
>>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>>>> /usr/lib/libcsound64.so.6.0
>>>> #10 0x0000000000401358 in ?? ()
>>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>>>> libc-start.c:287
>>>> #12 0x00000000004013b0 in _start ()
>>>>
>>>>
>>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>>> Thanks for the quick reply, Victor.
>>>> I'll report back if I encounter the problem again!
>>>> Though I'm not that good with gdb
>>>>
>>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>> Use gdb. Are you using the csound command? Do gdb csound, then
>>>> use the run command with the arguments you need eg
>>>>
>>>> run mycsd.csd
>>>>
>>>> when it crashes you can try using the
>>>> backtrace command to show where it stopped.
>>>>
>>>> On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>>>> wrote:
>>>>
>>>>> How to do it?
>>>>>
>>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>> Can you run it under a debugger?
>>>>>
>>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>>>>> wrote:
>>>>>
>>>>>> Unfortunately after several minutes of playing the service breaks
>>>>>> with the message
>>>>>>
>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>>> *** Error in `csound': double free or corruption (out):
>>>>>> 0x00000000014bfd70 ***
>>>>>> Csound tidy up: Aborted
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>>
>>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>>>>>> It's done. Just in case if anyone interested in the end result.
>>>>>> I post a code for service. It can play continuously wav files
>>>>>> on several channels. Channels are identified by numbers.
>>>>>>
>>>>>> User can for the given channel
>>>>>>
>>>>>> * start playing a wav file in the loop. The wav files are played with
>>>>>> xfade at the ends
>>>>>>   so that user percieves it like a continuous flow.
>>>>>>
>>>>>> * stop playing a file
>>>>>>
>>>>>> * resume playback
>>>>>>
>>>>>> * set the volume for the given channel
>>>>>>
>>>>>> * set a global fade in/out time
>>>>>>
>>>>>> Also there is a python file that makes it easy to trigger the service
>>>>>> from the code. There are some test remnants of file names you can
>>>>>> substitute it with your own files.
>>>>>>
>>>>>> This combo of OSC service and python client makes it easy
>>>>>> to livecode with python.
>>>>>>
>>>>>>
>>>>>> Anton
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>>>>>> <Victor.Lazzarini@nuim.ie>:
>>>>>> Strings are updated generally at i-time, but with special provisions
>>>>>> for perf-time.
>>>>>> ========================
>>>>>> Dr Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>>>>>>> <anton.kholomiov@gmail.com> wrote:
>>>>>>>
>>>>>>> Thank you for clarification. It was a blind spot for me is S behaves
>>>>>>> like I or like K.
>>>>>>> So the assignment operation works only at init time
>>>>>>> and for k-rate we should use strcpyk.
>>>>>>>
>>>>>>> Anton
>>>>>>>
>>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>>>>>>> <Victor.Lazzarini@nuim.ie>:
>>>>>>> String assignment is i-time only. Use strcpyk
>>>>>>>
>>>>>>> gSFile strcpyk SFile
>>>>>>> ========================
>>>>>>> Dr Victor Lazzarini
>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>> Maynooth University,
>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>> Tel: 00 353 7086936
>>>>>>> Fax: 00 353 1 7086952
>>>>>>>
>>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>>>>>>>>
>>>>>>>> I'm trying to write an OSC-server with Csound.
>>>>>>>> The service should receive the name of the wav-file and the
>>>>>>>> length of crossfade.
>>>>>>>>
>>>>>>>> On receive it should stop playing any previous wavs
>>>>>>>> and start a loop that plays next wav file.
>>>>>>>> The two loops should crossfade.
>>>>>>>>
>>>>>>>> While trying to write such a thing I'm getting into trouble
>>>>>>>> with receiving String message with OSC.
>>>>>>>> I receive a string-field then assign it to a global String var.
>>>>>>>> But when I try to use it with diskin2 or filelen I get INIT errors
>>>>>>>> like this
>>>>>>>>
>>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>>>>>>>> ilen  filelen gSFile  1
>>>>>>>>
>>>>>>>> What can be wrong with my code?
>>>>>>>>
>>>>>>>> I attach the two files.
>>>>>>>> csd with server and python with client to test the server.
>>>>>>>> The python uses pyOSC library
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Anton
>>>>>>>>
>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>>> be posted here <flow.csd><test_flow.py>
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>        https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>> be posted here
>>>>>>
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>        https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>> be posted here
>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>> be posted here
>>>>>
>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>> be posted here
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>>>
>>>>
>>>>
>>>>
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>>
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:28
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I mean in the instrument that receives the set_volume message (if that is how you made it crash),
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:20, Anton Kholomiov  wrote:
> 
> @Victor
> 
> It takes 5 to 15 minutes....
> It takes some time to make it crash. Thank you for the help
> I'll try it tomorrow. 
> 
> Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
> 
> 2016-01-24 2:16 GMT+03:00 Anton Kholomiov :
> @Steven Then I get 
> 
> Maybe it's better to create two separate instruments for mono and stereo diskins
> 
> ~~~
> INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> ~~~
> 
> 
> 2016-01-24 2:10 GMT+03:00 Steven Yi :
> A couple of things that may (or may not) be useful:
> 
> 1. This post discusses the victim error message:
> 
> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> 
> 2. There is an i-time if-then used that wraps perf-time code (the
> diskin's). Could you try:
> 
>     ichan filenchnls gSFiles[iChannel]
>     kchan init ichan
>     if (kchan == 1) then
> 
> 
> 
> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>  wrote:
> > Here is the code
> >
> > ~~~
> > 
> > 
> > -odac   -d
> > 
> > 
> >
> > sr = 44100
> > ksmps = 64
> > nchnls = 2
> > 0dbfs  = 1
> >
> > #ifndef PORT
> >     #define PORT        # 7700 #
> > #end
> >
> > #ifndef SIZE
> >     #define SIZE        # 8 #
> > #end
> >
> > gkVolume   init 1
> > gSFile     init ""
> >
> > gSFiles[]   init $SIZE
> > gkVolumes[] init $SIZE
> >
> > gaL init 0
> > gaR init 0
> >
> > gihandle OSCinit $PORT
> >
> > gkFadeTime init 1
> >
> > opcode FracInstr, k, ik
> >     iInstrNum, kChannel xin
> >     kres = iInstrNum + ((kChannel + 1) / 1000)
> >     xout kres
> > endop
> >
> > instr   PlayMsg
> >     SFile = ""
> >     kVolume   init 0
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     kSched FracInstr 100, kChannel
> >     kRun   FracInstr 80,  kChannel
> >
> >     printk 0,kSched
> >      printk 0,kRun
> >
> >
> >     turnoff2 kSched, 4, 0
> >     turnoff2 kRun,  4, gkFadeTime
> >     gSFiles[kChannel] strcpyk SFile
> >     event "i", kSched, 0, -1, kChannel
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr StopMsg
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     kSched FracInstr 100, kChannel
> >     kRun   FracInstr 80,  kChannel
> >     turnoff2 kSched, 4, 0
> >     turnoff2 kRun,  4, gkFadeTime
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr ResumeMsg
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     kSched FracInstr 100, kChannel
> >     kRun   FracInstr 80,  kChannel
> >     turnoff2 kSched, 4, 0
> >     turnoff2 kRun,  4, gkFadeTime
> >     event "i", kSched, 0, -1, kChannel
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> >
> > instr   SetVolMsg
> >     kVolume   init 0
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     gkVolumes[kChannel] = kVolume
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr   SetFadeMsg
> >     kFade   init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > if (kk == 0) goto ex
> >     gkFadeTime = kFade
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr 80
> >     print p1
> >     idur    = p3
> >     iFadeTime = i(gkFadeTime)
> >     iChannel  = p4
> >     ichan filenchnls gSFiles[iChannel]
> >     if (ichan == 1) then
> >         al diskin2 gSFiles[iChannel], 1
> >         ar = al
> >     else
> >         al, ar diskin2 gSFiles[iChannel], 1
> >     endif
> >
> >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > iFadeTime, 0
> >     kvol    port gkVolumes[iChannel], 0.05
> >
> >     gaL  = gaL + kenv * kvol * al
> >     gaR  = gaR + kenv * kvol * ar
> > endin
> >
> > instr 100
> >     iChannel  = p4
> >     iFadeTime = i(gkFadeTime)
> >     ilen  filelen gSFiles[iChannel]
> >     km    metro (1 / (ilen - iFadeTime))
> >     kRun FracInstr 80, iChannel
> >     if (km == 1)  then
> >         event "i", kRun, 0, ilen, iChannel
> >     endif
> > endin
> >
> > instr 110
> >     outs gaL, gaR
> >     gaL = 0
> >     gaR = 0
> > endin
> >
> > instr Init
> >     kCount = 0
> >     until (kCount == lenarray(gkVolumes)) do
> >         gkVolumes[kCount] = 1
> >         kCount = kCount + 1
> >     od
> > endin
> >
> >
> > 
> > 
> >
> > f0 1000000
> >
> > i "Init" 0 0.01
> >
> > i   "PlayMsg"    0 -1
> > i   "SetVolMsg"  0 -1
> > i   "SetFadeMsg" 0 -1
> > i   "StopMsg"    0 -1
> > i   "ResumeMsg"  0 -1
> >
> > i 110 0 -1
> > e
> > 
> > 
> > ~~~
> >
> > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
> >>
> >> Can you post the Csound code? I see no global arrays in your earlier
> >> flow.csd
> >> ========================
> >> Dr Victor Lazzarini
> >> Dean of Arts, Celtic Studies and Philosophy,
> >> Maynooth University,
> >> Maynooth, Co Kildare, Ireland
> >> Tel: 00 353 7086936
> >> Fax: 00 353 1 7086952
> >>
> >> > On 23 Jan 2016, at 22:36, Anton Kholomiov 
> >> > wrote:
> >> >
> >> > Here I'm reading the same file with diskin2 in the two instances of the
> >> > same instrument.
> >> > It's triggered with fractional numbers. 80.001 and 80.005
> >> >
> >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> >> > The last message I've sent was to set the volume on channel. It assigns
> >> > a value to the cell of global array.
> >> >
> >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> >> > Here is message from gdb:
> >> >
> >> > diskin2: opened '/home/anton/Seashore.wav':
> >> >          44100 Hz, 2 channel(s), 546731 sample frames
> >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> >> >      number of samples out of range:        2        2
> >> > new alloc for instr 80:
> >> > instr 80:  p1 = 80.005
> >> > diskin2: opened '/home/anton/Seashore.wav':
> >> >          44100 Hz, 2 channel(s), 546731 sample frames
> >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> >> >      number of samples out of range:     1315      451
> >> > instr 80:  p1 = 80.001
> >> >
> >> > Program received signal SIGSEGV, Segmentation fault.
> >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
> >> > malloc.c:4163
> >> > 4163    malloc.c: No such file or directory.
> >> > (gdb) bt
> >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
> >> >     at malloc.c:4163
> >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> >> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
> >> >     at malloc.c:3423
> >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
> >> >     elem_size=) at malloc.c:3219
> >> > #3  0x00007ffff70df5f2 in sf_open ()
> >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> >> > /usr/lib/libcsound64.so.6.0
> >> > #10 0x0000000000401358 in ?? ()
> >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> >> >     argv=0x7fffffffd7c8, init=, fini=,
> >> >     rtld_fini=, stack_end=0x7fffffffd7b8) at
> >> > libc-start.c:287
> >> > #12 0x00000000004013b0 in _start ()
> >> >
> >> >
> >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> >> > Thanks for the quick reply, Victor.
> >> > I'll report back if I encounter the problem again!
> >> > Though I'm not that good with gdb
> >> >
> >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> >> > Use gdb. Are you using the csound command? Do gdb csound, then
> >> > use the run command with the arguments you need eg
> >> >
> >> > run mycsd.csd
> >> >
> >> > when it crashes you can try using the
> >> > backtrace command to show where it stopped.
> >> >
> >> > On 23 Jan 2016, at 22:07, Anton Kholomiov 
> >> > wrote:
> >> >
> >> >> How to do it?
> >> >>
> >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
> >> >> Can you run it under a debugger?
> >> >>
> >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov 
> >> >> wrote:
> >> >>
> >> >>> Unfortunately after several minutes of playing the service breaks
> >> >>> with the message
> >> >>>
> >> >>> diskin2: opened '/home/anton/Seashore.wav':
> >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> >> >>> *** Error in `csound': double free or corruption (out):
> >> >>> 0x00000000014bfd70 ***
> >> >>> Csound tidy up: Aborted
> >> >>>
> >> >>> Any ideas?
> >> >>>
> >> >>>
> >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
> >> >>> It's done. Just in case if anyone interested in the end result.
> >> >>> I post a code for service. It can play continuously wav files
> >> >>> on several channels. Channels are identified by numbers.
> >> >>>
> >> >>> User can for the given channel
> >> >>>
> >> >>> * start playing a wav file in the loop. The wav files are played with
> >> >>> xfade at the ends
> >> >>>    so that user percieves it like a continuous flow.
> >> >>>
> >> >>> * stop playing a file
> >> >>>
> >> >>> * resume playback
> >> >>>
> >> >>> * set the volume for the given channel
> >> >>>
> >> >>> * set a global fade in/out time
> >> >>>
> >> >>> Also there is a python file that makes it easy to trigger the service
> >> >>> from the code. There are some test remnants of file names you can
> >> >>> substitute it with your own files.
> >> >>>
> >> >>> This combo of OSC service and python client makes it easy
> >> >>> to livecode with python.
> >> >>>
> >> >>>
> >> >>> Anton
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> >> >>> :
> >> >>> Strings are updated generally at i-time, but with special provisions
> >> >>> for perf-time.
> >> >>> ========================
> >> >>> Dr Victor Lazzarini
> >> >>> Dean of Arts, Celtic Studies and Philosophy,
> >> >>> Maynooth University,
> >> >>> Maynooth, Co Kildare, Ireland
> >> >>> Tel: 00 353 7086936
> >> >>> Fax: 00 353 1 7086952
> >> >>>
> >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> >> >>> >  wrote:
> >> >>> >
> >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> >> >>> > like I or like K.
> >> >>> > So the assignment operation works only at init time
> >> >>> > and for k-rate we should use strcpyk.
> >> >>> >
> >> >>> > Anton
> >> >>> >
> >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> >> >>> > :
> >> >>> > String assignment is i-time only. Use strcpyk
> >> >>> >
> >> >>> > gSFile strcpyk SFile
> >> >>> > ========================
> >> >>> > Dr Victor Lazzarini
> >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> >> >>> > Maynooth University,
> >> >>> > Maynooth, Co Kildare, Ireland
> >> >>> > Tel: 00 353 7086936
> >> >>> > Fax: 00 353 1 7086952
> >> >>> >
> >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> >> >>> > >  wrote:
> >> >>> > >
> >> >>> > > I'm trying to write an OSC-server with Csound.
> >> >>> > > The service should receive the name of the wav-file and the
> >> >>> > > length of crossfade.
> >> >>> > >
> >> >>> > > On receive it should stop playing any previous wavs
> >> >>> > > and start a loop that plays next wav file.
> >> >>> > > The two loops should crossfade.
> >> >>> > >
> >> >>> > > While trying to write such a thing I'm getting into trouble
> >> >>> > > with receiving String message with OSC.
> >> >>> > > I receive a string-field then assign it to a global String var.
> >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> >> >>> > > like this
> >> >>> > >
> >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> >> >>> > > ilen  filelen gSFile  1
> >> >>> > >
> >> >>> > > What can be wrong with my code?
> >> >>> > >
> >> >>> > > I attach the two files.
> >> >>> > > csd with server and python with client to test the server.
> >> >>> > > The python uses pyOSC library
> >> >>> > >
> >> >>> > > Thanks,
> >> >>> > > Anton
> >> >>> > >
> >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >>> > > be posted here 
> >> >>> >
> >> >>> > Csound mailing list
> >> >>> > Csound@listserv.heanet.ie
> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> >>> > Send bugs reports to
> >> >>> >         https://github.com/csound/csound/issues
> >> >>> > Discussions of bugs and features can be posted here
> >> >>> >
> >> >>> > Csound mailing list Csound@listserv.heanet.ie
> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >>> > be posted here
> >> >>>
> >> >>> Csound mailing list
> >> >>> Csound@listserv.heanet.ie
> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> >>> Send bugs reports to
> >> >>>         https://github.com/csound/csound/issues
> >> >>> Discussions of bugs and features can be posted here
> >> >>>
> >> >>>
> >> >>> Csound mailing list Csound@listserv.heanet.ie
> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >>> be posted here
> >> >> Csound mailing list Csound@listserv.heanet.ie
> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >> be posted here
> >> >>
> >> >> Csound mailing list Csound@listserv.heanet.ie
> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >> be posted here
> >> > Csound mailing list Csound@listserv.heanet.ie
> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> > be posted here
> >> >
> >> >
> >> >
> >> >
> >> > Csound mailing list Csound@listserv.heanet.ie
> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> > be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>         https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:28
Fromjpff
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Double frees are best identified in valgrind rather than gdb
==John ff

On Sun, 24 Jan 2016, Anton Kholomiov wrote:

> There have to be no out of bounds array assignment. Since I check the messages
> for being in the right interval.
> 
> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini :
>       I think the if-then gets translated into an i & perf time check
>       (cggoto).
>
>       But I am thinking here the crash might be to do with accessing
>       arrays out of bounds.
>       I can’t reproduce it though.
>       ========================
>       Dr Victor Lazzarini
>       Dean of Arts, Celtic Studies and Philosophy,
>       Maynooth University,
>       Maynooth, Co Kildare, Ireland
>       Tel: 00 353 7086936
>       Fax: 00 353 1 7086952
>
>       > On 23 Jan 2016, at 23:10, Steven Yi  wrote:
>       >
>       > A couple of things that may (or may not) be useful:
>       >
>       > 1. This post discusses the victim error message:
>       >
>       >
>       http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>       >
>       > 2. There is an i-time if-then used that wraps perf-time code
>       (the
>       > diskin's). Could you try:
>       >
>       >    ichan filenchnls gSFiles[iChannel]
>       >    kchan init ichan
>       >    if (kchan == 1) then
>       >
>       >
>       >
>       > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>       >  wrote:
>       >> Here is the code
>       >>
>       >> ~~~
>       >> 
>       >> 
>       >> -odac   -d
>       >> 
>       >> 
>       >>
>       >> sr = 44100
>       >> ksmps = 64
>       >> nchnls = 2
>       >> 0dbfs  = 1
>       >>
>       >> #ifndef PORT
>       >>    #define PORT        # 7700 #
>       >> #end
>       >>
>       >> #ifndef SIZE
>       >>    #define SIZE        # 8 #
>       >> #end
>       >>
>       >> gkVolume   init 1
>       >> gSFile     init ""
>       >>
>       >> gSFiles[]   init $SIZE
>       >> gkVolumes[] init $SIZE
>       >>
>       >> gaL init 0
>       >> gaR init 0
>       >>
>       >> gihandle OSCinit $PORT
>       >>
>       >> gkFadeTime init 1
>       >>
>       >> opcode FracInstr, k, ik
>       >>    iInstrNum, kChannel xin
>       >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>       >>    xout kres
>       >> endop
>       >>
>       >> instr   PlayMsg
>       >>    SFile = ""
>       >>    kVolume   init 0
>       >>    kChannel  init 0
>       >>    kk init 0
>       >>
>       >> nxtmsg:
>       >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>       >> if (kk == 0 || kChannel >= $SIZE) goto ex
>       >>    kSched FracInstr 100, kChannel
>       >>    kRun   FracInstr 80,  kChannel
>       >>
>       >>    printk 0,kSched
>       >>     printk 0,kRun
>       >>
>       >>
>       >>    turnoff2 kSched, 4, 0
>       >>    turnoff2 kRun,  4, gkFadeTime
>       >>    gSFiles[kChannel] strcpyk SFile
>       >>    event "i", kSched, 0, -1, kChannel
>       >>    kgoto nxtmsg
>       >> ex:
>       >> endin
>       >>
>       >> instr StopMsg
>       >>    kChannel  init 0
>       >>    kk init 0
>       >>
>       >> nxtmsg:
>       >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>       >> if (kk == 0 || kChannel >= $SIZE) goto ex
>       >>    kSched FracInstr 100, kChannel
>       >>    kRun   FracInstr 80,  kChannel
>       >>    turnoff2 kSched, 4, 0
>       >>    turnoff2 kRun,  4, gkFadeTime
>       >>    kgoto nxtmsg
>       >> ex:
>       >> endin
>       >>
>       >> instr ResumeMsg
>       >>    kChannel  init 0
>       >>    kk init 0
>       >>
>       >> nxtmsg:
>       >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>       >> if (kk == 0 || kChannel >= $SIZE) goto ex
>       >>    kSched FracInstr 100, kChannel
>       >>    kRun   FracInstr 80,  kChannel
>       >>    turnoff2 kSched, 4, 0
>       >>    turnoff2 kRun,  4, gkFadeTime
>       >>    event "i", kSched, 0, -1, kChannel
>       >>    kgoto nxtmsg
>       >> ex:
>       >> endin
>       >>
>       >>
>       >> instr   SetVolMsg
>       >>    kVolume   init 0
>       >>    kChannel  init 0
>       >>    kk init 0
>       >>
>       >> nxtmsg:
>       >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel,
>       kVolume
>       >> if (kk == 0 || kChannel >= $SIZE) goto ex
>       >>    gkVolumes[kChannel] = kVolume
>       >>    kgoto nxtmsg
>       >> ex:
>       >> endin
>       >>
>       >> instr   SetFadeMsg
>       >>    kFade   init 0
>       >>    kk init 0
>       >>
>       >> nxtmsg:
>       >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>       >> if (kk == 0) goto ex
>       >>    gkFadeTime = kFade
>       >>    kgoto nxtmsg
>       >> ex:
>       >> endin
>       >>
>       >> instr 80
>       >>    print p1
>       >>    idur    = p3
>       >>    iFadeTime = i(gkFadeTime)
>       >>    iChannel  = p4
>       >>    ichan filenchnls gSFiles[iChannel]
>       >>    if (ichan == 1) then
>       >>        al diskin2 gSFiles[iChannel], 1
>       >>        ar = al
>       >>    else
>       >>        al, ar diskin2 gSFiles[iChannel], 1
>       >>    endif
>       >>
>       >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>       iFadeTime, 0,
>       >> iFadeTime, 0
>       >>    kvol    port gkVolumes[iChannel], 0.05
>       >>
>       >>    gaL  = gaL + kenv * kvol * al
>       >>    gaR  = gaR + kenv * kvol * ar
>       >> endin
>       >>
>       >> instr 100
>       >>    iChannel  = p4
>       >>    iFadeTime = i(gkFadeTime)
>       >>    ilen  filelen gSFiles[iChannel]
>       >>    km    metro (1 / (ilen - iFadeTime))
>       >>    kRun FracInstr 80, iChannel
>       >>    if (km == 1)  then
>       >>        event "i", kRun, 0, ilen, iChannel
>       >>    endif
>       >> endin
>       >>
>       >> instr 110
>       >>    outs gaL, gaR
>       >>    gaL = 0
>       >>    gaR = 0
>       >> endin
>       >>
>       >> instr Init
>       >>    kCount = 0
>       >>    until (kCount == lenarray(gkVolumes)) do
>       >>        gkVolumes[kCount] = 1
>       >>        kCount = kCount + 1
>       >>    od
>       >> endin
>       >>
>       >>
>       >> 
>       >> 
>       >>
>       >> f0 1000000
>       >>
>       >> i "Init" 0 0.01
>       >>
>       >> i   "PlayMsg"    0 -1
>       >> i   "SetVolMsg"  0 -1
>       >> i   "SetFadeMsg" 0 -1
>       >> i   "StopMsg"    0 -1
>       >> i   "ResumeMsg"  0 -1
>       >>
>       >> i 110 0 -1
>       >> e
>       >> 
>       >> 
>       >> ~~~
>       >>
>       >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>       :
>       >>>
>       >>> Can you post the Csound code? I see no global arrays in your
>       earlier
>       >>> flow.csd
>       >>> ========================
>       >>> Dr Victor Lazzarini
>       >>> Dean of Arts, Celtic Studies and Philosophy,
>       >>> Maynooth University,
>       >>> Maynooth, Co Kildare, Ireland
>       >>> Tel: 00 353 7086936
>       >>> Fax: 00 353 1 7086952
>       >>>
>       >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>       
>       >>>> wrote:
>       >>>>
>       >>>> Here I'm reading the same file with diskin2 in the two
>       instances of the
>       >>>> same instrument.
>       >>>> It's triggered with fractional numbers. 80.001 and 80.005
>       >>>>
>       >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>       :
>       >>>> The last message I've sent was to set the volume on channel.
>       It assigns
>       >>>> a value to the cell of global array.
>       >>>>
>       >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>       :
>       >>>> Here is message from gdb:
>       >>>>
>       >>>> diskin2: opened '/home/anton/Seashore.wav':
>       >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>       >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>       >>>>     number of samples out of range:        2        2
>       >>>> new alloc for instr 80:
>       >>>> instr 80:  p1 = 80.005
>       >>>> diskin2: opened '/home/anton/Seashore.wav':
>       >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>       >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>       >>>>     number of samples out of range:     1315      451
>       >>>> instr 80:  p1 = 80.001
>       >>>>
>       >>>> Program received signal SIGSEGV, Segmentation fault.
>       >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>       at
>       >>>> malloc.c:4163
>       >>>> 4163    malloc.c: No such file or directory.
>       >>>> (gdb) bt
>       >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760
>       )
>       >>>>    at malloc.c:4163
>       >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>       >>>>    av=av@entry=0x7ffff76fa760 ,
>       bytes=bytes@entry=59184)
>       >>>>    at malloc.c:3423
>       >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>       >>>>    elem_size=) at malloc.c:3219
>       >>>> #3  0x00007ffff70df5f2 in sf_open ()
>       >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>       >>>> #4  0x00007ffff79cfb67 in ?? () from
>       /usr/lib/libcsound64.so.6.0
>       >>>> #5  0x00007ffff79cffc8 in ?? () from
>       /usr/lib/libcsound64.so.6.0
>       >>>> #6  0x00007ffff796ecb9 in ?? () from
>       /usr/lib/libcsound64.so.6.0
>       >>>> #7  0x00007ffff7973e40 in ?? () from
>       /usr/lib/libcsound64.so.6.0
>       >>>> #8  0x00007ffff7976502 in ?? () from
>       /usr/lib/libcsound64.so.6.0
>       >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>       >>>> /usr/lib/libcsound64.so.6.0
>       >>>> #10 0x0000000000401358 in ?? ()
>       >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>       argc=2,
>       >>>>    argv=0x7fffffffd7c8, init=, fini=       out>,
>       >>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
>       >>>> libc-start.c:287
>       >>>> #12 0x00000000004013b0 in _start ()
>       >>>>
>       >>>>
>       >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>       :
>       >>>> Thanks for the quick reply, Victor.
>       >>>> I'll report back if I encounter the problem again!
>       >>>> Though I'm not that good with gdb
>       >>>>
>       >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>       :
>       >>>> Use gdb. Are you using the csound command? Do gdb csound,
>       then
>       >>>> use the run command with the arguments you need eg
>       >>>>
>       >>>> run mycsd.csd
>       >>>>
>       >>>> when it crashes you can try using the
>       >>>> backtrace command to show where it stopped.
>       >>>>
>       >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>       
>       >>>> wrote:
>       >>>>
>       >>>>> How to do it?
>       >>>>>
>       >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>       :
>       >>>>> Can you run it under a debugger?
>       >>>>>
>       >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>       
>       >>>>> wrote:
>       >>>>>
>       >>>>>> Unfortunately after several minutes of playing the service
>       breaks
>       >>>>>> with the message
>       >>>>>>
>       >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>       >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>       >>>>>> *** Error in `csound': double free or corruption (out):
>       >>>>>> 0x00000000014bfd70 ***
>       >>>>>> Csound tidy up: Aborted
>       >>>>>>
>       >>>>>> Any ideas?
>       >>>>>>
>       >>>>>>
>       >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>       :
>       >>>>>> It's done. Just in case if anyone interested in the end
>       result.
>       >>>>>> I post a code for service. It can play continuously wav
>       files
>       >>>>>> on several channels. Channels are identified by numbers.
>       >>>>>>
>       >>>>>> User can for the given channel
>       >>>>>>
>       >>>>>> * start playing a wav file in the loop. The wav files are
>       played with
>       >>>>>> xfade at the ends
>       >>>>>>   so that user percieves it like a continuous flow.
>       >>>>>>
>       >>>>>> * stop playing a file
>       >>>>>>
>       >>>>>> * resume playback
>       >>>>>>
>       >>>>>> * set the volume for the given channel
>       >>>>>>
>       >>>>>> * set a global fade in/out time
>       >>>>>>
>       >>>>>> Also there is a python file that makes it easy to trigger
>       the service
>       >>>>>> from the code. There are some test remnants of file names
>       you can
>       >>>>>> substitute it with your own files.
>       >>>>>>
>       >>>>>> This combo of OSC service and python client makes it easy
>       >>>>>> to livecode with python.
>       >>>>>>
>       >>>>>>
>       >>>>>> Anton
>       >>>>>>
>       >>>>>>
>       >>>>>>
>       >>>>>>
>       >>>>>>
>       >>>>>>
>       >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>       >>>>>> :
>       >>>>>> Strings are updated generally at i-time, but with special
>       provisions
>       >>>>>> for perf-time.
>       >>>>>> ========================
>       >>>>>> Dr Victor Lazzarini
>       >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>       >>>>>> Maynooth University,
>       >>>>>> Maynooth, Co Kildare, Ireland
>       >>>>>> Tel: 00 353 7086936
>       >>>>>> Fax: 00 353 1 7086952
>       >>>>>>
>       >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>       >>>>>>>  wrote:
>       >>>>>>>
>       >>>>>>> Thank you for clarification. It was a blind spot for me is
>       S behaves
>       >>>>>>> like I or like K.
>       >>>>>>> So the assignment operation works only at init time
>       >>>>>>> and for k-rate we should use strcpyk.
>       >>>>>>>
>       >>>>>>> Anton
>       >>>>>>>
>       >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>       >>>>>>> :
>       >>>>>>> String assignment is i-time only. Use strcpyk
>       >>>>>>>
>       >>>>>>> gSFile strcpyk SFile
>       >>>>>>> ========================
>       >>>>>>> Dr Victor Lazzarini
>       >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>       >>>>>>> Maynooth University,
>       >>>>>>> Maynooth, Co Kildare, Ireland
>       >>>>>>> Tel: 00 353 7086936
>       >>>>>>> Fax: 00 353 1 7086952
>       >>>>>>>
>       >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>       >>>>>>>>  wrote:
>       >>>>>>>>
>       >>>>>>>> I'm trying to write an OSC-server with Csound.
>       >>>>>>>> The service should receive the name of the wav-file and
>       the
>       >>>>>>>> length of crossfade.
>       >>>>>>>>
>       >>>>>>>> On receive it should stop playing any previous wavs
>       >>>>>>>> and start a loop that plays next wav file.
>       >>>>>>>> The two loops should crossfade.
>       >>>>>>>>
>       >>>>>>>> While trying to write such a thing I'm getting into
>       trouble
>       >>>>>>>> with receiving String message with OSC.
>       >>>>>>>> I receive a string-field then assign it to a global
>       String var.
>       >>>>>>>> But when I try to use it with diskin2 or filelen I get
>       INIT errors
>       >>>>>>>> like this
>       >>>>>>>>
>       >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>       >>>>>>>> ilen  filelen gSFile  1
>       >>>>>>>>
>       >>>>>>>> What can be wrong with my code?
>       >>>>>>>>
>       >>>>>>>> I attach the two files.
>       >>>>>>>> csd with server and python with client to test the
>       server.
>       >>>>>>>> The python uses pyOSC library
>       >>>>>>>>
>       >>>>>>>> Thanks,
>       >>>>>>>> Anton
>       >>>>>>>>
>       >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>>>>>> https://github.com/csound/csound/issues Discussions of
>       bugs and features can
>       >>>>>>>> be posted here 
>       >>>>>>>
>       >>>>>>> Csound mailing list
>       >>>>>>> Csound@listserv.heanet.ie
>       >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       >>>>>>> Send bugs reports to
>       >>>>>>>        https://github.com/csound/csound/issues
>       >>>>>>> Discussions of bugs and features can be posted here
>       >>>>>>>
>       >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>>>>> https://github.com/csound/csound/issues Discussions of
>       bugs and features can
>       >>>>>>> be posted here
>       >>>>>>
>       >>>>>> Csound mailing list
>       >>>>>> Csound@listserv.heanet.ie
>       >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       >>>>>> Send bugs reports to
>       >>>>>>        https://github.com/csound/csound/issues
>       >>>>>> Discussions of bugs and features can be posted here
>       >>>>>>
>       >>>>>>
>       >>>>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>>>> https://github.com/csound/csound/issues Discussions of bugs
>       and features can
>       >>>>>> be posted here
>       >>>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>>> https://github.com/csound/csound/issues Discussions of bugs
>       and features can
>       >>>>> be posted here
>       >>>>>
>       >>>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>>> https://github.com/csound/csound/issues Discussions of bugs
>       and features can
>       >>>>> be posted here
>       >>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>> https://github.com/csound/csound/issues Discussions of bugs
>       and features can
>       >>>> be posted here
>       >>>>
>       >>>>
>       >>>>
>       >>>>
>       >>>> Csound mailing list Csound@listserv.heanet.ie
>       >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >>>> https://github.com/csound/csound/issues Discussions of bugs
>       and features can
>       >>>> be posted here
>       >>>
>       >>> Csound mailing list
>       >>> Csound@listserv.heanet.ie
>       >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       >>> Send bugs reports to
>       >>>        https://github.com/csound/csound/issues
>       >>> Discussions of bugs and features can be posted here
>       >>
>       >>
>       >> Csound mailing list Csound@listserv.heanet.ie
>       >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>       reports to
>       >> https://github.com/csound/csound/issues Discussions of bugs and
>       features can
>       >> be posted here
>       >
>       > Csound mailing list
>       > Csound@listserv.heanet.ie
>       > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       > Send bugs reports to
>       >        https://github.com/csound/csound/issues
>       > Discussions of bugs and features can be posted here
>
>       Csound mailing list
>       Csound@listserv.heanet.ie
>       https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       Send bugs reports to
>               https://github.com/csound/csound/issues
>       Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:30
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I think

if i-expr then  => cggoto
if k-expr then => ckgoto

That’s why the second does not work.

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:23, Steven Yi  wrote:
> 
> Interesting, that's the opposite of what I was expecting. I guess I
> need to review what's happening there.  I had thought that maybe both
> diskin's were getting used somehow in the i-rate if-then.  Anyways,
> can cross that idea off.
> 
> Trying separate instruments for mono and stereo could be interesting
> to have more information.
> 
> 
> 
> On Sat, Jan 23, 2016 at 6:16 PM, Anton Kholomiov
>  wrote:
>> @Steven Then I get
>> 
>> Maybe it's better to create two separate instruments for mono and stereo
>> diskins
>> 
>> ~~~
>> INIT ERROR in instr 80: diskin2: number of output args inconsistent with
>> number of file channels
>> ~~~
>> 
>> 
>> 2016-01-24 2:10 GMT+03:00 Steven Yi :
>>> 
>>> A couple of things that may (or may not) be useful:
>>> 
>>> 1. This post discusses the victim error message:
>>> 
>>> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>>> 
>>> 2. There is an i-time if-then used that wraps perf-time code (the
>>> diskin's). Could you try:
>>> 
>>>    ichan filenchnls gSFiles[iChannel]
>>>    kchan init ichan
>>>    if (kchan == 1) then
>>> 
>>> 
>>> 
>>> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>>>  wrote:
>>>> Here is the code
>>>> 
>>>> ~~~
>>>> 
>>>> 
>>>> -odac   -d
>>>> 
>>>> 
>>>> 
>>>> sr = 44100
>>>> ksmps = 64
>>>> nchnls = 2
>>>> 0dbfs  = 1
>>>> 
>>>> #ifndef PORT
>>>>    #define PORT        # 7700 #
>>>> #end
>>>> 
>>>> #ifndef SIZE
>>>>    #define SIZE        # 8 #
>>>> #end
>>>> 
>>>> gkVolume   init 1
>>>> gSFile     init ""
>>>> 
>>>> gSFiles[]   init $SIZE
>>>> gkVolumes[] init $SIZE
>>>> 
>>>> gaL init 0
>>>> gaR init 0
>>>> 
>>>> gihandle OSCinit $PORT
>>>> 
>>>> gkFadeTime init 1
>>>> 
>>>> opcode FracInstr, k, ik
>>>>    iInstrNum, kChannel xin
>>>>    kres = iInstrNum + ((kChannel + 1) / 1000)
>>>>    xout kres
>>>> endop
>>>> 
>>>> instr   PlayMsg
>>>>    SFile = ""
>>>>    kVolume   init 0
>>>>    kChannel  init 0
>>>>    kk init 0
>>>> 
>>>> nxtmsg:
>>>>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>    kSched FracInstr 100, kChannel
>>>>    kRun   FracInstr 80,  kChannel
>>>> 
>>>>    printk 0,kSched
>>>>     printk 0,kRun
>>>> 
>>>> 
>>>>    turnoff2 kSched, 4, 0
>>>>    turnoff2 kRun,  4, gkFadeTime
>>>>    gSFiles[kChannel] strcpyk SFile
>>>>    event "i", kSched, 0, -1, kChannel
>>>>    kgoto nxtmsg
>>>> ex:
>>>> endin
>>>> 
>>>> instr StopMsg
>>>>    kChannel  init 0
>>>>    kk init 0
>>>> 
>>>> nxtmsg:
>>>>    kk  OSClisten gihandle, "/stop", "i", kChannel
>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>    kSched FracInstr 100, kChannel
>>>>    kRun   FracInstr 80,  kChannel
>>>>    turnoff2 kSched, 4, 0
>>>>    turnoff2 kRun,  4, gkFadeTime
>>>>    kgoto nxtmsg
>>>> ex:
>>>> endin
>>>> 
>>>> instr ResumeMsg
>>>>    kChannel  init 0
>>>>    kk init 0
>>>> 
>>>> nxtmsg:
>>>>    kk  OSClisten gihandle, "/resume", "i", kChannel
>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>    kSched FracInstr 100, kChannel
>>>>    kRun   FracInstr 80,  kChannel
>>>>    turnoff2 kSched, 4, 0
>>>>    turnoff2 kRun,  4, gkFadeTime
>>>>    event "i", kSched, 0, -1, kChannel
>>>>    kgoto nxtmsg
>>>> ex:
>>>> endin
>>>> 
>>>> 
>>>> instr   SetVolMsg
>>>>    kVolume   init 0
>>>>    kChannel  init 0
>>>>    kk init 0
>>>> 
>>>> nxtmsg:
>>>>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>    gkVolumes[kChannel] = kVolume
>>>>    kgoto nxtmsg
>>>> ex:
>>>> endin
>>>> 
>>>> instr   SetFadeMsg
>>>>    kFade   init 0
>>>>    kk init 0
>>>> 
>>>> nxtmsg:
>>>>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>>>> if (kk == 0) goto ex
>>>>    gkFadeTime = kFade
>>>>    kgoto nxtmsg
>>>> ex:
>>>> endin
>>>> 
>>>> instr 80
>>>>    print p1
>>>>    idur    = p3
>>>>    iFadeTime = i(gkFadeTime)
>>>>    iChannel  = p4
>>>>    ichan filenchnls gSFiles[iChannel]
>>>>    if (ichan == 1) then
>>>>        al diskin2 gSFiles[iChannel], 1
>>>>        ar = al
>>>>    else
>>>>        al, ar diskin2 gSFiles[iChannel], 1
>>>>    endif
>>>> 
>>>>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime,
>>>> 0,
>>>> iFadeTime, 0
>>>>    kvol    port gkVolumes[iChannel], 0.05
>>>> 
>>>>    gaL  = gaL + kenv * kvol * al
>>>>    gaR  = gaR + kenv * kvol * ar
>>>> endin
>>>> 
>>>> instr 100
>>>>    iChannel  = p4
>>>>    iFadeTime = i(gkFadeTime)
>>>>    ilen  filelen gSFiles[iChannel]
>>>>    km    metro (1 / (ilen - iFadeTime))
>>>>    kRun FracInstr 80, iChannel
>>>>    if (km == 1)  then
>>>>        event "i", kRun, 0, ilen, iChannel
>>>>    endif
>>>> endin
>>>> 
>>>> instr 110
>>>>    outs gaL, gaR
>>>>    gaL = 0
>>>>    gaR = 0
>>>> endin
>>>> 
>>>> instr Init
>>>>    kCount = 0
>>>>    until (kCount == lenarray(gkVolumes)) do
>>>>        gkVolumes[kCount] = 1
>>>>        kCount = kCount + 1
>>>>    od
>>>> endin
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> f0 1000000
>>>> 
>>>> i "Init" 0 0.01
>>>> 
>>>> i   "PlayMsg"    0 -1
>>>> i   "SetVolMsg"  0 -1
>>>> i   "SetFadeMsg" 0 -1
>>>> i   "StopMsg"    0 -1
>>>> i   "ResumeMsg"  0 -1
>>>> 
>>>> i 110 0 -1
>>>> e
>>>> 
>>>> 
>>>> ~~~
>>>> 
>>>> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
>>>>> 
>>>>> Can you post the Csound code? I see no global arrays in your earlier
>>>>> flow.csd
>>>>> ========================
>>>>> Dr Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>> 
>>>>>> On 23 Jan 2016, at 22:36, Anton Kholomiov 
>>>>>> wrote:
>>>>>> 
>>>>>> Here I'm reading the same file with diskin2 in the two instances of
>>>>>> the
>>>>>> same instrument.
>>>>>> It's triggered with fractional numbers. 80.001 and 80.005
>>>>>> 
>>>>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>>>>>> :
>>>>>> The last message I've sent was to set the volume on channel. It
>>>>>> assigns
>>>>>> a value to the cell of global array.
>>>>>> 
>>>>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>>>>>> :
>>>>>> Here is message from gdb:
>>>>>> 
>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>>>>>>     number of samples out of range:        2        2
>>>>>> new alloc for instr 80:
>>>>>> instr 80:  p1 = 80.005
>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>>>>>>     number of samples out of range:     1315      451
>>>>>> instr 80:  p1 = 80.001
>>>>>> 
>>>>>> Program received signal SIGSEGV, Segmentation fault.
>>>>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>>>>>> malloc.c:4163
>>>>>> 4163    malloc.c: No such file or directory.
>>>>>> (gdb) bt
>>>>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>>>>>>    at malloc.c:4163
>>>>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>>>>>>    av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>>>>>>    at malloc.c:3423
>>>>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>>>>>>    elem_size=) at malloc.c:3219
>>>>>> #3  0x00007ffff70df5f2 in sf_open ()
>>>>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>>>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>>>>>> /usr/lib/libcsound64.so.6.0
>>>>>> #10 0x0000000000401358 in ?? ()
>>>>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>>>>>>    argv=0x7fffffffd7c8, init=, fini=,
>>>>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
>>>>>> libc-start.c:287
>>>>>> #12 0x00000000004013b0 in _start ()
>>>>>> 
>>>>>> 
>>>>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>>>>>> :
>>>>>> Thanks for the quick reply, Victor.
>>>>>> I'll report back if I encounter the problem again!
>>>>>> Though I'm not that good with gdb
>>>>>> 
>>>>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>>>>>> :
>>>>>> Use gdb. Are you using the csound command? Do gdb csound, then
>>>>>> use the run command with the arguments you need eg
>>>>>> 
>>>>>> run mycsd.csd
>>>>>> 
>>>>>> when it crashes you can try using the
>>>>>> backtrace command to show where it stopped.
>>>>>> 
>>>>>> On 23 Jan 2016, at 22:07, Anton Kholomiov 
>>>>>> wrote:
>>>>>> 
>>>>>>> How to do it?
>>>>>>> 
>>>>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>>>>>>> :
>>>>>>> Can you run it under a debugger?
>>>>>>> 
>>>>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>>>>>>> 
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> Unfortunately after several minutes of playing the service breaks
>>>>>>>> with the message
>>>>>>>> 
>>>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>> *** Error in `csound': double free or corruption (out):
>>>>>>>> 0x00000000014bfd70 ***
>>>>>>>> Csound tidy up: Aborted
>>>>>>>> 
>>>>>>>> Any ideas?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>>>>>>>> :
>>>>>>>> It's done. Just in case if anyone interested in the end result.
>>>>>>>> I post a code for service. It can play continuously wav files
>>>>>>>> on several channels. Channels are identified by numbers.
>>>>>>>> 
>>>>>>>> User can for the given channel
>>>>>>>> 
>>>>>>>> * start playing a wav file in the loop. The wav files are played
>>>>>>>> with
>>>>>>>> xfade at the ends
>>>>>>>>   so that user percieves it like a continuous flow.
>>>>>>>> 
>>>>>>>> * stop playing a file
>>>>>>>> 
>>>>>>>> * resume playback
>>>>>>>> 
>>>>>>>> * set the volume for the given channel
>>>>>>>> 
>>>>>>>> * set a global fade in/out time
>>>>>>>> 
>>>>>>>> Also there is a python file that makes it easy to trigger the
>>>>>>>> service
>>>>>>>> from the code. There are some test remnants of file names you can
>>>>>>>> substitute it with your own files.
>>>>>>>> 
>>>>>>>> This combo of OSC service and python client makes it easy
>>>>>>>> to livecode with python.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Anton
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>>>>>>>> :
>>>>>>>> Strings are updated generally at i-time, but with special
>>>>>>>> provisions
>>>>>>>> for perf-time.
>>>>>>>> ========================
>>>>>>>> Dr Victor Lazzarini
>>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>>> Maynooth University,
>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>> Tel: 00 353 7086936
>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>> 
>>>>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>>>>>>>>>  wrote:
>>>>>>>>> 
>>>>>>>>> Thank you for clarification. It was a blind spot for me is S
>>>>>>>>> behaves
>>>>>>>>> like I or like K.
>>>>>>>>> So the assignment operation works only at init time
>>>>>>>>> and for k-rate we should use strcpyk.
>>>>>>>>> 
>>>>>>>>> Anton
>>>>>>>>> 
>>>>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>>>>>>>>> :
>>>>>>>>> String assignment is i-time only. Use strcpyk
>>>>>>>>> 
>>>>>>>>> gSFile strcpyk SFile
>>>>>>>>> ========================
>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>>>> Maynooth University,
>>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>>> Tel: 00 353 7086936
>>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>> 
>>>>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>>>>>>>>>>  wrote:
>>>>>>>>>> 
>>>>>>>>>> I'm trying to write an OSC-server with Csound.
>>>>>>>>>> The service should receive the name of the wav-file and the
>>>>>>>>>> length of crossfade.
>>>>>>>>>> 
>>>>>>>>>> On receive it should stop playing any previous wavs
>>>>>>>>>> and start a loop that plays next wav file.
>>>>>>>>>> The two loops should crossfade.
>>>>>>>>>> 
>>>>>>>>>> While trying to write such a thing I'm getting into trouble
>>>>>>>>>> with receiving String message with OSC.
>>>>>>>>>> I receive a string-field then assign it to a global String var.
>>>>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>>>>>>>>>> errors
>>>>>>>>>> like this
>>>>>>>>>> 
>>>>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>>>>>>>>>> ilen  filelen gSFile  1
>>>>>>>>>> 
>>>>>>>>>> What can be wrong with my code?
>>>>>>>>>> 
>>>>>>>>>> I attach the two files.
>>>>>>>>>> csd with server and python with client to test the server.
>>>>>>>>>> The python uses pyOSC library
>>>>>>>>>> 
>>>>>>>>>> Thanks,
>>>>>>>>>> Anton
>>>>>>>>>> 
>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>>>> reports to
>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>> features can
>>>>>>>>>> be posted here 
>>>>>>>>> 
>>>>>>>>> Csound mailing list
>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>>> Send bugs reports to
>>>>>>>>>        https://github.com/csound/csound/issues
>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>> 
>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>>>>>>>> to
>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>> features can
>>>>>>>>> be posted here
>>>>>>>> 
>>>>>>>> Csound mailing list
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>> Send bugs reports to
>>>>>>>>        https://github.com/csound/csound/issues
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>>>>>>> to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>> features can
>>>>>>>> be posted here
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>> features can
>>>>>>> be posted here
>>>>>>> 
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>> features can
>>>>>>> be posted here
>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>> features can
>>>>>> be posted here
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>> features can
>>>>>> be posted here
>>>>> 
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>        https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>> 
>>>> 
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>> can
>>>> be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>> 
>> 
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:30
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Oh know it's not related. It can happen after any message.
It can happen without any message being sent

It takes 5 to 15 minute to crash but time can pass quicker if you have good samples ) 

2016-01-24 2:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I mean in the instrument that receives the set_volume message (if that is how you made it crash),
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 23:20, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
> @Victor
>
> It takes 5 to 15 minutes....
> It takes some time to make it crash. Thank you for the help
> I'll try it tomorrow.
>
> Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
>
> 2016-01-24 2:16 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Steven Then I get
>
> Maybe it's better to create two separate instruments for mono and stereo diskins
>
> ~~~
> INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> ~~~
>
>
> 2016-01-24 2:10 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> A couple of things that may (or may not) be useful:
>
> 1. This post discusses the victim error message:
>
> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>
> 2. There is an i-time if-then used that wraps perf-time code (the
> diskin's). Could you try:
>
>     ichan filenchnls gSFiles[iChannel]
>     kchan init ichan
>     if (kchan == 1) then
>
>
>
> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> <anton.kholomiov@gmail.com> wrote:
> > Here is the code
> >
> > ~~~
> > <CsoundSynthesizer>
> > <CsOptions>
> > -odac   -d
> > </CsOptions>
> > <CsInstruments>
> >
> > sr = 44100
> > ksmps = 64
> > nchnls = 2
> > 0dbfs  = 1
> >
> > #ifndef PORT
> >     #define PORT        # 7700 #
> > #end
> >
> > #ifndef SIZE
> >     #define SIZE        # 8 #
> > #end
> >
> > gkVolume   init 1
> > gSFile     init ""
> >
> > gSFiles[]   init $SIZE
> > gkVolumes[] init $SIZE
> >
> > gaL init 0
> > gaR init 0
> >
> > gihandle OSCinit $PORT
> >
> > gkFadeTime init 1
> >
> > opcode FracInstr, k, ik
> >     iInstrNum, kChannel xin
> >     kres = iInstrNum + ((kChannel + 1) / 1000)
> >     xout kres
> > endop
> >
> > instr   PlayMsg
> >     SFile = ""
> >     kVolume   init 0
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     kSched FracInstr 100, kChannel
> >     kRun   FracInstr 80,  kChannel
> >
> >     printk 0,kSched
> >      printk 0,kRun
> >
> >
> >     turnoff2 kSched, 4, 0
> >     turnoff2 kRun,  4, gkFadeTime
> >     gSFiles[kChannel] strcpyk SFile
> >     event "i", kSched, 0, -1, kChannel
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr StopMsg
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     kSched FracInstr 100, kChannel
> >     kRun   FracInstr 80,  kChannel
> >     turnoff2 kSched, 4, 0
> >     turnoff2 kRun,  4, gkFadeTime
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr ResumeMsg
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     kSched FracInstr 100, kChannel
> >     kRun   FracInstr 80,  kChannel
> >     turnoff2 kSched, 4, 0
> >     turnoff2 kRun,  4, gkFadeTime
> >     event "i", kSched, 0, -1, kChannel
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> >
> > instr   SetVolMsg
> >     kVolume   init 0
> >     kChannel  init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > if (kk == 0 || kChannel >= $SIZE) goto ex
> >     gkVolumes[kChannel] = kVolume
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr   SetFadeMsg
> >     kFade   init 0
> >     kk init 0
> >
> > nxtmsg:
> >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > if (kk == 0) goto ex
> >     gkFadeTime = kFade
> >     kgoto nxtmsg
> > ex:
> > endin
> >
> > instr 80
> >     print p1
> >     idur    = p3
> >     iFadeTime = i(gkFadeTime)
> >     iChannel  = p4
> >     ichan filenchnls gSFiles[iChannel]
> >     if (ichan == 1) then
> >         al diskin2 gSFiles[iChannel], 1
> >         ar = al
> >     else
> >         al, ar diskin2 gSFiles[iChannel], 1
> >     endif
> >
> >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > iFadeTime, 0
> >     kvol    port gkVolumes[iChannel], 0.05
> >
> >     gaL  = gaL + kenv * kvol * al
> >     gaR  = gaR + kenv * kvol * ar
> > endin
> >
> > instr 100
> >     iChannel  = p4
> >     iFadeTime = i(gkFadeTime)
> >     ilen  filelen gSFiles[iChannel]
> >     km    metro (1 / (ilen - iFadeTime))
> >     kRun FracInstr 80, iChannel
> >     if (km == 1)  then
> >         event "i", kRun, 0, ilen, iChannel
> >     endif
> > endin
> >
> > instr 110
> >     outs gaL, gaR
> >     gaL = 0
> >     gaR = 0
> > endin
> >
> > instr Init
> >     kCount = 0
> >     until (kCount == lenarray(gkVolumes)) do
> >         gkVolumes[kCount] = 1
> >         kCount = kCount + 1
> >     od
> > endin
> >
> >
> > </CsInstruments>
> > <CsScore>
> >
> > f0 1000000
> >
> > i "Init" 0 0.01
> >
> > i   "PlayMsg"    0 -1
> > i   "SetVolMsg"  0 -1
> > i   "SetFadeMsg" 0 -1
> > i   "StopMsg"    0 -1
> > i   "ResumeMsg"  0 -1
> >
> > i 110 0 -1
> > e
> > </CsScore>
> > </CsoundSynthesizer>
> > ~~~
> >
> > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>
> >> Can you post the Csound code? I see no global arrays in your earlier
> >> flow.csd
> >> ========================
> >> Dr Victor Lazzarini
> >> Dean of Arts, Celtic Studies and Philosophy,
> >> Maynooth University,
> >> Maynooth, Co Kildare, Ireland
> >> Tel: 00 353 7086936
> >> Fax: 00 353 1 7086952
> >>
> >> > On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
> >> > wrote:
> >> >
> >> > Here I'm reading the same file with diskin2 in the two instances of the
> >> > same instrument.
> >> > It's triggered with fractional numbers. 80.001 and 80.005
> >> >
> >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> >> > The last message I've sent was to set the volume on channel. It assigns
> >> > a value to the cell of global array.
> >> >
> >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> >> > Here is message from gdb:
> >> >
> >> > diskin2: opened '/home/anton/Seashore.wav':
> >> >          44100 Hz, 2 channel(s), 546731 sample frames
> >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> >> >      number of samples out of range:        2        2
> >> > new alloc for instr 80:
> >> > instr 80:  p1 = 80.005
> >> > diskin2: opened '/home/anton/Seashore.wav':
> >> >          44100 Hz, 2 channel(s), 546731 sample frames
> >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> >> >      number of samples out of range:     1315      451
> >> > instr 80:  p1 = 80.001
> >> >
> >> > Program received signal SIGSEGV, Segmentation fault.
> >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
> >> > malloc.c:4163
> >> > 4163    malloc.c: No such file or directory.
> >> > (gdb) bt
> >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
> >> >     at malloc.c:4163
> >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> >> >     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
> >> >     at malloc.c:3423
> >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
> >> >     elem_size=<optimized out>) at malloc.c:3219
> >> > #3  0x00007ffff70df5f2 in sf_open ()
> >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> >> > /usr/lib/libcsound64.so.6.0
> >> > #10 0x0000000000401358 in ?? ()
> >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> >> >     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
> >> >     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
> >> > libc-start.c:287
> >> > #12 0x00000000004013b0 in _start ()
> >> >
> >> >
> >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> >> > Thanks for the quick reply, Victor.
> >> > I'll report back if I encounter the problem again!
> >> > Though I'm not that good with gdb
> >> >
> >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >> > Use gdb. Are you using the csound command? Do gdb csound, then
> >> > use the run command with the arguments you need eg
> >> >
> >> > run mycsd.csd
> >> >
> >> > when it crashes you can try using the
> >> > backtrace command to show where it stopped.
> >> >
> >> > On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
> >> > wrote:
> >> >
> >> >> How to do it?
> >> >>
> >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >> >> Can you run it under a debugger?
> >> >>
> >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
> >> >> wrote:
> >> >>
> >> >>> Unfortunately after several minutes of playing the service breaks
> >> >>> with the message
> >> >>>
> >> >>> diskin2: opened '/home/anton/Seashore.wav':
> >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> >> >>> *** Error in `csound': double free or corruption (out):
> >> >>> 0x00000000014bfd70 ***
> >> >>> Csound tidy up: Aborted
> >> >>>
> >> >>> Any ideas?
> >> >>>
> >> >>>
> >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> >> >>> It's done. Just in case if anyone interested in the end result.
> >> >>> I post a code for service. It can play continuously wav files
> >> >>> on several channels. Channels are identified by numbers.
> >> >>>
> >> >>> User can for the given channel
> >> >>>
> >> >>> * start playing a wav file in the loop. The wav files are played with
> >> >>> xfade at the ends
> >> >>>    so that user percieves it like a continuous flow.
> >> >>>
> >> >>> * stop playing a file
> >> >>>
> >> >>> * resume playback
> >> >>>
> >> >>> * set the volume for the given channel
> >> >>>
> >> >>> * set a global fade in/out time
> >> >>>
> >> >>> Also there is a python file that makes it easy to trigger the service
> >> >>> from the code. There are some test remnants of file names you can
> >> >>> substitute it with your own files.
> >> >>>
> >> >>> This combo of OSC service and python client makes it easy
> >> >>> to livecode with python.
> >> >>>
> >> >>>
> >> >>> Anton
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> >> >>> <Victor.Lazzarini@nuim.ie>:
> >> >>> Strings are updated generally at i-time, but with special provisions
> >> >>> for perf-time.
> >> >>> ========================
> >> >>> Dr Victor Lazzarini
> >> >>> Dean of Arts, Celtic Studies and Philosophy,
> >> >>> Maynooth University,
> >> >>> Maynooth, Co Kildare, Ireland
> >> >>> Tel: 00 353 7086936
> >> >>> Fax: 00 353 1 7086952
> >> >>>
> >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> >> >>> > <anton.kholomiov@gmail.com> wrote:
> >> >>> >
> >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> >> >>> > like I or like K.
> >> >>> > So the assignment operation works only at init time
> >> >>> > and for k-rate we should use strcpyk.
> >> >>> >
> >> >>> > Anton
> >> >>> >
> >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> >> >>> > <Victor.Lazzarini@nuim.ie>:
> >> >>> > String assignment is i-time only. Use strcpyk
> >> >>> >
> >> >>> > gSFile strcpyk SFile
> >> >>> > ========================
> >> >>> > Dr Victor Lazzarini
> >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> >> >>> > Maynooth University,
> >> >>> > Maynooth, Co Kildare, Ireland
> >> >>> > Tel: 00 353 7086936
> >> >>> > Fax: 00 353 1 7086952
> >> >>> >
> >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> >> >>> > > <anton.kholomiov@GMAIL.COM> wrote:
> >> >>> > >
> >> >>> > > I'm trying to write an OSC-server with Csound.
> >> >>> > > The service should receive the name of the wav-file and the
> >> >>> > > length of crossfade.
> >> >>> > >
> >> >>> > > On receive it should stop playing any previous wavs
> >> >>> > > and start a loop that plays next wav file.
> >> >>> > > The two loops should crossfade.
> >> >>> > >
> >> >>> > > While trying to write such a thing I'm getting into trouble
> >> >>> > > with receiving String message with OSC.
> >> >>> > > I receive a string-field then assign it to a global String var.
> >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> >> >>> > > like this
> >> >>> > >
> >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> >> >>> > > ilen  filelen gSFile  1
> >> >>> > >
> >> >>> > > What can be wrong with my code?
> >> >>> > >
> >> >>> > > I attach the two files.
> >> >>> > > csd with server and python with client to test the server.
> >> >>> > > The python uses pyOSC library
> >> >>> > >
> >> >>> > > Thanks,
> >> >>> > > Anton
> >> >>> > >
> >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >>> > > be posted here <flow.csd><test_flow.py>
> >> >>> >
> >> >>> > Csound mailing list
> >> >>> > Csound@listserv.heanet.ie
> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> >>> > Send bugs reports to
> >> >>> >         https://github.com/csound/csound/issues
> >> >>> > Discussions of bugs and features can be posted here
> >> >>> >
> >> >>> > Csound mailing list Csound@listserv.heanet.ie
> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >>> > be posted here
> >> >>>
> >> >>> Csound mailing list
> >> >>> Csound@listserv.heanet.ie
> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> >>> Send bugs reports to
> >> >>>         https://github.com/csound/csound/issues
> >> >>> Discussions of bugs and features can be posted here
> >> >>>
> >> >>>
> >> >>> Csound mailing list Csound@listserv.heanet.ie
> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >>> be posted here
> >> >> Csound mailing list Csound@listserv.heanet.ie
> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >> be posted here
> >> >>
> >> >> Csound mailing list Csound@listserv.heanet.ie
> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> >> be posted here
> >> > Csound mailing list Csound@listserv.heanet.ie
> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> > be posted here
> >> >
> >> >
> >> >
> >> >
> >> > Csound mailing list Csound@listserv.heanet.ie
> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> >> > be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>         https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:33
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
It does not check if it is below 0. (but Csound does. I get a warning if I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:25, Anton Kholomiov  wrote:
> 
> There have to be no out of bounds array assignment. Since I check the messages for being in the right interval.
> 
> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini :
> I think the if-then gets translated into an i & perf time check (cggoto).
> 
> But I am thinking here the crash might be to do with accessing arrays out of bounds.
> I can’t reproduce it though.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 23 Jan 2016, at 23:10, Steven Yi  wrote:
> >
> > A couple of things that may (or may not) be useful:
> >
> > 1. This post discusses the victim error message:
> >
> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> >
> > 2. There is an i-time if-then used that wraps perf-time code (the
> > diskin's). Could you try:
> >
> >    ichan filenchnls gSFiles[iChannel]
> >    kchan init ichan
> >    if (kchan == 1) then
> >
> >
> >
> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> >  wrote:
> >> Here is the code
> >>
> >> ~~~
> >> 
> >> 
> >> -odac   -d
> >> 
> >> 
> >>
> >> sr = 44100
> >> ksmps = 64
> >> nchnls = 2
> >> 0dbfs  = 1
> >>
> >> #ifndef PORT
> >>    #define PORT        # 7700 #
> >> #end
> >>
> >> #ifndef SIZE
> >>    #define SIZE        # 8 #
> >> #end
> >>
> >> gkVolume   init 1
> >> gSFile     init ""
> >>
> >> gSFiles[]   init $SIZE
> >> gkVolumes[] init $SIZE
> >>
> >> gaL init 0
> >> gaR init 0
> >>
> >> gihandle OSCinit $PORT
> >>
> >> gkFadeTime init 1
> >>
> >> opcode FracInstr, k, ik
> >>    iInstrNum, kChannel xin
> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
> >>    xout kres
> >> endop
> >>
> >> instr   PlayMsg
> >>    SFile = ""
> >>    kVolume   init 0
> >>    kChannel  init 0
> >>    kk init 0
> >>
> >> nxtmsg:
> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> >> if (kk == 0 || kChannel >= $SIZE) goto ex
> >>    kSched FracInstr 100, kChannel
> >>    kRun   FracInstr 80,  kChannel
> >>
> >>    printk 0,kSched
> >>     printk 0,kRun
> >>
> >>
> >>    turnoff2 kSched, 4, 0
> >>    turnoff2 kRun,  4, gkFadeTime
> >>    gSFiles[kChannel] strcpyk SFile
> >>    event "i", kSched, 0, -1, kChannel
> >>    kgoto nxtmsg
> >> ex:
> >> endin
> >>
> >> instr StopMsg
> >>    kChannel  init 0
> >>    kk init 0
> >>
> >> nxtmsg:
> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
> >> if (kk == 0 || kChannel >= $SIZE) goto ex
> >>    kSched FracInstr 100, kChannel
> >>    kRun   FracInstr 80,  kChannel
> >>    turnoff2 kSched, 4, 0
> >>    turnoff2 kRun,  4, gkFadeTime
> >>    kgoto nxtmsg
> >> ex:
> >> endin
> >>
> >> instr ResumeMsg
> >>    kChannel  init 0
> >>    kk init 0
> >>
> >> nxtmsg:
> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
> >> if (kk == 0 || kChannel >= $SIZE) goto ex
> >>    kSched FracInstr 100, kChannel
> >>    kRun   FracInstr 80,  kChannel
> >>    turnoff2 kSched, 4, 0
> >>    turnoff2 kRun,  4, gkFadeTime
> >>    event "i", kSched, 0, -1, kChannel
> >>    kgoto nxtmsg
> >> ex:
> >> endin
> >>
> >>
> >> instr   SetVolMsg
> >>    kVolume   init 0
> >>    kChannel  init 0
> >>    kk init 0
> >>
> >> nxtmsg:
> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> >> if (kk == 0 || kChannel >= $SIZE) goto ex
> >>    gkVolumes[kChannel] = kVolume
> >>    kgoto nxtmsg
> >> ex:
> >> endin
> >>
> >> instr   SetFadeMsg
> >>    kFade   init 0
> >>    kk init 0
> >>
> >> nxtmsg:
> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
> >> if (kk == 0) goto ex
> >>    gkFadeTime = kFade
> >>    kgoto nxtmsg
> >> ex:
> >> endin
> >>
> >> instr 80
> >>    print p1
> >>    idur    = p3
> >>    iFadeTime = i(gkFadeTime)
> >>    iChannel  = p4
> >>    ichan filenchnls gSFiles[iChannel]
> >>    if (ichan == 1) then
> >>        al diskin2 gSFiles[iChannel], 1
> >>        ar = al
> >>    else
> >>        al, ar diskin2 gSFiles[iChannel], 1
> >>    endif
> >>
> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> >> iFadeTime, 0
> >>    kvol    port gkVolumes[iChannel], 0.05
> >>
> >>    gaL  = gaL + kenv * kvol * al
> >>    gaR  = gaR + kenv * kvol * ar
> >> endin
> >>
> >> instr 100
> >>    iChannel  = p4
> >>    iFadeTime = i(gkFadeTime)
> >>    ilen  filelen gSFiles[iChannel]
> >>    km    metro (1 / (ilen - iFadeTime))
> >>    kRun FracInstr 80, iChannel
> >>    if (km == 1)  then
> >>        event "i", kRun, 0, ilen, iChannel
> >>    endif
> >> endin
> >>
> >> instr 110
> >>    outs gaL, gaR
> >>    gaL = 0
> >>    gaR = 0
> >> endin
> >>
> >> instr Init
> >>    kCount = 0
> >>    until (kCount == lenarray(gkVolumes)) do
> >>        gkVolumes[kCount] = 1
> >>        kCount = kCount + 1
> >>    od
> >> endin
> >>
> >>
> >> 
> >> 
> >>
> >> f0 1000000
> >>
> >> i "Init" 0 0.01
> >>
> >> i   "PlayMsg"    0 -1
> >> i   "SetVolMsg"  0 -1
> >> i   "SetFadeMsg" 0 -1
> >> i   "StopMsg"    0 -1
> >> i   "ResumeMsg"  0 -1
> >>
> >> i 110 0 -1
> >> e
> >> 
> >> 
> >> ~~~
> >>
> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
> >>>
> >>> Can you post the Csound code? I see no global arrays in your earlier
> >>> flow.csd
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov 
> >>>> wrote:
> >>>>
> >>>> Here I'm reading the same file with diskin2 in the two instances of the
> >>>> same instrument.
> >>>> It's triggered with fractional numbers. 80.001 and 80.005
> >>>>
> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> >>>> The last message I've sent was to set the volume on channel. It assigns
> >>>> a value to the cell of global array.
> >>>>
> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> >>>> Here is message from gdb:
> >>>>
> >>>> diskin2: opened '/home/anton/Seashore.wav':
> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> >>>>     number of samples out of range:        2        2
> >>>> new alloc for instr 80:
> >>>> instr 80:  p1 = 80.005
> >>>> diskin2: opened '/home/anton/Seashore.wav':
> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> >>>>     number of samples out of range:     1315      451
> >>>> instr 80:  p1 = 80.001
> >>>>
> >>>> Program received signal SIGSEGV, Segmentation fault.
> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
> >>>> malloc.c:4163
> >>>> 4163    malloc.c: No such file or directory.
> >>>> (gdb) bt
> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
> >>>>    at malloc.c:4163
> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
> >>>>    av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
> >>>>    at malloc.c:3423
> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
> >>>>    elem_size=) at malloc.c:3219
> >>>> #3  0x00007ffff70df5f2 in sf_open ()
> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
> >>>> /usr/lib/libcsound64.so.6.0
> >>>> #10 0x0000000000401358 in ?? ()
> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> >>>>    argv=0x7fffffffd7c8, init=, fini=,
> >>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
> >>>> libc-start.c:287
> >>>> #12 0x00000000004013b0 in _start ()
> >>>>
> >>>>
> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> >>>> Thanks for the quick reply, Victor.
> >>>> I'll report back if I encounter the problem again!
> >>>> Though I'm not that good with gdb
> >>>>
> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
> >>>> use the run command with the arguments you need eg
> >>>>
> >>>> run mycsd.csd
> >>>>
> >>>> when it crashes you can try using the
> >>>> backtrace command to show where it stopped.
> >>>>
> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov 
> >>>> wrote:
> >>>>
> >>>>> How to do it?
> >>>>>
> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
> >>>>> Can you run it under a debugger?
> >>>>>
> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov 
> >>>>> wrote:
> >>>>>
> >>>>>> Unfortunately after several minutes of playing the service breaks
> >>>>>> with the message
> >>>>>>
> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>> *** Error in `csound': double free or corruption (out):
> >>>>>> 0x00000000014bfd70 ***
> >>>>>> Csound tidy up: Aborted
> >>>>>>
> >>>>>> Any ideas?
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
> >>>>>> It's done. Just in case if anyone interested in the end result.
> >>>>>> I post a code for service. It can play continuously wav files
> >>>>>> on several channels. Channels are identified by numbers.
> >>>>>>
> >>>>>> User can for the given channel
> >>>>>>
> >>>>>> * start playing a wav file in the loop. The wav files are played with
> >>>>>> xfade at the ends
> >>>>>>   so that user percieves it like a continuous flow.
> >>>>>>
> >>>>>> * stop playing a file
> >>>>>>
> >>>>>> * resume playback
> >>>>>>
> >>>>>> * set the volume for the given channel
> >>>>>>
> >>>>>> * set a global fade in/out time
> >>>>>>
> >>>>>> Also there is a python file that makes it easy to trigger the service
> >>>>>> from the code. There are some test remnants of file names you can
> >>>>>> substitute it with your own files.
> >>>>>>
> >>>>>> This combo of OSC service and python client makes it easy
> >>>>>> to livecode with python.
> >>>>>>
> >>>>>>
> >>>>>> Anton
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> >>>>>> :
> >>>>>> Strings are updated generally at i-time, but with special provisions
> >>>>>> for perf-time.
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
> >>>>>>>  wrote:
> >>>>>>>
> >>>>>>> Thank you for clarification. It was a blind spot for me is S behaves
> >>>>>>> like I or like K.
> >>>>>>> So the assignment operation works only at init time
> >>>>>>> and for k-rate we should use strcpyk.
> >>>>>>>
> >>>>>>> Anton
> >>>>>>>
> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> >>>>>>> :
> >>>>>>> String assignment is i-time only. Use strcpyk
> >>>>>>>
> >>>>>>> gSFile strcpyk SFile
> >>>>>>> ========================
> >>>>>>> Dr Victor Lazzarini
> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>>> Maynooth University,
> >>>>>>> Maynooth, Co Kildare, Ireland
> >>>>>>> Tel: 00 353 7086936
> >>>>>>> Fax: 00 353 1 7086952
> >>>>>>>
> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
> >>>>>>>>  wrote:
> >>>>>>>>
> >>>>>>>> I'm trying to write an OSC-server with Csound.
> >>>>>>>> The service should receive the name of the wav-file and the
> >>>>>>>> length of crossfade.
> >>>>>>>>
> >>>>>>>> On receive it should stop playing any previous wavs
> >>>>>>>> and start a loop that plays next wav file.
> >>>>>>>> The two loops should crossfade.
> >>>>>>>>
> >>>>>>>> While trying to write such a thing I'm getting into trouble
> >>>>>>>> with receiving String message with OSC.
> >>>>>>>> I receive a string-field then assign it to a global String var.
> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT errors
> >>>>>>>> like this
> >>>>>>>>
> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
> >>>>>>>> ilen  filelen gSFile  1
> >>>>>>>>
> >>>>>>>> What can be wrong with my code?
> >>>>>>>>
> >>>>>>>> I attach the two files.
> >>>>>>>> csd with server and python with client to test the server.
> >>>>>>>> The python uses pyOSC library
> >>>>>>>>
> >>>>>>>> Thanks,
> >>>>>>>> Anton
> >>>>>>>>
> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>>> be posted here 
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>        https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>        https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>> be posted here
> >>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>> be posted here
> >>>>>
> >>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>> be posted here
> >>>> Csound mailing list Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>> be posted here
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Csound mailing list Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>> be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >>
> >> Csound mailing list Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> >> be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >        https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:37
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Well, I have been running for longer than that. Still playing. And I am sending messages.
What version of Csound are you using?
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:30, Anton Kholomiov  wrote:
> 
> Oh know it's not related. It can happen after any message.
> It can happen without any message being sent
> 
> It takes 5 to 15 minute to crash but time can pass quicker if you have good samples ) 
> 
> 2016-01-24 2:28 GMT+03:00 Victor Lazzarini :
> I mean in the instrument that receives the set_volume message (if that is how you made it crash),
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 23 Jan 2016, at 23:20, Anton Kholomiov  wrote:
> >
> > @Victor
> >
> > It takes 5 to 15 minutes....
> > It takes some time to make it crash. Thank you for the help
> > I'll try it tomorrow.
> >
> > Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
> >
> > 2016-01-24 2:16 GMT+03:00 Anton Kholomiov :
> > @Steven Then I get
> >
> > Maybe it's better to create two separate instruments for mono and stereo diskins
> >
> > ~~~
> > INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> > ~~~
> >
> >
> > 2016-01-24 2:10 GMT+03:00 Steven Yi :
> > A couple of things that may (or may not) be useful:
> >
> > 1. This post discusses the victim error message:
> >
> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> >
> > 2. There is an i-time if-then used that wraps perf-time code (the
> > diskin's). Could you try:
> >
> >     ichan filenchnls gSFiles[iChannel]
> >     kchan init ichan
> >     if (kchan == 1) then
> >
> >
> >
> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> >  wrote:
> > > Here is the code
> > >
> > > ~~~
> > > 
> > > 
> > > -odac   -d
> > > 
> > > 
> > >
> > > sr = 44100
> > > ksmps = 64
> > > nchnls = 2
> > > 0dbfs  = 1
> > >
> > > #ifndef PORT
> > >     #define PORT        # 7700 #
> > > #end
> > >
> > > #ifndef SIZE
> > >     #define SIZE        # 8 #
> > > #end
> > >
> > > gkVolume   init 1
> > > gSFile     init ""
> > >
> > > gSFiles[]   init $SIZE
> > > gkVolumes[] init $SIZE
> > >
> > > gaL init 0
> > > gaR init 0
> > >
> > > gihandle OSCinit $PORT
> > >
> > > gkFadeTime init 1
> > >
> > > opcode FracInstr, k, ik
> > >     iInstrNum, kChannel xin
> > >     kres = iInstrNum + ((kChannel + 1) / 1000)
> > >     xout kres
> > > endop
> > >
> > > instr   PlayMsg
> > >     SFile = ""
> > >     kVolume   init 0
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     kSched FracInstr 100, kChannel
> > >     kRun   FracInstr 80,  kChannel
> > >
> > >     printk 0,kSched
> > >      printk 0,kRun
> > >
> > >
> > >     turnoff2 kSched, 4, 0
> > >     turnoff2 kRun,  4, gkFadeTime
> > >     gSFiles[kChannel] strcpyk SFile
> > >     event "i", kSched, 0, -1, kChannel
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr StopMsg
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     kSched FracInstr 100, kChannel
> > >     kRun   FracInstr 80,  kChannel
> > >     turnoff2 kSched, 4, 0
> > >     turnoff2 kRun,  4, gkFadeTime
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr ResumeMsg
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     kSched FracInstr 100, kChannel
> > >     kRun   FracInstr 80,  kChannel
> > >     turnoff2 kSched, 4, 0
> > >     turnoff2 kRun,  4, gkFadeTime
> > >     event "i", kSched, 0, -1, kChannel
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > >
> > > instr   SetVolMsg
> > >     kVolume   init 0
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     gkVolumes[kChannel] = kVolume
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr   SetFadeMsg
> > >     kFade   init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > > if (kk == 0) goto ex
> > >     gkFadeTime = kFade
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr 80
> > >     print p1
> > >     idur    = p3
> > >     iFadeTime = i(gkFadeTime)
> > >     iChannel  = p4
> > >     ichan filenchnls gSFiles[iChannel]
> > >     if (ichan == 1) then
> > >         al diskin2 gSFiles[iChannel], 1
> > >         ar = al
> > >     else
> > >         al, ar diskin2 gSFiles[iChannel], 1
> > >     endif
> > >
> > >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > > iFadeTime, 0
> > >     kvol    port gkVolumes[iChannel], 0.05
> > >
> > >     gaL  = gaL + kenv * kvol * al
> > >     gaR  = gaR + kenv * kvol * ar
> > > endin
> > >
> > > instr 100
> > >     iChannel  = p4
> > >     iFadeTime = i(gkFadeTime)
> > >     ilen  filelen gSFiles[iChannel]
> > >     km    metro (1 / (ilen - iFadeTime))
> > >     kRun FracInstr 80, iChannel
> > >     if (km == 1)  then
> > >         event "i", kRun, 0, ilen, iChannel
> > >     endif
> > > endin
> > >
> > > instr 110
> > >     outs gaL, gaR
> > >     gaL = 0
> > >     gaR = 0
> > > endin
> > >
> > > instr Init
> > >     kCount = 0
> > >     until (kCount == lenarray(gkVolumes)) do
> > >         gkVolumes[kCount] = 1
> > >         kCount = kCount + 1
> > >     od
> > > endin
> > >
> > >
> > > 
> > > 
> > >
> > > f0 1000000
> > >
> > > i "Init" 0 0.01
> > >
> > > i   "PlayMsg"    0 -1
> > > i   "SetVolMsg"  0 -1
> > > i   "SetFadeMsg" 0 -1
> > > i   "StopMsg"    0 -1
> > > i   "ResumeMsg"  0 -1
> > >
> > > i 110 0 -1
> > > e
> > > 
> > > 
> > > ~~~
> > >
> > > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
> > >>
> > >> Can you post the Csound code? I see no global arrays in your earlier
> > >> flow.csd
> > >> ========================
> > >> Dr Victor Lazzarini
> > >> Dean of Arts, Celtic Studies and Philosophy,
> > >> Maynooth University,
> > >> Maynooth, Co Kildare, Ireland
> > >> Tel: 00 353 7086936
> > >> Fax: 00 353 1 7086952
> > >>
> > >> > On 23 Jan 2016, at 22:36, Anton Kholomiov 
> > >> > wrote:
> > >> >
> > >> > Here I'm reading the same file with diskin2 in the two instances of the
> > >> > same instrument.
> > >> > It's triggered with fractional numbers. 80.001 and 80.005
> > >> >
> > >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> > >> > The last message I've sent was to set the volume on channel. It assigns
> > >> > a value to the cell of global array.
> > >> >
> > >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> > >> > Here is message from gdb:
> > >> >
> > >> > diskin2: opened '/home/anton/Seashore.wav':
> > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> > >> >      number of samples out of range:        2        2
> > >> > new alloc for instr 80:
> > >> > instr 80:  p1 = 80.005
> > >> > diskin2: opened '/home/anton/Seashore.wav':
> > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> > >> >      number of samples out of range:     1315      451
> > >> > instr 80:  p1 = 80.001
> > >> >
> > >> > Program received signal SIGSEGV, Segmentation fault.
> > >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
> > >> > malloc.c:4163
> > >> > 4163    malloc.c: No such file or directory.
> > >> > (gdb) bt
> > >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
> > >> >     at malloc.c:4163
> > >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> > >> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
> > >> >     at malloc.c:3423
> > >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
> > >> >     elem_size=) at malloc.c:3219
> > >> > #3  0x00007ffff70df5f2 in sf_open ()
> > >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> > >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> > >> > /usr/lib/libcsound64.so.6.0
> > >> > #10 0x0000000000401358 in ?? ()
> > >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> > >> >     argv=0x7fffffffd7c8, init=, fini=,
> > >> >     rtld_fini=, stack_end=0x7fffffffd7b8) at
> > >> > libc-start.c:287
> > >> > #12 0x00000000004013b0 in _start ()
> > >> >
> > >> >
> > >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> > >> > Thanks for the quick reply, Victor.
> > >> > I'll report back if I encounter the problem again!
> > >> > Though I'm not that good with gdb
> > >> >
> > >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> > >> > Use gdb. Are you using the csound command? Do gdb csound, then
> > >> > use the run command with the arguments you need eg
> > >> >
> > >> > run mycsd.csd
> > >> >
> > >> > when it crashes you can try using the
> > >> > backtrace command to show where it stopped.
> > >> >
> > >> > On 23 Jan 2016, at 22:07, Anton Kholomiov 
> > >> > wrote:
> > >> >
> > >> >> How to do it?
> > >> >>
> > >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
> > >> >> Can you run it under a debugger?
> > >> >>
> > >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov 
> > >> >> wrote:
> > >> >>
> > >> >>> Unfortunately after several minutes of playing the service breaks
> > >> >>> with the message
> > >> >>>
> > >> >>> diskin2: opened '/home/anton/Seashore.wav':
> > >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> > >> >>> *** Error in `csound': double free or corruption (out):
> > >> >>> 0x00000000014bfd70 ***
> > >> >>> Csound tidy up: Aborted
> > >> >>>
> > >> >>> Any ideas?
> > >> >>>
> > >> >>>
> > >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
> > >> >>> It's done. Just in case if anyone interested in the end result.
> > >> >>> I post a code for service. It can play continuously wav files
> > >> >>> on several channels. Channels are identified by numbers.
> > >> >>>
> > >> >>> User can for the given channel
> > >> >>>
> > >> >>> * start playing a wav file in the loop. The wav files are played with
> > >> >>> xfade at the ends
> > >> >>>    so that user percieves it like a continuous flow.
> > >> >>>
> > >> >>> * stop playing a file
> > >> >>>
> > >> >>> * resume playback
> > >> >>>
> > >> >>> * set the volume for the given channel
> > >> >>>
> > >> >>> * set a global fade in/out time
> > >> >>>
> > >> >>> Also there is a python file that makes it easy to trigger the service
> > >> >>> from the code. There are some test remnants of file names you can
> > >> >>> substitute it with your own files.
> > >> >>>
> > >> >>> This combo of OSC service and python client makes it easy
> > >> >>> to livecode with python.
> > >> >>>
> > >> >>>
> > >> >>> Anton
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> > >> >>> :
> > >> >>> Strings are updated generally at i-time, but with special provisions
> > >> >>> for perf-time.
> > >> >>> ========================
> > >> >>> Dr Victor Lazzarini
> > >> >>> Dean of Arts, Celtic Studies and Philosophy,
> > >> >>> Maynooth University,
> > >> >>> Maynooth, Co Kildare, Ireland
> > >> >>> Tel: 00 353 7086936
> > >> >>> Fax: 00 353 1 7086952
> > >> >>>
> > >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> > >> >>> >  wrote:
> > >> >>> >
> > >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> > >> >>> > like I or like K.
> > >> >>> > So the assignment operation works only at init time
> > >> >>> > and for k-rate we should use strcpyk.
> > >> >>> >
> > >> >>> > Anton
> > >> >>> >
> > >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> > >> >>> > :
> > >> >>> > String assignment is i-time only. Use strcpyk
> > >> >>> >
> > >> >>> > gSFile strcpyk SFile
> > >> >>> > ========================
> > >> >>> > Dr Victor Lazzarini
> > >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> > >> >>> > Maynooth University,
> > >> >>> > Maynooth, Co Kildare, Ireland
> > >> >>> > Tel: 00 353 7086936
> > >> >>> > Fax: 00 353 1 7086952
> > >> >>> >
> > >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> > >> >>> > >  wrote:
> > >> >>> > >
> > >> >>> > > I'm trying to write an OSC-server with Csound.
> > >> >>> > > The service should receive the name of the wav-file and the
> > >> >>> > > length of crossfade.
> > >> >>> > >
> > >> >>> > > On receive it should stop playing any previous wavs
> > >> >>> > > and start a loop that plays next wav file.
> > >> >>> > > The two loops should crossfade.
> > >> >>> > >
> > >> >>> > > While trying to write such a thing I'm getting into trouble
> > >> >>> > > with receiving String message with OSC.
> > >> >>> > > I receive a string-field then assign it to a global String var.
> > >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> > >> >>> > > like this
> > >> >>> > >
> > >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> > >> >>> > > ilen  filelen gSFile  1
> > >> >>> > >
> > >> >>> > > What can be wrong with my code?
> > >> >>> > >
> > >> >>> > > I attach the two files.
> > >> >>> > > csd with server and python with client to test the server.
> > >> >>> > > The python uses pyOSC library
> > >> >>> > >
> > >> >>> > > Thanks,
> > >> >>> > > Anton
> > >> >>> > >
> > >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> > >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >>> > > be posted here 
> > >> >>> >
> > >> >>> > Csound mailing list
> > >> >>> > Csound@listserv.heanet.ie
> > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> >>> > Send bugs reports to
> > >> >>> >         https://github.com/csound/csound/issues
> > >> >>> > Discussions of bugs and features can be posted here
> > >> >>> >
> > >> >>> > Csound mailing list Csound@listserv.heanet.ie
> > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >>> > be posted here
> > >> >>>
> > >> >>> Csound mailing list
> > >> >>> Csound@listserv.heanet.ie
> > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> >>> Send bugs reports to
> > >> >>>         https://github.com/csound/csound/issues
> > >> >>> Discussions of bugs and features can be posted here
> > >> >>>
> > >> >>>
> > >> >>> Csound mailing list Csound@listserv.heanet.ie
> > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >>> be posted here
> > >> >> Csound mailing list Csound@listserv.heanet.ie
> > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >> be posted here
> > >> >>
> > >> >> Csound mailing list Csound@listserv.heanet.ie
> > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >> be posted here
> > >> > Csound mailing list Csound@listserv.heanet.ie
> > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> > be posted here
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > Csound mailing list Csound@listserv.heanet.ie
> > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> > be posted here
> > >>
> > >> Csound mailing list
> > >> Csound@listserv.heanet.ie
> > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> Send bugs reports to
> > >>         https://github.com/csound/csound/issues
> > >> Discussions of bugs and features can be posted here
> > >
> > >
> > > Csound mailing list Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:38
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
One other off-chance possibility, I noticed the libsndfile in the trace is in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
 wrote:
> It does not check if it is below 0. (but Csound does. I get a warning if I sent a negative channel).
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 23 Jan 2016, at 23:25, Anton Kholomiov  wrote:
>>
>> There have to be no out of bounds array assignment. Since I check the messages for being in the right interval.
>>
>> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini :
>> I think the if-then gets translated into an i & perf time check (cggoto).
>>
>> But I am thinking here the crash might be to do with accessing arrays out of bounds.
>> I can’t reproduce it though.
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>> > On 23 Jan 2016, at 23:10, Steven Yi  wrote:
>> >
>> > A couple of things that may (or may not) be useful:
>> >
>> > 1. This post discusses the victim error message:
>> >
>> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >
>> > 2. There is an i-time if-then used that wraps perf-time code (the
>> > diskin's). Could you try:
>> >
>> >    ichan filenchnls gSFiles[iChannel]
>> >    kchan init ichan
>> >    if (kchan == 1) then
>> >
>> >
>> >
>> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >  wrote:
>> >> Here is the code
>> >>
>> >> ~~~
>> >> 
>> >> 
>> >> -odac   -d
>> >> 
>> >> 
>> >>
>> >> sr = 44100
>> >> ksmps = 64
>> >> nchnls = 2
>> >> 0dbfs  = 1
>> >>
>> >> #ifndef PORT
>> >>    #define PORT        # 7700 #
>> >> #end
>> >>
>> >> #ifndef SIZE
>> >>    #define SIZE        # 8 #
>> >> #end
>> >>
>> >> gkVolume   init 1
>> >> gSFile     init ""
>> >>
>> >> gSFiles[]   init $SIZE
>> >> gkVolumes[] init $SIZE
>> >>
>> >> gaL init 0
>> >> gaR init 0
>> >>
>> >> gihandle OSCinit $PORT
>> >>
>> >> gkFadeTime init 1
>> >>
>> >> opcode FracInstr, k, ik
>> >>    iInstrNum, kChannel xin
>> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >>    xout kres
>> >> endop
>> >>
>> >> instr   PlayMsg
>> >>    SFile = ""
>> >>    kVolume   init 0
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    kSched FracInstr 100, kChannel
>> >>    kRun   FracInstr 80,  kChannel
>> >>
>> >>    printk 0,kSched
>> >>     printk 0,kRun
>> >>
>> >>
>> >>    turnoff2 kSched, 4, 0
>> >>    turnoff2 kRun,  4, gkFadeTime
>> >>    gSFiles[kChannel] strcpyk SFile
>> >>    event "i", kSched, 0, -1, kChannel
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr StopMsg
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    kSched FracInstr 100, kChannel
>> >>    kRun   FracInstr 80,  kChannel
>> >>    turnoff2 kSched, 4, 0
>> >>    turnoff2 kRun,  4, gkFadeTime
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr ResumeMsg
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    kSched FracInstr 100, kChannel
>> >>    kRun   FracInstr 80,  kChannel
>> >>    turnoff2 kSched, 4, 0
>> >>    turnoff2 kRun,  4, gkFadeTime
>> >>    event "i", kSched, 0, -1, kChannel
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >>
>> >> instr   SetVolMsg
>> >>    kVolume   init 0
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    gkVolumes[kChannel] = kVolume
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr   SetFadeMsg
>> >>    kFade   init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> if (kk == 0) goto ex
>> >>    gkFadeTime = kFade
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr 80
>> >>    print p1
>> >>    idur    = p3
>> >>    iFadeTime = i(gkFadeTime)
>> >>    iChannel  = p4
>> >>    ichan filenchnls gSFiles[iChannel]
>> >>    if (ichan == 1) then
>> >>        al diskin2 gSFiles[iChannel], 1
>> >>        ar = al
>> >>    else
>> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >>    endif
>> >>
>> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
>> >> iFadeTime, 0
>> >>    kvol    port gkVolumes[iChannel], 0.05
>> >>
>> >>    gaL  = gaL + kenv * kvol * al
>> >>    gaR  = gaR + kenv * kvol * ar
>> >> endin
>> >>
>> >> instr 100
>> >>    iChannel  = p4
>> >>    iFadeTime = i(gkFadeTime)
>> >>    ilen  filelen gSFiles[iChannel]
>> >>    km    metro (1 / (ilen - iFadeTime))
>> >>    kRun FracInstr 80, iChannel
>> >>    if (km == 1)  then
>> >>        event "i", kRun, 0, ilen, iChannel
>> >>    endif
>> >> endin
>> >>
>> >> instr 110
>> >>    outs gaL, gaR
>> >>    gaL = 0
>> >>    gaR = 0
>> >> endin
>> >>
>> >> instr Init
>> >>    kCount = 0
>> >>    until (kCount == lenarray(gkVolumes)) do
>> >>        gkVolumes[kCount] = 1
>> >>        kCount = kCount + 1
>> >>    od
>> >> endin
>> >>
>> >>
>> >> 
>> >> 
>> >>
>> >> f0 1000000
>> >>
>> >> i "Init" 0 0.01
>> >>
>> >> i   "PlayMsg"    0 -1
>> >> i   "SetVolMsg"  0 -1
>> >> i   "SetFadeMsg" 0 -1
>> >> i   "StopMsg"    0 -1
>> >> i   "ResumeMsg"  0 -1
>> >>
>> >> i 110 0 -1
>> >> e
>> >> 
>> >> 
>> >> ~~~
>> >>
>> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
>> >>>
>> >>> Can you post the Csound code? I see no global arrays in your earlier
>> >>> flow.csd
>> >>> ========================
>> >>> Dr Victor Lazzarini
>> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >>> Maynooth University,
>> >>> Maynooth, Co Kildare, Ireland
>> >>> Tel: 00 353 7086936
>> >>> Fax: 00 353 1 7086952
>> >>>
>> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov 
>> >>>> wrote:
>> >>>>
>> >>>> Here I'm reading the same file with diskin2 in the two instances of the
>> >>>> same instrument.
>> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >>>>
>> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
>> >>>> The last message I've sent was to set the volume on channel. It assigns
>> >>>> a value to the cell of global array.
>> >>>>
>> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
>> >>>> Here is message from gdb:
>> >>>>
>> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >>>>     number of samples out of range:        2        2
>> >>>> new alloc for instr 80:
>> >>>> instr 80:  p1 = 80.005
>> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >>>>     number of samples out of range:     1315      451
>> >>>> instr 80:  p1 = 80.001
>> >>>>
>> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>> >>>> malloc.c:4163
>> >>>> 4163    malloc.c: No such file or directory.
>> >>>> (gdb) bt
>> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>> >>>>    at malloc.c:4163
>> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >>>>    av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
>> >>>>    at malloc.c:3423
>> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>> >>>>    elem_size=) at malloc.c:3219
>> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >>>> /usr/lib/libcsound64.so.6.0
>> >>>> #10 0x0000000000401358 in ?? ()
>> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>> >>>>    argv=0x7fffffffd7c8, init=, fini=,
>> >>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
>> >>>> libc-start.c:287
>> >>>> #12 0x00000000004013b0 in _start ()
>> >>>>
>> >>>>
>> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
>> >>>> Thanks for the quick reply, Victor.
>> >>>> I'll report back if I encounter the problem again!
>> >>>> Though I'm not that good with gdb
>> >>>>
>> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
>> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >>>> use the run command with the arguments you need eg
>> >>>>
>> >>>> run mycsd.csd
>> >>>>
>> >>>> when it crashes you can try using the
>> >>>> backtrace command to show where it stopped.
>> >>>>
>> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov 
>> >>>> wrote:
>> >>>>
>> >>>>> How to do it?
>> >>>>>
>> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
>> >>>>> Can you run it under a debugger?
>> >>>>>
>> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov 
>> >>>>> wrote:
>> >>>>>
>> >>>>>> Unfortunately after several minutes of playing the service breaks
>> >>>>>> with the message
>> >>>>>>
>> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >>>>>> *** Error in `csound': double free or corruption (out):
>> >>>>>> 0x00000000014bfd70 ***
>> >>>>>> Csound tidy up: Aborted
>> >>>>>>
>> >>>>>> Any ideas?
>> >>>>>>
>> >>>>>>
>> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
>> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >>>>>> I post a code for service. It can play continuously wav files
>> >>>>>> on several channels. Channels are identified by numbers.
>> >>>>>>
>> >>>>>> User can for the given channel
>> >>>>>>
>> >>>>>> * start playing a wav file in the loop. The wav files are played with
>> >>>>>> xfade at the ends
>> >>>>>>   so that user percieves it like a continuous flow.
>> >>>>>>
>> >>>>>> * stop playing a file
>> >>>>>>
>> >>>>>> * resume playback
>> >>>>>>
>> >>>>>> * set the volume for the given channel
>> >>>>>>
>> >>>>>> * set a global fade in/out time
>> >>>>>>
>> >>>>>> Also there is a python file that makes it easy to trigger the service
>> >>>>>> from the code. There are some test remnants of file names you can
>> >>>>>> substitute it with your own files.
>> >>>>>>
>> >>>>>> This combo of OSC service and python client makes it easy
>> >>>>>> to livecode with python.
>> >>>>>>
>> >>>>>>
>> >>>>>> Anton
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >>>>>> :
>> >>>>>> Strings are updated generally at i-time, but with special provisions
>> >>>>>> for perf-time.
>> >>>>>> ========================
>> >>>>>> Dr Victor Lazzarini
>> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >>>>>> Maynooth University,
>> >>>>>> Maynooth, Co Kildare, Ireland
>> >>>>>> Tel: 00 353 7086936
>> >>>>>> Fax: 00 353 1 7086952
>> >>>>>>
>> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >>>>>>>  wrote:
>> >>>>>>>
>> >>>>>>> Thank you for clarification. It was a blind spot for me is S behaves
>> >>>>>>> like I or like K.
>> >>>>>>> So the assignment operation works only at init time
>> >>>>>>> and for k-rate we should use strcpyk.
>> >>>>>>>
>> >>>>>>> Anton
>> >>>>>>>
>> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >>>>>>> :
>> >>>>>>> String assignment is i-time only. Use strcpyk
>> >>>>>>>
>> >>>>>>> gSFile strcpyk SFile
>> >>>>>>> ========================
>> >>>>>>> Dr Victor Lazzarini
>> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >>>>>>> Maynooth University,
>> >>>>>>> Maynooth, Co Kildare, Ireland
>> >>>>>>> Tel: 00 353 7086936
>> >>>>>>> Fax: 00 353 1 7086952
>> >>>>>>>
>> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >>>>>>>>  wrote:
>> >>>>>>>>
>> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >>>>>>>> The service should receive the name of the wav-file and the
>> >>>>>>>> length of crossfade.
>> >>>>>>>>
>> >>>>>>>> On receive it should stop playing any previous wavs
>> >>>>>>>> and start a loop that plays next wav file.
>> >>>>>>>> The two loops should crossfade.
>> >>>>>>>>
>> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >>>>>>>> with receiving String message with OSC.
>> >>>>>>>> I receive a string-field then assign it to a global String var.
>> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT errors
>> >>>>>>>> like this
>> >>>>>>>>
>> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >>>>>>>> ilen  filelen gSFile  1
>> >>>>>>>>
>> >>>>>>>> What can be wrong with my code?
>> >>>>>>>>
>> >>>>>>>> I attach the two files.
>> >>>>>>>> csd with server and python with client to test the server.
>> >>>>>>>> The python uses pyOSC library
>> >>>>>>>>
>> >>>>>>>> Thanks,
>> >>>>>>>> Anton
>> >>>>>>>>
>> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>>>>> be posted here 
>> >>>>>>>
>> >>>>>>> Csound mailing list
>> >>>>>>> Csound@listserv.heanet.ie
>> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>>>> Send bugs reports to
>> >>>>>>>        https://github.com/csound/csound/issues
>> >>>>>>> Discussions of bugs and features can be posted here
>> >>>>>>>
>> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>>>> be posted here
>> >>>>>>
>> >>>>>> Csound mailing list
>> >>>>>> Csound@listserv.heanet.ie
>> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>>> Send bugs reports to
>> >>>>>>        https://github.com/csound/csound/issues
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>>
>> >>>>>>
>> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>>> be posted here
>> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>> be posted here
>> >>>>>
>> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>> be posted here
>> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>> be posted here
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>> be posted here
>> >>>
>> >>> Csound mailing list
>> >>> Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>        https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >        https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:38
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
It's Csound version 6.03.2

2016-01-24 2:37 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Well, I have been running for longer than that. Still playing. And I am sending messages.
What version of Csound are you using?
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 23:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
> Oh know it's not related. It can happen after any message.
> It can happen without any message being sent
>
> It takes 5 to 15 minute to crash but time can pass quicker if you have good samples )
>
> 2016-01-24 2:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> I mean in the instrument that receives the set_volume message (if that is how you made it crash),
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 23 Jan 2016, at 23:20, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > @Victor
> >
> > It takes 5 to 15 minutes....
> > It takes some time to make it crash. Thank you for the help
> > I'll try it tomorrow.
> >
> > Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
> >
> > 2016-01-24 2:16 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > @Steven Then I get
> >
> > Maybe it's better to create two separate instruments for mono and stereo diskins
> >
> > ~~~
> > INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> > ~~~
> >
> >
> > 2016-01-24 2:10 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> > A couple of things that may (or may not) be useful:
> >
> > 1. This post discusses the victim error message:
> >
> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> >
> > 2. There is an i-time if-then used that wraps perf-time code (the
> > diskin's). Could you try:
> >
> >     ichan filenchnls gSFiles[iChannel]
> >     kchan init ichan
> >     if (kchan == 1) then
> >
> >
> >
> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> > <anton.kholomiov@gmail.com> wrote:
> > > Here is the code
> > >
> > > ~~~
> > > <CsoundSynthesizer>
> > > <CsOptions>
> > > -odac   -d
> > > </CsOptions>
> > > <CsInstruments>
> > >
> > > sr = 44100
> > > ksmps = 64
> > > nchnls = 2
> > > 0dbfs  = 1
> > >
> > > #ifndef PORT
> > >     #define PORT        # 7700 #
> > > #end
> > >
> > > #ifndef SIZE
> > >     #define SIZE        # 8 #
> > > #end
> > >
> > > gkVolume   init 1
> > > gSFile     init ""
> > >
> > > gSFiles[]   init $SIZE
> > > gkVolumes[] init $SIZE
> > >
> > > gaL init 0
> > > gaR init 0
> > >
> > > gihandle OSCinit $PORT
> > >
> > > gkFadeTime init 1
> > >
> > > opcode FracInstr, k, ik
> > >     iInstrNum, kChannel xin
> > >     kres = iInstrNum + ((kChannel + 1) / 1000)
> > >     xout kres
> > > endop
> > >
> > > instr   PlayMsg
> > >     SFile = ""
> > >     kVolume   init 0
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     kSched FracInstr 100, kChannel
> > >     kRun   FracInstr 80,  kChannel
> > >
> > >     printk 0,kSched
> > >      printk 0,kRun
> > >
> > >
> > >     turnoff2 kSched, 4, 0
> > >     turnoff2 kRun,  4, gkFadeTime
> > >     gSFiles[kChannel] strcpyk SFile
> > >     event "i", kSched, 0, -1, kChannel
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr StopMsg
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     kSched FracInstr 100, kChannel
> > >     kRun   FracInstr 80,  kChannel
> > >     turnoff2 kSched, 4, 0
> > >     turnoff2 kRun,  4, gkFadeTime
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr ResumeMsg
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     kSched FracInstr 100, kChannel
> > >     kRun   FracInstr 80,  kChannel
> > >     turnoff2 kSched, 4, 0
> > >     turnoff2 kRun,  4, gkFadeTime
> > >     event "i", kSched, 0, -1, kChannel
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > >
> > > instr   SetVolMsg
> > >     kVolume   init 0
> > >     kChannel  init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > >     gkVolumes[kChannel] = kVolume
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr   SetFadeMsg
> > >     kFade   init 0
> > >     kk init 0
> > >
> > > nxtmsg:
> > >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > > if (kk == 0) goto ex
> > >     gkFadeTime = kFade
> > >     kgoto nxtmsg
> > > ex:
> > > endin
> > >
> > > instr 80
> > >     print p1
> > >     idur    = p3
> > >     iFadeTime = i(gkFadeTime)
> > >     iChannel  = p4
> > >     ichan filenchnls gSFiles[iChannel]
> > >     if (ichan == 1) then
> > >         al diskin2 gSFiles[iChannel], 1
> > >         ar = al
> > >     else
> > >         al, ar diskin2 gSFiles[iChannel], 1
> > >     endif
> > >
> > >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > > iFadeTime, 0
> > >     kvol    port gkVolumes[iChannel], 0.05
> > >
> > >     gaL  = gaL + kenv * kvol * al
> > >     gaR  = gaR + kenv * kvol * ar
> > > endin
> > >
> > > instr 100
> > >     iChannel  = p4
> > >     iFadeTime = i(gkFadeTime)
> > >     ilen  filelen gSFiles[iChannel]
> > >     km    metro (1 / (ilen - iFadeTime))
> > >     kRun FracInstr 80, iChannel
> > >     if (km == 1)  then
> > >         event "i", kRun, 0, ilen, iChannel
> > >     endif
> > > endin
> > >
> > > instr 110
> > >     outs gaL, gaR
> > >     gaL = 0
> > >     gaR = 0
> > > endin
> > >
> > > instr Init
> > >     kCount = 0
> > >     until (kCount == lenarray(gkVolumes)) do
> > >         gkVolumes[kCount] = 1
> > >         kCount = kCount + 1
> > >     od
> > > endin
> > >
> > >
> > > </CsInstruments>
> > > <CsScore>
> > >
> > > f0 1000000
> > >
> > > i "Init" 0 0.01
> > >
> > > i   "PlayMsg"    0 -1
> > > i   "SetVolMsg"  0 -1
> > > i   "SetFadeMsg" 0 -1
> > > i   "StopMsg"    0 -1
> > > i   "ResumeMsg"  0 -1
> > >
> > > i 110 0 -1
> > > e
> > > </CsScore>
> > > </CsoundSynthesizer>
> > > ~~~
> > >
> > > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > >>
> > >> Can you post the Csound code? I see no global arrays in your earlier
> > >> flow.csd
> > >> ========================
> > >> Dr Victor Lazzarini
> > >> Dean of Arts, Celtic Studies and Philosophy,
> > >> Maynooth University,
> > >> Maynooth, Co Kildare, Ireland
> > >> Tel: 00 353 7086936
> > >> Fax: 00 353 1 7086952
> > >>
> > >> > On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
> > >> > wrote:
> > >> >
> > >> > Here I'm reading the same file with diskin2 in the two instances of the
> > >> > same instrument.
> > >> > It's triggered with fractional numbers. 80.001 and 80.005
> > >> >
> > >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > >> > The last message I've sent was to set the volume on channel. It assigns
> > >> > a value to the cell of global array.
> > >> >
> > >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > >> > Here is message from gdb:
> > >> >
> > >> > diskin2: opened '/home/anton/Seashore.wav':
> > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> > >> >      number of samples out of range:        2        2
> > >> > new alloc for instr 80:
> > >> > instr 80:  p1 = 80.005
> > >> > diskin2: opened '/home/anton/Seashore.wav':
> > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> > >> >      number of samples out of range:     1315      451
> > >> > instr 80:  p1 = 80.001
> > >> >
> > >> > Program received signal SIGSEGV, Segmentation fault.
> > >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
> > >> > malloc.c:4163
> > >> > 4163    malloc.c: No such file or directory.
> > >> > (gdb) bt
> > >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
> > >> >     at malloc.c:4163
> > >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> > >> >     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
> > >> >     at malloc.c:3423
> > >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
> > >> >     elem_size=<optimized out>) at malloc.c:3219
> > >> > #3  0x00007ffff70df5f2 in sf_open ()
> > >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> > >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> > >> > /usr/lib/libcsound64.so.6.0
> > >> > #10 0x0000000000401358 in ?? ()
> > >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> > >> >     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
> > >> >     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
> > >> > libc-start.c:287
> > >> > #12 0x00000000004013b0 in _start ()
> > >> >
> > >> >
> > >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > >> > Thanks for the quick reply, Victor.
> > >> > I'll report back if I encounter the problem again!
> > >> > Though I'm not that good with gdb
> > >> >
> > >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > >> > Use gdb. Are you using the csound command? Do gdb csound, then
> > >> > use the run command with the arguments you need eg
> > >> >
> > >> > run mycsd.csd
> > >> >
> > >> > when it crashes you can try using the
> > >> > backtrace command to show where it stopped.
> > >> >
> > >> > On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
> > >> > wrote:
> > >> >
> > >> >> How to do it?
> > >> >>
> > >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > >> >> Can you run it under a debugger?
> > >> >>
> > >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
> > >> >> wrote:
> > >> >>
> > >> >>> Unfortunately after several minutes of playing the service breaks
> > >> >>> with the message
> > >> >>>
> > >> >>> diskin2: opened '/home/anton/Seashore.wav':
> > >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> > >> >>> *** Error in `csound': double free or corruption (out):
> > >> >>> 0x00000000014bfd70 ***
> > >> >>> Csound tidy up: Aborted
> > >> >>>
> > >> >>> Any ideas?
> > >> >>>
> > >> >>>
> > >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > >> >>> It's done. Just in case if anyone interested in the end result.
> > >> >>> I post a code for service. It can play continuously wav files
> > >> >>> on several channels. Channels are identified by numbers.
> > >> >>>
> > >> >>> User can for the given channel
> > >> >>>
> > >> >>> * start playing a wav file in the loop. The wav files are played with
> > >> >>> xfade at the ends
> > >> >>>    so that user percieves it like a continuous flow.
> > >> >>>
> > >> >>> * stop playing a file
> > >> >>>
> > >> >>> * resume playback
> > >> >>>
> > >> >>> * set the volume for the given channel
> > >> >>>
> > >> >>> * set a global fade in/out time
> > >> >>>
> > >> >>> Also there is a python file that makes it easy to trigger the service
> > >> >>> from the code. There are some test remnants of file names you can
> > >> >>> substitute it with your own files.
> > >> >>>
> > >> >>> This combo of OSC service and python client makes it easy
> > >> >>> to livecode with python.
> > >> >>>
> > >> >>>
> > >> >>> Anton
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> > >> >>> <Victor.Lazzarini@nuim.ie>:
> > >> >>> Strings are updated generally at i-time, but with special provisions
> > >> >>> for perf-time.
> > >> >>> ========================
> > >> >>> Dr Victor Lazzarini
> > >> >>> Dean of Arts, Celtic Studies and Philosophy,
> > >> >>> Maynooth University,
> > >> >>> Maynooth, Co Kildare, Ireland
> > >> >>> Tel: 00 353 7086936
> > >> >>> Fax: 00 353 1 7086952
> > >> >>>
> > >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> > >> >>> > <anton.kholomiov@gmail.com> wrote:
> > >> >>> >
> > >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> > >> >>> > like I or like K.
> > >> >>> > So the assignment operation works only at init time
> > >> >>> > and for k-rate we should use strcpyk.
> > >> >>> >
> > >> >>> > Anton
> > >> >>> >
> > >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> > >> >>> > <Victor.Lazzarini@nuim.ie>:
> > >> >>> > String assignment is i-time only. Use strcpyk
> > >> >>> >
> > >> >>> > gSFile strcpyk SFile
> > >> >>> > ========================
> > >> >>> > Dr Victor Lazzarini
> > >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> > >> >>> > Maynooth University,
> > >> >>> > Maynooth, Co Kildare, Ireland
> > >> >>> > Tel: 00 353 7086936
> > >> >>> > Fax: 00 353 1 7086952
> > >> >>> >
> > >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> > >> >>> > > <anton.kholomiov@GMAIL.COM> wrote:
> > >> >>> > >
> > >> >>> > > I'm trying to write an OSC-server with Csound.
> > >> >>> > > The service should receive the name of the wav-file and the
> > >> >>> > > length of crossfade.
> > >> >>> > >
> > >> >>> > > On receive it should stop playing any previous wavs
> > >> >>> > > and start a loop that plays next wav file.
> > >> >>> > > The two loops should crossfade.
> > >> >>> > >
> > >> >>> > > While trying to write such a thing I'm getting into trouble
> > >> >>> > > with receiving String message with OSC.
> > >> >>> > > I receive a string-field then assign it to a global String var.
> > >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> > >> >>> > > like this
> > >> >>> > >
> > >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> > >> >>> > > ilen  filelen gSFile  1
> > >> >>> > >
> > >> >>> > > What can be wrong with my code?
> > >> >>> > >
> > >> >>> > > I attach the two files.
> > >> >>> > > csd with server and python with client to test the server.
> > >> >>> > > The python uses pyOSC library
> > >> >>> > >
> > >> >>> > > Thanks,
> > >> >>> > > Anton
> > >> >>> > >
> > >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> > >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >>> > > be posted here <flow.csd><test_flow.py>
> > >> >>> >
> > >> >>> > Csound mailing list
> > >> >>> > Csound@listserv.heanet.ie
> > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> >>> > Send bugs reports to
> > >> >>> >         https://github.com/csound/csound/issues
> > >> >>> > Discussions of bugs and features can be posted here
> > >> >>> >
> > >> >>> > Csound mailing list Csound@listserv.heanet.ie
> > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >>> > be posted here
> > >> >>>
> > >> >>> Csound mailing list
> > >> >>> Csound@listserv.heanet.ie
> > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> >>> Send bugs reports to
> > >> >>>         https://github.com/csound/csound/issues
> > >> >>> Discussions of bugs and features can be posted here
> > >> >>>
> > >> >>>
> > >> >>> Csound mailing list Csound@listserv.heanet.ie
> > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >>> be posted here
> > >> >> Csound mailing list Csound@listserv.heanet.ie
> > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >> be posted here
> > >> >>
> > >> >> Csound mailing list Csound@listserv.heanet.ie
> > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> >> be posted here
> > >> > Csound mailing list Csound@listserv.heanet.ie
> > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> > be posted here
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > Csound mailing list Csound@listserv.heanet.ie
> > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > >> > be posted here
> > >>
> > >> Csound mailing list
> > >> Csound@listserv.heanet.ie
> > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> Send bugs reports to
> > >>         https://github.com/csound/csound/issues
> > >> Discussions of bugs and features can be posted here
> > >
> > >
> > > Csound mailing list Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:41
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
> It does not check if it is below 0. (but Csound does. I get a warning if I sent a negative channel).
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>>
>> There have to be no out of bounds array assignment. Since I check the messages for being in the right interval.
>>
>> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> I think the if-then gets translated into an i & perf time check (cggoto).
>>
>> But I am thinking here the crash might be to do with accessing arrays out of bounds.
>> I can’t reproduce it though.
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >
>> > A couple of things that may (or may not) be useful:
>> >
>> > 1. This post discusses the victim error message:
>> >
>> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >
>> > 2. There is an i-time if-then used that wraps perf-time code (the
>> > diskin's). Could you try:
>> >
>> >    ichan filenchnls gSFiles[iChannel]
>> >    kchan init ichan
>> >    if (kchan == 1) then
>> >
>> >
>> >
>> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> > <anton.kholomiov@gmail.com> wrote:
>> >> Here is the code
>> >>
>> >> ~~~
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac   -d
>> >> </CsOptions>
>> >> <CsInstruments>
>> >>
>> >> sr = 44100
>> >> ksmps = 64
>> >> nchnls = 2
>> >> 0dbfs  = 1
>> >>
>> >> #ifndef PORT
>> >>    #define PORT        # 7700 #
>> >> #end
>> >>
>> >> #ifndef SIZE
>> >>    #define SIZE        # 8 #
>> >> #end
>> >>
>> >> gkVolume   init 1
>> >> gSFile     init ""
>> >>
>> >> gSFiles[]   init $SIZE
>> >> gkVolumes[] init $SIZE
>> >>
>> >> gaL init 0
>> >> gaR init 0
>> >>
>> >> gihandle OSCinit $PORT
>> >>
>> >> gkFadeTime init 1
>> >>
>> >> opcode FracInstr, k, ik
>> >>    iInstrNum, kChannel xin
>> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >>    xout kres
>> >> endop
>> >>
>> >> instr   PlayMsg
>> >>    SFile = ""
>> >>    kVolume   init 0
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    kSched FracInstr 100, kChannel
>> >>    kRun   FracInstr 80,  kChannel
>> >>
>> >>    printk 0,kSched
>> >>     printk 0,kRun
>> >>
>> >>
>> >>    turnoff2 kSched, 4, 0
>> >>    turnoff2 kRun,  4, gkFadeTime
>> >>    gSFiles[kChannel] strcpyk SFile
>> >>    event "i", kSched, 0, -1, kChannel
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr StopMsg
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    kSched FracInstr 100, kChannel
>> >>    kRun   FracInstr 80,  kChannel
>> >>    turnoff2 kSched, 4, 0
>> >>    turnoff2 kRun,  4, gkFadeTime
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr ResumeMsg
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    kSched FracInstr 100, kChannel
>> >>    kRun   FracInstr 80,  kChannel
>> >>    turnoff2 kSched, 4, 0
>> >>    turnoff2 kRun,  4, gkFadeTime
>> >>    event "i", kSched, 0, -1, kChannel
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >>
>> >> instr   SetVolMsg
>> >>    kVolume   init 0
>> >>    kChannel  init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >>    gkVolumes[kChannel] = kVolume
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr   SetFadeMsg
>> >>    kFade   init 0
>> >>    kk init 0
>> >>
>> >> nxtmsg:
>> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> if (kk == 0) goto ex
>> >>    gkFadeTime = kFade
>> >>    kgoto nxtmsg
>> >> ex:
>> >> endin
>> >>
>> >> instr 80
>> >>    print p1
>> >>    idur    = p3
>> >>    iFadeTime = i(gkFadeTime)
>> >>    iChannel  = p4
>> >>    ichan filenchnls gSFiles[iChannel]
>> >>    if (ichan == 1) then
>> >>        al diskin2 gSFiles[iChannel], 1
>> >>        ar = al
>> >>    else
>> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >>    endif
>> >>
>> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
>> >> iFadeTime, 0
>> >>    kvol    port gkVolumes[iChannel], 0.05
>> >>
>> >>    gaL  = gaL + kenv * kvol * al
>> >>    gaR  = gaR + kenv * kvol * ar
>> >> endin
>> >>
>> >> instr 100
>> >>    iChannel  = p4
>> >>    iFadeTime = i(gkFadeTime)
>> >>    ilen  filelen gSFiles[iChannel]
>> >>    km    metro (1 / (ilen - iFadeTime))
>> >>    kRun FracInstr 80, iChannel
>> >>    if (km == 1)  then
>> >>        event "i", kRun, 0, ilen, iChannel
>> >>    endif
>> >> endin
>> >>
>> >> instr 110
>> >>    outs gaL, gaR
>> >>    gaL = 0
>> >>    gaR = 0
>> >> endin
>> >>
>> >> instr Init
>> >>    kCount = 0
>> >>    until (kCount == lenarray(gkVolumes)) do
>> >>        gkVolumes[kCount] = 1
>> >>        kCount = kCount + 1
>> >>    od
>> >> endin
>> >>
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >>
>> >> f0 1000000
>> >>
>> >> i "Init" 0 0.01
>> >>
>> >> i   "PlayMsg"    0 -1
>> >> i   "SetVolMsg"  0 -1
>> >> i   "SetFadeMsg" 0 -1
>> >> i   "StopMsg"    0 -1
>> >> i   "ResumeMsg"  0 -1
>> >>
>> >> i 110 0 -1
>> >> e
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >> ~~~
>> >>
>> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >>>
>> >>> Can you post the Csound code? I see no global arrays in your earlier
>> >>> flow.csd
>> >>> ========================
>> >>> Dr Victor Lazzarini
>> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >>> Maynooth University,
>> >>> Maynooth, Co Kildare, Ireland
>> >>> Tel: 00 353 7086936
>> >>> Fax: 00 353 1 7086952
>> >>>
>> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
>> >>>> wrote:
>> >>>>
>> >>>> Here I'm reading the same file with diskin2 in the two instances of the
>> >>>> same instrument.
>> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >>>>
>> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> >>>> The last message I've sent was to set the volume on channel. It assigns
>> >>>> a value to the cell of global array.
>> >>>>
>> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> >>>> Here is message from gdb:
>> >>>>
>> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >>>>     number of samples out of range:        2        2
>> >>>> new alloc for instr 80:
>> >>>> instr 80:  p1 = 80.005
>> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >>>>     number of samples out of range:     1315      451
>> >>>> instr 80:  p1 = 80.001
>> >>>>
>> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >>>> malloc.c:4163
>> >>>> 4163    malloc.c: No such file or directory.
>> >>>> (gdb) bt
>> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >>>>    at malloc.c:4163
>> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
>> >>>>    at malloc.c:3423
>> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >>>> /usr/lib/libcsound64.so.6.0
>> >>>> #10 0x0000000000401358 in ?? ()
>> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
>> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
>> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >>>> libc-start.c:287
>> >>>> #12 0x00000000004013b0 in _start ()
>> >>>>
>> >>>>
>> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> >>>> Thanks for the quick reply, Victor.
>> >>>> I'll report back if I encounter the problem again!
>> >>>> Though I'm not that good with gdb
>> >>>>
>> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >>>> use the run command with the arguments you need eg
>> >>>>
>> >>>> run mycsd.csd
>> >>>>
>> >>>> when it crashes you can try using the
>> >>>> backtrace command to show where it stopped.
>> >>>>
>> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >>>> wrote:
>> >>>>
>> >>>>> How to do it?
>> >>>>>
>> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >>>>> Can you run it under a debugger?
>> >>>>>
>> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >>>>> wrote:
>> >>>>>
>> >>>>>> Unfortunately after several minutes of playing the service breaks
>> >>>>>> with the message
>> >>>>>>
>> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >>>>>> *** Error in `csound': double free or corruption (out):
>> >>>>>> 0x00000000014bfd70 ***
>> >>>>>> Csound tidy up: Aborted
>> >>>>>>
>> >>>>>> Any ideas?
>> >>>>>>
>> >>>>>>
>> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
>> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >>>>>> I post a code for service. It can play continuously wav files
>> >>>>>> on several channels. Channels are identified by numbers.
>> >>>>>>
>> >>>>>> User can for the given channel
>> >>>>>>
>> >>>>>> * start playing a wav file in the loop. The wav files are played with
>> >>>>>> xfade at the ends
>> >>>>>>   so that user percieves it like a continuous flow.
>> >>>>>>
>> >>>>>> * stop playing a file
>> >>>>>>
>> >>>>>> * resume playback
>> >>>>>>
>> >>>>>> * set the volume for the given channel
>> >>>>>>
>> >>>>>> * set a global fade in/out time
>> >>>>>>
>> >>>>>> Also there is a python file that makes it easy to trigger the service
>> >>>>>> from the code. There are some test remnants of file names you can
>> >>>>>> substitute it with your own files.
>> >>>>>>
>> >>>>>> This combo of OSC service and python client makes it easy
>> >>>>>> to livecode with python.
>> >>>>>>
>> >>>>>>
>> >>>>>> Anton
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >>>>>> Strings are updated generally at i-time, but with special provisions
>> >>>>>> for perf-time.
>> >>>>>> ========================
>> >>>>>> Dr Victor Lazzarini
>> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >>>>>> Maynooth University,
>> >>>>>> Maynooth, Co Kildare, Ireland
>> >>>>>> Tel: 00 353 7086936
>> >>>>>> Fax: 00 353 1 7086952
>> >>>>>>
>> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >>>>>>>
>> >>>>>>> Thank you for clarification. It was a blind spot for me is S behaves
>> >>>>>>> like I or like K.
>> >>>>>>> So the assignment operation works only at init time
>> >>>>>>> and for k-rate we should use strcpyk.
>> >>>>>>>
>> >>>>>>> Anton
>> >>>>>>>
>> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >>>>>>> String assignment is i-time only. Use strcpyk
>> >>>>>>>
>> >>>>>>> gSFile strcpyk SFile
>> >>>>>>> ========================
>> >>>>>>> Dr Victor Lazzarini
>> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >>>>>>> Maynooth University,
>> >>>>>>> Maynooth, Co Kildare, Ireland
>> >>>>>>> Tel: 00 353 7086936
>> >>>>>>> Fax: 00 353 1 7086952
>> >>>>>>>
>> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >>>>>>>>
>> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >>>>>>>> The service should receive the name of the wav-file and the
>> >>>>>>>> length of crossfade.
>> >>>>>>>>
>> >>>>>>>> On receive it should stop playing any previous wavs
>> >>>>>>>> and start a loop that plays next wav file.
>> >>>>>>>> The two loops should crossfade.
>> >>>>>>>>
>> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >>>>>>>> with receiving String message with OSC.
>> >>>>>>>> I receive a string-field then assign it to a global String var.
>> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT errors
>> >>>>>>>> like this
>> >>>>>>>>
>> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >>>>>>>> ilen  filelen gSFile  1
>> >>>>>>>>
>> >>>>>>>> What can be wrong with my code?
>> >>>>>>>>
>> >>>>>>>> I attach the two files.
>> >>>>>>>> csd with server and python with client to test the server.
>> >>>>>>>> The python uses pyOSC library
>> >>>>>>>>
>> >>>>>>>> Thanks,
>> >>>>>>>> Anton
>> >>>>>>>>
>> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >>>>>>>
>> >>>>>>> Csound mailing list
>> >>>>>>> Csound@listserv.heanet.ie
>> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>>>> Send bugs reports to
>> >>>>>>>        https://github.com/csound/csound/issues
>> >>>>>>> Discussions of bugs and features can be posted here
>> >>>>>>>
>> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>>>> be posted here
>> >>>>>>
>> >>>>>> Csound mailing list
>> >>>>>> Csound@listserv.heanet.ie
>> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>>> Send bugs reports to
>> >>>>>>        https://github.com/csound/csound/issues
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>>
>> >>>>>>
>> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>>> be posted here
>> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>> be posted here
>> >>>>>
>> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>>> be posted here
>> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>> be posted here
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >>>> be posted here
>> >>>
>> >>> Csound mailing list
>> >>> Csound@listserv.heanet.ie
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>        https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >        https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:43
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Well, that’s old. It will be hard for us to assess if there is a problem with the current code. For what’s worth, I’ve been running your
CSD for  about half an hour with no issues.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:38, Anton Kholomiov  wrote:
> 
> It's Csound version 6.03.2
> 
> 2016-01-24 2:37 GMT+03:00 Victor Lazzarini :
> Well, I have been running for longer than that. Still playing. And I am sending messages.
> What version of Csound are you using?
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 23 Jan 2016, at 23:30, Anton Kholomiov  wrote:
> >
> > Oh know it's not related. It can happen after any message.
> > It can happen without any message being sent
> >
> > It takes 5 to 15 minute to crash but time can pass quicker if you have good samples )
> >
> > 2016-01-24 2:28 GMT+03:00 Victor Lazzarini :
> > I mean in the instrument that receives the set_volume message (if that is how you made it crash),
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> > > On 23 Jan 2016, at 23:20, Anton Kholomiov  wrote:
> > >
> > > @Victor
> > >
> > > It takes 5 to 15 minutes....
> > > It takes some time to make it crash. Thank you for the help
> > > I'll try it tomorrow.
> > >
> > > Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
> > >
> > > 2016-01-24 2:16 GMT+03:00 Anton Kholomiov :
> > > @Steven Then I get
> > >
> > > Maybe it's better to create two separate instruments for mono and stereo diskins
> > >
> > > ~~~
> > > INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> > > ~~~
> > >
> > >
> > > 2016-01-24 2:10 GMT+03:00 Steven Yi :
> > > A couple of things that may (or may not) be useful:
> > >
> > > 1. This post discusses the victim error message:
> > >
> > > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> > >
> > > 2. There is an i-time if-then used that wraps perf-time code (the
> > > diskin's). Could you try:
> > >
> > >     ichan filenchnls gSFiles[iChannel]
> > >     kchan init ichan
> > >     if (kchan == 1) then
> > >
> > >
> > >
> > > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> > >  wrote:
> > > > Here is the code
> > > >
> > > > ~~~
> > > > 
> > > > 
> > > > -odac   -d
> > > > 
> > > > 
> > > >
> > > > sr = 44100
> > > > ksmps = 64
> > > > nchnls = 2
> > > > 0dbfs  = 1
> > > >
> > > > #ifndef PORT
> > > >     #define PORT        # 7700 #
> > > > #end
> > > >
> > > > #ifndef SIZE
> > > >     #define SIZE        # 8 #
> > > > #end
> > > >
> > > > gkVolume   init 1
> > > > gSFile     init ""
> > > >
> > > > gSFiles[]   init $SIZE
> > > > gkVolumes[] init $SIZE
> > > >
> > > > gaL init 0
> > > > gaR init 0
> > > >
> > > > gihandle OSCinit $PORT
> > > >
> > > > gkFadeTime init 1
> > > >
> > > > opcode FracInstr, k, ik
> > > >     iInstrNum, kChannel xin
> > > >     kres = iInstrNum + ((kChannel + 1) / 1000)
> > > >     xout kres
> > > > endop
> > > >
> > > > instr   PlayMsg
> > > >     SFile = ""
> > > >     kVolume   init 0
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     kSched FracInstr 100, kChannel
> > > >     kRun   FracInstr 80,  kChannel
> > > >
> > > >     printk 0,kSched
> > > >      printk 0,kRun
> > > >
> > > >
> > > >     turnoff2 kSched, 4, 0
> > > >     turnoff2 kRun,  4, gkFadeTime
> > > >     gSFiles[kChannel] strcpyk SFile
> > > >     event "i", kSched, 0, -1, kChannel
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr StopMsg
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     kSched FracInstr 100, kChannel
> > > >     kRun   FracInstr 80,  kChannel
> > > >     turnoff2 kSched, 4, 0
> > > >     turnoff2 kRun,  4, gkFadeTime
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr ResumeMsg
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     kSched FracInstr 100, kChannel
> > > >     kRun   FracInstr 80,  kChannel
> > > >     turnoff2 kSched, 4, 0
> > > >     turnoff2 kRun,  4, gkFadeTime
> > > >     event "i", kSched, 0, -1, kChannel
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > >
> > > > instr   SetVolMsg
> > > >     kVolume   init 0
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     gkVolumes[kChannel] = kVolume
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr   SetFadeMsg
> > > >     kFade   init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > > > if (kk == 0) goto ex
> > > >     gkFadeTime = kFade
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr 80
> > > >     print p1
> > > >     idur    = p3
> > > >     iFadeTime = i(gkFadeTime)
> > > >     iChannel  = p4
> > > >     ichan filenchnls gSFiles[iChannel]
> > > >     if (ichan == 1) then
> > > >         al diskin2 gSFiles[iChannel], 1
> > > >         ar = al
> > > >     else
> > > >         al, ar diskin2 gSFiles[iChannel], 1
> > > >     endif
> > > >
> > > >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > > > iFadeTime, 0
> > > >     kvol    port gkVolumes[iChannel], 0.05
> > > >
> > > >     gaL  = gaL + kenv * kvol * al
> > > >     gaR  = gaR + kenv * kvol * ar
> > > > endin
> > > >
> > > > instr 100
> > > >     iChannel  = p4
> > > >     iFadeTime = i(gkFadeTime)
> > > >     ilen  filelen gSFiles[iChannel]
> > > >     km    metro (1 / (ilen - iFadeTime))
> > > >     kRun FracInstr 80, iChannel
> > > >     if (km == 1)  then
> > > >         event "i", kRun, 0, ilen, iChannel
> > > >     endif
> > > > endin
> > > >
> > > > instr 110
> > > >     outs gaL, gaR
> > > >     gaL = 0
> > > >     gaR = 0
> > > > endin
> > > >
> > > > instr Init
> > > >     kCount = 0
> > > >     until (kCount == lenarray(gkVolumes)) do
> > > >         gkVolumes[kCount] = 1
> > > >         kCount = kCount + 1
> > > >     od
> > > > endin
> > > >
> > > >
> > > > 
> > > > 
> > > >
> > > > f0 1000000
> > > >
> > > > i "Init" 0 0.01
> > > >
> > > > i   "PlayMsg"    0 -1
> > > > i   "SetVolMsg"  0 -1
> > > > i   "SetFadeMsg" 0 -1
> > > > i   "StopMsg"    0 -1
> > > > i   "ResumeMsg"  0 -1
> > > >
> > > > i 110 0 -1
> > > > e
> > > > 
> > > > 
> > > > ~~~
> > > >
> > > > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
> > > >>
> > > >> Can you post the Csound code? I see no global arrays in your earlier
> > > >> flow.csd
> > > >> ========================
> > > >> Dr Victor Lazzarini
> > > >> Dean of Arts, Celtic Studies and Philosophy,
> > > >> Maynooth University,
> > > >> Maynooth, Co Kildare, Ireland
> > > >> Tel: 00 353 7086936
> > > >> Fax: 00 353 1 7086952
> > > >>
> > > >> > On 23 Jan 2016, at 22:36, Anton Kholomiov 
> > > >> > wrote:
> > > >> >
> > > >> > Here I'm reading the same file with diskin2 in the two instances of the
> > > >> > same instrument.
> > > >> > It's triggered with fractional numbers. 80.001 and 80.005
> > > >> >
> > > >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> > > >> > The last message I've sent was to set the volume on channel. It assigns
> > > >> > a value to the cell of global array.
> > > >> >
> > > >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> > > >> > Here is message from gdb:
> > > >> >
> > > >> > diskin2: opened '/home/anton/Seashore.wav':
> > > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > > >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> > > >> >      number of samples out of range:        2        2
> > > >> > new alloc for instr 80:
> > > >> > instr 80:  p1 = 80.005
> > > >> > diskin2: opened '/home/anton/Seashore.wav':
> > > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > > >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> > > >> >      number of samples out of range:     1315      451
> > > >> > instr 80:  p1 = 80.001
> > > >> >
> > > >> > Program received signal SIGSEGV, Segmentation fault.
> > > >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
> > > >> > malloc.c:4163
> > > >> > 4163    malloc.c: No such file or directory.
> > > >> > (gdb) bt
> > > >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
> > > >> >     at malloc.c:4163
> > > >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> > > >> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
> > > >> >     at malloc.c:3423
> > > >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
> > > >> >     elem_size=) at malloc.c:3219
> > > >> > #3  0x00007ffff70df5f2 in sf_open ()
> > > >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> > > >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> > > >> > /usr/lib/libcsound64.so.6.0
> > > >> > #10 0x0000000000401358 in ?? ()
> > > >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> > > >> >     argv=0x7fffffffd7c8, init=, fini=,
> > > >> >     rtld_fini=, stack_end=0x7fffffffd7b8) at
> > > >> > libc-start.c:287
> > > >> > #12 0x00000000004013b0 in _start ()
> > > >> >
> > > >> >
> > > >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> > > >> > Thanks for the quick reply, Victor.
> > > >> > I'll report back if I encounter the problem again!
> > > >> > Though I'm not that good with gdb
> > > >> >
> > > >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> > > >> > Use gdb. Are you using the csound command? Do gdb csound, then
> > > >> > use the run command with the arguments you need eg
> > > >> >
> > > >> > run mycsd.csd
> > > >> >
> > > >> > when it crashes you can try using the
> > > >> > backtrace command to show where it stopped.
> > > >> >
> > > >> > On 23 Jan 2016, at 22:07, Anton Kholomiov 
> > > >> > wrote:
> > > >> >
> > > >> >> How to do it?
> > > >> >>
> > > >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
> > > >> >> Can you run it under a debugger?
> > > >> >>
> > > >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov 
> > > >> >> wrote:
> > > >> >>
> > > >> >>> Unfortunately after several minutes of playing the service breaks
> > > >> >>> with the message
> > > >> >>>
> > > >> >>> diskin2: opened '/home/anton/Seashore.wav':
> > > >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> > > >> >>> *** Error in `csound': double free or corruption (out):
> > > >> >>> 0x00000000014bfd70 ***
> > > >> >>> Csound tidy up: Aborted
> > > >> >>>
> > > >> >>> Any ideas?
> > > >> >>>
> > > >> >>>
> > > >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
> > > >> >>> It's done. Just in case if anyone interested in the end result.
> > > >> >>> I post a code for service. It can play continuously wav files
> > > >> >>> on several channels. Channels are identified by numbers.
> > > >> >>>
> > > >> >>> User can for the given channel
> > > >> >>>
> > > >> >>> * start playing a wav file in the loop. The wav files are played with
> > > >> >>> xfade at the ends
> > > >> >>>    so that user percieves it like a continuous flow.
> > > >> >>>
> > > >> >>> * stop playing a file
> > > >> >>>
> > > >> >>> * resume playback
> > > >> >>>
> > > >> >>> * set the volume for the given channel
> > > >> >>>
> > > >> >>> * set a global fade in/out time
> > > >> >>>
> > > >> >>> Also there is a python file that makes it easy to trigger the service
> > > >> >>> from the code. There are some test remnants of file names you can
> > > >> >>> substitute it with your own files.
> > > >> >>>
> > > >> >>> This combo of OSC service and python client makes it easy
> > > >> >>> to livecode with python.
> > > >> >>>
> > > >> >>>
> > > >> >>> Anton
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> > > >> >>> :
> > > >> >>> Strings are updated generally at i-time, but with special provisions
> > > >> >>> for perf-time.
> > > >> >>> ========================
> > > >> >>> Dr Victor Lazzarini
> > > >> >>> Dean of Arts, Celtic Studies and Philosophy,
> > > >> >>> Maynooth University,
> > > >> >>> Maynooth, Co Kildare, Ireland
> > > >> >>> Tel: 00 353 7086936
> > > >> >>> Fax: 00 353 1 7086952
> > > >> >>>
> > > >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> > > >> >>> >  wrote:
> > > >> >>> >
> > > >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> > > >> >>> > like I or like K.
> > > >> >>> > So the assignment operation works only at init time
> > > >> >>> > and for k-rate we should use strcpyk.
> > > >> >>> >
> > > >> >>> > Anton
> > > >> >>> >
> > > >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> > > >> >>> > :
> > > >> >>> > String assignment is i-time only. Use strcpyk
> > > >> >>> >
> > > >> >>> > gSFile strcpyk SFile
> > > >> >>> > ========================
> > > >> >>> > Dr Victor Lazzarini
> > > >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> > > >> >>> > Maynooth University,
> > > >> >>> > Maynooth, Co Kildare, Ireland
> > > >> >>> > Tel: 00 353 7086936
> > > >> >>> > Fax: 00 353 1 7086952
> > > >> >>> >
> > > >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> > > >> >>> > >  wrote:
> > > >> >>> > >
> > > >> >>> > > I'm trying to write an OSC-server with Csound.
> > > >> >>> > > The service should receive the name of the wav-file and the
> > > >> >>> > > length of crossfade.
> > > >> >>> > >
> > > >> >>> > > On receive it should stop playing any previous wavs
> > > >> >>> > > and start a loop that plays next wav file.
> > > >> >>> > > The two loops should crossfade.
> > > >> >>> > >
> > > >> >>> > > While trying to write such a thing I'm getting into trouble
> > > >> >>> > > with receiving String message with OSC.
> > > >> >>> > > I receive a string-field then assign it to a global String var.
> > > >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> > > >> >>> > > like this
> > > >> >>> > >
> > > >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> > > >> >>> > > ilen  filelen gSFile  1
> > > >> >>> > >
> > > >> >>> > > What can be wrong with my code?
> > > >> >>> > >
> > > >> >>> > > I attach the two files.
> > > >> >>> > > csd with server and python with client to test the server.
> > > >> >>> > > The python uses pyOSC library
> > > >> >>> > >
> > > >> >>> > > Thanks,
> > > >> >>> > > Anton
> > > >> >>> > >
> > > >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> > > >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >>> > > be posted here 
> > > >> >>> >
> > > >> >>> > Csound mailing list
> > > >> >>> > Csound@listserv.heanet.ie
> > > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > >> >>> > Send bugs reports to
> > > >> >>> >         https://github.com/csound/csound/issues
> > > >> >>> > Discussions of bugs and features can be posted here
> > > >> >>> >
> > > >> >>> > Csound mailing list Csound@listserv.heanet.ie
> > > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >>> > be posted here
> > > >> >>>
> > > >> >>> Csound mailing list
> > > >> >>> Csound@listserv.heanet.ie
> > > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > >> >>> Send bugs reports to
> > > >> >>>         https://github.com/csound/csound/issues
> > > >> >>> Discussions of bugs and features can be posted here
> > > >> >>>
> > > >> >>>
> > > >> >>> Csound mailing list Csound@listserv.heanet.ie
> > > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >>> be posted here
> > > >> >> Csound mailing list Csound@listserv.heanet.ie
> > > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >> be posted here
> > > >> >>
> > > >> >> Csound mailing list Csound@listserv.heanet.ie
> > > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >> be posted here
> > > >> > Csound mailing list Csound@listserv.heanet.ie
> > > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> > be posted here
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> > Csound mailing list Csound@listserv.heanet.ie
> > > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> > be posted here
> > > >>
> > > >> Csound mailing list
> > > >> Csound@listserv.heanet.ie
> > > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > >> Send bugs reports to
> > > >>         https://github.com/csound/csound/issues
> > > >> Discussions of bugs and features can be posted here
> > > >
> > > >
> > > > Csound mailing list Csound@listserv.heanet.ie
> > > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > be posted here
> > >
> > > Csound mailing list
> > > Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > Send bugs reports to
> > >         https://github.com/csound/csound/issues
> > > Discussions of bugs and features can be posted here
> > >
> > >
> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-23 23:45
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Thanks for your patience with me. 
I think I need to find out how to build the csound...

Anton

2016-01-24 2:43 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Well, that’s old. It will be hard for us to assess if there is a problem with the current code. For what’s worth, I’ve been running your
CSD for  about half an hour with no issues.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 23 Jan 2016, at 23:38, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
>
> It's Csound version 6.03.2
>
> 2016-01-24 2:37 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> Well, I have been running for longer than that. Still playing. And I am sending messages.
> What version of Csound are you using?
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 23 Jan 2016, at 23:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> >
> > Oh know it's not related. It can happen after any message.
> > It can happen without any message being sent
> >
> > It takes 5 to 15 minute to crash but time can pass quicker if you have good samples )
> >
> > 2016-01-24 2:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > I mean in the instrument that receives the set_volume message (if that is how you made it crash),
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> > > On 23 Jan 2016, at 23:20, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
> > >
> > > @Victor
> > >
> > > It takes 5 to 15 minutes....
> > > It takes some time to make it crash. Thank you for the help
> > > I'll try it tomorrow.
> > >
> > > Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
> > >
> > > 2016-01-24 2:16 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > > @Steven Then I get
> > >
> > > Maybe it's better to create two separate instruments for mono and stereo diskins
> > >
> > > ~~~
> > > INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> > > ~~~
> > >
> > >
> > > 2016-01-24 2:10 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> > > A couple of things that may (or may not) be useful:
> > >
> > > 1. This post discusses the victim error message:
> > >
> > > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> > >
> > > 2. There is an i-time if-then used that wraps perf-time code (the
> > > diskin's). Could you try:
> > >
> > >     ichan filenchnls gSFiles[iChannel]
> > >     kchan init ichan
> > >     if (kchan == 1) then
> > >
> > >
> > >
> > > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> > > <anton.kholomiov@gmail.com> wrote:
> > > > Here is the code
> > > >
> > > > ~~~
> > > > <CsoundSynthesizer>
> > > > <CsOptions>
> > > > -odac   -d
> > > > </CsOptions>
> > > > <CsInstruments>
> > > >
> > > > sr = 44100
> > > > ksmps = 64
> > > > nchnls = 2
> > > > 0dbfs  = 1
> > > >
> > > > #ifndef PORT
> > > >     #define PORT        # 7700 #
> > > > #end
> > > >
> > > > #ifndef SIZE
> > > >     #define SIZE        # 8 #
> > > > #end
> > > >
> > > > gkVolume   init 1
> > > > gSFile     init ""
> > > >
> > > > gSFiles[]   init $SIZE
> > > > gkVolumes[] init $SIZE
> > > >
> > > > gaL init 0
> > > > gaR init 0
> > > >
> > > > gihandle OSCinit $PORT
> > > >
> > > > gkFadeTime init 1
> > > >
> > > > opcode FracInstr, k, ik
> > > >     iInstrNum, kChannel xin
> > > >     kres = iInstrNum + ((kChannel + 1) / 1000)
> > > >     xout kres
> > > > endop
> > > >
> > > > instr   PlayMsg
> > > >     SFile = ""
> > > >     kVolume   init 0
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     kSched FracInstr 100, kChannel
> > > >     kRun   FracInstr 80,  kChannel
> > > >
> > > >     printk 0,kSched
> > > >      printk 0,kRun
> > > >
> > > >
> > > >     turnoff2 kSched, 4, 0
> > > >     turnoff2 kRun,  4, gkFadeTime
> > > >     gSFiles[kChannel] strcpyk SFile
> > > >     event "i", kSched, 0, -1, kChannel
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr StopMsg
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     kSched FracInstr 100, kChannel
> > > >     kRun   FracInstr 80,  kChannel
> > > >     turnoff2 kSched, 4, 0
> > > >     turnoff2 kRun,  4, gkFadeTime
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr ResumeMsg
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     kSched FracInstr 100, kChannel
> > > >     kRun   FracInstr 80,  kChannel
> > > >     turnoff2 kSched, 4, 0
> > > >     turnoff2 kRun,  4, gkFadeTime
> > > >     event "i", kSched, 0, -1, kChannel
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > >
> > > > instr   SetVolMsg
> > > >     kVolume   init 0
> > > >     kChannel  init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > >     gkVolumes[kChannel] = kVolume
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr   SetFadeMsg
> > > >     kFade   init 0
> > > >     kk init 0
> > > >
> > > > nxtmsg:
> > > >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > > > if (kk == 0) goto ex
> > > >     gkFadeTime = kFade
> > > >     kgoto nxtmsg
> > > > ex:
> > > > endin
> > > >
> > > > instr 80
> > > >     print p1
> > > >     idur    = p3
> > > >     iFadeTime = i(gkFadeTime)
> > > >     iChannel  = p4
> > > >     ichan filenchnls gSFiles[iChannel]
> > > >     if (ichan == 1) then
> > > >         al diskin2 gSFiles[iChannel], 1
> > > >         ar = al
> > > >     else
> > > >         al, ar diskin2 gSFiles[iChannel], 1
> > > >     endif
> > > >
> > > >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > > > iFadeTime, 0
> > > >     kvol    port gkVolumes[iChannel], 0.05
> > > >
> > > >     gaL  = gaL + kenv * kvol * al
> > > >     gaR  = gaR + kenv * kvol * ar
> > > > endin
> > > >
> > > > instr 100
> > > >     iChannel  = p4
> > > >     iFadeTime = i(gkFadeTime)
> > > >     ilen  filelen gSFiles[iChannel]
> > > >     km    metro (1 / (ilen - iFadeTime))
> > > >     kRun FracInstr 80, iChannel
> > > >     if (km == 1)  then
> > > >         event "i", kRun, 0, ilen, iChannel
> > > >     endif
> > > > endin
> > > >
> > > > instr 110
> > > >     outs gaL, gaR
> > > >     gaL = 0
> > > >     gaR = 0
> > > > endin
> > > >
> > > > instr Init
> > > >     kCount = 0
> > > >     until (kCount == lenarray(gkVolumes)) do
> > > >         gkVolumes[kCount] = 1
> > > >         kCount = kCount + 1
> > > >     od
> > > > endin
> > > >
> > > >
> > > > </CsInstruments>
> > > > <CsScore>
> > > >
> > > > f0 1000000
> > > >
> > > > i "Init" 0 0.01
> > > >
> > > > i   "PlayMsg"    0 -1
> > > > i   "SetVolMsg"  0 -1
> > > > i   "SetFadeMsg" 0 -1
> > > > i   "StopMsg"    0 -1
> > > > i   "ResumeMsg"  0 -1
> > > >
> > > > i 110 0 -1
> > > > e
> > > > </CsScore>
> > > > </CsoundSynthesizer>
> > > > ~~~
> > > >
> > > > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > > >>
> > > >> Can you post the Csound code? I see no global arrays in your earlier
> > > >> flow.csd
> > > >> ========================
> > > >> Dr Victor Lazzarini
> > > >> Dean of Arts, Celtic Studies and Philosophy,
> > > >> Maynooth University,
> > > >> Maynooth, Co Kildare, Ireland
> > > >> Tel: 00 353 7086936
> > > >> Fax: 00 353 1 7086952
> > > >>
> > > >> > On 23 Jan 2016, at 22:36, Anton Kholomiov <anton.kholomiov@gmail.com>
> > > >> > wrote:
> > > >> >
> > > >> > Here I'm reading the same file with diskin2 in the two instances of the
> > > >> > same instrument.
> > > >> > It's triggered with fractional numbers. 80.001 and 80.005
> > > >> >
> > > >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > > >> > The last message I've sent was to set the volume on channel. It assigns
> > > >> > a value to the cell of global array.
> > > >> >
> > > >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > > >> > Here is message from gdb:
> > > >> >
> > > >> > diskin2: opened '/home/anton/Seashore.wav':
> > > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > > >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> > > >> >      number of samples out of range:        2        2
> > > >> > new alloc for instr 80:
> > > >> > instr 80:  p1 = 80.005
> > > >> > diskin2: opened '/home/anton/Seashore.wav':
> > > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > > >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> > > >> >      number of samples out of range:     1315      451
> > > >> > instr 80:  p1 = 80.001
> > > >> >
> > > >> > Program received signal SIGSEGV, Segmentation fault.
> > > >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
> > > >> > malloc.c:4163
> > > >> > 4163    malloc.c: No such file or directory.
> > > >> > (gdb) bt
> > > >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
> > > >> >     at malloc.c:4163
> > > >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> > > >> >     av=av@entry=0x7ffff76fa760 <main_arena>, bytes=bytes@entry=59184)
> > > >> >     at malloc.c:3423
> > > >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
> > > >> >     elem_size=<optimized out>) at malloc.c:3219
> > > >> > #3  0x00007ffff70df5f2 in sf_open ()
> > > >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> > > >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > > >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> > > >> > /usr/lib/libcsound64.so.6.0
> > > >> > #10 0x0000000000401358 in ?? ()
> > > >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> > > >> >     argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized out>,
> > > >> >     rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
> > > >> > libc-start.c:287
> > > >> > #12 0x00000000004013b0 in _start ()
> > > >> >
> > > >> >
> > > >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > > >> > Thanks for the quick reply, Victor.
> > > >> > I'll report back if I encounter the problem again!
> > > >> > Though I'm not that good with gdb
> > > >> >
> > > >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > > >> > Use gdb. Are you using the csound command? Do gdb csound, then
> > > >> > use the run command with the arguments you need eg
> > > >> >
> > > >> > run mycsd.csd
> > > >> >
> > > >> > when it crashes you can try using the
> > > >> > backtrace command to show where it stopped.
> > > >> >
> > > >> > On 23 Jan 2016, at 22:07, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
> > > >> > wrote:
> > > >> >
> > > >> >> How to do it?
> > > >> >>
> > > >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > > >> >> Can you run it under a debugger?
> > > >> >>
> > > >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
> > > >> >> wrote:
> > > >> >>
> > > >> >>> Unfortunately after several minutes of playing the service breaks
> > > >> >>> with the message
> > > >> >>>
> > > >> >>> diskin2: opened '/home/anton/Seashore.wav':
> > > >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> > > >> >>> *** Error in `csound': double free or corruption (out):
> > > >> >>> 0x00000000014bfd70 ***
> > > >> >>> Csound tidy up: Aborted
> > > >> >>>
> > > >> >>> Any ideas?
> > > >> >>>
> > > >> >>>
> > > >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> > > >> >>> It's done. Just in case if anyone interested in the end result.
> > > >> >>> I post a code for service. It can play continuously wav files
> > > >> >>> on several channels. Channels are identified by numbers.
> > > >> >>>
> > > >> >>> User can for the given channel
> > > >> >>>
> > > >> >>> * start playing a wav file in the loop. The wav files are played with
> > > >> >>> xfade at the ends
> > > >> >>>    so that user percieves it like a continuous flow.
> > > >> >>>
> > > >> >>> * stop playing a file
> > > >> >>>
> > > >> >>> * resume playback
> > > >> >>>
> > > >> >>> * set the volume for the given channel
> > > >> >>>
> > > >> >>> * set a global fade in/out time
> > > >> >>>
> > > >> >>> Also there is a python file that makes it easy to trigger the service
> > > >> >>> from the code. There are some test remnants of file names you can
> > > >> >>> substitute it with your own files.
> > > >> >>>
> > > >> >>> This combo of OSC service and python client makes it easy
> > > >> >>> to livecode with python.
> > > >> >>>
> > > >> >>>
> > > >> >>> Anton
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>>
> > > >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> > > >> >>> <Victor.Lazzarini@nuim.ie>:
> > > >> >>> Strings are updated generally at i-time, but with special provisions
> > > >> >>> for perf-time.
> > > >> >>> ========================
> > > >> >>> Dr Victor Lazzarini
> > > >> >>> Dean of Arts, Celtic Studies and Philosophy,
> > > >> >>> Maynooth University,
> > > >> >>> Maynooth, Co Kildare, Ireland
> > > >> >>> Tel: 00 353 7086936
> > > >> >>> Fax: 00 353 1 7086952
> > > >> >>>
> > > >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> > > >> >>> > <anton.kholomiov@gmail.com> wrote:
> > > >> >>> >
> > > >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> > > >> >>> > like I or like K.
> > > >> >>> > So the assignment operation works only at init time
> > > >> >>> > and for k-rate we should use strcpyk.
> > > >> >>> >
> > > >> >>> > Anton
> > > >> >>> >
> > > >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> > > >> >>> > <Victor.Lazzarini@nuim.ie>:
> > > >> >>> > String assignment is i-time only. Use strcpyk
> > > >> >>> >
> > > >> >>> > gSFile strcpyk SFile
> > > >> >>> > ========================
> > > >> >>> > Dr Victor Lazzarini
> > > >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> > > >> >>> > Maynooth University,
> > > >> >>> > Maynooth, Co Kildare, Ireland
> > > >> >>> > Tel: 00 353 7086936
> > > >> >>> > Fax: 00 353 1 7086952
> > > >> >>> >
> > > >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> > > >> >>> > > <anton.kholomiov@GMAIL.COM> wrote:
> > > >> >>> > >
> > > >> >>> > > I'm trying to write an OSC-server with Csound.
> > > >> >>> > > The service should receive the name of the wav-file and the
> > > >> >>> > > length of crossfade.
> > > >> >>> > >
> > > >> >>> > > On receive it should stop playing any previous wavs
> > > >> >>> > > and start a loop that plays next wav file.
> > > >> >>> > > The two loops should crossfade.
> > > >> >>> > >
> > > >> >>> > > While trying to write such a thing I'm getting into trouble
> > > >> >>> > > with receiving String message with OSC.
> > > >> >>> > > I receive a string-field then assign it to a global String var.
> > > >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> > > >> >>> > > like this
> > > >> >>> > >
> > > >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> > > >> >>> > > ilen  filelen gSFile  1
> > > >> >>> > >
> > > >> >>> > > What can be wrong with my code?
> > > >> >>> > >
> > > >> >>> > > I attach the two files.
> > > >> >>> > > csd with server and python with client to test the server.
> > > >> >>> > > The python uses pyOSC library
> > > >> >>> > >
> > > >> >>> > > Thanks,
> > > >> >>> > > Anton
> > > >> >>> > >
> > > >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> > > >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >>> > > be posted here <flow.csd><test_flow.py>
> > > >> >>> >
> > > >> >>> > Csound mailing list
> > > >> >>> > Csound@listserv.heanet.ie
> > > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > >> >>> > Send bugs reports to
> > > >> >>> >         https://github.com/csound/csound/issues
> > > >> >>> > Discussions of bugs and features can be posted here
> > > >> >>> >
> > > >> >>> > Csound mailing list Csound@listserv.heanet.ie
> > > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >>> > be posted here
> > > >> >>>
> > > >> >>> Csound mailing list
> > > >> >>> Csound@listserv.heanet.ie
> > > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > >> >>> Send bugs reports to
> > > >> >>>         https://github.com/csound/csound/issues
> > > >> >>> Discussions of bugs and features can be posted here
> > > >> >>>
> > > >> >>>
> > > >> >>> Csound mailing list Csound@listserv.heanet.ie
> > > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >>> be posted here
> > > >> >> Csound mailing list Csound@listserv.heanet.ie
> > > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >> be posted here
> > > >> >>
> > > >> >> Csound mailing list Csound@listserv.heanet.ie
> > > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> >> be posted here
> > > >> > Csound mailing list Csound@listserv.heanet.ie
> > > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> > be posted here
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> > Csound mailing list Csound@listserv.heanet.ie
> > > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > >> > be posted here
> > > >>
> > > >> Csound mailing list
> > > >> Csound@listserv.heanet.ie
> > > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > >> Send bugs reports to
> > > >>         https://github.com/csound/csound/issues
> > > >> Discussions of bugs and features can be posted here
> > > >
> > > >
> > > > Csound mailing list Csound@listserv.heanet.ie
> > > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > be posted here
> > >
> > > Csound mailing list
> > > Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > Send bugs reports to
> > >         https://github.com/csound/csound/issues
> > > Discussions of bugs and features can be posted here
> > >
> > >
> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-23 23:51
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
https://github.com/csound/csound/blob/develop/BUILD.md
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 23 Jan 2016, at 23:45, Anton Kholomiov  wrote:
> 
> Thanks for your patience with me. 
> I think I need to find out how to build the csound...
> 
> Anton
> 
> 2016-01-24 2:43 GMT+03:00 Victor Lazzarini :
> Well, that’s old. It will be hard for us to assess if there is a problem with the current code. For what’s worth, I’ve been running your
> CSD for  about half an hour with no issues.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 23 Jan 2016, at 23:38, Anton Kholomiov  wrote:
> >
> > It's Csound version 6.03.2
> >
> > 2016-01-24 2:37 GMT+03:00 Victor Lazzarini :
> > Well, I have been running for longer than that. Still playing. And I am sending messages.
> > What version of Csound are you using?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> > > On 23 Jan 2016, at 23:30, Anton Kholomiov  wrote:
> > >
> > > Oh know it's not related. It can happen after any message.
> > > It can happen without any message being sent
> > >
> > > It takes 5 to 15 minute to crash but time can pass quicker if you have good samples )
> > >
> > > 2016-01-24 2:28 GMT+03:00 Victor Lazzarini :
> > > I mean in the instrument that receives the set_volume message (if that is how you made it crash),
> > > ========================
> > > Dr Victor Lazzarini
> > > Dean of Arts, Celtic Studies and Philosophy,
> > > Maynooth University,
> > > Maynooth, Co Kildare, Ireland
> > > Tel: 00 353 7086936
> > > Fax: 00 353 1 7086952
> > >
> > > > On 23 Jan 2016, at 23:20, Anton Kholomiov  wrote:
> > > >
> > > > @Victor
> > > >
> > > > It takes 5 to 15 minutes....
> > > > It takes some time to make it crash. Thank you for the help
> > > > I'll try it tomorrow.
> > > >
> > > > Do you mean the assignment in the Init instrument or in the Osc message instrument SetVolMsg?
> > > >
> > > > 2016-01-24 2:16 GMT+03:00 Anton Kholomiov :
> > > > @Steven Then I get
> > > >
> > > > Maybe it's better to create two separate instruments for mono and stereo diskins
> > > >
> > > > ~~~
> > > > INIT ERROR in instr 80: diskin2: number of output args inconsistent with number of file channels
> > > > ~~~
> > > >
> > > >
> > > > 2016-01-24 2:10 GMT+03:00 Steven Yi :
> > > > A couple of things that may (or may not) be useful:
> > > >
> > > > 1. This post discusses the victim error message:
> > > >
> > > > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
> > > >
> > > > 2. There is an i-time if-then used that wraps perf-time code (the
> > > > diskin's). Could you try:
> > > >
> > > >     ichan filenchnls gSFiles[iChannel]
> > > >     kchan init ichan
> > > >     if (kchan == 1) then
> > > >
> > > >
> > > >
> > > > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
> > > >  wrote:
> > > > > Here is the code
> > > > >
> > > > > ~~~
> > > > > 
> > > > > 
> > > > > -odac   -d
> > > > > 
> > > > > 
> > > > >
> > > > > sr = 44100
> > > > > ksmps = 64
> > > > > nchnls = 2
> > > > > 0dbfs  = 1
> > > > >
> > > > > #ifndef PORT
> > > > >     #define PORT        # 7700 #
> > > > > #end
> > > > >
> > > > > #ifndef SIZE
> > > > >     #define SIZE        # 8 #
> > > > > #end
> > > > >
> > > > > gkVolume   init 1
> > > > > gSFile     init ""
> > > > >
> > > > > gSFiles[]   init $SIZE
> > > > > gkVolumes[] init $SIZE
> > > > >
> > > > > gaL init 0
> > > > > gaR init 0
> > > > >
> > > > > gihandle OSCinit $PORT
> > > > >
> > > > > gkFadeTime init 1
> > > > >
> > > > > opcode FracInstr, k, ik
> > > > >     iInstrNum, kChannel xin
> > > > >     kres = iInstrNum + ((kChannel + 1) / 1000)
> > > > >     xout kres
> > > > > endop
> > > > >
> > > > > instr   PlayMsg
> > > > >     SFile = ""
> > > > >     kVolume   init 0
> > > > >     kChannel  init 0
> > > > >     kk init 0
> > > > >
> > > > > nxtmsg:
> > > > >     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
> > > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > > >     kSched FracInstr 100, kChannel
> > > > >     kRun   FracInstr 80,  kChannel
> > > > >
> > > > >     printk 0,kSched
> > > > >      printk 0,kRun
> > > > >
> > > > >
> > > > >     turnoff2 kSched, 4, 0
> > > > >     turnoff2 kRun,  4, gkFadeTime
> > > > >     gSFiles[kChannel] strcpyk SFile
> > > > >     event "i", kSched, 0, -1, kChannel
> > > > >     kgoto nxtmsg
> > > > > ex:
> > > > > endin
> > > > >
> > > > > instr StopMsg
> > > > >     kChannel  init 0
> > > > >     kk init 0
> > > > >
> > > > > nxtmsg:
> > > > >     kk  OSClisten gihandle, "/stop", "i", kChannel
> > > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > > >     kSched FracInstr 100, kChannel
> > > > >     kRun   FracInstr 80,  kChannel
> > > > >     turnoff2 kSched, 4, 0
> > > > >     turnoff2 kRun,  4, gkFadeTime
> > > > >     kgoto nxtmsg
> > > > > ex:
> > > > > endin
> > > > >
> > > > > instr ResumeMsg
> > > > >     kChannel  init 0
> > > > >     kk init 0
> > > > >
> > > > > nxtmsg:
> > > > >     kk  OSClisten gihandle, "/resume", "i", kChannel
> > > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > > >     kSched FracInstr 100, kChannel
> > > > >     kRun   FracInstr 80,  kChannel
> > > > >     turnoff2 kSched, 4, 0
> > > > >     turnoff2 kRun,  4, gkFadeTime
> > > > >     event "i", kSched, 0, -1, kChannel
> > > > >     kgoto nxtmsg
> > > > > ex:
> > > > > endin
> > > > >
> > > > >
> > > > > instr   SetVolMsg
> > > > >     kVolume   init 0
> > > > >     kChannel  init 0
> > > > >     kk init 0
> > > > >
> > > > > nxtmsg:
> > > > >     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
> > > > > if (kk == 0 || kChannel >= $SIZE) goto ex
> > > > >     gkVolumes[kChannel] = kVolume
> > > > >     kgoto nxtmsg
> > > > > ex:
> > > > > endin
> > > > >
> > > > > instr   SetFadeMsg
> > > > >     kFade   init 0
> > > > >     kk init 0
> > > > >
> > > > > nxtmsg:
> > > > >     kk  OSClisten gihandle, "/set_fade", "f", kFade
> > > > > if (kk == 0) goto ex
> > > > >     gkFadeTime = kFade
> > > > >     kgoto nxtmsg
> > > > > ex:
> > > > > endin
> > > > >
> > > > > instr 80
> > > > >     print p1
> > > > >     idur    = p3
> > > > >     iFadeTime = i(gkFadeTime)
> > > > >     iChannel  = p4
> > > > >     ichan filenchnls gSFiles[iChannel]
> > > > >     if (ichan == 1) then
> > > > >         al diskin2 gSFiles[iChannel], 1
> > > > >         ar = al
> > > > >     else
> > > > >         al, ar diskin2 gSFiles[iChannel], 1
> > > > >     endif
> > > > >
> > > > >     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1, iFadeTime, 0,
> > > > > iFadeTime, 0
> > > > >     kvol    port gkVolumes[iChannel], 0.05
> > > > >
> > > > >     gaL  = gaL + kenv * kvol * al
> > > > >     gaR  = gaR + kenv * kvol * ar
> > > > > endin
> > > > >
> > > > > instr 100
> > > > >     iChannel  = p4
> > > > >     iFadeTime = i(gkFadeTime)
> > > > >     ilen  filelen gSFiles[iChannel]
> > > > >     km    metro (1 / (ilen - iFadeTime))
> > > > >     kRun FracInstr 80, iChannel
> > > > >     if (km == 1)  then
> > > > >         event "i", kRun, 0, ilen, iChannel
> > > > >     endif
> > > > > endin
> > > > >
> > > > > instr 110
> > > > >     outs gaL, gaR
> > > > >     gaL = 0
> > > > >     gaR = 0
> > > > > endin
> > > > >
> > > > > instr Init
> > > > >     kCount = 0
> > > > >     until (kCount == lenarray(gkVolumes)) do
> > > > >         gkVolumes[kCount] = 1
> > > > >         kCount = kCount + 1
> > > > >     od
> > > > > endin
> > > > >
> > > > >
> > > > > 
> > > > > 
> > > > >
> > > > > f0 1000000
> > > > >
> > > > > i "Init" 0 0.01
> > > > >
> > > > > i   "PlayMsg"    0 -1
> > > > > i   "SetVolMsg"  0 -1
> > > > > i   "SetFadeMsg" 0 -1
> > > > > i   "StopMsg"    0 -1
> > > > > i   "ResumeMsg"  0 -1
> > > > >
> > > > > i 110 0 -1
> > > > > e
> > > > > 
> > > > > 
> > > > > ~~~
> > > > >
> > > > > 2016-01-24 1:59 GMT+03:00 Victor Lazzarini :
> > > > >>
> > > > >> Can you post the Csound code? I see no global arrays in your earlier
> > > > >> flow.csd
> > > > >> ========================
> > > > >> Dr Victor Lazzarini
> > > > >> Dean of Arts, Celtic Studies and Philosophy,
> > > > >> Maynooth University,
> > > > >> Maynooth, Co Kildare, Ireland
> > > > >> Tel: 00 353 7086936
> > > > >> Fax: 00 353 1 7086952
> > > > >>
> > > > >> > On 23 Jan 2016, at 22:36, Anton Kholomiov 
> > > > >> > wrote:
> > > > >> >
> > > > >> > Here I'm reading the same file with diskin2 in the two instances of the
> > > > >> > same instrument.
> > > > >> > It's triggered with fractional numbers. 80.001 and 80.005
> > > > >> >
> > > > >> > 2016-01-24 1:33 GMT+03:00 Anton Kholomiov :
> > > > >> > The last message I've sent was to set the volume on channel. It assigns
> > > > >> > a value to the cell of global array.
> > > > >> >
> > > > >> > 2016-01-24 1:32 GMT+03:00 Anton Kholomiov :
> > > > >> > Here is message from gdb:
> > > > >> >
> > > > >> > diskin2: opened '/home/anton/Seashore.wav':
> > > > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > > > >> >   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
> > > > >> >      number of samples out of range:        2        2
> > > > >> > new alloc for instr 80:
> > > > >> > instr 80:  p1 = 80.005
> > > > >> > diskin2: opened '/home/anton/Seashore.wav':
> > > > >> >          44100 Hz, 2 channel(s), 546731 sample frames
> > > > >> >   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
> > > > >> >      number of samples out of range:     1315      451
> > > > >> > instr 80:  p1 = 80.001
> > > > >> >
> > > > >> > Program received signal SIGSEGV, Segmentation fault.
> > > > >> > malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
> > > > >> > malloc.c:4163
> > > > >> > 4163    malloc.c: No such file or directory.
> > > > >> > (gdb) bt
> > > > >> > #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
> > > > >> >     at malloc.c:4163
> > > > >> > #1  0x00007ffff73bbdf8 in _int_malloc (
> > > > >> >     av=av@entry=0x7ffff76fa760 , bytes=bytes@entry=59184)
> > > > >> >     at malloc.c:3423
> > > > >> > #2  0x00007ffff73bf2cc in __libc_calloc (n=,
> > > > >> >     elem_size=) at malloc.c:3219
> > > > >> > #3  0x00007ffff70df5f2 in sf_open ()
> > > > >> >    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
> > > > >> > #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
> > > > >> > #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
> > > > >> > #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
> > > > >> > #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
> > > > >> > #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
> > > > >> > #9  0x00007ffff7a8bb5e in csoundPerform () from
> > > > >> > /usr/lib/libcsound64.so.6.0
> > > > >> > #10 0x0000000000401358 in ?? ()
> > > > >> > #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130, argc=2,
> > > > >> >     argv=0x7fffffffd7c8, init=, fini=,
> > > > >> >     rtld_fini=, stack_end=0x7fffffffd7b8) at
> > > > >> > libc-start.c:287
> > > > >> > #12 0x00000000004013b0 in _start ()
> > > > >> >
> > > > >> >
> > > > >> > 2016-01-24 1:24 GMT+03:00 Anton Kholomiov :
> > > > >> > Thanks for the quick reply, Victor.
> > > > >> > I'll report back if I encounter the problem again!
> > > > >> > Though I'm not that good with gdb
> > > > >> >
> > > > >> > 2016-01-24 1:20 GMT+03:00 Victor Lazzarini :
> > > > >> > Use gdb. Are you using the csound command? Do gdb csound, then
> > > > >> > use the run command with the arguments you need eg
> > > > >> >
> > > > >> > run mycsd.csd
> > > > >> >
> > > > >> > when it crashes you can try using the
> > > > >> > backtrace command to show where it stopped.
> > > > >> >
> > > > >> > On 23 Jan 2016, at 22:07, Anton Kholomiov 
> > > > >> > wrote:
> > > > >> >
> > > > >> >> How to do it?
> > > > >> >>
> > > > >> >> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini :
> > > > >> >> Can you run it under a debugger?
> > > > >> >>
> > > > >> >> On 23 Jan 2016, at 21:55, Anton Kholomiov 
> > > > >> >> wrote:
> > > > >> >>
> > > > >> >>> Unfortunately after several minutes of playing the service breaks
> > > > >> >>> with the message
> > > > >> >>>
> > > > >> >>> diskin2: opened '/home/anton/Seashore.wav':
> > > > >> >>>          44100 Hz, 2 channel(s), 546731 sample frames
> > > > >> >>> *** Error in `csound': double free or corruption (out):
> > > > >> >>> 0x00000000014bfd70 ***
> > > > >> >>> Csound tidy up: Aborted
> > > > >> >>>
> > > > >> >>> Any ideas?
> > > > >> >>>
> > > > >> >>>
> > > > >> >>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov :
> > > > >> >>> It's done. Just in case if anyone interested in the end result.
> > > > >> >>> I post a code for service. It can play continuously wav files
> > > > >> >>> on several channels. Channels are identified by numbers.
> > > > >> >>>
> > > > >> >>> User can for the given channel
> > > > >> >>>
> > > > >> >>> * start playing a wav file in the loop. The wav files are played with
> > > > >> >>> xfade at the ends
> > > > >> >>>    so that user percieves it like a continuous flow.
> > > > >> >>>
> > > > >> >>> * stop playing a file
> > > > >> >>>
> > > > >> >>> * resume playback
> > > > >> >>>
> > > > >> >>> * set the volume for the given channel
> > > > >> >>>
> > > > >> >>> * set a global fade in/out time
> > > > >> >>>
> > > > >> >>> Also there is a python file that makes it easy to trigger the service
> > > > >> >>> from the code. There are some test remnants of file names you can
> > > > >> >>> substitute it with your own files.
> > > > >> >>>
> > > > >> >>> This combo of OSC service and python client makes it easy
> > > > >> >>> to livecode with python.
> > > > >> >>>
> > > > >> >>>
> > > > >> >>> Anton
> > > > >> >>>
> > > > >> >>>
> > > > >> >>>
> > > > >> >>>
> > > > >> >>>
> > > > >> >>>
> > > > >> >>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
> > > > >> >>> :
> > > > >> >>> Strings are updated generally at i-time, but with special provisions
> > > > >> >>> for perf-time.
> > > > >> >>> ========================
> > > > >> >>> Dr Victor Lazzarini
> > > > >> >>> Dean of Arts, Celtic Studies and Philosophy,
> > > > >> >>> Maynooth University,
> > > > >> >>> Maynooth, Co Kildare, Ireland
> > > > >> >>> Tel: 00 353 7086936
> > > > >> >>> Fax: 00 353 1 7086952
> > > > >> >>>
> > > > >> >>> > On 22 Jan 2016, at 15:52, Anton Kholomiov
> > > > >> >>> >  wrote:
> > > > >> >>> >
> > > > >> >>> > Thank you for clarification. It was a blind spot for me is S behaves
> > > > >> >>> > like I or like K.
> > > > >> >>> > So the assignment operation works only at init time
> > > > >> >>> > and for k-rate we should use strcpyk.
> > > > >> >>> >
> > > > >> >>> > Anton
> > > > >> >>> >
> > > > >> >>> > 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
> > > > >> >>> > :
> > > > >> >>> > String assignment is i-time only. Use strcpyk
> > > > >> >>> >
> > > > >> >>> > gSFile strcpyk SFile
> > > > >> >>> > ========================
> > > > >> >>> > Dr Victor Lazzarini
> > > > >> >>> > Dean of Arts, Celtic Studies and Philosophy,
> > > > >> >>> > Maynooth University,
> > > > >> >>> > Maynooth, Co Kildare, Ireland
> > > > >> >>> > Tel: 00 353 7086936
> > > > >> >>> > Fax: 00 353 1 7086952
> > > > >> >>> >
> > > > >> >>> > > On 22 Jan 2016, at 15:33, Anton Kholomiov
> > > > >> >>> > >  wrote:
> > > > >> >>> > >
> > > > >> >>> > > I'm trying to write an OSC-server with Csound.
> > > > >> >>> > > The service should receive the name of the wav-file and the
> > > > >> >>> > > length of crossfade.
> > > > >> >>> > >
> > > > >> >>> > > On receive it should stop playing any previous wavs
> > > > >> >>> > > and start a loop that plays next wav file.
> > > > >> >>> > > The two loops should crossfade.
> > > > >> >>> > >
> > > > >> >>> > > While trying to write such a thing I'm getting into trouble
> > > > >> >>> > > with receiving String message with OSC.
> > > > >> >>> > > I receive a string-field then assign it to a global String var.
> > > > >> >>> > > But when I try to use it with diskin2 or filelen I get INIT errors
> > > > >> >>> > > like this
> > > > >> >>> > >
> > > > >> >>> > > INIT ERROR in instr 100: diskinfo cannot open
> > > > >> >>> > > ilen  filelen gSFile  1
> > > > >> >>> > >
> > > > >> >>> > > What can be wrong with my code?
> > > > >> >>> > >
> > > > >> >>> > > I attach the two files.
> > > > >> >>> > > csd with server and python with client to test the server.
> > > > >> >>> > > The python uses pyOSC library
> > > > >> >>> > >
> > > > >> >>> > > Thanks,
> > > > >> >>> > > Anton
> > > > >> >>> > >
> > > > >> >>> > > Csound mailing list Csound@listserv.heanet.ie
> > > > >> >>> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> >>> > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> >>> > > be posted here 
> > > > >> >>> >
> > > > >> >>> > Csound mailing list
> > > > >> >>> > Csound@listserv.heanet.ie
> > > > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > > >> >>> > Send bugs reports to
> > > > >> >>> >         https://github.com/csound/csound/issues
> > > > >> >>> > Discussions of bugs and features can be posted here
> > > > >> >>> >
> > > > >> >>> > Csound mailing list Csound@listserv.heanet.ie
> > > > >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> >>> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> >>> > be posted here
> > > > >> >>>
> > > > >> >>> Csound mailing list
> > > > >> >>> Csound@listserv.heanet.ie
> > > > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > > >> >>> Send bugs reports to
> > > > >> >>>         https://github.com/csound/csound/issues
> > > > >> >>> Discussions of bugs and features can be posted here
> > > > >> >>>
> > > > >> >>>
> > > > >> >>> Csound mailing list Csound@listserv.heanet.ie
> > > > >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> >>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> >>> be posted here
> > > > >> >> Csound mailing list Csound@listserv.heanet.ie
> > > > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> >> be posted here
> > > > >> >>
> > > > >> >> Csound mailing list Csound@listserv.heanet.ie
> > > > >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> >> be posted here
> > > > >> > Csound mailing list Csound@listserv.heanet.ie
> > > > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> > be posted here
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> > Csound mailing list Csound@listserv.heanet.ie
> > > > >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > >> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > >> > be posted here
> > > > >>
> > > > >> Csound mailing list
> > > > >> Csound@listserv.heanet.ie
> > > > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > > >> Send bugs reports to
> > > > >>         https://github.com/csound/csound/issues
> > > > >> Discussions of bugs and features can be posted here
> > > > >
> > > > >
> > > > > Csound mailing list Csound@listserv.heanet.ie
> > > > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > > > > https://github.com/csound/csound/issues Discussions of bugs and features can
> > > > > be posted here
> > > >
> > > > Csound mailing list
> > > > Csound@listserv.heanet.ie
> > > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > > Send bugs reports to
> > > >         https://github.com/csound/csound/issues
> > > > Discussions of bugs and features can be posted here
> > > >
> > > >
> > > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> > >
> > > Csound mailing list
> > > Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > Send bugs reports to
> > >         https://github.com/csound/csound/issues
> > > Discussions of bugs and features can be posted here
> > >
> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-24 00:30
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
 wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi :
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>>  wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov 
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini :
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi  wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> >  wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> 
>> >> >> 
>> >> >> -odac   -d
>> >> >> 
>> >> >> 
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> 
>> >> >> 
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> 
>> >> >> 
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> :
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> 
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> :
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> :
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 ,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>> >> >>>>    elem_size=) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=, fini=> >> >>>> out>,
>> >> >>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> :
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> :
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> 
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> :
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> 
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> :
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> :
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>>  wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> :
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>>  wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here 
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-24 08:06
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> > <anton.kholomiov@gmail.com> wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> <CsoundSynthesizer>
>> >> >> <CsOptions>
>> >> >> -odac   -d
>> >> >> </CsOptions>
>> >> >> <CsInstruments>
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> </CsInstruments>
>> >> >> <CsScore>
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> </CsScore>
>> >> >> </CsoundSynthesizer>
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> <Victor.Lazzarini@nuim.ie>:
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
>> >> >>>> out>,
>> >> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> <anton.kholomiov@gmail.com>:
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-24 08:10
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Attachmentsconfig-log.txt  
@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system. 
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> > <anton.kholomiov@gmail.com> wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> <CsoundSynthesizer>
>> >> >> <CsOptions>
>> >> >> -odac   -d
>> >> >> </CsOptions>
>> >> >> <CsInstruments>
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> </CsInstruments>
>> >> >> <CsScore>
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> </CsScore>
>> >> >> </CsoundSynthesizer>
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> <Victor.Lazzarini@nuim.ie>:
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
>> >> >>>> out>,
>> >> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> <anton.kholomiov@gmail.com>:
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-24 08:11
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Steven It's libsndfile-1.0.25

virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.03.2 (double samples) Aug 23 2014
libsndfile-1.0.25


2016-01-24 11:10 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system. 
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> > <anton.kholomiov@gmail.com> wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> <CsoundSynthesizer>
>> >> >> <CsOptions>
>> >> >> -odac   -d
>> >> >> </CsOptions>
>> >> >> <CsInstruments>
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> </CsInstruments>
>> >> >> <CsScore>
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> </CsScore>
>> >> >> </CsoundSynthesizer>
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> <Victor.Lazzarini@nuim.ie>:
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
>> >> >>>> out>,
>> >> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> <anton.kholomiov@gmail.com>:
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-24 10:20
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system. 
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> > <anton.kholomiov@gmail.com> wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> <CsoundSynthesizer>
>> >> >> <CsOptions>
>> >> >> -odac   -d
>> >> >> </CsOptions>
>> >> >> <CsInstruments>
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> </CsInstruments>
>> >> >> <CsScore>
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> </CsScore>
>> >> >> </CsoundSynthesizer>
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> <Victor.Lazzarini@nuim.ie>:
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
>> >> >>>> out>,
>> >> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> <anton.kholomiov@gmail.com>:
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>

Date2016-01-24 15:00
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system. 
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> > <anton.kholomiov@gmail.com> wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> <CsoundSynthesizer>
>> >> >> <CsOptions>
>> >> >> -odac   -d
>> >> >> </CsOptions>
>> >> >> <CsInstruments>
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> </CsInstruments>
>> >> >> <CsScore>
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> </CsScore>
>> >> >> </CsoundSynthesizer>
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> <Victor.Lazzarini@nuim.ie>:
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
>> >> >>>> out>,
>> >> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> <anton.kholomiov@gmail.com>:
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-24 19:50
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11 
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:

Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system. 
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
> The csound is 6.03.2. How can I find out the version of libsndfile?
>
> 2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
>>
>> One other off-chance possibility, I noticed the libsndfile in the trace is
>> in:
>>
>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>
>> but csound is in:
>>
>> /usr/lib/libcsound64.so.6.0
>>
>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> I'm not sure if that'd even runtime link...
>>
>> What version of libsndfile and csound are being used?
>>
>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>> > It does not check if it is below 0. (but Csound does. I get a warning if
>> > I sent a negative channel).
>> > ========================
>> > Dr Victor Lazzarini
>> > Dean of Arts, Celtic Studies and Philosophy,
>> > Maynooth University,
>> > Maynooth, Co Kildare, Ireland
>> > Tel: 00 353 7086936
>> > Fax: 00 353 1 7086952
>> >
>> >> On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
>> >> wrote:
>> >>
>> >> There have to be no out of bounds array assignment. Since I check the
>> >> messages for being in the right interval.
>> >>
>> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >> I think the if-then gets translated into an i & perf time check
>> >> (cggoto).
>> >>
>> >> But I am thinking here the crash might be to do with accessing arrays
>> >> out of bounds.
>> >> I can’t reproduce it though.
>> >> ========================
>> >> Dr Victor Lazzarini
>> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> Maynooth University,
>> >> Maynooth, Co Kildare, Ireland
>> >> Tel: 00 353 7086936
>> >> Fax: 00 353 1 7086952
>> >>
>> >> > On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> >
>> >> > A couple of things that may (or may not) be useful:
>> >> >
>> >> > 1. This post discusses the victim error message:
>> >> >
>> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >
>> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> > diskin's). Could you try:
>> >> >
>> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >    kchan init ichan
>> >> >    if (kchan == 1) then
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> > <anton.kholomiov@gmail.com> wrote:
>> >> >> Here is the code
>> >> >>
>> >> >> ~~~
>> >> >> <CsoundSynthesizer>
>> >> >> <CsOptions>
>> >> >> -odac   -d
>> >> >> </CsOptions>
>> >> >> <CsInstruments>
>> >> >>
>> >> >> sr = 44100
>> >> >> ksmps = 64
>> >> >> nchnls = 2
>> >> >> 0dbfs  = 1
>> >> >>
>> >> >> #ifndef PORT
>> >> >>    #define PORT        # 7700 #
>> >> >> #end
>> >> >>
>> >> >> #ifndef SIZE
>> >> >>    #define SIZE        # 8 #
>> >> >> #end
>> >> >>
>> >> >> gkVolume   init 1
>> >> >> gSFile     init ""
>> >> >>
>> >> >> gSFiles[]   init $SIZE
>> >> >> gkVolumes[] init $SIZE
>> >> >>
>> >> >> gaL init 0
>> >> >> gaR init 0
>> >> >>
>> >> >> gihandle OSCinit $PORT
>> >> >>
>> >> >> gkFadeTime init 1
>> >> >>
>> >> >> opcode FracInstr, k, ik
>> >> >>    iInstrNum, kChannel xin
>> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >>    xout kres
>> >> >> endop
>> >> >>
>> >> >> instr   PlayMsg
>> >> >>    SFile = ""
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>
>> >> >>    printk 0,kSched
>> >> >>     printk 0,kRun
>> >> >>
>> >> >>
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr StopMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr ResumeMsg
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    kSched FracInstr 100, kChannel
>> >> >>    kRun   FracInstr 80,  kChannel
>> >> >>    turnoff2 kSched, 4, 0
>> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> instr   SetVolMsg
>> >> >>    kVolume   init 0
>> >> >>    kChannel  init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >>    gkVolumes[kChannel] = kVolume
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr   SetFadeMsg
>> >> >>    kFade   init 0
>> >> >>    kk init 0
>> >> >>
>> >> >> nxtmsg:
>> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> if (kk == 0) goto ex
>> >> >>    gkFadeTime = kFade
>> >> >>    kgoto nxtmsg
>> >> >> ex:
>> >> >> endin
>> >> >>
>> >> >> instr 80
>> >> >>    print p1
>> >> >>    idur    = p3
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    iChannel  = p4
>> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >>    if (ichan == 1) then
>> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >>        ar = al
>> >> >>    else
>> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >>    endif
>> >> >>
>> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> iFadeTime, 0,
>> >> >> iFadeTime, 0
>> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >>
>> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> endin
>> >> >>
>> >> >> instr 100
>> >> >>    iChannel  = p4
>> >> >>    iFadeTime = i(gkFadeTime)
>> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >>    kRun FracInstr 80, iChannel
>> >> >>    if (km == 1)  then
>> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >>    endif
>> >> >> endin
>> >> >>
>> >> >> instr 110
>> >> >>    outs gaL, gaR
>> >> >>    gaL = 0
>> >> >>    gaR = 0
>> >> >> endin
>> >> >>
>> >> >> instr Init
>> >> >>    kCount = 0
>> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >>        gkVolumes[kCount] = 1
>> >> >>        kCount = kCount + 1
>> >> >>    od
>> >> >> endin
>> >> >>
>> >> >>
>> >> >> </CsInstruments>
>> >> >> <CsScore>
>> >> >>
>> >> >> f0 1000000
>> >> >>
>> >> >> i "Init" 0 0.01
>> >> >>
>> >> >> i   "PlayMsg"    0 -1
>> >> >> i   "SetVolMsg"  0 -1
>> >> >> i   "SetFadeMsg" 0 -1
>> >> >> i   "StopMsg"    0 -1
>> >> >> i   "ResumeMsg"  0 -1
>> >> >>
>> >> >> i 110 0 -1
>> >> >> e
>> >> >> </CsScore>
>> >> >> </CsoundSynthesizer>
>> >> >> ~~~
>> >> >>
>> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> <Victor.Lazzarini@nuim.ie>:
>> >> >>>
>> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >>> earlier
>> >> >>> flow.csd
>> >> >>> ========================
>> >> >>> Dr Victor Lazzarini
>> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>> Maynooth University,
>> >> >>> Maynooth, Co Kildare, Ireland
>> >> >>> Tel: 00 353 7086936
>> >> >>> Fax: 00 353 1 7086952
>> >> >>>
>> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >>>> of the
>> >> >>>> same instrument.
>> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >>>>
>> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >>>> assigns
>> >> >>>> a value to the cell of global array.
>> >> >>>>
>> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Here is message from gdb:
>> >> >>>>
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >>>>     number of samples out of range:        2        2
>> >> >>>> new alloc for instr 80:
>> >> >>>> instr 80:  p1 = 80.005
>> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >>>>     number of samples out of range:     1315      451
>> >> >>>> instr 80:  p1 = 80.001
>> >> >>>>
>> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
>> >> >>>> malloc.c:4163
>> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >>>> (gdb) bt
>> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
>> >> >>>>    at malloc.c:4163
>> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >>>>    av=av@entry=0x7ffff76fa760 <main_arena>,
>> >> >>>> bytes=bytes@entry=59184)
>> >> >>>>    at malloc.c:3423
>> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
>> >> >>>>    elem_size=<optimized out>) at malloc.c:3219
>> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >>>> argc=2,
>> >> >>>>    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
>> >> >>>> out>,
>> >> >>>>    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
>> >> >>>> libc-start.c:287
>> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >>>>
>> >> >>>>
>> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >>>> <anton.kholomiov@gmail.com>:
>> >> >>>> Thanks for the quick reply, Victor.
>> >> >>>> I'll report back if I encounter the problem again!
>> >> >>>> Though I'm not that good with gdb
>> >> >>>>
>> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >>>> use the run command with the arguments you need eg
>> >> >>>>
>> >> >>>> run mycsd.csd
>> >> >>>>
>> >> >>>> when it crashes you can try using the
>> >> >>>> backtrace command to show where it stopped.
>> >> >>>>
>> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>>> How to do it?
>> >> >>>>>
>> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>> Can you run it under a debugger?
>> >> >>>>>
>> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >>>>> <anton.kholomiov@GMAIL.COM>
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >>>>>> breaks
>> >> >>>>>> with the message
>> >> >>>>>>
>> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >>>>>> 0x00000000014bfd70 ***
>> >> >>>>>> Csound tidy up: Aborted
>> >> >>>>>>
>> >> >>>>>> Any ideas?
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >>>>>> <anton.kholomiov@gmail.com>:
>> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >>>>>>
>> >> >>>>>> User can for the given channel
>> >> >>>>>>
>> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >>>>>> with
>> >> >>>>>> xfade at the ends
>> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >>>>>>
>> >> >>>>>> * stop playing a file
>> >> >>>>>>
>> >> >>>>>> * resume playback
>> >> >>>>>>
>> >> >>>>>> * set the volume for the given channel
>> >> >>>>>>
>> >> >>>>>> * set a global fade in/out time
>> >> >>>>>>
>> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >>>>>> service
>> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >>>>>> can
>> >> >>>>>> substitute it with your own files.
>> >> >>>>>>
>> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >>>>>> to livecode with python.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Anton
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >>>>>> provisions
>> >> >>>>>> for perf-time.
>> >> >>>>>> ========================
>> >> >>>>>> Dr Victor Lazzarini
>> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>> Maynooth University,
>> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>> Tel: 00 353 7086936
>> >> >>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>
>> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >>>>>>> <anton.kholomiov@gmail.com> wrote:
>> >> >>>>>>>
>> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >>>>>>> behaves
>> >> >>>>>>> like I or like K.
>> >> >>>>>>> So the assignment operation works only at init time
>> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >>>>>>>
>> >> >>>>>>> Anton
>> >> >>>>>>>
>> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >>>>>>> <Victor.Lazzarini@nuim.ie>:
>> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >>>>>>>
>> >> >>>>>>> gSFile strcpyk SFile
>> >> >>>>>>> ========================
>> >> >>>>>>> Dr Victor Lazzarini
>> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >>>>>>> Maynooth University,
>> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >>>>>>> Tel: 00 353 7086936
>> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >>>>>>>
>> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >>>>>>>> <anton.kholomiov@GMAIL.COM> wrote:
>> >> >>>>>>>>
>> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >>>>>>>> length of crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >>>>>>>> The two loops should crossfade.
>> >> >>>>>>>>
>> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >>>>>>>> with receiving String message with OSC.
>> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >>>>>>>> var.
>> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >>>>>>>> errors
>> >> >>>>>>>> like this
>> >> >>>>>>>>
>> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >>>>>>>>
>> >> >>>>>>>> What can be wrong with my code?
>> >> >>>>>>>>
>> >> >>>>>>>> I attach the two files.
>> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >>>>>>>> The python uses pyOSC library
>> >> >>>>>>>>
>> >> >>>>>>>> Thanks,
>> >> >>>>>>>> Anton
>> >> >>>>>>>>
>> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>>> reports to
>> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >>>>>>>> and features can
>> >> >>>>>>>> be posted here <flow.csd><test_flow.py>
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list
>> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>>> Send bugs reports to
>> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>>
>> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>>> reports to
>> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>>> features can
>> >> >>>>>>> be posted here
>> >> >>>>>>
>> >> >>>>>> Csound mailing list
>> >> >>>>>> Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>>> Send bugs reports to
>> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >>>>>> reports to
>> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>>> features can
>> >> >>>>>> be posted here
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>>>
>> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>>> to
>> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>>> features can
>> >> >>>>> be posted here
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >>>> to
>> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >>>> features can
>> >> >>>> be posted here
>> >> >>>
>> >> >>> Csound mailing list
>> >> >>> Csound@listserv.heanet.ie
>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>> Send bugs reports to
>> >> >>>        https://github.com/csound/csound/issues
>> >> >>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >        https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-24 20:37
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
It’s a problem with the FLTK library in your system. 
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 24 Jan 2016, at 19:50, Anton Kholomiov  wrote:
> 
> 
> This is what I get with "make VERBOSE=1 -j1" :
> 
> ~~~
> [ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
> cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
> [ 74%] Linking CXX shared module ../libvirtual.so
> cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
> /usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11 
> /usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
> /usr/local/lib/libfltk.a: error adding symbols: Bad value
> collect2: error: ld returned 1 exit status
> make[2]: *** [libvirtual.so] Error 1
> make[2]: Leaving directory `/home/anton/tools/cs6make'
> make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
> make[1]: Leaving directory `/home/anton/tools/cs6make'
> make: *** [all] Error 2
> ~~~
> 
> Anton
> 
> 
> 2016-01-24 18:00 GMT+03:00 Steven Yi :
> Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.
> 
> 
> On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini  wrote:
> What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.
> 
> On 24 Jan 2016, at 08:10, Anton Kholomiov  wrote:
> 
>> @ Victor
>> 
>> I've got as far as
>> 
>> ~~~
>> [ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
>> [ 80%] Linking C shared library libcsound64.so
>> [ 80%] Built target csound64
>> make: *** [all] Error 2
>> ~~~
>> I've failed to install libpulse-dev and libjack-dev on my system. 
>> It says I have some unmet deps that it fails to install((
>> My system is Ubuntu 14.04. My config log is in the attachment.
>> 
>> 
>> 
>> 
>> 
>> 2016-01-24 11:06 GMT+03:00 Anton Kholomiov :
>> 
>> 
>> 2016-01-24 3:30 GMT+03:00 Steven Yi :
>> Csound should report the version of libsndfile, for example on my system:
>> 
>> $ csound --help
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> Csound version 6.07 (double samples) Jan 19 2016
>> libsndfile-1.0.25-exp
>> 
>> As Victor mentioned, 6.03.2 is a bit old and using a newer version
>> would help eliminate some possibilities.
>> 
>> On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
>>  wrote:
>> > The csound is 6.03.2. How can I find out the version of libsndfile?
>> >
>> > 2016-01-24 2:38 GMT+03:00 Steven Yi :
>> >>
>> >> One other off-chance possibility, I noticed the libsndfile in the trace is
>> >> in:
>> >>
>> >> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >>
>> >> but csound is in:
>> >>
>> >> /usr/lib/libcsound64.so.6.0
>> >>
>> >> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>> >> I'm not sure if that'd even runtime link...
>> >>
>> >> What version of libsndfile and csound are being used?
>> >>
>> >> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>> >>  wrote:
>> >> > It does not check if it is below 0. (but Csound does. I get a warning if
>> >> > I sent a negative channel).
>> >> > ========================
>> >> > Dr Victor Lazzarini
>> >> > Dean of Arts, Celtic Studies and Philosophy,
>> >> > Maynooth University,
>> >> > Maynooth, Co Kildare, Ireland
>> >> > Tel: 00 353 7086936
>> >> > Fax: 00 353 1 7086952
>> >> >
>> >> >> On 23 Jan 2016, at 23:25, Anton Kholomiov 
>> >> >> wrote:
>> >> >>
>> >> >> There have to be no out of bounds array assignment. Since I check the
>> >> >> messages for being in the right interval.
>> >> >>
>> >> >> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini :
>> >> >> I think the if-then gets translated into an i & perf time check
>> >> >> (cggoto).
>> >> >>
>> >> >> But I am thinking here the crash might be to do with accessing arrays
>> >> >> out of bounds.
>> >> >> I can’t reproduce it though.
>> >> >> ========================
>> >> >> Dr Victor Lazzarini
>> >> >> Dean of Arts, Celtic Studies and Philosophy,
>> >> >> Maynooth University,
>> >> >> Maynooth, Co Kildare, Ireland
>> >> >> Tel: 00 353 7086936
>> >> >> Fax: 00 353 1 7086952
>> >> >>
>> >> >> > On 23 Jan 2016, at 23:10, Steven Yi  wrote:
>> >> >> >
>> >> >> > A couple of things that may (or may not) be useful:
>> >> >> >
>> >> >> > 1. This post discusses the victim error message:
>> >> >> >
>> >> >> > http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>> >> >> >
>> >> >> > 2. There is an i-time if-then used that wraps perf-time code (the
>> >> >> > diskin's). Could you try:
>> >> >> >
>> >> >> >    ichan filenchnls gSFiles[iChannel]
>> >> >> >    kchan init ichan
>> >> >> >    if (kchan == 1) then
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>> >> >> >  wrote:
>> >> >> >> Here is the code
>> >> >> >>
>> >> >> >> ~~~
>> >> >> >> 
>> >> >> >> 
>> >> >> >> -odac   -d
>> >> >> >> 
>> >> >> >> 
>> >> >> >>
>> >> >> >> sr = 44100
>> >> >> >> ksmps = 64
>> >> >> >> nchnls = 2
>> >> >> >> 0dbfs  = 1
>> >> >> >>
>> >> >> >> #ifndef PORT
>> >> >> >>    #define PORT        # 7700 #
>> >> >> >> #end
>> >> >> >>
>> >> >> >> #ifndef SIZE
>> >> >> >>    #define SIZE        # 8 #
>> >> >> >> #end
>> >> >> >>
>> >> >> >> gkVolume   init 1
>> >> >> >> gSFile     init ""
>> >> >> >>
>> >> >> >> gSFiles[]   init $SIZE
>> >> >> >> gkVolumes[] init $SIZE
>> >> >> >>
>> >> >> >> gaL init 0
>> >> >> >> gaR init 0
>> >> >> >>
>> >> >> >> gihandle OSCinit $PORT
>> >> >> >>
>> >> >> >> gkFadeTime init 1
>> >> >> >>
>> >> >> >> opcode FracInstr, k, ik
>> >> >> >>    iInstrNum, kChannel xin
>> >> >> >>    kres = iInstrNum + ((kChannel + 1) / 1000)
>> >> >> >>    xout kres
>> >> >> >> endop
>> >> >> >>
>> >> >> >> instr   PlayMsg
>> >> >> >>    SFile = ""
>> >> >> >>    kVolume   init 0
>> >> >> >>    kChannel  init 0
>> >> >> >>    kk init 0
>> >> >> >>
>> >> >> >> nxtmsg:
>> >> >> >>    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>> >> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >> >>    kSched FracInstr 100, kChannel
>> >> >> >>    kRun   FracInstr 80,  kChannel
>> >> >> >>
>> >> >> >>    printk 0,kSched
>> >> >> >>     printk 0,kRun
>> >> >> >>
>> >> >> >>
>> >> >> >>    turnoff2 kSched, 4, 0
>> >> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >> >>    gSFiles[kChannel] strcpyk SFile
>> >> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >> >>    kgoto nxtmsg
>> >> >> >> ex:
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr StopMsg
>> >> >> >>    kChannel  init 0
>> >> >> >>    kk init 0
>> >> >> >>
>> >> >> >> nxtmsg:
>> >> >> >>    kk  OSClisten gihandle, "/stop", "i", kChannel
>> >> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >> >>    kSched FracInstr 100, kChannel
>> >> >> >>    kRun   FracInstr 80,  kChannel
>> >> >> >>    turnoff2 kSched, 4, 0
>> >> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >> >>    kgoto nxtmsg
>> >> >> >> ex:
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr ResumeMsg
>> >> >> >>    kChannel  init 0
>> >> >> >>    kk init 0
>> >> >> >>
>> >> >> >> nxtmsg:
>> >> >> >>    kk  OSClisten gihandle, "/resume", "i", kChannel
>> >> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >> >>    kSched FracInstr 100, kChannel
>> >> >> >>    kRun   FracInstr 80,  kChannel
>> >> >> >>    turnoff2 kSched, 4, 0
>> >> >> >>    turnoff2 kRun,  4, gkFadeTime
>> >> >> >>    event "i", kSched, 0, -1, kChannel
>> >> >> >>    kgoto nxtmsg
>> >> >> >> ex:
>> >> >> >> endin
>> >> >> >>
>> >> >> >>
>> >> >> >> instr   SetVolMsg
>> >> >> >>    kVolume   init 0
>> >> >> >>    kChannel  init 0
>> >> >> >>    kk init 0
>> >> >> >>
>> >> >> >> nxtmsg:
>> >> >> >>    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>> >> >> >> if (kk == 0 || kChannel >= $SIZE) goto ex
>> >> >> >>    gkVolumes[kChannel] = kVolume
>> >> >> >>    kgoto nxtmsg
>> >> >> >> ex:
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr   SetFadeMsg
>> >> >> >>    kFade   init 0
>> >> >> >>    kk init 0
>> >> >> >>
>> >> >> >> nxtmsg:
>> >> >> >>    kk  OSClisten gihandle, "/set_fade", "f", kFade
>> >> >> >> if (kk == 0) goto ex
>> >> >> >>    gkFadeTime = kFade
>> >> >> >>    kgoto nxtmsg
>> >> >> >> ex:
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr 80
>> >> >> >>    print p1
>> >> >> >>    idur    = p3
>> >> >> >>    iFadeTime = i(gkFadeTime)
>> >> >> >>    iChannel  = p4
>> >> >> >>    ichan filenchnls gSFiles[iChannel]
>> >> >> >>    if (ichan == 1) then
>> >> >> >>        al diskin2 gSFiles[iChannel], 1
>> >> >> >>        ar = al
>> >> >> >>    else
>> >> >> >>        al, ar diskin2 gSFiles[iChannel], 1
>> >> >> >>    endif
>> >> >> >>
>> >> >> >>    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>> >> >> >> iFadeTime, 0,
>> >> >> >> iFadeTime, 0
>> >> >> >>    kvol    port gkVolumes[iChannel], 0.05
>> >> >> >>
>> >> >> >>    gaL  = gaL + kenv * kvol * al
>> >> >> >>    gaR  = gaR + kenv * kvol * ar
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr 100
>> >> >> >>    iChannel  = p4
>> >> >> >>    iFadeTime = i(gkFadeTime)
>> >> >> >>    ilen  filelen gSFiles[iChannel]
>> >> >> >>    km    metro (1 / (ilen - iFadeTime))
>> >> >> >>    kRun FracInstr 80, iChannel
>> >> >> >>    if (km == 1)  then
>> >> >> >>        event "i", kRun, 0, ilen, iChannel
>> >> >> >>    endif
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr 110
>> >> >> >>    outs gaL, gaR
>> >> >> >>    gaL = 0
>> >> >> >>    gaR = 0
>> >> >> >> endin
>> >> >> >>
>> >> >> >> instr Init
>> >> >> >>    kCount = 0
>> >> >> >>    until (kCount == lenarray(gkVolumes)) do
>> >> >> >>        gkVolumes[kCount] = 1
>> >> >> >>        kCount = kCount + 1
>> >> >> >>    od
>> >> >> >> endin
>> >> >> >>
>> >> >> >>
>> >> >> >> 
>> >> >> >> 
>> >> >> >>
>> >> >> >> f0 1000000
>> >> >> >>
>> >> >> >> i "Init" 0 0.01
>> >> >> >>
>> >> >> >> i   "PlayMsg"    0 -1
>> >> >> >> i   "SetVolMsg"  0 -1
>> >> >> >> i   "SetFadeMsg" 0 -1
>> >> >> >> i   "StopMsg"    0 -1
>> >> >> >> i   "ResumeMsg"  0 -1
>> >> >> >>
>> >> >> >> i 110 0 -1
>> >> >> >> e
>> >> >> >> 
>> >> >> >> 
>> >> >> >> ~~~
>> >> >> >>
>> >> >> >> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>> >> >> >> :
>> >> >> >>>
>> >> >> >>> Can you post the Csound code? I see no global arrays in your
>> >> >> >>> earlier
>> >> >> >>> flow.csd
>> >> >> >>> ========================
>> >> >> >>> Dr Victor Lazzarini
>> >> >> >>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >> >>> Maynooth University,
>> >> >> >>> Maynooth, Co Kildare, Ireland
>> >> >> >>> Tel: 00 353 7086936
>> >> >> >>> Fax: 00 353 1 7086952
>> >> >> >>>
>> >> >> >>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>> >> >> >>>> 
>> >> >> >>>> wrote:
>> >> >> >>>>
>> >> >> >>>> Here I'm reading the same file with diskin2 in the two instances
>> >> >> >>>> of the
>> >> >> >>>> same instrument.
>> >> >> >>>> It's triggered with fractional numbers. 80.001 and 80.005
>> >> >> >>>>
>> >> >> >>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>> >> >> >>>> :
>> >> >> >>>> The last message I've sent was to set the volume on channel. It
>> >> >> >>>> assigns
>> >> >> >>>> a value to the cell of global array.
>> >> >> >>>>
>> >> >> >>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>> >> >> >>>> :
>> >> >> >>>> Here is message from gdb:
>> >> >> >>>>
>> >> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >> >>>>  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>> >> >> >>>>     number of samples out of range:        2        2
>> >> >> >>>> new alloc for instr 80:
>> >> >> >>>> instr 80:  p1 = 80.005
>> >> >> >>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >> >>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >> >>>>  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>> >> >> >>>>     number of samples out of range:     1315      451
>> >> >> >>>> instr 80:  p1 = 80.001
>> >> >> >>>>
>> >> >> >>>> Program received signal SIGSEGV, Segmentation fault.
>> >> >> >>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>> >> >> >>>> malloc.c:4163
>> >> >> >>>> 4163    malloc.c: No such file or directory.
>> >> >> >>>> (gdb) bt
>> >> >> >>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>> >> >> >>>>    at malloc.c:4163
>> >> >> >>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>> >> >> >>>>    av=av@entry=0x7ffff76fa760 ,
>> >> >> >>>> bytes=bytes@entry=59184)
>> >> >> >>>>    at malloc.c:3423
>> >> >> >>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>> >> >> >>>>    elem_size=) at malloc.c:3219
>> >> >> >>>> #3  0x00007ffff70df5f2 in sf_open ()
>> >> >> >>>>   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>> >> >> >>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >> >>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >> >>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >> >>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >> >>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>> >> >> >>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>> >> >> >>>> /usr/lib/libcsound64.so.6.0
>> >> >> >>>> #10 0x0000000000401358 in ?? ()
>> >> >> >>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>> >> >> >>>> argc=2,
>> >> >> >>>>    argv=0x7fffffffd7c8, init=, fini=> >> >> >>>> out>,
>> >> >> >>>>    rtld_fini=, stack_end=0x7fffffffd7b8) at
>> >> >> >>>> libc-start.c:287
>> >> >> >>>> #12 0x00000000004013b0 in _start ()
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>> >> >> >>>> :
>> >> >> >>>> Thanks for the quick reply, Victor.
>> >> >> >>>> I'll report back if I encounter the problem again!
>> >> >> >>>> Though I'm not that good with gdb
>> >> >> >>>>
>> >> >> >>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>> >> >> >>>> :
>> >> >> >>>> Use gdb. Are you using the csound command? Do gdb csound, then
>> >> >> >>>> use the run command with the arguments you need eg
>> >> >> >>>>
>> >> >> >>>> run mycsd.csd
>> >> >> >>>>
>> >> >> >>>> when it crashes you can try using the
>> >> >> >>>> backtrace command to show where it stopped.
>> >> >> >>>>
>> >> >> >>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>> >> >> >>>> 
>> >> >> >>>> wrote:
>> >> >> >>>>
>> >> >> >>>>> How to do it?
>> >> >> >>>>>
>> >> >> >>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>> >> >> >>>>> :
>> >> >> >>>>> Can you run it under a debugger?
>> >> >> >>>>>
>> >> >> >>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>> >> >> >>>>> 
>> >> >> >>>>> wrote:
>> >> >> >>>>>
>> >> >> >>>>>> Unfortunately after several minutes of playing the service
>> >> >> >>>>>> breaks
>> >> >> >>>>>> with the message
>> >> >> >>>>>>
>> >> >> >>>>>> diskin2: opened '/home/anton/Seashore.wav':
>> >> >> >>>>>>         44100 Hz, 2 channel(s), 546731 sample frames
>> >> >> >>>>>> *** Error in `csound': double free or corruption (out):
>> >> >> >>>>>> 0x00000000014bfd70 ***
>> >> >> >>>>>> Csound tidy up: Aborted
>> >> >> >>>>>>
>> >> >> >>>>>> Any ideas?
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>> >> >> >>>>>> :
>> >> >> >>>>>> It's done. Just in case if anyone interested in the end result.
>> >> >> >>>>>> I post a code for service. It can play continuously wav files
>> >> >> >>>>>> on several channels. Channels are identified by numbers.
>> >> >> >>>>>>
>> >> >> >>>>>> User can for the given channel
>> >> >> >>>>>>
>> >> >> >>>>>> * start playing a wav file in the loop. The wav files are played
>> >> >> >>>>>> with
>> >> >> >>>>>> xfade at the ends
>> >> >> >>>>>>   so that user percieves it like a continuous flow.
>> >> >> >>>>>>
>> >> >> >>>>>> * stop playing a file
>> >> >> >>>>>>
>> >> >> >>>>>> * resume playback
>> >> >> >>>>>>
>> >> >> >>>>>> * set the volume for the given channel
>> >> >> >>>>>>
>> >> >> >>>>>> * set a global fade in/out time
>> >> >> >>>>>>
>> >> >> >>>>>> Also there is a python file that makes it easy to trigger the
>> >> >> >>>>>> service
>> >> >> >>>>>> from the code. There are some test remnants of file names you
>> >> >> >>>>>> can
>> >> >> >>>>>> substitute it with your own files.
>> >> >> >>>>>>
>> >> >> >>>>>> This combo of OSC service and python client makes it easy
>> >> >> >>>>>> to livecode with python.
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>> Anton
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>> >> >> >>>>>> :
>> >> >> >>>>>> Strings are updated generally at i-time, but with special
>> >> >> >>>>>> provisions
>> >> >> >>>>>> for perf-time.
>> >> >> >>>>>> ========================
>> >> >> >>>>>> Dr Victor Lazzarini
>> >> >> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >> >>>>>> Maynooth University,
>> >> >> >>>>>> Maynooth, Co Kildare, Ireland
>> >> >> >>>>>> Tel: 00 353 7086936
>> >> >> >>>>>> Fax: 00 353 1 7086952
>> >> >> >>>>>>
>> >> >> >>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>> >> >> >>>>>>>  wrote:
>> >> >> >>>>>>>
>> >> >> >>>>>>> Thank you for clarification. It was a blind spot for me is S
>> >> >> >>>>>>> behaves
>> >> >> >>>>>>> like I or like K.
>> >> >> >>>>>>> So the assignment operation works only at init time
>> >> >> >>>>>>> and for k-rate we should use strcpyk.
>> >> >> >>>>>>>
>> >> >> >>>>>>> Anton
>> >> >> >>>>>>>
>> >> >> >>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>> >> >> >>>>>>> :
>> >> >> >>>>>>> String assignment is i-time only. Use strcpyk
>> >> >> >>>>>>>
>> >> >> >>>>>>> gSFile strcpyk SFile
>> >> >> >>>>>>> ========================
>> >> >> >>>>>>> Dr Victor Lazzarini
>> >> >> >>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>> >> >> >>>>>>> Maynooth University,
>> >> >> >>>>>>> Maynooth, Co Kildare, Ireland
>> >> >> >>>>>>> Tel: 00 353 7086936
>> >> >> >>>>>>> Fax: 00 353 1 7086952
>> >> >> >>>>>>>
>> >> >> >>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>> >> >> >>>>>>>>  wrote:
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> I'm trying to write an OSC-server with Csound.
>> >> >> >>>>>>>> The service should receive the name of the wav-file and the
>> >> >> >>>>>>>> length of crossfade.
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> On receive it should stop playing any previous wavs
>> >> >> >>>>>>>> and start a loop that plays next wav file.
>> >> >> >>>>>>>> The two loops should crossfade.
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> While trying to write such a thing I'm getting into trouble
>> >> >> >>>>>>>> with receiving String message with OSC.
>> >> >> >>>>>>>> I receive a string-field then assign it to a global String
>> >> >> >>>>>>>> var.
>> >> >> >>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>> >> >> >>>>>>>> errors
>> >> >> >>>>>>>> like this
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>> >> >> >>>>>>>> ilen  filelen gSFile  1
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> What can be wrong with my code?
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> I attach the two files.
>> >> >> >>>>>>>> csd with server and python with client to test the server.
>> >> >> >>>>>>>> The python uses pyOSC library
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> Thanks,
>> >> >> >>>>>>>> Anton
>> >> >> >>>>>>>>
>> >> >> >>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >> >>>>>>>> reports to
>> >> >> >>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>> >> >> >>>>>>>> and features can
>> >> >> >>>>>>>> be posted here 
>> >> >> >>>>>>>
>> >> >> >>>>>>> Csound mailing list
>> >> >> >>>>>>> Csound@listserv.heanet.ie
>> >> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> >>>>>>> Send bugs reports to
>> >> >> >>>>>>>        https://github.com/csound/csound/issues
>> >> >> >>>>>>> Discussions of bugs and features can be posted here
>> >> >> >>>>>>>
>> >> >> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >> >>>>>>> reports to
>> >> >> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >>>>>>> features can
>> >> >> >>>>>>> be posted here
>> >> >> >>>>>>
>> >> >> >>>>>> Csound mailing list
>> >> >> >>>>>> Csound@listserv.heanet.ie
>> >> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> >>>>>> Send bugs reports to
>> >> >> >>>>>>        https://github.com/csound/csound/issues
>> >> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >> >>>>>>
>> >> >> >>>>>>
>> >> >> >>>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>> >> >> >>>>>> reports to
>> >> >> >>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >>>>>> features can
>> >> >> >>>>>> be posted here
>> >> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >> >>>>> to
>> >> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >>>>> features can
>> >> >> >>>>> be posted here
>> >> >> >>>>>
>> >> >> >>>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >> >>>>> to
>> >> >> >>>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >>>>> features can
>> >> >> >>>>> be posted here
>> >> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >> >>>> to
>> >> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >>>> features can
>> >> >> >>>> be posted here
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> >> >> >>>> to
>> >> >> >>>> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >>>> features can
>> >> >> >>>> be posted here
>> >> >> >>>
>> >> >> >>> Csound mailing list
>> >> >> >>> Csound@listserv.heanet.ie
>> >> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> >>> Send bugs reports to
>> >> >> >>>        https://github.com/csound/csound/issues
>> >> >> >>> Discussions of bugs and features can be posted here
>> >> >> >>
>> >> >> >>
>> >> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> >> >> features can
>> >> >> >> be posted here
>> >> >> >
>> >> >> > Csound mailing list
>> >> >> > Csound@listserv.heanet.ie
>> >> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> > Send bugs reports to
>> >> >> >        https://github.com/csound/csound/issues
>> >> >> > Discussions of bugs and features can be posted here
>> >> >>
>> >> >> Csound mailing list
>> >> >> Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> Send bugs reports to
>> >> >>         https://github.com/csound/csound/issues
>> >> >> Discussions of bugs and features can be posted here
>> >> >>
>> >> >> Csound mailing list Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> >> https://github.com/csound/csound/issues Discussions of bugs and features can
>> >> >> be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >         https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> 
>> 
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-24 21:02
FromGuillermo Senna
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Hi Anton,

Do you have libfltk1.1-dev installed?


On 24/01/16 17:37, Victor Lazzarini wrote:
> It’s a problem with the FLTK library in your system.
> Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
> build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
> -DUSE_FLTK=0 to Cmake.
>
> Regards
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 24 Jan 2016, at 19:50, Anton Kholomiov  wrote:
>>
>>
>> This is what I get with "make VERBOSE=1 -j1" :
>>
>> ~~~
>> [ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
>> cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
>> [ 74%] Linking CXX shared module ../libvirtual.so
>> cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
>> /usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -
 lXext -lXinerama -lpthread -ldl -lm -lX11
>> /usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
>> /usr/local/lib/libfltk.a: error adding symbols: Bad value
>> collect2: error: ld returned 1 exit status
>> make[2]: *** [libvirtual.so] Error 1
>> make[2]: Leaving directory `/home/anton/tools/cs6make'
>> make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
>> make[1]: Leaving directory `/home/anton/tools/cs6make'
>> make: *** [all] Error 2
>> ~~~
>>
>> Anton
>>
>>
>> 2016-01-24 18:00 GMT+03:00 Steven Yi :
>> Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.
>>
>>
>> On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini  wrote:
>> What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.
>>
>> On 24 Jan 2016, at 08:10, Anton Kholomiov  wrote:
>>
>>> @ Victor
>>>
>>> I've got as far as
>>>
>>> ~~~
>>> [ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
>>> [ 80%] Linking C shared library libcsound64.so
>>> [ 80%] Built target csound64
>>> make: *** [all] Error 2
>>> ~~~
>>> I've failed to install libpulse-dev and libjack-dev on my system.
>>> It says I have some unmet deps that it fails to install((
>>> My system is Ubuntu 14.04. My config log is in the attachment.
>>>
>>>
>>>
>>>
>>>
>>> 2016-01-24 11:06 GMT+03:00 Anton Kholomiov :
>>>
>>>
>>> 2016-01-24 3:30 GMT+03:00 Steven Yi :
>>> Csound should report the version of libsndfile, for example on my system:
>>>
>>> $ csound --help
>>> virtual_keyboard real time MIDI plugin for Csound
>>> 0dBFS level = 32768.0
>>> Csound version 6.07 (double samples) Jan 19 2016
>>> libsndfile-1.0.25-exp
>>>
>>> As Victor mentioned, 6.03.2 is a bit old and using a newer version
>>> would help eliminate some possibilities.
>>>
>>> On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
>>>  wrote:
>>>> The csound is 6.03.2. How can I find out the version of libsndfile?
>>>>
>>>> 2016-01-24 2:38 GMT+03:00 Steven Yi :
>>>>> One other off-chance possibility, I noticed the libsndfile in the trace is
>>>>> in:
>>>>>
>>>>> /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>>>>
>>>>> but csound is in:
>>>>>
>>>>> /usr/lib/libcsound64.so.6.0
>>>>>
>>>>> Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
>>>>> I'm not sure if that'd even runtime link...
>>>>>
>>>>> What version of libsndfile and csound are being used?
>>>>>
>>>>> On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
>>>>>  wrote:
>>>>>> It does not check if it is below 0. (but Csound does. I get a warning if
>>>>>> I sent a negative channel).
>>>>>> ========================
>>>>>> Dr Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 23 Jan 2016, at 23:25, Anton Kholomiov 
>>>>>>> wrote:
>>>>>>>
>>>>>>> There have to be no out of bounds array assignment. Since I check the
>>>>>>> messages for being in the right interval.
>>>>>>>
>>>>>>> 2016-01-24 2:23 GMT+03:00 Victor Lazzarini :
>>>>>>> I think the if-then gets translated into an i & perf time check
>>>>>>> (cggoto).
>>>>>>>
>>>>>>> But I am thinking here the crash might be to do with accessing arrays
>>>>>>> out of bounds.
>>>>>>> I can’t reproduce it though.
>>>>>>> ========================
>>>>>>> Dr Victor Lazzarini
>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>> Maynooth University,
>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>> Tel: 00 353 7086936
>>>>>>> Fax: 00 353 1 7086952
>>>>>>>
>>>>>>>> On 23 Jan 2016, at 23:10, Steven Yi  wrote:
>>>>>>>>
>>>>>>>> A couple of things that may (or may not) be useful:
>>>>>>>>
>>>>>>>> 1. This post discusses the victim error message:
>>>>>>>>
>>>>>>>> http://stackoverflow.com/questions/9123064/int-malloc-assertion-error
>>>>>>>>
>>>>>>>> 2. There is an i-time if-then used that wraps perf-time code (the
>>>>>>>> diskin's). Could you try:
>>>>>>>>
>>>>>>>>     ichan filenchnls gSFiles[iChannel]
>>>>>>>>     kchan init ichan
>>>>>>>>     if (kchan == 1) then
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
>>>>>>>>  wrote:
>>>>>>>>> Here is the code
>>>>>>>>>
>>>>>>>>> ~~~
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> -odac   -d
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>
>>>>>>>>> sr = 44100
>>>>>>>>> ksmps = 64
>>>>>>>>> nchnls = 2
>>>>>>>>> 0dbfs  = 1
>>>>>>>>>
>>>>>>>>> #ifndef PORT
>>>>>>>>>     #define PORT        # 7700 #
>>>>>>>>> #end
>>>>>>>>>
>>>>>>>>> #ifndef SIZE
>>>>>>>>>     #define SIZE        # 8 #
>>>>>>>>> #end
>>>>>>>>>
>>>>>>>>> gkVolume   init 1
>>>>>>>>> gSFile     init ""
>>>>>>>>>
>>>>>>>>> gSFiles[]   init $SIZE
>>>>>>>>> gkVolumes[] init $SIZE
>>>>>>>>>
>>>>>>>>> gaL init 0
>>>>>>>>> gaR init 0
>>>>>>>>>
>>>>>>>>> gihandle OSCinit $PORT
>>>>>>>>>
>>>>>>>>> gkFadeTime init 1
>>>>>>>>>
>>>>>>>>> opcode FracInstr, k, ik
>>>>>>>>>     iInstrNum, kChannel xin
>>>>>>>>>     kres = iInstrNum + ((kChannel + 1) / 1000)
>>>>>>>>>     xout kres
>>>>>>>>> endop
>>>>>>>>>
>>>>>>>>> instr   PlayMsg
>>>>>>>>>     SFile = ""
>>>>>>>>>     kVolume   init 0
>>>>>>>>>     kChannel  init 0
>>>>>>>>>     kk init 0
>>>>>>>>>
>>>>>>>>> nxtmsg:
>>>>>>>>>     kk  OSClisten gihandle, "/play", "is", kChannel, SFile
>>>>>>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>>>>>>     kSched FracInstr 100, kChannel
>>>>>>>>>     kRun   FracInstr 80,  kChannel
>>>>>>>>>
>>>>>>>>>     printk 0,kSched
>>>>>>>>>      printk 0,kRun
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>     turnoff2 kSched, 4, 0
>>>>>>>>>     turnoff2 kRun,  4, gkFadeTime
>>>>>>>>>     gSFiles[kChannel] strcpyk SFile
>>>>>>>>>     event "i", kSched, 0, -1, kChannel
>>>>>>>>>     kgoto nxtmsg
>>>>>>>>> ex:
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr StopMsg
>>>>>>>>>     kChannel  init 0
>>>>>>>>>     kk init 0
>>>>>>>>>
>>>>>>>>> nxtmsg:
>>>>>>>>>     kk  OSClisten gihandle, "/stop", "i", kChannel
>>>>>>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>>>>>>     kSched FracInstr 100, kChannel
>>>>>>>>>     kRun   FracInstr 80,  kChannel
>>>>>>>>>     turnoff2 kSched, 4, 0
>>>>>>>>>     turnoff2 kRun,  4, gkFadeTime
>>>>>>>>>     kgoto nxtmsg
>>>>>>>>> ex:
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr ResumeMsg
>>>>>>>>>     kChannel  init 0
>>>>>>>>>     kk init 0
>>>>>>>>>
>>>>>>>>> nxtmsg:
>>>>>>>>>     kk  OSClisten gihandle, "/resume", "i", kChannel
>>>>>>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>>>>>>     kSched FracInstr 100, kChannel
>>>>>>>>>     kRun   FracInstr 80,  kChannel
>>>>>>>>>     turnoff2 kSched, 4, 0
>>>>>>>>>     turnoff2 kRun,  4, gkFadeTime
>>>>>>>>>     event "i", kSched, 0, -1, kChannel
>>>>>>>>>     kgoto nxtmsg
>>>>>>>>> ex:
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> instr   SetVolMsg
>>>>>>>>>     kVolume   init 0
>>>>>>>>>     kChannel  init 0
>>>>>>>>>     kk init 0
>>>>>>>>>
>>>>>>>>> nxtmsg:
>>>>>>>>>     kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
>>>>>>>>> if (kk == 0 || kChannel >= $SIZE) goto ex
>>>>>>>>>     gkVolumes[kChannel] = kVolume
>>>>>>>>>     kgoto nxtmsg
>>>>>>>>> ex:
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr   SetFadeMsg
>>>>>>>>>     kFade   init 0
>>>>>>>>>     kk init 0
>>>>>>>>>
>>>>>>>>> nxtmsg:
>>>>>>>>>     kk  OSClisten gihandle, "/set_fade", "f", kFade
>>>>>>>>> if (kk == 0) goto ex
>>>>>>>>>     gkFadeTime = kFade
>>>>>>>>>     kgoto nxtmsg
>>>>>>>>> ex:
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr 80
>>>>>>>>>     print p1
>>>>>>>>>     idur    = p3
>>>>>>>>>     iFadeTime = i(gkFadeTime)
>>>>>>>>>     iChannel  = p4
>>>>>>>>>     ichan filenchnls gSFiles[iChannel]
>>>>>>>>>     if (ichan == 1) then
>>>>>>>>>         al diskin2 gSFiles[iChannel], 1
>>>>>>>>>         ar = al
>>>>>>>>>     else
>>>>>>>>>         al, ar diskin2 gSFiles[iChannel], 1
>>>>>>>>>     endif
>>>>>>>>>
>>>>>>>>>     kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
>>>>>>>>> iFadeTime, 0,
>>>>>>>>> iFadeTime, 0
>>>>>>>>>     kvol    port gkVolumes[iChannel], 0.05
>>>>>>>>>
>>>>>>>>>     gaL  = gaL + kenv * kvol * al
>>>>>>>>>     gaR  = gaR + kenv * kvol * ar
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr 100
>>>>>>>>>     iChannel  = p4
>>>>>>>>>     iFadeTime = i(gkFadeTime)
>>>>>>>>>     ilen  filelen gSFiles[iChannel]
>>>>>>>>>     km    metro (1 / (ilen - iFadeTime))
>>>>>>>>>     kRun FracInstr 80, iChannel
>>>>>>>>>     if (km == 1)  then
>>>>>>>>>         event "i", kRun, 0, ilen, iChannel
>>>>>>>>>     endif
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr 110
>>>>>>>>>     outs gaL, gaR
>>>>>>>>>     gaL = 0
>>>>>>>>>     gaR = 0
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>> instr Init
>>>>>>>>>     kCount = 0
>>>>>>>>>     until (kCount == lenarray(gkVolumes)) do
>>>>>>>>>         gkVolumes[kCount] = 1
>>>>>>>>>         kCount = kCount + 1
>>>>>>>>>     od
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>
>>>>>>>>> f0 1000000
>>>>>>>>>
>>>>>>>>> i "Init" 0 0.01
>>>>>>>>>
>>>>>>>>> i   "PlayMsg"    0 -1
>>>>>>>>> i   "SetVolMsg"  0 -1
>>>>>>>>> i   "SetFadeMsg" 0 -1
>>>>>>>>> i   "StopMsg"    0 -1
>>>>>>>>> i   "ResumeMsg"  0 -1
>>>>>>>>>
>>>>>>>>> i 110 0 -1
>>>>>>>>> e
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ~~~
>>>>>>>>>
>>>>>>>>> 2016-01-24 1:59 GMT+03:00 Victor Lazzarini
>>>>>>>>> :
>>>>>>>>>> Can you post the Csound code? I see no global arrays in your
>>>>>>>>>> earlier
>>>>>>>>>> flow.csd
>>>>>>>>>> ========================
>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>>>>> Maynooth University,
>>>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>>>> Tel: 00 353 7086936
>>>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>>>
>>>>>>>>>>> On 23 Jan 2016, at 22:36, Anton Kholomiov
>>>>>>>>>>> 
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Here I'm reading the same file with diskin2 in the two instances
>>>>>>>>>>> of the
>>>>>>>>>>> same instrument.
>>>>>>>>>>> It's triggered with fractional numbers. 80.001 and 80.005
>>>>>>>>>>>
>>>>>>>>>>> 2016-01-24 1:33 GMT+03:00 Anton Kholomiov
>>>>>>>>>>> :
>>>>>>>>>>> The last message I've sent was to set the volume on channel. It
>>>>>>>>>>> assigns
>>>>>>>>>>> a value to the cell of global array.
>>>>>>>>>>>
>>>>>>>>>>> 2016-01-24 1:32 GMT+03:00 Anton Kholomiov
>>>>>>>>>>> :
>>>>>>>>>>> Here is message from gdb:
>>>>>>>>>>>
>>>>>>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>>>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>>>>>   rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
>>>>>>>>>>>      number of samples out of range:        2        2
>>>>>>>>>>> new alloc for instr 80:
>>>>>>>>>>> instr 80:  p1 = 80.005
>>>>>>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>>>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>>>>>   rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
>>>>>>>>>>>      number of samples out of range:     1315      451
>>>>>>>>>>> instr 80:  p1 = 80.001
>>>>>>>>>>>
>>>>>>>>>>> Program received signal SIGSEGV, Segmentation fault.
>>>>>>>>>>> malloc_consolidate (av=av@entry=0x7ffff76fa760 ) at
>>>>>>>>>>> malloc.c:4163
>>>>>>>>>>> 4163    malloc.c: No such file or directory.
>>>>>>>>>>> (gdb) bt
>>>>>>>>>>> #0  malloc_consolidate (av=av@entry=0x7ffff76fa760 )
>>>>>>>>>>>     at malloc.c:4163
>>>>>>>>>>> #1  0x00007ffff73bbdf8 in _int_malloc (
>>>>>>>>>>>     av=av@entry=0x7ffff76fa760 ,
>>>>>>>>>>> bytes=bytes@entry=59184)
>>>>>>>>>>>     at malloc.c:3423
>>>>>>>>>>> #2  0x00007ffff73bf2cc in __libc_calloc (n=,
>>>>>>>>>>>     elem_size=) at malloc.c:3219
>>>>>>>>>>> #3  0x00007ffff70df5f2 in sf_open ()
>>>>>>>>>>>    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
>>>>>>>>>>> #4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>>>>>>> #5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>>>>>>> #6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>>>>>>> #7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>>>>>>> #8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
>>>>>>>>>>> #9  0x00007ffff7a8bb5e in csoundPerform () from
>>>>>>>>>>> /usr/lib/libcsound64.so.6.0
>>>>>>>>>>> #10 0x0000000000401358 in ?? ()
>>>>>>>>>>> #11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
>>>>>>>>>>> argc=2,
>>>>>>>>>>>     argv=0x7fffffffd7c8, init=, fini=>>>>>>>>>> out>,
>>>>>>>>>>>     rtld_fini=, stack_end=0x7fffffffd7b8) at
>>>>>>>>>>> libc-start.c:287
>>>>>>>>>>> #12 0x00000000004013b0 in _start ()
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 2016-01-24 1:24 GMT+03:00 Anton Kholomiov
>>>>>>>>>>> :
>>>>>>>>>>> Thanks for the quick reply, Victor.
>>>>>>>>>>> I'll report back if I encounter the problem again!
>>>>>>>>>>> Though I'm not that good with gdb
>>>>>>>>>>>
>>>>>>>>>>> 2016-01-24 1:20 GMT+03:00 Victor Lazzarini
>>>>>>>>>>> :
>>>>>>>>>>> Use gdb. Are you using the csound command? Do gdb csound, then
>>>>>>>>>>> use the run command with the arguments you need eg
>>>>>>>>>>>
>>>>>>>>>>> run mycsd.csd
>>>>>>>>>>>
>>>>>>>>>>> when it crashes you can try using the
>>>>>>>>>>> backtrace command to show where it stopped.
>>>>>>>>>>>
>>>>>>>>>>> On 23 Jan 2016, at 22:07, Anton Kholomiov
>>>>>>>>>>> 
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> How to do it?
>>>>>>>>>>>>
>>>>>>>>>>>> 2016-01-24 1:06 GMT+03:00 Victor Lazzarini
>>>>>>>>>>>> :
>>>>>>>>>>>> Can you run it under a debugger?
>>>>>>>>>>>>
>>>>>>>>>>>> On 23 Jan 2016, at 21:55, Anton Kholomiov
>>>>>>>>>>>> 
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Unfortunately after several minutes of playing the service
>>>>>>>>>>>>> breaks
>>>>>>>>>>>>> with the message
>>>>>>>>>>>>>
>>>>>>>>>>>>> diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>>>>>>>          44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>>>>>>> *** Error in `csound': double free or corruption (out):
>>>>>>>>>>>>> 0x00000000014bfd70 ***
>>>>>>>>>>>>> Csound tidy up: Aborted
>>>>>>>>>>>>>
>>>>>>>>>>>>> Any ideas?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2016-01-24 0:54 GMT+03:00 Anton Kholomiov
>>>>>>>>>>>>> :
>>>>>>>>>>>>> It's done. Just in case if anyone interested in the end result.
>>>>>>>>>>>>> I post a code for service. It can play continuously wav files
>>>>>>>>>>>>> on several channels. Channels are identified by numbers.
>>>>>>>>>>>>>
>>>>>>>>>>>>> User can for the given channel
>>>>>>>>>>>>>
>>>>>>>>>>>>> * start playing a wav file in the loop. The wav files are played
>>>>>>>>>>>>> with
>>>>>>>>>>>>> xfade at the ends
>>>>>>>>>>>>>    so that user percieves it like a continuous flow.
>>>>>>>>>>>>>
>>>>>>>>>>>>> * stop playing a file
>>>>>>>>>>>>>
>>>>>>>>>>>>> * resume playback
>>>>>>>>>>>>>
>>>>>>>>>>>>> * set the volume for the given channel
>>>>>>>>>>>>>
>>>>>>>>>>>>> * set a global fade in/out time
>>>>>>>>>>>>>
>>>>>>>>>>>>> Also there is a python file that makes it easy to trigger the
>>>>>>>>>>>>> service
>>>>>>>>>>>>> from the code. There are some test remnants of file names you
>>>>>>>>>>>>> can
>>>>>>>>>>>>> substitute it with your own files.
>>>>>>>>>>>>>
>>>>>>>>>>>>> This combo of OSC service and python client makes it easy
>>>>>>>>>>>>> to livecode with python.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Anton
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2016-01-22 18:56 GMT+03:00 Victor Lazzarini
>>>>>>>>>>>>> :
>>>>>>>>>>>>> Strings are updated generally at i-time, but with special
>>>>>>>>>>>>> provisions
>>>>>>>>>>>>> for perf-time.
>>>>>>>>>>>>> ========================
>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>>>>>>>> Maynooth University,
>>>>>>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>>>>>>> Tel: 00 353 7086936
>>>>>>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 22 Jan 2016, at 15:52, Anton Kholomiov
>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thank you for clarification. It was a blind spot for me is S
>>>>>>>>>>>>>> behaves
>>>>>>>>>>>>>> like I or like K.
>>>>>>>>>>>>>> So the assignment operation works only at init time
>>>>>>>>>>>>>> and for k-rate we should use strcpyk.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Anton
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 2016-01-22 18:45 GMT+03:00 Victor Lazzarini
>>>>>>>>>>>>>> :
>>>>>>>>>>>>>> String assignment is i-time only. Use strcpyk
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> gSFile strcpyk SFile
>>>>>>>>>>>>>> ========================
>>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>>>>>>>>>> Maynooth University,
>>>>>>>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>>>>>>>> Tel: 00 353 7086936
>>>>>>>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 22 Jan 2016, at 15:33, Anton Kholomiov
>>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I'm trying to write an OSC-server with Csound.
>>>>>>>>>>>>>>> The service should receive the name of the wav-file and the
>>>>>>>>>>>>>>> length of crossfade.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On receive it should stop playing any previous wavs
>>>>>>>>>>>>>>> and start a loop that plays next wav file.
>>>>>>>>>>>>>>> The two loops should crossfade.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> While trying to write such a thing I'm getting into trouble
>>>>>>>>>>>>>>> with receiving String message with OSC.
>>>>>>>>>>>>>>> I receive a string-field then assign it to a global String
>>>>>>>>>>>>>>> var.
>>>>>>>>>>>>>>> But when I try to use it with diskin2 or filelen I get INIT
>>>>>>>>>>>>>>> errors
>>>>>>>>>>>>>>> like this
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> INIT ERROR in instr 100: diskinfo cannot open
>>>>>>>>>>>>>>> ilen  filelen gSFile  1
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> What can be wrong with my code?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I attach the two files.
>>>>>>>>>>>>>>> csd with server and python with client to test the server.
>>>>>>>>>>>>>>> The python uses pyOSC library
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>> Anton
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>>>>>>>>> reports to
>>>>>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs
>>>>>>>>>>>>>>> and features can
>>>>>>>>>>>>>>> be posted here 
>>>>>>>>>>>>>> Csound mailing list
>>>>>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>>>>>>>> Send bugs reports to
>>>>>>>>>>>>>>         https://github.com/csound/csound/issues
>>>>>>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>>>>>>>> reports to
>>>>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>>>>>> features can
>>>>>>>>>>>>>> be posted here
>>>>>>>>>>>>> Csound mailing list
>>>>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>>>>>>> Send bugs reports to
>>>>>>>>>>>>>         https://github.com/csound/csound/issues
>>>>>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>>>>>>> reports to
>>>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>>>>> features can
>>>>>>>>>>>>> be posted here
>>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>>>>>>>>>>> to
>>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>>>> features can
>>>>>>>>>>>> be posted here
>>>>>>>>>>>>
>>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>>>>>>>>>>> to
>>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>>>> features can
>>>>>>>>>>>> be posted here
>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>>>>>>>>>> to
>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>>> features can
>>>>>>>>>>> be posted here
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>>>>>>>>>> to
>>>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>>>> features can
>>>>>>>>>>> be posted here
>>>>>>>>>> Csound mailing list
>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>>>> Send bugs reports to
>>>>>>>>>>         https://github.com/csound/csound/issues
>>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>>
>>>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>> features can
>>>>>>>>> be posted here
>>>>>>>> Csound mailing list
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>> Send bugs reports to
>>>>>>>>         https://github.com/csound/csound/issues
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>          https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>> be posted here
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>          https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>          https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>          https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>>
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> 
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 12:46
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 12:55
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 13:08
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 13:30
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 13:46
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 17:59
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 18:08
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 18:11
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 18:26
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 18:34
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 19:02
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 19:09
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ok. As I said, I can't reproduce it, but maybe if any of the developers on Linux can help to track this down.

On 25 Jan 2016, at 19:02, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 19:14
FromAnders Genell
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 19:16
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Unfortunately this step fails for me. I've installed as much packages as I could separately. 
~~~
$ sudo apt-get build-dep csound 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have unmet dependencies:
 libpulse-dev : Depends: libpulse0 (= 1:4.0-0ubuntu11.1) but 1:4.0-0ubuntu22 is to be installed
                Depends: libpulse-mainloop-glib0 (= 1:4.0-0ubuntu11.1) but 1:4.0-0ubuntu22 is to be installed
                Depends: libavahi-client-dev but it is not going to be installed
E: Build-dependencies for csound could not be satisfied.
~~~

2016-01-25 22:14 GMT+03:00 Anders Genell <anders.genell@gmail.com>:
In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 19:46
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Maybe Anders can test your code to confirm the problem?

On 25 Jan 2016, at 19:14, Anders Genell <anders.genell@GMAIL.COM> wrote:

In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 19:58
FromGuillermo Senna
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ubuntu Studio 14.04.3 -> Works!

Tested with Csound 6.06; "fox.wav"; both, jack and alsa.

On 25/01/16 16:46, Victor Lazzarini wrote:
Maybe Anders can test your code to confirm the problem?

On 25 Jan 2016, at 19:14, Anders Genell <anders.genell@GMAIL.COM> wrote:

In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2016-01-25 20:04
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Guillermo have you tried a failure scenario? It works  for me too but when I send some commands it breaks


2016-01-25 22:58 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Ubuntu Studio 14.04.3 -> Works!

Tested with Csound 6.06; "fox.wav"; both, jack and alsa.

On 25/01/16 16:46, Victor Lazzarini wrote:
Maybe Anders can test your code to confirm the problem?

On 25 Jan 2016, at 19:14, Anders Genell <anders.genell@GMAIL.COM> wrote:

In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:05
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I've posted it before

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  fileA)

In [4]: c.play(1,  fileB)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  fileA)

In [8]: c.play(2,  fileC)

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, fileA)

~~~

2016-01-25 23:04 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
@Guillermo have you tried a failure scenario? It works  for me too but when I send some commands it breaks


2016-01-25 22:58 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Ubuntu Studio 14.04.3 -> Works!

Tested with Csound 6.06; "fox.wav"; both, jack and alsa.

On 25/01/16 16:46, Victor Lazzarini wrote:
Maybe Anders can test your code to confirm the problem?

On 25 Jan 2016, at 19:14, Anders Genell <anders.genell@GMAIL.COM> wrote:

In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:05
FromAnders Genell
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Oh, yes, you already said so, sorry. 
Could you try aptitude instead? Sometimes it works better...
sudo aptitude build-dep csound

Regards,
Anders

25 jan. 2016 kl. 20:16 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

Unfortunately this step fails for me. I've installed as much packages as I could separately. 
~~~
$ sudo apt-get build-dep csound 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have unmet dependencies:
 libpulse-dev : Depends: libpulse0 (= 1:4.0-0ubuntu11.1) but 1:4.0-0ubuntu22 is to be installed
                Depends: libpulse-mainloop-glib0 (= 1:4.0-0ubuntu11.1) but 1:4.0-0ubuntu22 is to be installed
                Depends: libavahi-client-dev but it is not going to be installed
E: Build-dependencies for csound could not be satisfied.
~~~

2016-01-25 22:14 GMT+03:00 Anders Genell <anders.genell@gmail.com>:
In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:06
FromAnders Genell
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I can try it tomorrow. 

Regards
Anders

25 jan. 2016 kl. 20:46 skrev Victor Lazzarini <Victor.Lazzarini@NUIM.IE>:

Maybe Anders can test your code to confirm the problem?

On 25 Jan 2016, at 19:14, Anders Genell <anders.genell@GMAIL.COM> wrote:

In almost all flavours of Ubuntu the default audio backend is pulse nowadays, so if you're building csound without pulse that might complicate things...

Did you do
sudo apt-get build-dep csound 
at any point? That should install a lot of things useful for building csound including pulse development libraries I believe. 

Regards,
Anders

25 jan. 2016 kl. 20:02 skrev Anton Kholomiov <anton.kholomiov@GMAIL.COM>:

I'm not setting any flags. I'm usiing the default for linux. I guess it's alsa.
And cmake says I have no pulseaudio support

~~~
-- USE_ALSA is enabled
-- PULSEAUDIO_HEADER="", so disabling USE_PULSEAUDIO
-- PULSEAUDIO_LIBRARY="PULSEAUDIO_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- PULSESIMPLE_LIBRARY="PULSESIMPLE_LIBRARY-NOTFOUND", so disabling USE_PULSEAUDIO
-- USE_PULSEAUDIO is disabled

~~~

2016-01-25 21:34 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That's different alright. It looks like pulseaudio failing in this one. Are you using pulseaudio?

The first backtrace seemed to point to an array read.

On 25 Jan 2016, at 18:26, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

A shorter script to get the error:

~~~
> python

> from test_flow import *
> c = Flow(7700, 8)
c.play(0,  fileA)
> c.play(1, fileB)
> c.stop(0)
> c.resume(0)
> c.play(0, fileA)
~~~

Though error is slightly different:

~~~
Assertion 'p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK' failed at pulsecore/pstream.c:513, function prepare_next_write_item(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe30ee700 (LWP 9425)]
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007fffe9b08708 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#3  0x00007fffe9fa6b87 in pa_mainloop_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007fffe9fa6f8c in pa_mainloop_iterate ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007fffe9fa7030 in pa_mainloop_run ()
   from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007fffe9fb53f6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffe9b18628 in ?? ()
   from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so
#8  0x00007ffff7675182 in start_thread (arg=0x7fffe30ee700)
    at pthread_create.c:312
#9  0x00007ffff73a247d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
~~~


2016-01-25 21:11 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I mean **here is my trace

My session in ipython to get this error:

~~~
In [1]: from test_flow import *

In [2]: c = Flow(7700, 8)

In [3]: c.play(0,  pad(hams))

In [4]: c.play(1,  file_name)

In [5]: c.stop(1)

In [6]: c.set_volume(1, 0.25)

In [7]: 

In [7]: 

In [7]: c.play(1,  file_name)

In [8]: c.play(2,  pad(overt))

In [9]: c.stop(0)

In [10]: c.resume(0)

In [11]: c.play(0, pad(hams))

~~~

file_name    -- some wav  files
pad(hams)
pad(overt)






2016-01-25 21:08 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Here is make trace:

~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast): 0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at /home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~

2016-01-25 20:59 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Should I write it like this? :

> cmake -DCMAKE_BUILD_TYPE=Debug ../csound

2016-01-25 16:46 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I can't see this problem as a result of low latency kernel. Now that you are building your own, you can set the CMAKE_BUILD_TYPE="Debug" and run it in gdb, so we can get better backtraces

On 25 Jan 2016, at 13:30, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Yes I did. Maybe it's something with my distro. I use low-letency linux kernel . Maybe I configured it improperly.
Though it was only once that I saw behavior like this with my other csound programs.
Th usual behavior for me is to crash at the start. But if csound runs
it can run for long time.

2016-01-25 16:08 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
It works here though. I tested it with no crashes even after 40mins. Are you sure you are running the latest? Have you removed the other version?

On 25 Jan 2016, at 12:55, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

Unfotunately this doesn't fix the original problem for me. My code breaks even with brand new csound((
I'll try the Steven's hint on init rate diskin2. Though it makes code more complicated.

2016-01-25 15:46 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
Ok, I've built the fltk with --enable-shared. Then make & sudo make install was a success story for csound!


Do you know why Csound doesn't want to build Jack opcodes? I've installed jack2 from sources.
What can I miss? I suspect that I installed jack headers to /usr/local/include
but cmakes searches for headers at /usr/include. Do you know how can I fix it?

Anton


2016-01-25 0:02 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Hi Anton,

Do you have libfltk1.1-dev installed?



On 24/01/16 17:37, Victor Lazzarini wrote:
It’s a problem with the FLTK library in your system.
Do you need the FLTK opcodes? If so, rebuild it by adding -fPIC to the build as it says (or just
build a shared libfltk, I think that would solve it). Otherwise just disable the build by saying
-DUSE_FLTK=0 to Cmake.

Regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 24 Jan 2016, at 19:50, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:


This is what I get with "make VERBOSE=1 -j1" :

~~~
[ 73%] Building CXX object InOut/CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o
cd /home/anton/tools/cs6make/InOut && /usr/bin/c++   -DCS_DEFAULT_PLUGINDIR=\"/usr/local/lib/csound/plugins64-6.0\" -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dvirtual_EXPORTS -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp -fPIC -I/home/anton/tools/csound/./H -I/home/anton/tools/csound/./include -I/home/anton/tools/csound/./Engine -I/home/anton/tools/csound/. -I/home/anton/tools/cs6make -I/home/anton/tools/cs6make/include -I/home/anton/tools/csound/InOut/. -I/usr/local/include    -Wno-format -o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -c /home/anton/tools/csound/InOut/virtual_keyboard/SliderData.cpp
[ 74%] Linking CXX shared module ../libvirtual.so
cd /home/anton/tools/cs6make/InOut && /home/anton/tools/cmake-3.3.0/bin/cmake -E cmake_link_script CMakeFiles/virtual.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp  -fopenmp -shared -Wl,-soname,libvirtual.so -o ../libvirtual.so CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWindow.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/FLTKKeyboardWidget.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/virtual_keyboard.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Bank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/KeyboardMapping.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/Program.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderBank.cpp.o CMakeFiles/virtual.dir/virtual_keyboard/SliderData.cpp.o -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl.o): relocation R_X86_64_32 against `.bss._ZL13first_timeout' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfltk.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libvirtual.so] Error 1
make[2]: Leaving directory `/home/anton/tools/cs6make'
make[1]: *** [InOut/CMakeFiles/virtual.dir/all] Error 2
make[1]: Leaving directory `/home/anton/tools/cs6make'
make: *** [all] Error 2
~~~

Anton


2016-01-24 18:00 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Alternatively you can use "make VERBOSE=1 -j1". I use this whenever there is an error so that the results are verbose and also the build is single threaded. I find when multithreaded the error message gets intermixed with other messages.


On Sun, Jan 24, 2016, 5:20 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What is the build error? Set verbose mode in Cmake (-DCMAKE_MAKEFILE_VERBOSE=1) to show it if it is not showing.

On 24 Jan 2016, at 08:10, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:

@ Victor

I've got as far as

~~~
[ 79%] Building C object CMakeFiles/csound64.dir/Engine/cs_par_dispatch.c.o
[ 80%] Linking C shared library libcsound64.so
[ 80%] Built target csound64
make: *** [all] Error 2
~~~
I've failed to install libpulse-dev and libjack-dev on my system.
It says I have some unmet deps that it fails to install((
My system is Ubuntu 14.04. My config log is in the attachment.





2016-01-24 11:06 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:


2016-01-24 3:30 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Csound should report the version of libsndfile, for example on my system:

$ csound --help
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.07 (double samples) Jan 19 2016
libsndfile-1.0.25-exp

As Victor mentioned, 6.03.2 is a bit old and using a newer version
would help eliminate some possibilities.

On Sat, Jan 23, 2016 at 6:41 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
The csound is 6.03.2. How can I find out the version of libsndfile?

2016-01-24 2:38 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
One other off-chance possibility, I noticed the libsndfile in the trace is
in:

/usr/lib/x86_64-linux-gnu/libsndfile.so.1

but csound is in:

/usr/lib/libcsound64.so.6.0

Any chance one could be 32-bit (i686) and the other 64-bit (x86_64)?
I'm not sure if that'd even runtime link...

What version of libsndfile and csound are being used?

On Sat, Jan 23, 2016 at 6:33 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
It does not check if it is below 0. (but Csound does. I get a warning if
I sent a negative channel).
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:25, Anton Kholomiov <anton.kholomiov@GMAIL.COM>
wrote:

There have to be no out of bounds array assignment. Since I check the
messages for being in the right interval.

2016-01-24 2:23 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think the if-then gets translated into an i & perf time check
(cggoto).

But I am thinking here the crash might be to do with accessing arrays
out of bounds.
I can’t reproduce it though.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 23:10, Steven Yi <stevenyi@GMAIL.COM> wrote:

A couple of things that may (or may not) be useful:

1. This post discusses the victim error message:

http://stackoverflow.com/questions/9123064/int-malloc-assertion-error

2. There is an i-time if-then used that wraps perf-time code (the
diskin's). Could you try:

    ichan filenchnls gSFiles[iChannel]
    kchan init ichan
    if (kchan == 1) then



On Sat, Jan 23, 2016 at 6:00 PM, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:
Here is the code

~~~
<CsoundSynthesizer>
<CsOptions>
-odac   -d
</CsOptions>
<CsInstruments>

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

#ifndef PORT
    #define PORT        # 7700 #
#end

#ifndef SIZE
    #define SIZE        # 8 #
#end

gkVolume   init 1
gSFile     init ""

gSFiles[]   init $SIZE
gkVolumes[] init $SIZE

gaL init 0
gaR init 0

gihandle OSCinit $PORT

gkFadeTime init 1

opcode FracInstr, k, ik
    iInstrNum, kChannel xin
    kres = iInstrNum + ((kChannel + 1) / 1000)
    xout kres
endop

instr   PlayMsg
    SFile = ""
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/play", "is", kChannel, SFile
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel

    printk 0,kSched
     printk 0,kRun


    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    gSFiles[kChannel] strcpyk SFile
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin

instr StopMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/stop", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    kgoto nxtmsg
ex:
endin

instr ResumeMsg
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/resume", "i", kChannel
if (kk == 0 || kChannel >= $SIZE) goto ex
    kSched FracInstr 100, kChannel
    kRun   FracInstr 80,  kChannel
    turnoff2 kSched, 4, 0
    turnoff2 kRun,  4, gkFadeTime
    event "i", kSched, 0, -1, kChannel
    kgoto nxtmsg
ex:
endin


instr   SetVolMsg
    kVolume   init 0
    kChannel  init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_volume", "if", kChannel, kVolume
if (kk == 0 || kChannel >= $SIZE) goto ex
    gkVolumes[kChannel] = kVolume
    kgoto nxtmsg
ex:
endin

instr   SetFadeMsg
    kFade   init 0
    kk init 0

nxtmsg:
    kk  OSClisten gihandle, "/set_fade", "f", kFade
if (kk == 0) goto ex
    gkFadeTime = kFade
    kgoto nxtmsg
ex:
endin

instr 80
    print p1
    idur    = p3
    iFadeTime = i(gkFadeTime)
    iChannel  = p4
    ichan filenchnls gSFiles[iChannel]
    if (ichan == 1) then
        al diskin2 gSFiles[iChannel], 1
        ar = al
    else
        al, ar diskin2 gSFiles[iChannel], 1
    endif

    kenv    linsegr 0, iFadeTime, 1, idur - 2 * iFadeTime, 1,
iFadeTime, 0,
iFadeTime, 0
    kvol    port gkVolumes[iChannel], 0.05

    gaL  = gaL + kenv * kvol * al
    gaR  = gaR + kenv * kvol * ar
endin

instr 100
    iChannel  = p4
    iFadeTime = i(gkFadeTime)
    ilen  filelen gSFiles[iChannel]
    km    metro (1 / (ilen - iFadeTime))
    kRun FracInstr 80, iChannel
    if (km == 1)  then
        event "i", kRun, 0, ilen, iChannel
    endif
endin

instr 110
    outs gaL, gaR
    gaL = 0
    gaR = 0
endin

instr Init
    kCount = 0
    until (kCount == lenarray(gkVolumes)) do
        gkVolumes[kCount] = 1
        kCount = kCount + 1
    od
endin


</CsInstruments>
<CsScore>

f0 1000000

i "Init" 0 0.01

i   "PlayMsg"    0 -1
i   "SetVolMsg"  0 -1
i   "SetFadeMsg" 0 -1
i   "StopMsg"    0 -1
i   "ResumeMsg"  0 -1

i 110 0 -1
e
</CsScore>
</CsoundSynthesizer>
~~~

2016-01-24 1:59 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you post the Csound code? I see no global arrays in your
earlier
flow.csd
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 23 Jan 2016, at 22:36, Anton Kholomiov
<anton.kholomiov@gmail.com>
wrote:

Here I'm reading the same file with diskin2 in the two instances
of the
same instrument.
It's triggered with fractional numbers. 80.001 and 80.005

2016-01-24 1:33 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
The last message I've sent was to set the volume on channel. It
assigns
a value to the cell of global array.

2016-01-24 1:32 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Here is message from gdb:

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T239.543 TT239.543 M:  1.04093  1.05760
     number of samples out of range:        2        2
new alloc for instr 80:
instr 80:  p1 = 80.005
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
  rtevent:       T249.986 TT249.986 M:  1.70557  1.27811
     number of samples out of range:     1315      451
instr 80:  p1 = 80.001

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>) at
malloc.c:4163
4163    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7ffff76fa760 <main_arena>)
    at malloc.c:4163
#1  0x00007ffff73bbdf8 in _int_malloc (
    av=av@entry=0x7ffff76fa760 <main_arena>,
bytes=bytes@entry=59184)
    at malloc.c:3423
#2  0x00007ffff73bf2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#3  0x00007ffff70df5f2 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#4  0x00007ffff79cfb67 in ?? () from /usr/lib/libcsound64.so.6.0
#5  0x00007ffff79cffc8 in ?? () from /usr/lib/libcsound64.so.6.0
#6  0x00007ffff796ecb9 in ?? () from /usr/lib/libcsound64.so.6.0
#7  0x00007ffff7973e40 in ?? () from /usr/lib/libcsound64.so.6.0
#8  0x00007ffff7976502 in ?? () from /usr/lib/libcsound64.so.6.0
#9  0x00007ffff7a8bb5e in csoundPerform () from
/usr/lib/libcsound64.so.6.0
#10 0x0000000000401358 in ?? ()
#11 0x00007ffff735dec5 in __libc_start_main (main=0x401130,
argc=2,
    argv=0x7fffffffd7c8, init=<optimized out>, fini=<optimized
out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffd7b8) at
libc-start.c:287
#12 0x00000000004013b0 in _start ()


2016-01-24 1:24 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
Thanks for the quick reply, Victor.
I'll report back if I encounter the problem again!
Though I'm not that good with gdb

2016-01-24 1:20 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Use gdb. Are you using the csound command? Do gdb csound, then
use the run command with the arguments you need eg

run mycsd.csd

when it crashes you can try using the
backtrace command to show where it stopped.

On 23 Jan 2016, at 22:07, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

How to do it?

2016-01-24 1:06 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Can you run it under a debugger?

On 23 Jan 2016, at 21:55, Anton Kholomiov
<anton.kholomiov@GMAIL.COM>
wrote:

Unfortunately after several minutes of playing the service
breaks
with the message

diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
*** Error in `csound': double free or corruption (out):
0x00000000014bfd70 ***
Csound tidy up: Aborted

Any ideas?


2016-01-24 0:54 GMT+03:00 Anton Kholomiov
<anton.kholomiov@gmail.com>:
It's done. Just in case if anyone interested in the end result.
I post a code for service. It can play continuously wav files
on several channels. Channels are identified by numbers.

User can for the given channel

* start playing a wav file in the loop. The wav files are played
with
xfade at the ends
   so that user percieves it like a continuous flow.

* stop playing a file

* resume playback

* set the volume for the given channel

* set a global fade in/out time

Also there is a python file that makes it easy to trigger the
service
from the code. There are some test remnants of file names you
can
substitute it with your own files.

This combo of OSC service and python client makes it easy
to livecode with python.


Anton






2016-01-22 18:56 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
Strings are updated generally at i-time, but with special
provisions
for perf-time.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:52, Anton Kholomiov
<anton.kholomiov@gmail.com> wrote:

Thank you for clarification. It was a blind spot for me is S
behaves
like I or like K.
So the assignment operation works only at init time
and for k-rate we should use strcpyk.

Anton

2016-01-22 18:45 GMT+03:00 Victor Lazzarini
<Victor.Lazzarini@nuim.ie>:
String assignment is i-time only. Use strcpyk

gSFile strcpyk SFile
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 22 Jan 2016, at 15:33, Anton Kholomiov
<anton.kholomiov@GMAIL.COM> wrote:

I'm trying to write an OSC-server with Csound.
The service should receive the name of the wav-file and the
length of crossfade.

On receive it should stop playing any previous wavs
and start a loop that plays next wav file.
The two loops should crossfade.

While trying to write such a thing I'm getting into trouble
with receiving String message with OSC.
I receive a string-field then assign it to a global String
var.
But when I try to use it with diskin2 or filelen I get INIT
errors
like this

INIT ERROR in instr 100: diskinfo cannot open
ilen  filelen gSFile  1

What can be wrong with my code?

I attach the two files.
csd with server and python with client to test the server.
The python uses pyOSC library

Thanks,
Anton

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs
and features can
be posted here <flow.csd><test_flow.py>
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here




Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and
features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
<config-log.txt>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
         https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here




Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:25
Fromjpff
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
That backtrace looks like a double free in string_copy_value where id 
attempts to delete the space in the dst arument.  Really I would love tis 
run under valgrind or ElectricFence or similar

On Mon, 25 Jan 2016, Anton Kholomiov wrote:

> Here is make trace:
> ~~~
> diskin2: opened '/home/anton/Seashore.wav':
>          44100 Hz, 2 channel(s), 546731 sample frames
>  i   1 time   220.31819:   100.00100
>  i   1 time   220.31819:    80.00100
> *** Error in `/usr/local/bin/csound': free(): invalid next size (fast):
> 0x0000000000843840 ***
> 
> Program received signal SIGABRT, Aborted.
> 0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> #2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
>     fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
>     at ../sysdeps/posix/libc_fatal.c:175
> #3  0x00007ffff732766e in malloc_printerr (ptr=, 
>     str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
>     at malloc.c:4996
> #4  _int_free (av=, p=, have_lock=0)
>     at malloc.c:3840
> #5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
>     at /home/anton/tools/csound/Engine/memalloc.c:172
> #6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
>     src=0x7b5a70) at
> /home/anton/tools/csound/Engine/csound_standard_types.c:70
> #7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
>     at /home/anton/tools/csound/Opcodes/arrays.c:264
> #8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
>     at /home/anton/tools/csound/Top/csound.c:1552
> #9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
>     at /home/anton/tools/csound/Top/csound.c:2044
> #10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
>     at /home/anton/tools/csound/frontends/csound/csound_main.c:318
> ~~~
>

Trimmed as it is messing thedigest

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 20:33
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
It's probably caused by the following line in my code:

~~~
gSFiles[kChannel] strcpyk SFile
~~~

Where  kChannel and SFile are filled with values that I receive in the OSC message

2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
That backtrace looks like a double free in string_copy_value where id attempts to delete the space in the dst arument.  Really I would love tis run under valgrind or ElectricFence or similar


On Mon, 25 Jan 2016, Anton Kholomiov wrote:

Here is make trace:
~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast):
0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>, 
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8, 
    src=0x7b5a70) at
/home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~


Trimmed as it is messing thedigest

==John ff


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:34
FromGuillermo Senna
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Got this twice:

instr 80:  p1 = 80.003
*** Error in `/opt/csound-6.06/bin/csound': corrupted double-linked 
list: 0x000000000079e100 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72f2cc9 in __GI_raise (sig=sig@entry=6)
     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72f2cc9 in __GI_raise (sig=sig@entry=6)
     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72f60d8 in __GI_abort () at abort.c:89
#2  0x00007ffff732f394 in __libc_message (do_abort=do_abort@entry=1,
     fmt=fmt@entry=0x7ffff743db28 "*** Error in `%s': %s: 0x%s ***\n")
     at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff733aac2 in malloc_printerr (ptr=,
     str=0x7ffff7439bfc "corrupted double-linked list", action=1)
     at malloc.c:4996
#4  malloc_consolidate (av=av@entry=0x7ffff767a760 )
     at malloc.c:4165
#5  0x00007ffff733bdf8 in _int_malloc (
     av=av@entry=0x7ffff767a760 , bytes=bytes@entry=59184)
     at malloc.c:3423
#6  0x00007ffff733f2cc in __libc_calloc (n=,
     elem_size=) at malloc.c:3219
#7  0x00007ffff705f522 in sf_open ()
    from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#8  0x00007ffff796960a in getsndinfo ()
    from /opt/csound-6.06/lib/libcsound64.so.6.0
#9  0x00007ffff7969aae in filenchnls_S ()
    from /opt/csound-6.06/lib/libcsound64.so.6.0
#10 0x00007ffff78f2307 in insert ()

On 25/01/16 17:25, jpff wrote:
> That backtrace looks like a double free in string_copy_value where id 
> attempts to delete the space in the dst arument.  Really I would love 
> tis run under valgrind or ElectricFence or similar
>
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>> Here is make trace:
>> ~~~
>> diskin2: opened '/home/anton/Seashore.wav':
>>          44100 Hz, 2 channel(s), 546731 sample frames
>>  i   1 time   220.31819:   100.00100
>>  i   1 time   220.31819:    80.00100
>> *** Error in `/usr/local/bin/csound': free(): invalid next size (fast):
>> 0x0000000000843840 ***
>>
>> Program received signal SIGABRT, Aborted.
>> 0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>> 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
>> (gdb) bt
>> #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>> #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>> #2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1,
>>     fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
>>     at ../sysdeps/posix/libc_fatal.c:175
>> #3  0x00007ffff732766e in malloc_printerr (ptr=,
>>     str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
>>     at malloc.c:4996
>> #4  _int_free (av=, p=, have_lock=0)
>>     at malloc.c:3840
>> #5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
>>     at /home/anton/tools/csound/Engine/memalloc.c:172
>> #6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, 
>> dest=0x8cc1c8,
>>     src=0x7b5a70) at
>> /home/anton/tools/csound/Engine/csound_standard_types.c:70
>> #7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
>>     at /home/anton/tools/csound/Opcodes/arrays.c:264
>> #8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
>>     at /home/anton/tools/csound/Top/csound.c:1552
>> #9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
>>     at /home/anton/tools/csound/Top/csound.c:2044
>> #10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
>>     at /home/anton/tools/csound/frontends/csound/csound_main.c:318
>> ~~~
>>
>
> Trimmed as it is messing thedigest
>
> ==John ff
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 20:38
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Wow! I'm not alone) someone can reproduce it.

2016-01-25 23:34 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
Got this twice:

instr 80:  p1 = 80.003
*** Error in `/opt/csound-6.06/bin/csound': corrupted double-linked list: 0x000000000079e100 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72f2cc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72f2cc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72f60d8 in __GI_abort () at abort.c:89
#2  0x00007ffff732f394 in __libc_message (do_abort=do_abort@entry=1,
    fmt=fmt@entry=0x7ffff743db28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff733aac2 in malloc_printerr (ptr=<optimized out>,
    str=0x7ffff7439bfc "corrupted double-linked list", action=1)
    at malloc.c:4996
#4  malloc_consolidate (av=av@entry=0x7ffff767a760 <main_arena>)
    at malloc.c:4165
#5  0x00007ffff733bdf8 in _int_malloc (
    av=av@entry=0x7ffff767a760 <main_arena>, bytes=bytes@entry=59184)
    at malloc.c:3423
#6  0x00007ffff733f2cc in __libc_calloc (n=<optimized out>,
    elem_size=<optimized out>) at malloc.c:3219
#7  0x00007ffff705f522 in sf_open ()
   from /usr/lib/x86_64-linux-gnu/libsndfile.so.1
#8  0x00007ffff796960a in getsndinfo ()
   from /opt/csound-6.06/lib/libcsound64.so.6.0
#9  0x00007ffff7969aae in filenchnls_S ()
   from /opt/csound-6.06/lib/libcsound64.so.6.0
#10 0x00007ffff78f2307 in insert ()


On 25/01/16 17:25, jpff wrote:
That backtrace looks like a double free in string_copy_value where id attempts to delete the space in the dst arument.  Really I would love tis run under valgrind or ElectricFence or similar

On Mon, 25 Jan 2016, Anton Kholomiov wrote:

Here is make trace:
~~~
diskin2: opened '/home/anton/Seashore.wav':
         44100 Hz, 2 channel(s), 546731 sample frames
 i   1 time   220.31819:   100.00100
 i   1 time   220.31819:    80.00100
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast):
0x0000000000843840 ***

Program received signal SIGABRT, Aborted.
0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff731b394 in __libc_message (do_abort=do_abort@entry=1,
    fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff732766e in malloc_printerr (ptr=<optimized out>,
    str=0x7ffff7429cc8 "free(): invalid next size (fast)", action=1)
    at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#5  0x00007ffff78e911f in mfree (csound=0x604040, p=0x843850)
    at /home/anton/tools/csound/Engine/memalloc.c:172
#6  0x00007ffff78fdd44 in string_copy_value (csound=0x604040, dest=0x8cc1c8,
    src=0x7b5a70) at
/home/anton/tools/csound/Engine/csound_standard_types.c:70
#7  0x00007ffff79cc2d3 in array_get (csound=0x604040, p=0x8d12d0)
    at /home/anton/tools/csound/Opcodes/arrays.c:264
#8  0x00007ffff7a4e8f5 in kperf_nodebug (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:1552
#9  0x00007ffff7a500a3 in csoundPerform (csound=0x604040)
    at /home/anton/tools/csound/Top/csound.c:2044
#10 0x000000000040181d in main (argc=2, argv=0x7fffffffd7b8)
    at /home/anton/tools/csound/frontends/csound/csound_main.c:318
~~~


Trimmed as it is messing thedigest

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:42
Fromjpff
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
So error most likely in OSX code readig a string.  I may ave time to look, 
but nit really my area.

On Mon, 25 Jan 2016, Anton Kholomiov wrote:

> It's probably caused by the following line in my code:
> ~~~
> gSFiles[kChannel] strcpyk SFile
> ~~~
> 
> Where  kChannel and SFile are filled with values that I receive in the OSC
> message
> 
> 2016-01-25 23:25 GMT+03:00 jpff :
>       That backtrace looks like a double free in string_copy_value where
>       id attempts to delete the space in the dst arument.  Really I
>       would love tis run under valgrind or ElectricFence or similar
>
>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>             Here is make trace:
>             ~~~
>             diskin2: opened '/home/anton/Seashore.wav':
>                      44100 Hz, 2 channel(s), 546731 sample frames
>              i   1 time   220.31819:   100.00100
>              i   1 time   220.31819:    80.00100
>             *** Error in `/usr/local/bin/csound': free(): invalid
>             next size (fast):
>             0x0000000000843840 ***
>
>             Program received signal SIGABRT, Aborted.
>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>             file or directory.
>             (gdb) bt
>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>             #2  0x00007ffff731b394 in __libc_message
>             (do_abort=do_abort@entry=1, 
>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>             %s: 0x%s ***\n")
>                 at ../sysdeps/posix/libc_fatal.c:175
>             #3  0x00007ffff732766e in malloc_printerr
>             (ptr=, 
>                 str=0x7ffff7429cc8 "free(): invalid next size
>             (fast)", action=1)
>                 at malloc.c:4996
>             #4  _int_free (av=, p=,
>             have_lock=0)
>                 at malloc.c:3840
>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>             p=0x843850)
>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>             #6  0x00007ffff78fdd44 in string_copy_value
>             (csound=0x604040, dest=0x8cc1c8, 
>                 src=0x7b5a70) at
>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>             p=0x8d12d0)
>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:1552
>             #9  0x00007ffff7a500a3 in csoundPerform
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:2044
>             #10 0x000000000040181d in main (argc=2,
>             argv=0x7fffffffd7b8)
>                 at
>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>             ~~~
> 
> 
> Trimmed as it is messing thedigest
> 
> ==John ff
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 20:47
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
OSX? It only crashes on Linux.

> On 25 Jan 2016, at 20:42, jpff  wrote:
> 
> So error most likely in OSX code readig a string.  I may ave time to look, but nit really my area.
> 
>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>> 
>> It's probably caused by the following line in my code:
>> ~~~
>> gSFiles[kChannel] strcpyk SFile
>> ~~~
>> Where  kChannel and SFile are filled with values that I receive in the OSC
>> message
>> 2016-01-25 23:25 GMT+03:00 jpff :
>>      That backtrace looks like a double free in string_copy_value where
>>      id attempts to delete the space in the dst arument.  Really I
>>      would love tis run under valgrind or ElectricFence or similar
>> 
>>      On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>> 
>>            Here is make trace:
>>            ~~~
>>            diskin2: opened '/home/anton/Seashore.wav':
>>                     44100 Hz, 2 channel(s), 546731 sample frames
>>             i   1 time   220.31819:   100.00100
>>             i   1 time   220.31819:    80.00100
>>            *** Error in `/usr/local/bin/csound': free(): invalid
>>            next size (fast):
>>            0x0000000000843840 ***
>> 
>>            Program received signal SIGABRT, Aborted.
>>            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>            file or directory.
>>            (gdb) bt
>>            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>            #2  0x00007ffff731b394 in __libc_message
>>            (do_abort=do_abort@entry=1, 
>>                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>            %s: 0x%s ***\n")
>>                at ../sysdeps/posix/libc_fatal.c:175
>>            #3  0x00007ffff732766e in malloc_printerr
>>            (ptr=, 
>>                str=0x7ffff7429cc8 "free(): invalid next size
>>            (fast)", action=1)
>>                at malloc.c:4996
>>            #4  _int_free (av=, p=,
>>            have_lock=0)
>>                at malloc.c:3840
>>            #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>            p=0x843850)
>>                at /home/anton/tools/csound/Engine/memalloc.c:172
>>            #6  0x00007ffff78fdd44 in string_copy_value
>>            (csound=0x604040, dest=0x8cc1c8, 
>>                src=0x7b5a70) at
>>            /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>            p=0x8d12d0)
>>                at /home/anton/tools/csound/Opcodes/arrays.c:264
>>            #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>            (csound=0x604040)
>>                at /home/anton/tools/csound/Top/csound.c:1552
>>            #9  0x00007ffff7a500a3 in csoundPerform
>>            (csound=0x604040)
>>                at /home/anton/tools/csound/Top/csound.c:2044
>>            #10 0x000000000040181d in main (argc=2,
>>            argv=0x7fffffffd7b8)
>>                at
>>            /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>            ~~~
>> Trimmed as it is messing thedigest
>> ==John ff
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 20:49
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I think it's a typo. It should be: *OSC

C and X are really close on keyboard

2016-01-25 23:47 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
OSX? It only crashes on Linux.

> On 25 Jan 2016, at 20:42, jpff <jpff@CODEMIST.CO.UK> wrote:
>
> So error most likely in OSX code readig a string.  I may ave time to look, but nit really my area.
>
>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>
>> It's probably caused by the following line in my code:
>> ~~~
>> gSFiles[kChannel] strcpyk SFile
>> ~~~
>> Where  kChannel and SFile are filled with values that I receive in the OSC
>> message
>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>      That backtrace looks like a double free in string_copy_value where
>>      id attempts to delete the space in the dst arument.  Really I
>>      would love tis run under valgrind or ElectricFence or similar
>>
>>      On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>
>>            Here is make trace:
>>            ~~~
>>            diskin2: opened '/home/anton/Seashore.wav':
>>                     44100 Hz, 2 channel(s), 546731 sample frames
>>             i   1 time   220.31819:   100.00100
>>             i   1 time   220.31819:    80.00100
>>            *** Error in `/usr/local/bin/csound': free(): invalid
>>            next size (fast):
>>            0x0000000000843840 ***
>>
>>            Program received signal SIGABRT, Aborted.
>>            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>            file or directory.
>>            (gdb) bt
>>            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>            #2  0x00007ffff731b394 in __libc_message
>>            (do_abort=do_abort@entry=1,
>>                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>            %s: 0x%s ***\n")
>>                at ../sysdeps/posix/libc_fatal.c:175
>>            #3  0x00007ffff732766e in malloc_printerr
>>            (ptr=<optimized out>,
>>                str=0x7ffff7429cc8 "free(): invalid next size
>>            (fast)", action=1)
>>                at malloc.c:4996
>>            #4  _int_free (av=<optimized out>, p=<optimized out>,
>>            have_lock=0)
>>                at malloc.c:3840
>>            #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>            p=0x843850)
>>                at /home/anton/tools/csound/Engine/memalloc.c:172
>>            #6  0x00007ffff78fdd44 in string_copy_value
>>            (csound=0x604040, dest=0x8cc1c8,
>>                src=0x7b5a70) at
>>            /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>            p=0x8d12d0)
>>                at /home/anton/tools/csound/Opcodes/arrays.c:264
>>            #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>            (csound=0x604040)
>>                at /home/anton/tools/csound/Top/csound.c:1552
>>            #9  0x00007ffff7a500a3 in csoundPerform
>>            (csound=0x604040)
>>                at /home/anton/tools/csound/Top/csound.c:2044
>>            #10 0x000000000040181d in main (argc=2,
>>            argv=0x7fffffffd7b8)
>>                at
>>            /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>            ~~~
>> Trimmed as it is messing thedigest
>> ==John ff
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 20:50
FromGuillermo Senna
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
So Anton, would it be too difficult to replace the OSC part with pure 
time-triggered Csound code? I mean as a way to confirm that the problem 
has to do with OSC.

On 25/01/16 17:42, jpff wrote:
> So error most likely in OSX code readig a string.  I may ave time to 
> look, but nit really my area.
>
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>> It's probably caused by the following line in my code:
>> ~~~
>> gSFiles[kChannel] strcpyk SFile
>> ~~~
>>
>> Where  kChannel and SFile are filled with values that I receive in 
>> the OSC
>> message
>>
>> 2016-01-25 23:25 GMT+03:00 jpff :
>>       That backtrace looks like a double free in string_copy_value where
>>       id attempts to delete the space in the dst arument. Really I
>>       would love tis run under valgrind or ElectricFence or similar
>>
>>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>
>>             Here is make trace:
>>             ~~~
>>             diskin2: opened '/home/anton/Seashore.wav':
>>                      44100 Hz, 2 channel(s), 546731 sample frames
>>              i   1 time   220.31819:   100.00100
>>              i   1 time   220.31819:    80.00100
>>             *** Error in `/usr/local/bin/csound': free(): invalid
>>             next size (fast):
>>             0x0000000000843840 ***
>>
>>             Program received signal SIGABRT, Aborted.
>>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>             file or directory.
>>             (gdb) bt
>>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>             #2  0x00007ffff731b394 in __libc_message
>>             (do_abort=do_abort@entry=1,
>>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>             %s: 0x%s ***\n")
>>                 at ../sysdeps/posix/libc_fatal.c:175
>>             #3  0x00007ffff732766e in malloc_printerr
>>             (ptr=,
>>                 str=0x7ffff7429cc8 "free(): invalid next size
>>             (fast)", action=1)
>>                 at malloc.c:4996
>>             #4  _int_free (av=, p=,
>>             have_lock=0)
>>                 at malloc.c:3840
>>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>             p=0x843850)
>>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>>             #6  0x00007ffff78fdd44 in string_copy_value
>>             (csound=0x604040, dest=0x8cc1c8,
>>                 src=0x7b5a70) at
>> /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>             p=0x8d12d0)
>>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>             (csound=0x604040)
>>                 at /home/anton/tools/csound/Top/csound.c:1552
>>             #9  0x00007ffff7a500a3 in csoundPerform
>>             (csound=0x604040)
>>                 at /home/anton/tools/csound/Top/csound.c:2044
>>             #10 0x000000000040181d in main (argc=2,
>>             argv=0x7fffffffd7b8)
>>                 at
>> /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>             ~~~
>>
>>
>> Trimmed as it is messing thedigest
>>
>> ==John ff
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>>
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and 
>> features can
>> be posted here
>>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 20:58
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Good idea. That will help us narrow it down.

> On 25 Jan 2016, at 20:50, Guillermo Senna  wrote:
> 
> So Anton, would it be too difficult to replace the OSC part with pure time-triggered Csound code? I mean as a way to confirm that the problem has to do with OSC.
> 
>> On 25/01/16 17:42, jpff wrote:
>> So error most likely in OSX code readig a string.  I may ave time to look, but nit really my area.
>> 
>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>> 
>>> It's probably caused by the following line in my code:
>>> ~~~
>>> gSFiles[kChannel] strcpyk SFile
>>> ~~~
>>> 
>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>> message
>>> 
>>> 2016-01-25 23:25 GMT+03:00 jpff :
>>>      That backtrace looks like a double free in string_copy_value where
>>>      id attempts to delete the space in the dst arument. Really I
>>>      would love tis run under valgrind or ElectricFence or similar
>>> 
>>>      On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>> 
>>>            Here is make trace:
>>>            ~~~
>>>            diskin2: opened '/home/anton/Seashore.wav':
>>>                     44100 Hz, 2 channel(s), 546731 sample frames
>>>             i   1 time   220.31819:   100.00100
>>>             i   1 time   220.31819:    80.00100
>>>            *** Error in `/usr/local/bin/csound': free(): invalid
>>>            next size (fast):
>>>            0x0000000000843840 ***
>>> 
>>>            Program received signal SIGABRT, Aborted.
>>>            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>            file or directory.
>>>            (gdb) bt
>>>            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>            #2  0x00007ffff731b394 in __libc_message
>>>            (do_abort=do_abort@entry=1,
>>>                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>            %s: 0x%s ***\n")
>>>                at ../sysdeps/posix/libc_fatal.c:175
>>>            #3  0x00007ffff732766e in malloc_printerr
>>>            (ptr=,
>>>                str=0x7ffff7429cc8 "free(): invalid next size
>>>            (fast)", action=1)
>>>                at malloc.c:4996
>>>            #4  _int_free (av=, p=,
>>>            have_lock=0)
>>>                at malloc.c:3840
>>>            #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>            p=0x843850)
>>>                at /home/anton/tools/csound/Engine/memalloc.c:172
>>>            #6  0x00007ffff78fdd44 in string_copy_value
>>>            (csound=0x604040, dest=0x8cc1c8,
>>>                src=0x7b5a70) at
>>> /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>            p=0x8d12d0)
>>>                at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>            #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>            (csound=0x604040)
>>>                at /home/anton/tools/csound/Top/csound.c:1552
>>>            #9  0x00007ffff7a500a3 in csoundPerform
>>>            (csound=0x604040)
>>>                at /home/anton/tools/csound/Top/csound.c:2044
>>>            #10 0x000000000040181d in main (argc=2,
>>>            argv=0x7fffffffd7b8)
>>>                at
>>> /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>            ~~~
>>> 
>>> 
>>> Trimmed as it is messing thedigest
>>> 
>>> ==John ff
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>> be posted here
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>       https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 20:59
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ok. I'll try to do it with notes. It will take some time to rewrite it this way.
I'll report back later

2016-01-25 23:50 GMT+03:00 Guillermo Senna <gsenna@gmail.com>:
So Anton, would it be too difficult to replace the OSC part with pure time-triggered Csound code? I mean as a way to confirm that the problem has to do with OSC.


On 25/01/16 17:42, jpff wrote:
So error most likely in OSX code readig a string.  I may ave time to look, but nit really my area.

On Mon, 25 Jan 2016, Anton Kholomiov wrote:

It's probably caused by the following line in my code:
~~~
gSFiles[kChannel] strcpyk SFile
~~~

Where  kChannel and SFile are filled with values that I receive in the OSC
message

2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
      That backtrace looks like a double free in string_copy_value where
      id attempts to delete the space in the dst arument. Really I
      would love tis run under valgrind or ElectricFence or similar

      On Mon, 25 Jan 2016, Anton Kholomiov wrote:

            Here is make trace:
            ~~~
            diskin2: opened '/home/anton/Seashore.wav':
                     44100 Hz, 2 channel(s), 546731 sample frames
             i   1 time   220.31819:   100.00100
             i   1 time   220.31819:    80.00100
            *** Error in `/usr/local/bin/csound': free(): invalid
            next size (fast):
            0x0000000000843840 ***

            Program received signal SIGABRT, Aborted.
            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
            file or directory.
            (gdb) bt
            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
            #2  0x00007ffff731b394 in __libc_message
            (do_abort=do_abort@entry=1,
                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
            %s: 0x%s ***\n")
                at ../sysdeps/posix/libc_fatal.c:175
            #3  0x00007ffff732766e in malloc_printerr
            (ptr=<optimized out>,
                str=0x7ffff7429cc8 "free(): invalid next size
            (fast)", action=1)
                at malloc.c:4996
            #4  _int_free (av=<optimized out>, p=<optimized out>,
            have_lock=0)
                at malloc.c:3840
            #5  0x00007ffff78e911f in mfree (csound=0x604040,
            p=0x843850)
                at /home/anton/tools/csound/Engine/memalloc.c:172
            #6  0x00007ffff78fdd44 in string_copy_value
            (csound=0x604040, dest=0x8cc1c8,
                src=0x7b5a70) at
/home/anton/tools/csound/Engine/csound_standard_types.c:70
            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
            p=0x8d12d0)
                at /home/anton/tools/csound/Opcodes/arrays.c:264
            #8  0x00007ffff7a4e8f5 in kperf_nodebug
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:1552
            #9  0x00007ffff7a500a3 in csoundPerform
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:2044
            #10 0x000000000040181d in main (argc=2,
            argv=0x7fffffffd7b8)
                at
/home/anton/tools/csound/frontends/csound/csound_main.c:318
            ~~~


Trimmed as it is messing thedigest

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 21:02
Fromjpff
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Found an oddity in OSC receiving strings -- investigating.
Also code is weak on tye checking


On Mon, 25 Jan 2016, Anton Kholomiov wrote:

> It's probably caused by the following line in my code:
> ~~~
> gSFiles[kChannel] strcpyk SFile
> ~~~
> 
> Where  kChannel and SFile are filled with values that I receive in the OSC
> message
> 
> 2016-01-25 23:25 GMT+03:00 jpff :
>       That backtrace looks like a double free in string_copy_value where
>       id attempts to delete the space in the dst arument.  Really I
>       would love tis run under valgrind or ElectricFence or similar
>
>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>             Here is make trace:
>             ~~~
>             diskin2: opened '/home/anton/Seashore.wav':
>                      44100 Hz, 2 channel(s), 546731 sample frames
>              i   1 time   220.31819:   100.00100
>              i   1 time   220.31819:    80.00100
>             *** Error in `/usr/local/bin/csound': free(): invalid
>             next size (fast):
>             0x0000000000843840 ***
>
>             Program received signal SIGABRT, Aborted.
>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>             file or directory.
>             (gdb) bt
>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>             #2  0x00007ffff731b394 in __libc_message
>             (do_abort=do_abort@entry=1, 
>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>             %s: 0x%s ***\n")
>                 at ../sysdeps/posix/libc_fatal.c:175
>             #3  0x00007ffff732766e in malloc_printerr
>             (ptr=, 
>                 str=0x7ffff7429cc8 "free(): invalid next size
>             (fast)", action=1)
>                 at malloc.c:4996
>             #4  _int_free (av=, p=,
>             have_lock=0)
>                 at malloc.c:3840
>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>             p=0x843850)
>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>             #6  0x00007ffff78fdd44 in string_copy_value
>             (csound=0x604040, dest=0x8cc1c8, 
>                 src=0x7b5a70) at
>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>             p=0x8d12d0)
>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:1552
>             #9  0x00007ffff7a500a3 in csoundPerform
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:2044
>             #10 0x000000000040181d in main (argc=2,
>             argv=0x7fffffffd7b8)
>                 at
>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>             ~~~
> 
> 
> Trimmed as it is messing thedigest
> 
> ==John ff
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 21:16
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

I’ve made instruments with notes for messages. It works fine with bad python scenario emulated with score.:

i "PlayNote"   4  0.01   0 "/home/anton/hamsadhvani-pad-E.wav"
i "PlayNote"   8  0.01   1 "/home/anton/Seashore.wav"  
i "StopNote"   12 0.01   1
i "SetVolNote" 14 0.01   1 0.25
i "PlayNote"   16 0.01   1 "/home/anton/Seashore.wav"  
i "PlayNote"   20 0.01   2 "/home/anton/overtone-major-pad-E.wav"  
i "StopNote"   24 0.01   0 
i "ResumeNote" 26 0.01   0
i "PlayNote"   32 0.01   0 "/home/anton/hamsadhvani-pad-E.wav"

2016-01-26 0:02 GMT+03:00 jpff <jpff@codemist.co.uk>:
Found an oddity in OSC receiving strings -- investigating.
Also code is weak on tye checking



On Mon, 25 Jan 2016, Anton Kholomiov wrote:

It's probably caused by the following line in my code:
~~~
gSFiles[kChannel] strcpyk SFile
~~~

Where  kChannel and SFile are filled with values that I receive in the OSC
message

2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
      That backtrace looks like a double free in string_copy_value where
      id attempts to delete the space in the dst arument.  Really I
      would love tis run under valgrind or ElectricFence or similar

      On Mon, 25 Jan 2016, Anton Kholomiov wrote:

            Here is make trace:
            ~~~
            diskin2: opened '/home/anton/Seashore.wav':
                     44100 Hz, 2 channel(s), 546731 sample frames
             i   1 time   220.31819:   100.00100
             i   1 time   220.31819:    80.00100
            *** Error in `/usr/local/bin/csound': free(): invalid
            next size (fast):
            0x0000000000843840 ***

            Program received signal SIGABRT, Aborted.
            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
            file or directory.
            (gdb) bt
            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
            #2  0x00007ffff731b394 in __libc_message
            (do_abort=do_abort@entry=1, 
                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
            %s: 0x%s ***\n")
                at ../sysdeps/posix/libc_fatal.c:175
            #3  0x00007ffff732766e in malloc_printerr
            (ptr=<optimized out>, 
                str=0x7ffff7429cc8 "free(): invalid next size
            (fast)", action=1)
                at malloc.c:4996
            #4  _int_free (av=<optimized out>, p=<optimized out>,
            have_lock=0)
                at malloc.c:3840
            #5  0x00007ffff78e911f in mfree (csound=0x604040,
            p=0x843850)
                at /home/anton/tools/csound/Engine/memalloc.c:172
            #6  0x00007ffff78fdd44 in string_copy_value
            (csound=0x604040, dest=0x8cc1c8, 
                src=0x7b5a70) at
            /home/anton/tools/csound/Engine/csound_standard_types.c:70
            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
            p=0x8d12d0)
                at /home/anton/tools/csound/Opcodes/arrays.c:264
            #8  0x00007ffff7a4e8f5 in kperf_nodebug
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:1552
            #9  0x00007ffff7a500a3 in csoundPerform
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:2044
            #10 0x000000000040181d in main (argc=2,
            argv=0x7fffffffd7b8)
                at
            /home/anton/tools/csound/frontends/csound/csound_main.c:318
            ~~~


Trimmed as it is messing thedigest

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 21:39
Fromjpff
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I have pushed a small fix to git in file Opcodes/OSC.c
It _might_ fix it.

On Mon, 25 Jan 2016, jpff wrote:

> Found an oddity in OSC receiving strings -- investigating.
> Also code is weak on tye checking
>
>
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>> It's probably caused by the following line in my code:
>> ~~~
>> gSFiles[kChannel] strcpyk SFile
>> ~~~
>> 
>> Where  kChannel and SFile are filled with values that I receive in the OSC
>> message
>> 
>> 2016-01-25 23:25 GMT+03:00 jpff :
>>       That backtrace looks like a double free in string_copy_value where
>>       id attempts to delete the space in the dst arument.  Really I
>>       would love tis run under valgrind or ElectricFence or similar
>>
>>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>
>>             Here is make trace:
>>             ~~~
>>             diskin2: opened '/home/anton/Seashore.wav':
>>                      44100 Hz, 2 channel(s), 546731 sample frames
>>              i   1 time   220.31819:   100.00100
>>              i   1 time   220.31819:    80.00100
>>             *** Error in `/usr/local/bin/csound': free(): invalid
>>             next size (fast):
>>             0x0000000000843840 ***
>>
>>             Program received signal SIGABRT, Aborted.
>>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>             file or directory.
>>             (gdb) bt
>>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>             #2  0x00007ffff731b394 in __libc_message
>>             (do_abort=do_abort@entry=1, 
>>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>             %s: 0x%s ***\n")
>>                 at ../sysdeps/posix/libc_fatal.c:175
>>             #3  0x00007ffff732766e in malloc_printerr
>>             (ptr=, 
>>                 str=0x7ffff7429cc8 "free(): invalid next size
>>             (fast)", action=1)
>>                 at malloc.c:4996
>>             #4  _int_free (av=, p=,
>>             have_lock=0)
>>                 at malloc.c:3840
>>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>             p=0x843850)
>>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>>             #6  0x00007ffff78fdd44 in string_copy_value
>>             (csound=0x604040, dest=0x8cc1c8, 
>>                 src=0x7b5a70) at
>>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>             p=0x8d12d0)
>>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>             (csound=0x604040)
>>                 at /home/anton/tools/csound/Top/csound.c:1552
>>             #9  0x00007ffff7a500a3 in csoundPerform
>>             (csound=0x604040)
>>                 at /home/anton/tools/csound/Top/csound.c:2044
>>             #10 0x000000000040181d in main (argc=2,
>>             argv=0x7fffffffd7b8)
>>                 at
>>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>             ~~~
>> 
>> 
>> Trimmed as it is messing thedigest
>> 
>> ==John ff
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> 
>> 
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features 
>> can
>> be posted here
>> 
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 09:05
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?

The code with no osc also fails when I wrap it to python interface(((

I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:

;ichan filenchnls gSFiles[iChannel]    
;if (ichan == 1) then
;    al diskin2 gSFiles[iChannel], 1    
;    ar = al
;else
    al, ar diskin2 gSFiles[iChannel], 1
;endif

2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
I have pushed a small fix to git in file Opcodes/OSC.c
It _might_ fix it.


On Mon, 25 Jan 2016, jpff wrote:

Found an oddity in OSC receiving strings -- investigating.
Also code is weak on tye checking


On Mon, 25 Jan 2016, Anton Kholomiov wrote:

It's probably caused by the following line in my code:
~~~
gSFiles[kChannel] strcpyk SFile
~~~

Where  kChannel and SFile are filled with values that I receive in the OSC
message

2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
      That backtrace looks like a double free in string_copy_value where
      id attempts to delete the space in the dst arument.  Really I
      would love tis run under valgrind or ElectricFence or similar

      On Mon, 25 Jan 2016, Anton Kholomiov wrote:

            Here is make trace:
            ~~~
            diskin2: opened '/home/anton/Seashore.wav':
                     44100 Hz, 2 channel(s), 546731 sample frames
             i   1 time   220.31819:   100.00100
             i   1 time   220.31819:    80.00100
            *** Error in `/usr/local/bin/csound': free(): invalid
            next size (fast):
            0x0000000000843840 ***

            Program received signal SIGABRT, Aborted.
            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
            file or directory.
            (gdb) bt
            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
            #2  0x00007ffff731b394 in __libc_message
            (do_abort=do_abort@entry=1, 
                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
            %s: 0x%s ***\n")
                at ../sysdeps/posix/libc_fatal.c:175
            #3  0x00007ffff732766e in malloc_printerr
            (ptr=<optimized out>, 
                str=0x7ffff7429cc8 "free(): invalid next size
            (fast)", action=1)
                at malloc.c:4996
            #4  _int_free (av=<optimized out>, p=<optimized out>,
            have_lock=0)
                at malloc.c:3840
            #5  0x00007ffff78e911f in mfree (csound=0x604040,
            p=0x843850)
                at /home/anton/tools/csound/Engine/memalloc.c:172
            #6  0x00007ffff78fdd44 in string_copy_value
            (csound=0x604040, dest=0x8cc1c8, 
                src=0x7b5a70) at
            /home/anton/tools/csound/Engine/csound_standard_types.c:70
            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
            p=0x8d12d0)
                at /home/anton/tools/csound/Opcodes/arrays.c:264
            #8  0x00007ffff7a4e8f5 in kperf_nodebug
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:1552
            #9  0x00007ffff7a500a3 in csoundPerform
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:2044
            #10 0x000000000040181d in main (argc=2,
            argv=0x7fffffffd7b8)
                at
            /home/anton/tools/csound/frontends/csound/csound_main.c:318
            ~~~


Trimmed as it is messing thedigest

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
      https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 09:09
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
One more note is that new Csound is a bit slower. Some programs 
that I was able to run with 6.03 are produce a lot of Buffer underruns. 
The Csound that I install with apt-get is faster then the thing that I've build myself.



2016-01-26 12:05 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:

The code with no osc also fails when I wrap it to python interface(((

I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:

;ichan filenchnls gSFiles[iChannel]    
;if (ichan == 1) then
;    al diskin2 gSFiles[iChannel], 1    
;    ar = al
;else
    al, ar diskin2 gSFiles[iChannel], 1
;endif

2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
I have pushed a small fix to git in file Opcodes/OSC.c
It _might_ fix it.


On Mon, 25 Jan 2016, jpff wrote:

Found an oddity in OSC receiving strings -- investigating.
Also code is weak on tye checking


On Mon, 25 Jan 2016, Anton Kholomiov wrote:

It's probably caused by the following line in my code:
~~~
gSFiles[kChannel] strcpyk SFile
~~~

Where  kChannel and SFile are filled with values that I receive in the OSC
message

2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
      That backtrace looks like a double free in string_copy_value where
      id attempts to delete the space in the dst arument.  Really I
      would love tis run under valgrind or ElectricFence or similar

      On Mon, 25 Jan 2016, Anton Kholomiov wrote:

            Here is make trace:
            ~~~
            diskin2: opened '/home/anton/Seashore.wav':
                     44100 Hz, 2 channel(s), 546731 sample frames
             i   1 time   220.31819:   100.00100
             i   1 time   220.31819:    80.00100
            *** Error in `/usr/local/bin/csound': free(): invalid
            next size (fast):
            0x0000000000843840 ***

            Program received signal SIGABRT, Aborted.
            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
            file or directory.
            (gdb) bt
            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
            #2  0x00007ffff731b394 in __libc_message
            (do_abort=do_abort@entry=1, 
                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
            %s: 0x%s ***\n")
                at ../sysdeps/posix/libc_fatal.c:175
            #3  0x00007ffff732766e in malloc_printerr
            (ptr=<optimized out>, 
                str=0x7ffff7429cc8 "free(): invalid next size
            (fast)", action=1)
                at malloc.c:4996
            #4  _int_free (av=<optimized out>, p=<optimized out>,
            have_lock=0)
                at malloc.c:3840
            #5  0x00007ffff78e911f in mfree (csound=0x604040,
            p=0x843850)
                at /home/anton/tools/csound/Engine/memalloc.c:172
            #6  0x00007ffff78fdd44 in string_copy_value
            (csound=0x604040, dest=0x8cc1c8, 
                src=0x7b5a70) at
            /home/anton/tools/csound/Engine/csound_standard_types.c:70
            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
            p=0x8d12d0)
                at /home/anton/tools/csound/Opcodes/arrays.c:264
            #8  0x00007ffff7a4e8f5 in kperf_nodebug
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:1552
            #9  0x00007ffff7a500a3 in csoundPerform
            (csound=0x604040)
                at /home/anton/tools/csound/Top/csound.c:2044
            #10 0x000000000040181d in main (argc=2,
            argv=0x7fffffffd7b8)
                at
            /home/anton/tools/csound/frontends/csound/csound_main.c:318
            ~~~


Trimmed as it is messing thedigest

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
      https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 09:25
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
That is because you have a debug build, with not a lot of optimisations. If you set it to ‘Release’, it will be faster.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 09:09, Anton Kholomiov  wrote:
> 
> One more note is that new Csound is a bit slower. Some programs 
> that I was able to run with 6.03 are produce a lot of Buffer underruns. 
> The Csound that I install with apt-get is faster then the thing that I've build myself.
> 
> 
> 
> 2016-01-26 12:05 GMT+03:00 Anton Kholomiov :
> The code with no osc also fails when I wrap it to python interface(((
> 
> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> 
> ;ichan filenchnls gSFiles[iChannel]    
> ;if (ichan == 1) then
> ;    al diskin2 gSFiles[iChannel], 1    
> ;    ar = al
> ;else
>     al, ar diskin2 gSFiles[iChannel], 1
> ;endif
> 
> 
> 2016-01-26 0:39 GMT+03:00 jpff :
> I have pushed a small fix to git in file Opcodes/OSC.c
> It _might_ fix it.
> 
> 
> On Mon, 25 Jan 2016, jpff wrote:
> 
> Found an oddity in OSC receiving strings -- investigating.
> Also code is weak on tye checking
> 
> 
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> 
> It's probably caused by the following line in my code:
> ~~~
> gSFiles[kChannel] strcpyk SFile
> ~~~
> 
> Where  kChannel and SFile are filled with values that I receive in the OSC
> message
> 
> 2016-01-25 23:25 GMT+03:00 jpff :
>       That backtrace looks like a double free in string_copy_value where
>       id attempts to delete the space in the dst arument.  Really I
>       would love tis run under valgrind or ElectricFence or similar
> 
>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> 
>             Here is make trace:
>             ~~~
>             diskin2: opened '/home/anton/Seashore.wav':
>                      44100 Hz, 2 channel(s), 546731 sample frames
>              i   1 time   220.31819:   100.00100
>              i   1 time   220.31819:    80.00100
>             *** Error in `/usr/local/bin/csound': free(): invalid
>             next size (fast):
>             0x0000000000843840 ***
> 
>             Program received signal SIGABRT, Aborted.
>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>             file or directory.
>             (gdb) bt
>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>             #2  0x00007ffff731b394 in __libc_message
>             (do_abort=do_abort@entry=1, 
>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>             %s: 0x%s ***\n")
>                 at ../sysdeps/posix/libc_fatal.c:175
>             #3  0x00007ffff732766e in malloc_printerr
>             (ptr=, 
>                 str=0x7ffff7429cc8 "free(): invalid next size
>             (fast)", action=1)
>                 at malloc.c:4996
>             #4  _int_free (av=, p=,
>             have_lock=0)
>                 at malloc.c:3840
>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>             p=0x843850)
>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>             #6  0x00007ffff78fdd44 in string_copy_value
>             (csound=0x604040, dest=0x8cc1c8, 
>                 src=0x7b5a70) at
>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>             p=0x8d12d0)
>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:1552
>             #9  0x00007ffff7a500a3 in csoundPerform
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:2044
>             #10 0x000000000040181d in main (argc=2,
>             argv=0x7fffffffd7b8)
>                 at
>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>             ~~~
> 
> 
> Trimmed as it is messing thedigest
> 
> ==John ff
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 11:09
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@jpff Thanks for the fix. I've tried with your updates, but error remains present

2016-01-26 12:25 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
That is because you have a debug build, with not a lot of optimisations. If you set it to ‘Release’, it will be faster.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 09:09, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> One more note is that new Csound is a bit slower. Some programs
> that I was able to run with 6.03 are produce a lot of Buffer underruns.
> The Csound that I install with apt-get is faster then the thing that I've build myself.
>
>
>
> 2016-01-26 12:05 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> The code with no osc also fails when I wrap it to python interface(((
>
> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>
> ;ichan filenchnls gSFiles[iChannel]
> ;if (ichan == 1) then
> ;    al diskin2 gSFiles[iChannel], 1
> ;    ar = al
> ;else
>     al, ar diskin2 gSFiles[iChannel], 1
> ;endif
>
>
> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> I have pushed a small fix to git in file Opcodes/OSC.c
> It _might_ fix it.
>
>
> On Mon, 25 Jan 2016, jpff wrote:
>
> Found an oddity in OSC receiving strings -- investigating.
> Also code is weak on tye checking
>
>
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
> It's probably caused by the following line in my code:
> ~~~
> gSFiles[kChannel] strcpyk SFile
> ~~~
>
> Where  kChannel and SFile are filled with values that I receive in the OSC
> message
>
> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
>       That backtrace looks like a double free in string_copy_value where
>       id attempts to delete the space in the dst arument.  Really I
>       would love tis run under valgrind or ElectricFence or similar
>
>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>             Here is make trace:
>             ~~~
>             diskin2: opened '/home/anton/Seashore.wav':
>                      44100 Hz, 2 channel(s), 546731 sample frames
>              i   1 time   220.31819:   100.00100
>              i   1 time   220.31819:    80.00100
>             *** Error in `/usr/local/bin/csound': free(): invalid
>             next size (fast):
>             0x0000000000843840 ***
>
>             Program received signal SIGABRT, Aborted.
>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>             file or directory.
>             (gdb) bt
>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>             #2  0x00007ffff731b394 in __libc_message
>             (do_abort=do_abort@entry=1,
>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>             %s: 0x%s ***\n")
>                 at ../sysdeps/posix/libc_fatal.c:175
>             #3  0x00007ffff732766e in malloc_printerr
>             (ptr=<optimized out>,
>                 str=0x7ffff7429cc8 "free(): invalid next size
>             (fast)", action=1)
>                 at malloc.c:4996
>             #4  _int_free (av=<optimized out>, p=<optimized out>,
>             have_lock=0)
>                 at malloc.c:3840
>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>             p=0x843850)
>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>             #6  0x00007ffff78fdd44 in string_copy_value
>             (csound=0x604040, dest=0x8cc1c8,
>                 src=0x7b5a70) at
>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>             p=0x8d12d0)
>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:1552
>             #9  0x00007ffff7a500a3 in csoundPerform
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:2044
>             #10 0x000000000040181d in main (argc=2,
>             argv=0x7fffffffd7b8)
>                 at
>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>             ~~~
>
>
> Trimmed as it is messing thedigest
>
> ==John ff
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 11:28
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
So what you are saying is that, without the if … then, there is no crash?

Note that the condition will be checked both at i-time and perf-time, so it should affect
the code at all. If the crash is not happening, the reason might be different. 
We know that it seems to be triggered by an array_get(), which is called whenever
you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
can track down which one of the two is responsible, we should be able to locate
the problem.

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> 
> The code with no osc also fails when I wrap it to python interface(((
> 
> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> 
> ;ichan filenchnls gSFiles[iChannel]    
> ;if (ichan == 1) then
> ;    al diskin2 gSFiles[iChannel], 1    
> ;    ar = al
> ;else
>     al, ar diskin2 gSFiles[iChannel], 1
> ;endif
> 
> 
> 2016-01-26 0:39 GMT+03:00 jpff :
> I have pushed a small fix to git in file Opcodes/OSC.c
> It _might_ fix it.
> 
> 
> On Mon, 25 Jan 2016, jpff wrote:
> 
> Found an oddity in OSC receiving strings -- investigating.
> Also code is weak on tye checking
> 
> 
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> 
> It's probably caused by the following line in my code:
> ~~~
> gSFiles[kChannel] strcpyk SFile
> ~~~
> 
> Where  kChannel and SFile are filled with values that I receive in the OSC
> message
> 
> 2016-01-25 23:25 GMT+03:00 jpff :
>       That backtrace looks like a double free in string_copy_value where
>       id attempts to delete the space in the dst arument.  Really I
>       would love tis run under valgrind or ElectricFence or similar
> 
>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> 
>             Here is make trace:
>             ~~~
>             diskin2: opened '/home/anton/Seashore.wav':
>                      44100 Hz, 2 channel(s), 546731 sample frames
>              i   1 time   220.31819:   100.00100
>              i   1 time   220.31819:    80.00100
>             *** Error in `/usr/local/bin/csound': free(): invalid
>             next size (fast):
>             0x0000000000843840 ***
> 
>             Program received signal SIGABRT, Aborted.
>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>             file or directory.
>             (gdb) bt
>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>             #2  0x00007ffff731b394 in __libc_message
>             (do_abort=do_abort@entry=1, 
>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>             %s: 0x%s ***\n")
>                 at ../sysdeps/posix/libc_fatal.c:175
>             #3  0x00007ffff732766e in malloc_printerr
>             (ptr=, 
>                 str=0x7ffff7429cc8 "free(): invalid next size
>             (fast)", action=1)
>                 at malloc.c:4996
>             #4  _int_free (av=, p=,
>             have_lock=0)
>                 at malloc.c:3840
>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>             p=0x843850)
>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>             #6  0x00007ffff78fdd44 in string_copy_value
>             (csound=0x604040, dest=0x8cc1c8, 
>                 src=0x7b5a70) at
>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>             p=0x8d12d0)
>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:1552
>             #9  0x00007ffff7a500a3 in csoundPerform
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:2044
>             #10 0x000000000040181d in main (argc=2,
>             argv=0x7fffffffd7b8)
>                 at
>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>             ~~~
> 
> 
> Trimmed as it is messing thedigest
> 
> ==John ff
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 11:35
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I'm sorry for misinformation. The error is tricky to manifest.
Tere was no crash by some happy accident when I've commented the if/thens.
But then later I've made a version with no if/then for diskin2 
(I've put mono and stereo versions at separate instruments) and it fails too
with the same error.



2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
So what you are saying is that, without the if … then, there is no crash?

Note that the condition will be checked both at i-time and perf-time, so it should affect
the code at all. If the crash is not happening, the reason might be different.
We know that it seems to be triggered by an array_get(), which is called whenever
you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
can track down which one of the two is responsible, we should be able to locate
the problem.

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> The code with no osc also fails when I wrap it to python interface(((
>
> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>
> ;ichan filenchnls gSFiles[iChannel]
> ;if (ichan == 1) then
> ;    al diskin2 gSFiles[iChannel], 1
> ;    ar = al
> ;else
>     al, ar diskin2 gSFiles[iChannel], 1
> ;endif
>
>
> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> I have pushed a small fix to git in file Opcodes/OSC.c
> It _might_ fix it.
>
>
> On Mon, 25 Jan 2016, jpff wrote:
>
> Found an oddity in OSC receiving strings -- investigating.
> Also code is weak on tye checking
>
>
> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
> It's probably caused by the following line in my code:
> ~~~
> gSFiles[kChannel] strcpyk SFile
> ~~~
>
> Where  kChannel and SFile are filled with values that I receive in the OSC
> message
>
> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
>       That backtrace looks like a double free in string_copy_value where
>       id attempts to delete the space in the dst arument.  Really I
>       would love tis run under valgrind or ElectricFence or similar
>
>       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>
>             Here is make trace:
>             ~~~
>             diskin2: opened '/home/anton/Seashore.wav':
>                      44100 Hz, 2 channel(s), 546731 sample frames
>              i   1 time   220.31819:   100.00100
>              i   1 time   220.31819:    80.00100
>             *** Error in `/usr/local/bin/csound': free(): invalid
>             next size (fast):
>             0x0000000000843840 ***
>
>             Program received signal SIGABRT, Aborted.
>             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>             file or directory.
>             (gdb) bt
>             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>             #2  0x00007ffff731b394 in __libc_message
>             (do_abort=do_abort@entry=1,
>                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>             %s: 0x%s ***\n")
>                 at ../sysdeps/posix/libc_fatal.c:175
>             #3  0x00007ffff732766e in malloc_printerr
>             (ptr=<optimized out>,
>                 str=0x7ffff7429cc8 "free(): invalid next size
>             (fast)", action=1)
>                 at malloc.c:4996
>             #4  _int_free (av=<optimized out>, p=<optimized out>,
>             have_lock=0)
>                 at malloc.c:3840
>             #5  0x00007ffff78e911f in mfree (csound=0x604040,
>             p=0x843850)
>                 at /home/anton/tools/csound/Engine/memalloc.c:172
>             #6  0x00007ffff78fdd44 in string_copy_value
>             (csound=0x604040, dest=0x8cc1c8,
>                 src=0x7b5a70) at
>             /home/anton/tools/csound/Engine/csound_standard_types.c:70
>             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>             p=0x8d12d0)
>                 at /home/anton/tools/csound/Opcodes/arrays.c:264
>             #8  0x00007ffff7a4e8f5 in kperf_nodebug
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:1552
>             #9  0x00007ffff7a500a3 in csoundPerform
>             (csound=0x604040)
>                 at /home/anton/tools/csound/Top/csound.c:2044
>             #10 0x000000000040181d in main (argc=2,
>             argv=0x7fffffffd7b8)
>                 at
>             /home/anton/tools/csound/frontends/csound/csound_main.c:318
>             ~~~
>
>
> Trimmed as it is messing thedigest
>
> ==John ff
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 11:47
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
changes that could stop the crash (but are not the final solution, just diagnostics).
Can you try them?

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
> 
> I'm sorry for misinformation. The error is tricky to manifest.
> Tere was no crash by some happy accident when I've commented the if/thens.
> But then later I've made a version with no if/then for diskin2 
> (I've put mono and stereo versions at separate instruments) and it fails too
> with the same error.
> 
> 
> 
> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
> So what you are saying is that, without the if … then, there is no crash?
> 
> Note that the condition will be checked both at i-time and perf-time, so it should affect
> the code at all. If the crash is not happening, the reason might be different.
> We know that it seems to be triggered by an array_get(), which is called whenever
> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> can track down which one of the two is responsible, we should be able to locate
> the problem.
> 
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> >
> > The code with no osc also fails when I wrap it to python interface(((
> >
> > I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >
> > ;ichan filenchnls gSFiles[iChannel]
> > ;if (ichan == 1) then
> > ;    al diskin2 gSFiles[iChannel], 1
> > ;    ar = al
> > ;else
> >     al, ar diskin2 gSFiles[iChannel], 1
> > ;endif
> >
> >
> > 2016-01-26 0:39 GMT+03:00 jpff :
> > I have pushed a small fix to git in file Opcodes/OSC.c
> > It _might_ fix it.
> >
> >
> > On Mon, 25 Jan 2016, jpff wrote:
> >
> > Found an oddity in OSC receiving strings -- investigating.
> > Also code is weak on tye checking
> >
> >
> > On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >
> > It's probably caused by the following line in my code:
> > ~~~
> > gSFiles[kChannel] strcpyk SFile
> > ~~~
> >
> > Where  kChannel and SFile are filled with values that I receive in the OSC
> > message
> >
> > 2016-01-25 23:25 GMT+03:00 jpff :
> >       That backtrace looks like a double free in string_copy_value where
> >       id attempts to delete the space in the dst arument.  Really I
> >       would love tis run under valgrind or ElectricFence or similar
> >
> >       On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >
> >             Here is make trace:
> >             ~~~
> >             diskin2: opened '/home/anton/Seashore.wav':
> >                      44100 Hz, 2 channel(s), 546731 sample frames
> >              i   1 time   220.31819:   100.00100
> >              i   1 time   220.31819:    80.00100
> >             *** Error in `/usr/local/bin/csound': free(): invalid
> >             next size (fast):
> >             0x0000000000843840 ***
> >
> >             Program received signal SIGABRT, Aborted.
> >             0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >             56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >             file or directory.
> >             (gdb) bt
> >             #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >                 at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >             #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >             #2  0x00007ffff731b394 in __libc_message
> >             (do_abort=do_abort@entry=1,
> >                 fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >             %s: 0x%s ***\n")
> >                 at ../sysdeps/posix/libc_fatal.c:175
> >             #3  0x00007ffff732766e in malloc_printerr
> >             (ptr=,
> >                 str=0x7ffff7429cc8 "free(): invalid next size
> >             (fast)", action=1)
> >                 at malloc.c:4996
> >             #4  _int_free (av=, p=,
> >             have_lock=0)
> >                 at malloc.c:3840
> >             #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >             p=0x843850)
> >                 at /home/anton/tools/csound/Engine/memalloc.c:172
> >             #6  0x00007ffff78fdd44 in string_copy_value
> >             (csound=0x604040, dest=0x8cc1c8,
> >                 src=0x7b5a70) at
> >             /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >             #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >             p=0x8d12d0)
> >                 at /home/anton/tools/csound/Opcodes/arrays.c:264
> >             #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >             (csound=0x604040)
> >                 at /home/anton/tools/csound/Top/csound.c:1552
> >             #9  0x00007ffff7a500a3 in csoundPerform
> >             (csound=0x604040)
> >                 at /home/anton/tools/csound/Top/csound.c:2044
> >             #10 0x000000000040181d in main (argc=2,
> >             argv=0x7fffffffd7b8)
> >                 at
> >             /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >             ~~~
> >
> >
> > Trimmed as it is messing thedigest
> >
> > ==John ff
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >        https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > https://github.com/csound/csound/issues Discussions of bugs and features can
> > be posted here
> >
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >       https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >        https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 11:59
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Actually, I manage to get a crash now. I am looking at it. 
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
> 
> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> changes that could stop the crash (but are not the final solution, just diagnostics).
> Can you try them?
> 
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952 
> 
>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
>> 
>> I'm sorry for misinformation. The error is tricky to manifest.
>> Tere was no crash by some happy accident when I've commented the if/thens.
>> But then later I've made a version with no if/then for diskin2 
>> (I've put mono and stereo versions at separate instruments) and it fails too
>> with the same error.
>> 
>> 
>> 
>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
>> So what you are saying is that, without the if … then, there is no crash?
>> 
>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>> the code at all. If the crash is not happening, the reason might be different.
>> We know that it seems to be triggered by an array_get(), which is called whenever
>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>> can track down which one of the two is responsible, we should be able to locate
>> the problem.
>> 
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>> 
>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
>>> 
>>> The code with no osc also fails when I wrap it to python interface(((
>>> 
>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>> 
>>> ;ichan filenchnls gSFiles[iChannel]
>>> ;if (ichan == 1) then
>>> ;    al diskin2 gSFiles[iChannel], 1
>>> ;    ar = al
>>> ;else
>>>    al, ar diskin2 gSFiles[iChannel], 1
>>> ;endif
>>> 
>>> 
>>> 2016-01-26 0:39 GMT+03:00 jpff :
>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>> It _might_ fix it.
>>> 
>>> 
>>> On Mon, 25 Jan 2016, jpff wrote:
>>> 
>>> Found an oddity in OSC receiving strings -- investigating.
>>> Also code is weak on tye checking
>>> 
>>> 
>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>> 
>>> It's probably caused by the following line in my code:
>>> ~~~
>>> gSFiles[kChannel] strcpyk SFile
>>> ~~~
>>> 
>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>> message
>>> 
>>> 2016-01-25 23:25 GMT+03:00 jpff :
>>>      That backtrace looks like a double free in string_copy_value where
>>>      id attempts to delete the space in the dst arument.  Really I
>>>      would love tis run under valgrind or ElectricFence or similar
>>> 
>>>      On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>> 
>>>            Here is make trace:
>>>            ~~~
>>>            diskin2: opened '/home/anton/Seashore.wav':
>>>                     44100 Hz, 2 channel(s), 546731 sample frames
>>>             i   1 time   220.31819:   100.00100
>>>             i   1 time   220.31819:    80.00100
>>>            *** Error in `/usr/local/bin/csound': free(): invalid
>>>            next size (fast):
>>>            0x0000000000843840 ***
>>> 
>>>            Program received signal SIGABRT, Aborted.
>>>            0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>            56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>            file or directory.
>>>            (gdb) bt
>>>            #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>                at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>            #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>            #2  0x00007ffff731b394 in __libc_message
>>>            (do_abort=do_abort@entry=1,
>>>                fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>            %s: 0x%s ***\n")
>>>                at ../sysdeps/posix/libc_fatal.c:175
>>>            #3  0x00007ffff732766e in malloc_printerr
>>>            (ptr=,
>>>                str=0x7ffff7429cc8 "free(): invalid next size
>>>            (fast)", action=1)
>>>                at malloc.c:4996
>>>            #4  _int_free (av=, p=,
>>>            have_lock=0)
>>>                at malloc.c:3840
>>>            #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>            p=0x843850)
>>>                at /home/anton/tools/csound/Engine/memalloc.c:172
>>>            #6  0x00007ffff78fdd44 in string_copy_value
>>>            (csound=0x604040, dest=0x8cc1c8,
>>>                src=0x7b5a70) at
>>>            /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>            #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>            p=0x8d12d0)
>>>                at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>            #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>            (csound=0x604040)
>>>                at /home/anton/tools/csound/Top/csound.c:1552
>>>            #9  0x00007ffff7a500a3 in csoundPerform
>>>            (csound=0x604040)
>>>                at /home/anton/tools/csound/Top/csound.c:2044
>>>            #10 0x000000000040181d in main (argc=2,
>>>            argv=0x7fffffffd7b8)
>>>                at
>>>            /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>            ~~~
>>> 
>>> 
>>> Trimmed as it is messing thedigest
>>> 
>>> ==John ff
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>> be posted here
>>> 
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>      https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> 
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 12:11
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
these lines to the top, before your instrument definitions:

 ii init 0
 while ii < $SIZE do
  gSFiles[ii] strcpy ""
  ii += 1
 od

From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
default to empty strings.

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
> 
> Actually, I manage to get a crash now. I am looking at it. 
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952 
> 
>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
>> 
>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>> changes that could stop the crash (but are not the final solution, just diagnostics).
>> Can you try them?
>> 
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952 
>> 
>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
>>> 
>>> I'm sorry for misinformation. The error is tricky to manifest.
>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>> But then later I've made a version with no if/then for diskin2 
>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>> with the same error.
>>> 
>>> 
>>> 
>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
>>> So what you are saying is that, without the if … then, there is no crash?
>>> 
>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>> the code at all. If the crash is not happening, the reason might be different.
>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>> can track down which one of the two is responsible, we should be able to locate
>>> the problem.
>>> 
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
>>>> 
>>>> The code with no osc also fails when I wrap it to python interface(((
>>>> 
>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>> 
>>>> ;ichan filenchnls gSFiles[iChannel]
>>>> ;if (ichan == 1) then
>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>> ;    ar = al
>>>> ;else
>>>>   al, ar diskin2 gSFiles[iChannel], 1
>>>> ;endif
>>>> 
>>>> 
>>>> 2016-01-26 0:39 GMT+03:00 jpff :
>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>> It _might_ fix it.
>>>> 
>>>> 
>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>> 
>>>> Found an oddity in OSC receiving strings -- investigating.
>>>> Also code is weak on tye checking
>>>> 
>>>> 
>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>> 
>>>> It's probably caused by the following line in my code:
>>>> ~~~
>>>> gSFiles[kChannel] strcpyk SFile
>>>> ~~~
>>>> 
>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>> message
>>>> 
>>>> 2016-01-25 23:25 GMT+03:00 jpff :
>>>>     That backtrace looks like a double free in string_copy_value where
>>>>     id attempts to delete the space in the dst arument.  Really I
>>>>     would love tis run under valgrind or ElectricFence or similar
>>>> 
>>>>     On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>> 
>>>>           Here is make trace:
>>>>           ~~~
>>>>           diskin2: opened '/home/anton/Seashore.wav':
>>>>                    44100 Hz, 2 channel(s), 546731 sample frames
>>>>            i   1 time   220.31819:   100.00100
>>>>            i   1 time   220.31819:    80.00100
>>>>           *** Error in `/usr/local/bin/csound': free(): invalid
>>>>           next size (fast):
>>>>           0x0000000000843840 ***
>>>> 
>>>>           Program received signal SIGABRT, Aborted.
>>>>           0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>           56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>           file or directory.
>>>>           (gdb) bt
>>>>           #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>           #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>           #2  0x00007ffff731b394 in __libc_message
>>>>           (do_abort=do_abort@entry=1,
>>>>               fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>           %s: 0x%s ***\n")
>>>>               at ../sysdeps/posix/libc_fatal.c:175
>>>>           #3  0x00007ffff732766e in malloc_printerr
>>>>           (ptr=,
>>>>               str=0x7ffff7429cc8 "free(): invalid next size
>>>>           (fast)", action=1)
>>>>               at malloc.c:4996
>>>>           #4  _int_free (av=, p=,
>>>>           have_lock=0)
>>>>               at malloc.c:3840
>>>>           #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>           p=0x843850)
>>>>               at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>           #6  0x00007ffff78fdd44 in string_copy_value
>>>>           (csound=0x604040, dest=0x8cc1c8,
>>>>               src=0x7b5a70) at
>>>>           /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>           #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>           p=0x8d12d0)
>>>>               at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>           #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>           (csound=0x604040)
>>>>               at /home/anton/tools/csound/Top/csound.c:1552
>>>>           #9  0x00007ffff7a500a3 in csoundPerform
>>>>           (csound=0x604040)
>>>>               at /home/anton/tools/csound/Top/csound.c:2044
>>>>           #10 0x000000000040181d in main (argc=2,
>>>>           argv=0x7fffffffd7b8)
>>>>               at
>>>>           /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>           ~~~
>>>> 
>>>> 
>>>> Trimmed as it is messing thedigest
>>>> 
>>>> ==John ff
>>>> 
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>> 
>>>> 
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>>> 
>>>> 
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>     https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>> 
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>> 
>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>       https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 12:30
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I don't think this is the true cause of the problem.
In my script I always use the function *play* before any command.
And play fills the array's cell with the value. 

I've tried your solution it crashes too, though I didn't pull your last changes
Should I do it?

~~~
*** Error in `csound': corrupted double-linked list: 0x00000000008ddd00 ***
~~~

2016-01-26 15:11 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
these lines to the top, before your instrument definitions:

 ii init 0
 while ii < $SIZE do
  gSFiles[ii] strcpy ""
  ii += 1
 od

>From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
default to empty strings.

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>
> Actually, I manage to get a crash now. I am looking at it.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>
>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>> changes that could stop the crash (but are not the final solution, just diagnostics).
>> Can you try them?
>>
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>>
>>> I'm sorry for misinformation. The error is tricky to manifest.
>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>> But then later I've made a version with no if/then for diskin2
>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>> with the same error.
>>>
>>>
>>>
>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>> So what you are saying is that, without the if … then, there is no crash?
>>>
>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>> the code at all. If the crash is not happening, the reason might be different.
>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>> can track down which one of the two is responsible, we should be able to locate
>>> the problem.
>>>
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>>>
>>>> The code with no osc also fails when I wrap it to python interface(((
>>>>
>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>>
>>>> ;ichan filenchnls gSFiles[iChannel]
>>>> ;if (ichan == 1) then
>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>> ;    ar = al
>>>> ;else
>>>>   al, ar diskin2 gSFiles[iChannel], 1
>>>> ;endif
>>>>
>>>>
>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>> It _might_ fix it.
>>>>
>>>>
>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>>
>>>> Found an oddity in OSC receiving strings -- investigating.
>>>> Also code is weak on tye checking
>>>>
>>>>
>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>
>>>> It's probably caused by the following line in my code:
>>>> ~~~
>>>> gSFiles[kChannel] strcpyk SFile
>>>> ~~~
>>>>
>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>> message
>>>>
>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>>>     That backtrace looks like a double free in string_copy_value where
>>>>     id attempts to delete the space in the dst arument.  Really I
>>>>     would love tis run under valgrind or ElectricFence or similar
>>>>
>>>>     On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>
>>>>           Here is make trace:
>>>>           ~~~
>>>>           diskin2: opened '/home/anton/Seashore.wav':
>>>>                    44100 Hz, 2 channel(s), 546731 sample frames
>>>>            i   1 time   220.31819:   100.00100
>>>>            i   1 time   220.31819:    80.00100
>>>>           *** Error in `/usr/local/bin/csound': free(): invalid
>>>>           next size (fast):
>>>>           0x0000000000843840 ***
>>>>
>>>>           Program received signal SIGABRT, Aborted.
>>>>           0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>           56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>           file or directory.
>>>>           (gdb) bt
>>>>           #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>           #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>           #2  0x00007ffff731b394 in __libc_message
>>>>           (do_abort=do_abort@entry=1,
>>>>               fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>           %s: 0x%s ***\n")
>>>>               at ../sysdeps/posix/libc_fatal.c:175
>>>>           #3  0x00007ffff732766e in malloc_printerr
>>>>           (ptr=<optimized out>,
>>>>               str=0x7ffff7429cc8 "free(): invalid next size
>>>>           (fast)", action=1)
>>>>               at malloc.c:4996
>>>>           #4  _int_free (av=<optimized out>, p=<optimized out>,
>>>>           have_lock=0)
>>>>               at malloc.c:3840
>>>>           #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>           p=0x843850)
>>>>               at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>           #6  0x00007ffff78fdd44 in string_copy_value
>>>>           (csound=0x604040, dest=0x8cc1c8,
>>>>               src=0x7b5a70) at
>>>>           /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>           #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>           p=0x8d12d0)
>>>>               at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>           #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>           (csound=0x604040)
>>>>               at /home/anton/tools/csound/Top/csound.c:1552
>>>>           #9  0x00007ffff7a500a3 in csoundPerform
>>>>           (csound=0x604040)
>>>>               at /home/anton/tools/csound/Top/csound.c:2044
>>>>           #10 0x000000000040181d in main (argc=2,
>>>>           argv=0x7fffffffd7b8)
>>>>               at
>>>>           /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>           ~~~
>>>>
>>>>
>>>> Trimmed as it is messing thedigest
>>>>
>>>> ==John ff
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>>
>>>> Csound mailing list Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>> be posted here
>>>>
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>     https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>       https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 12:34
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Did you try it?
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 12:30, Anton Kholomiov  wrote:
> 
> I don't think this is the true cause of the problem.
> In my script I always use the function *play* before any command.
> And play fills the array's cell with the value. 
> 
> I've tried your solution it crashes too, though I didn't pull your last changes
> Should I do it?
> 
> ~~~
> *** Error in `csound': corrupted double-linked list: 0x00000000008ddd00 ***
> ~~~
> 
> 2016-01-26 15:11 GMT+03:00 Victor Lazzarini :
> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> these lines to the top, before your instrument definitions:
> 
>  ii init 0
>  while ii < $SIZE do
>   gSFiles[ii] strcpy ""
>   ii += 1
>  od
> 
> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> default to empty strings.
> 
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
> >
> > Actually, I manage to get a crash now. I am looking at it.
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
> >>
> >> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >> changes that could stop the crash (but are not the final solution, just diagnostics).
> >> Can you try them?
> >>
> >> ========================
> >> Dr Victor Lazzarini
> >> Dean of Arts, Celtic Studies and Philosophy,
> >> Maynooth University,
> >> Maynooth, Co Kildare, Ireland
> >> Tel: 00 353 7086936
> >> Fax: 00 353 1 7086952
> >>
> >>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
> >>>
> >>> I'm sorry for misinformation. The error is tricky to manifest.
> >>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>> But then later I've made a version with no if/then for diskin2
> >>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>> with the same error.
> >>>
> >>>
> >>>
> >>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
> >>> So what you are saying is that, without the if … then, there is no crash?
> >>>
> >>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>> the code at all. If the crash is not happening, the reason might be different.
> >>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>> can track down which one of the two is responsible, we should be able to locate
> >>> the problem.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> >>>>
> >>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>
> >>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>
> >>>> ;ichan filenchnls gSFiles[iChannel]
> >>>> ;if (ichan == 1) then
> >>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>> ;    ar = al
> >>>> ;else
> >>>>   al, ar diskin2 gSFiles[iChannel], 1
> >>>> ;endif
> >>>>
> >>>>
> >>>> 2016-01-26 0:39 GMT+03:00 jpff :
> >>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>> It _might_ fix it.
> >>>>
> >>>>
> >>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>
> >>>> Found an oddity in OSC receiving strings -- investigating.
> >>>> Also code is weak on tye checking
> >>>>
> >>>>
> >>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>
> >>>> It's probably caused by the following line in my code:
> >>>> ~~~
> >>>> gSFiles[kChannel] strcpyk SFile
> >>>> ~~~
> >>>>
> >>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>> message
> >>>>
> >>>> 2016-01-25 23:25 GMT+03:00 jpff :
> >>>>     That backtrace looks like a double free in string_copy_value where
> >>>>     id attempts to delete the space in the dst arument.  Really I
> >>>>     would love tis run under valgrind or ElectricFence or similar
> >>>>
> >>>>     On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>
> >>>>           Here is make trace:
> >>>>           ~~~
> >>>>           diskin2: opened '/home/anton/Seashore.wav':
> >>>>                    44100 Hz, 2 channel(s), 546731 sample frames
> >>>>            i   1 time   220.31819:   100.00100
> >>>>            i   1 time   220.31819:    80.00100
> >>>>           *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>           next size (fast):
> >>>>           0x0000000000843840 ***
> >>>>
> >>>>           Program received signal SIGABRT, Aborted.
> >>>>           0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>           56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>           file or directory.
> >>>>           (gdb) bt
> >>>>           #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>           #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>           #2  0x00007ffff731b394 in __libc_message
> >>>>           (do_abort=do_abort@entry=1,
> >>>>               fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>           %s: 0x%s ***\n")
> >>>>               at ../sysdeps/posix/libc_fatal.c:175
> >>>>           #3  0x00007ffff732766e in malloc_printerr
> >>>>           (ptr=,
> >>>>               str=0x7ffff7429cc8 "free(): invalid next size
> >>>>           (fast)", action=1)
> >>>>               at malloc.c:4996
> >>>>           #4  _int_free (av=, p=,
> >>>>           have_lock=0)
> >>>>               at malloc.c:3840
> >>>>           #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>           p=0x843850)
> >>>>               at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>           #6  0x00007ffff78fdd44 in string_copy_value
> >>>>           (csound=0x604040, dest=0x8cc1c8,
> >>>>               src=0x7b5a70) at
> >>>>           /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>           #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>           p=0x8d12d0)
> >>>>               at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>           #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>           (csound=0x604040)
> >>>>               at /home/anton/tools/csound/Top/csound.c:1552
> >>>>           #9  0x00007ffff7a500a3 in csoundPerform
> >>>>           (csound=0x604040)
> >>>>               at /home/anton/tools/csound/Top/csound.c:2044
> >>>>           #10 0x000000000040181d in main (argc=2,
> >>>>           argv=0x7fffffffd7b8)
> >>>>               at
> >>>>           /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>           ~~~
> >>>>
> >>>>
> >>>> Trimmed as it is messing thedigest
> >>>>
> >>>> ==John ff
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>      https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>>
> >>>>
> >>>> Csound mailing list Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>> be posted here
> >>>>
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>     https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>      https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>       https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>       https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >        https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 12:37
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Wow, that's a good find Victor.  I took a quick to diagnose what would
be necessary for initialisation of each data member of an array. It's
a bit technical so I've just put it in a github issue
(https://github.com/csound/csound/issues/588) to keep it off this
list.  We should probably discuss on the dev list or through the
github issue.

On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
 wrote:
> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> these lines to the top, before your instrument definitions:
>
>  ii init 0
>  while ii < $SIZE do
>   gSFiles[ii] strcpy ""
>   ii += 1
>  od
>
> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> default to empty strings.
>
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
>>
>> Actually, I manage to get a crash now. I am looking at it.
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
>>>
>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>>> changes that could stop the crash (but are not the final solution, just diagnostics).
>>> Can you try them?
>>>
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
>>>>
>>>> I'm sorry for misinformation. The error is tricky to manifest.
>>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>>> But then later I've made a version with no if/then for diskin2
>>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>>> with the same error.
>>>>
>>>>
>>>>
>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
>>>> So what you are saying is that, without the if … then, there is no crash?
>>>>
>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>>> the code at all. If the crash is not happening, the reason might be different.
>>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>>> can track down which one of the two is responsible, we should be able to locate
>>>> the problem.
>>>>
>>>> ========================
>>>> Dr Victor Lazzarini
>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
>>>>>
>>>>> The code with no osc also fails when I wrap it to python interface(((
>>>>>
>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>>>
>>>>> ;ichan filenchnls gSFiles[iChannel]
>>>>> ;if (ichan == 1) then
>>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>>> ;    ar = al
>>>>> ;else
>>>>>   al, ar diskin2 gSFiles[iChannel], 1
>>>>> ;endif
>>>>>
>>>>>
>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>>> It _might_ fix it.
>>>>>
>>>>>
>>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>>>
>>>>> Found an oddity in OSC receiving strings -- investigating.
>>>>> Also code is weak on tye checking
>>>>>
>>>>>
>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>
>>>>> It's probably caused by the following line in my code:
>>>>> ~~~
>>>>> gSFiles[kChannel] strcpyk SFile
>>>>> ~~~
>>>>>
>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>>> message
>>>>>
>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
>>>>>     That backtrace looks like a double free in string_copy_value where
>>>>>     id attempts to delete the space in the dst arument.  Really I
>>>>>     would love tis run under valgrind or ElectricFence or similar
>>>>>
>>>>>     On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>
>>>>>           Here is make trace:
>>>>>           ~~~
>>>>>           diskin2: opened '/home/anton/Seashore.wav':
>>>>>                    44100 Hz, 2 channel(s), 546731 sample frames
>>>>>            i   1 time   220.31819:   100.00100
>>>>>            i   1 time   220.31819:    80.00100
>>>>>           *** Error in `/usr/local/bin/csound': free(): invalid
>>>>>           next size (fast):
>>>>>           0x0000000000843840 ***
>>>>>
>>>>>           Program received signal SIGABRT, Aborted.
>>>>>           0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>           56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>>           file or directory.
>>>>>           (gdb) bt
>>>>>           #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>               at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>           #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>>           #2  0x00007ffff731b394 in __libc_message
>>>>>           (do_abort=do_abort@entry=1,
>>>>>               fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>>           %s: 0x%s ***\n")
>>>>>               at ../sysdeps/posix/libc_fatal.c:175
>>>>>           #3  0x00007ffff732766e in malloc_printerr
>>>>>           (ptr=,
>>>>>               str=0x7ffff7429cc8 "free(): invalid next size
>>>>>           (fast)", action=1)
>>>>>               at malloc.c:4996
>>>>>           #4  _int_free (av=, p=,
>>>>>           have_lock=0)
>>>>>               at malloc.c:3840
>>>>>           #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>>           p=0x843850)
>>>>>               at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>>           #6  0x00007ffff78fdd44 in string_copy_value
>>>>>           (csound=0x604040, dest=0x8cc1c8,
>>>>>               src=0x7b5a70) at
>>>>>           /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>>           #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>>           p=0x8d12d0)
>>>>>               at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>>           #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>>           (csound=0x604040)
>>>>>               at /home/anton/tools/csound/Top/csound.c:1552
>>>>>           #9  0x00007ffff7a500a3 in csoundPerform
>>>>>           (csound=0x604040)
>>>>>               at /home/anton/tools/csound/Top/csound.c:2044
>>>>>           #10 0x000000000040181d in main (argc=2,
>>>>>           argv=0x7fffffffd7b8)
>>>>>               at
>>>>>           /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>>           ~~~
>>>>>
>>>>>
>>>>> Trimmed as it is messing thedigest
>>>>>
>>>>> ==John ff
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>      https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>>
>>>>>
>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>> be posted here
>>>>>
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>     https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>      https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>       https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 12:44
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 12:37, Steven Yi  wrote:
> 
> Wow, that's a good find Victor.  I took a quick to diagnose what would
> be necessary for initialisation of each data member of an array. It's
> a bit technical so I've just put it in a github issue
> (https://github.com/csound/csound/issues/588) to keep it off this
> list.  We should probably discuss on the dev list or through the
> github issue.
> 
> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
>  wrote:
>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
>> these lines to the top, before your instrument definitions:
>> 
>> ii init 0
>> while ii < $SIZE do
>>  gSFiles[ii] strcpy ""
>>  ii += 1
>> od
>> 
>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
>> default to empty strings.
>> 
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>> 
>>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
>>> 
>>> Actually, I manage to get a crash now. I am looking at it.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
>>>> 
>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
>>>> Can you try them?
>>>> 
>>>> ========================
>>>> Dr Victor Lazzarini
>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>> 
>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
>>>>> 
>>>>> I'm sorry for misinformation. The error is tricky to manifest.
>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>>>> But then later I've made a version with no if/then for diskin2
>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>>>> with the same error.
>>>>> 
>>>>> 
>>>>> 
>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
>>>>> So what you are saying is that, without the if … then, there is no crash?
>>>>> 
>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>>>> the code at all. If the crash is not happening, the reason might be different.
>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>>>> can track down which one of the two is responsible, we should be able to locate
>>>>> the problem.
>>>>> 
>>>>> ========================
>>>>> Dr Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>> 
>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
>>>>>> 
>>>>>> The code with no osc also fails when I wrap it to python interface(((
>>>>>> 
>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>>>> 
>>>>>> ;ichan filenchnls gSFiles[iChannel]
>>>>>> ;if (ichan == 1) then
>>>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>>>> ;    ar = al
>>>>>> ;else
>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
>>>>>> ;endif
>>>>>> 
>>>>>> 
>>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>>>> It _might_ fix it.
>>>>>> 
>>>>>> 
>>>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>>>> 
>>>>>> Found an oddity in OSC receiving strings -- investigating.
>>>>>> Also code is weak on tye checking
>>>>>> 
>>>>>> 
>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>> 
>>>>>> It's probably caused by the following line in my code:
>>>>>> ~~~
>>>>>> gSFiles[kChannel] strcpyk SFile
>>>>>> ~~~
>>>>>> 
>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>>>> message
>>>>>> 
>>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
>>>>>>    That backtrace looks like a double free in string_copy_value where
>>>>>>    id attempts to delete the space in the dst arument.  Really I
>>>>>>    would love tis run under valgrind or ElectricFence or similar
>>>>>> 
>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>> 
>>>>>>          Here is make trace:
>>>>>>          ~~~
>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>           i   1 time   220.31819:   100.00100
>>>>>>           i   1 time   220.31819:    80.00100
>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
>>>>>>          next size (fast):
>>>>>>          0x0000000000843840 ***
>>>>>> 
>>>>>>          Program received signal SIGABRT, Aborted.
>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>>>          file or directory.
>>>>>>          (gdb) bt
>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>>>          #2  0x00007ffff731b394 in __libc_message
>>>>>>          (do_abort=do_abort@entry=1,
>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>>>          %s: 0x%s ***\n")
>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
>>>>>>          #3  0x00007ffff732766e in malloc_printerr
>>>>>>          (ptr=,
>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
>>>>>>          (fast)", action=1)
>>>>>>              at malloc.c:4996
>>>>>>          #4  _int_free (av=, p=,
>>>>>>          have_lock=0)
>>>>>>              at malloc.c:3840
>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>>>          p=0x843850)
>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
>>>>>>          (csound=0x604040, dest=0x8cc1c8,
>>>>>>              src=0x7b5a70) at
>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>>>          p=0x8d12d0)
>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>>>          (csound=0x604040)
>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
>>>>>>          (csound=0x604040)
>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
>>>>>>          #10 0x000000000040181d in main (argc=2,
>>>>>>          argv=0x7fffffffd7b8)
>>>>>>              at
>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>>>          ~~~
>>>>>> 
>>>>>> 
>>>>>> Trimmed as it is messing thedigest
>>>>>> 
>>>>>> ==John ff
>>>>>> 
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>     https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>> 
>>>>>> 
>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>> be posted here
>>>>>> 
>>>>>> 
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>    https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>> 
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>     https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>> 
>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>> 
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>      https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>> 
>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>> 
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>> 
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 12:58
FromSteven Yi
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ah, I see it now. A couple things:

1. we should add init functions for strings and f-sigs (in
createString and createFsig in csound_standard_types.c).  They should
set the default values.

2. for places we create initialise or resize arrays, we should check
the array sub type to see if it's init function is set and, if so,
iterate over the member data and call the init function.

On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
 wrote:
> I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Jan 2016, at 12:37, Steven Yi  wrote:
>>
>> Wow, that's a good find Victor.  I took a quick to diagnose what would
>> be necessary for initialisation of each data member of an array. It's
>> a bit technical so I've just put it in a github issue
>> (https://github.com/csound/csound/issues/588) to keep it off this
>> list.  We should probably discuss on the dev list or through the
>> github issue.
>>
>> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
>>  wrote:
>>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
>>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
>>> these lines to the top, before your instrument definitions:
>>>
>>> ii init 0
>>> while ii < $SIZE do
>>>  gSFiles[ii] strcpy ""
>>>  ii += 1
>>> od
>>>
>>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
>>> default to empty strings.
>>>
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
>>>>
>>>> Actually, I manage to get a crash now. I am looking at it.
>>>> ========================
>>>> Dr Victor Lazzarini
>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
>>>>>
>>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
>>>>> Can you try them?
>>>>>
>>>>> ========================
>>>>> Dr Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>>
>>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
>>>>>>
>>>>>> I'm sorry for misinformation. The error is tricky to manifest.
>>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>>>>> But then later I've made a version with no if/then for diskin2
>>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>>>>> with the same error.
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
>>>>>> So what you are saying is that, without the if … then, there is no crash?
>>>>>>
>>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>>>>> the code at all. If the crash is not happening, the reason might be different.
>>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>>>>> can track down which one of the two is responsible, we should be able to locate
>>>>>> the problem.
>>>>>>
>>>>>> ========================
>>>>>> Dr Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
>>>>>>>
>>>>>>> The code with no osc also fails when I wrap it to python interface(((
>>>>>>>
>>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>>>>>
>>>>>>> ;ichan filenchnls gSFiles[iChannel]
>>>>>>> ;if (ichan == 1) then
>>>>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>>>>> ;    ar = al
>>>>>>> ;else
>>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
>>>>>>> ;endif
>>>>>>>
>>>>>>>
>>>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
>>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>>>>> It _might_ fix it.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>>>>>
>>>>>>> Found an oddity in OSC receiving strings -- investigating.
>>>>>>> Also code is weak on tye checking
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>>>
>>>>>>> It's probably caused by the following line in my code:
>>>>>>> ~~~
>>>>>>> gSFiles[kChannel] strcpyk SFile
>>>>>>> ~~~
>>>>>>>
>>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>>>>> message
>>>>>>>
>>>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
>>>>>>>    That backtrace looks like a double free in string_copy_value where
>>>>>>>    id attempts to delete the space in the dst arument.  Really I
>>>>>>>    would love tis run under valgrind or ElectricFence or similar
>>>>>>>
>>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>>>
>>>>>>>          Here is make trace:
>>>>>>>          ~~~
>>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>           i   1 time   220.31819:   100.00100
>>>>>>>           i   1 time   220.31819:    80.00100
>>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
>>>>>>>          next size (fast):
>>>>>>>          0x0000000000843840 ***
>>>>>>>
>>>>>>>          Program received signal SIGABRT, Aborted.
>>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>>>>          file or directory.
>>>>>>>          (gdb) bt
>>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>>>>          #2  0x00007ffff731b394 in __libc_message
>>>>>>>          (do_abort=do_abort@entry=1,
>>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>>>>          %s: 0x%s ***\n")
>>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
>>>>>>>          #3  0x00007ffff732766e in malloc_printerr
>>>>>>>          (ptr=,
>>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
>>>>>>>          (fast)", action=1)
>>>>>>>              at malloc.c:4996
>>>>>>>          #4  _int_free (av=, p=,
>>>>>>>          have_lock=0)
>>>>>>>              at malloc.c:3840
>>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>>>>          p=0x843850)
>>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
>>>>>>>          (csound=0x604040, dest=0x8cc1c8,
>>>>>>>              src=0x7b5a70) at
>>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>>>>          p=0x8d12d0)
>>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>>>>          (csound=0x604040)
>>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
>>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
>>>>>>>          (csound=0x604040)
>>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
>>>>>>>          #10 0x000000000040181d in main (argc=2,
>>>>>>>          argv=0x7fffffffd7b8)
>>>>>>>              at
>>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>>>>          ~~~
>>>>>>>
>>>>>>>
>>>>>>> Trimmed as it is messing thedigest
>>>>>>>
>>>>>>> ==John ff
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>     https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>> be posted here
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>    https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>     https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>      https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>      https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>       https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 13:28
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for 
string array). The scenario I've posted before is working but if I proceed
there is always a point where there is a crash. 

One of the recent messages

csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.

Sometimes it segfaults.

I'd better make an issue on github. I'll try to make a minimal example.

2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Ah, I see it now. A couple things:

1. we should add init functions for strings and f-sigs (in
createString and createFsig in csound_standard_types.c).  They should
set the default values.

2. for places we create initialise or resize arrays, we should check
the array sub type to see if it's init function is set and, if so,
iterate over the member data and call the init function.

On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
> I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
>>
>> Wow, that's a good find Victor.  I took a quick to diagnose what would
>> be necessary for initialisation of each data member of an array. It's
>> a bit technical so I've just put it in a github issue
>> (https://github.com/csound/csound/issues/588) to keep it off this
>> list.  We should probably discuss on the dev list or through the
>> github issue.
>>
>> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
>>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
>>> these lines to the top, before your instrument definitions:
>>>
>>> ii init 0
>>> while ii < $SIZE do
>>>  gSFiles[ii] strcpy ""
>>>  ii += 1
>>> od
>>>
>>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
>>> default to empty strings.
>>>
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>
>>>> Actually, I manage to get a crash now. I am looking at it.
>>>> ========================
>>>> Dr Victor Lazzarini
>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>>
>>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
>>>>> Can you try them?
>>>>>
>>>>> ========================
>>>>> Dr Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>>
>>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>>>>>
>>>>>> I'm sorry for misinformation. The error is tricky to manifest.
>>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>>>>> But then later I've made a version with no if/then for diskin2
>>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>>>>> with the same error.
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>>> So what you are saying is that, without the if … then, there is no crash?
>>>>>>
>>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>>>>> the code at all. If the crash is not happening, the reason might be different.
>>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>>>>> can track down which one of the two is responsible, we should be able to locate
>>>>>> the problem.
>>>>>>
>>>>>> ========================
>>>>>> Dr Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>>>>>>
>>>>>>> The code with no osc also fails when I wrap it to python interface(((
>>>>>>>
>>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>>>>>
>>>>>>> ;ichan filenchnls gSFiles[iChannel]
>>>>>>> ;if (ichan == 1) then
>>>>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>>>>> ;    ar = al
>>>>>>> ;else
>>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
>>>>>>> ;endif
>>>>>>>
>>>>>>>
>>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>>>>> It _might_ fix it.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>>>>>
>>>>>>> Found an oddity in OSC receiving strings -- investigating.
>>>>>>> Also code is weak on tye checking
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>>>
>>>>>>> It's probably caused by the following line in my code:
>>>>>>> ~~~
>>>>>>> gSFiles[kChannel] strcpyk SFile
>>>>>>> ~~~
>>>>>>>
>>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>>>>> message
>>>>>>>
>>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>>>>>>    That backtrace looks like a double free in string_copy_value where
>>>>>>>    id attempts to delete the space in the dst arument.  Really I
>>>>>>>    would love tis run under valgrind or ElectricFence or similar
>>>>>>>
>>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>>>
>>>>>>>          Here is make trace:
>>>>>>>          ~~~
>>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>           i   1 time   220.31819:   100.00100
>>>>>>>           i   1 time   220.31819:    80.00100
>>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
>>>>>>>          next size (fast):
>>>>>>>          0x0000000000843840 ***
>>>>>>>
>>>>>>>          Program received signal SIGABRT, Aborted.
>>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>>>>          file or directory.
>>>>>>>          (gdb) bt
>>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>>>>          #2  0x00007ffff731b394 in __libc_message
>>>>>>>          (do_abort=do_abort@entry=1,
>>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>>>>          %s: 0x%s ***\n")
>>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
>>>>>>>          #3  0x00007ffff732766e in malloc_printerr
>>>>>>>          (ptr=<optimized out>,
>>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
>>>>>>>          (fast)", action=1)
>>>>>>>              at malloc.c:4996
>>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
>>>>>>>          have_lock=0)
>>>>>>>              at malloc.c:3840
>>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>>>>          p=0x843850)
>>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
>>>>>>>          (csound=0x604040, dest=0x8cc1c8,
>>>>>>>              src=0x7b5a70) at
>>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>>>>          p=0x8d12d0)
>>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>>>>          (csound=0x604040)
>>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
>>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
>>>>>>>          (csound=0x604040)
>>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
>>>>>>>          #10 0x000000000040181d in main (argc=2,
>>>>>>>          argv=0x7fffffffd7b8)
>>>>>>>              at
>>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>>>>          ~~~
>>>>>>>
>>>>>>>
>>>>>>> Trimmed as it is messing thedigest
>>>>>>>
>>>>>>> ==John ff
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>     https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>> be posted here
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>    https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>     https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>      https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>      https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>       https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 13:31
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
anyway thanks for all the help and support. At least I know how to build
csound from sources

I wish I could get so many comments for one of my future csound tracks :)
It's really smart error that can jump at you when you are about to post 
to mailing list that it's gone. 

Anton

2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
@Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for 
string array). The scenario I've posted before is working but if I proceed
there is always a point where there is a crash. 

One of the recent messages

csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.

Sometimes it segfaults.

I'd better make an issue on github. I'll try to make a minimal example.

2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
Ah, I see it now. A couple things:

1. we should add init functions for strings and f-sigs (in
createString and createFsig in csound_standard_types.c).  They should
set the default values.

2. for places we create initialise or resize arrays, we should check
the array sub type to see if it's init function is set and, if so,
iterate over the member data and call the init function.

On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
> I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
>>
>> Wow, that's a good find Victor.  I took a quick to diagnose what would
>> be necessary for initialisation of each data member of an array. It's
>> a bit technical so I've just put it in a github issue
>> (https://github.com/csound/csound/issues/588) to keep it off this
>> list.  We should probably discuss on the dev list or through the
>> github issue.
>>
>> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
>> <Victor.Lazzarini@nuim.ie> wrote:
>>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
>>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
>>> these lines to the top, before your instrument definitions:
>>>
>>> ii init 0
>>> while ii < $SIZE do
>>>  gSFiles[ii] strcpy ""
>>>  ii += 1
>>> od
>>>
>>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
>>> default to empty strings.
>>>
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>
>>>> Actually, I manage to get a crash now. I am looking at it.
>>>> ========================
>>>> Dr Victor Lazzarini
>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>>
>>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
>>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
>>>>> Can you try them?
>>>>>
>>>>> ========================
>>>>> Dr Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>>
>>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>>>>>
>>>>>> I'm sorry for misinformation. The error is tricky to manifest.
>>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
>>>>>> But then later I've made a version with no if/then for diskin2
>>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
>>>>>> with the same error.
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>>> So what you are saying is that, without the if … then, there is no crash?
>>>>>>
>>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
>>>>>> the code at all. If the crash is not happening, the reason might be different.
>>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
>>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
>>>>>> can track down which one of the two is responsible, we should be able to locate
>>>>>> the problem.
>>>>>>
>>>>>> ========================
>>>>>> Dr Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>>>>>>>
>>>>>>> The code with no osc also fails when I wrap it to python interface(((
>>>>>>>
>>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
>>>>>>>
>>>>>>> ;ichan filenchnls gSFiles[iChannel]
>>>>>>> ;if (ichan == 1) then
>>>>>>> ;    al diskin2 gSFiles[iChannel], 1
>>>>>>> ;    ar = al
>>>>>>> ;else
>>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
>>>>>>> ;endif
>>>>>>>
>>>>>>>
>>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
>>>>>>> It _might_ fix it.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 25 Jan 2016, jpff wrote:
>>>>>>>
>>>>>>> Found an oddity in OSC receiving strings -- investigating.
>>>>>>> Also code is weak on tye checking
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>>>
>>>>>>> It's probably caused by the following line in my code:
>>>>>>> ~~~
>>>>>>> gSFiles[kChannel] strcpyk SFile
>>>>>>> ~~~
>>>>>>>
>>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
>>>>>>> message
>>>>>>>
>>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
>>>>>>>    That backtrace looks like a double free in string_copy_value where
>>>>>>>    id attempts to delete the space in the dst arument.  Really I
>>>>>>>    would love tis run under valgrind or ElectricFence or similar
>>>>>>>
>>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
>>>>>>>
>>>>>>>          Here is make trace:
>>>>>>>          ~~~
>>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
>>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
>>>>>>>           i   1 time   220.31819:   100.00100
>>>>>>>           i   1 time   220.31819:    80.00100
>>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
>>>>>>>          next size (fast):
>>>>>>>          0x0000000000843840 ***
>>>>>>>
>>>>>>>          Program received signal SIGABRT, Aborted.
>>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
>>>>>>>          file or directory.
>>>>>>>          (gdb) bt
>>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
>>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
>>>>>>>          #2  0x00007ffff731b394 in __libc_message
>>>>>>>          (do_abort=do_abort@entry=1,
>>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
>>>>>>>          %s: 0x%s ***\n")
>>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
>>>>>>>          #3  0x00007ffff732766e in malloc_printerr
>>>>>>>          (ptr=<optimized out>,
>>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
>>>>>>>          (fast)", action=1)
>>>>>>>              at malloc.c:4996
>>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
>>>>>>>          have_lock=0)
>>>>>>>              at malloc.c:3840
>>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
>>>>>>>          p=0x843850)
>>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
>>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
>>>>>>>          (csound=0x604040, dest=0x8cc1c8,
>>>>>>>              src=0x7b5a70) at
>>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
>>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
>>>>>>>          p=0x8d12d0)
>>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
>>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
>>>>>>>          (csound=0x604040)
>>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
>>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
>>>>>>>          (csound=0x604040)
>>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
>>>>>>>          #10 0x000000000040181d in main (argc=2,
>>>>>>>          argv=0x7fffffffd7b8)
>>>>>>>              at
>>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
>>>>>>>          ~~~
>>>>>>>
>>>>>>>
>>>>>>> Trimmed as it is messing thedigest
>>>>>>>
>>>>>>> ==John ff
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>     https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>>>>>> be posted here
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>    https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>     https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list
>>>>>> Csound@listserv.heanet.ie
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>      https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>      https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>       https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 13:38
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I managed to make it crash again and I am examining possibilities.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 13:28, Anton Kholomiov  wrote:
> 
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for 
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash. 
> 
> One of the recent messages
> 
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
> 
> Sometimes it segfaults.
> 
> I'd better make an issue on github. I'll try to make a minimal example.
> 
> 2016-01-26 15:58 GMT+03:00 Steven Yi :
> Ah, I see it now. A couple things:
> 
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
> 
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
> 
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
>  wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi  wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >>  wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=, p=,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 14:10
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 13:31, Anton Kholomiov  wrote:
> 
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
> 
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post 
> to mailing list that it's gone. 
> 
> Anton
> 
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov :
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for 
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash. 
> 
> One of the recent messages
> 
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
> 
> Sometimes it segfaults.
> 
> I'd better make an issue on github. I'll try to make a minimal example.
> 
> 2016-01-26 15:58 GMT+03:00 Steven Yi :
> Ah, I see it now. A couple things:
> 
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
> 
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
> 
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
>  wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi  wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >>  wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=, p=,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 14:37
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 14:45
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
It uses the same function.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Jan 2016, at 14:37, Anton Kholomiov  wrote:
> 
> One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
> Is it ok for the fix?
> 
> 2016-01-26 17:10 GMT+03:00 Victor Lazzarini :
> I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 26 Jan 2016, at 13:31, Anton Kholomiov  wrote:
> >
> > anyway thanks for all the help and support. At least I know how to build
> > csound from sources
> >
> > I wish I could get so many comments for one of my future csound tracks :)
> > It's really smart error that can jump at you when you are about to post
> > to mailing list that it's gone.
> >
> > Anton
> >
> > 2016-01-26 16:28 GMT+03:00 Anton Kholomiov :
> > @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> > string array). The scenario I've posted before is working but if I proceed
> > there is always a point where there is a crash.
> >
> > One of the recent messages
> >
> > csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
> >
> > Sometimes it segfaults.
> >
> > I'd better make an issue on github. I'll try to make a minimal example.
> >
> > 2016-01-26 15:58 GMT+03:00 Steven Yi :
> > Ah, I see it now. A couple things:
> >
> > 1. we should add init functions for strings and f-sigs (in
> > createString and createFsig in csound_standard_types.c).  They should
> > set the default values.
> >
> > 2. for places we create initialise or resize arrays, we should check
> > the array sub type to see if it's init function is set and, if so,
> > iterate over the member data and call the init function.
> >
> > On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> >  wrote:
> > > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > > ========================
> > > Dr Victor Lazzarini
> > > Dean of Arts, Celtic Studies and Philosophy,
> > > Maynooth University,
> > > Maynooth, Co Kildare, Ireland
> > > Tel: 00 353 7086936
> > > Fax: 00 353 1 7086952
> > >
> > >> On 26 Jan 2016, at 12:37, Steven Yi  wrote:
> > >>
> > >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> > >> be necessary for initialisation of each data member of an array. It's
> > >> a bit technical so I've just put it in a github issue
> > >> (https://github.com/csound/csound/issues/588) to keep it off this
> > >> list.  We should probably discuss on the dev list or through the
> > >> github issue.
> > >>
> > >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> > >>  wrote:
> > >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> > >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> > >>> these lines to the top, before your instrument definitions:
> > >>>
> > >>> ii init 0
> > >>> while ii < $SIZE do
> > >>>  gSFiles[ii] strcpy ""
> > >>>  ii += 1
> > >>> od
> > >>>
> > >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> > >>> default to empty strings.
> > >>>
> > >>> ========================
> > >>> Dr Victor Lazzarini
> > >>> Dean of Arts, Celtic Studies and Philosophy,
> > >>> Maynooth University,
> > >>> Maynooth, Co Kildare, Ireland
> > >>> Tel: 00 353 7086936
> > >>> Fax: 00 353 1 7086952
> > >>>
> > >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
> > >>>>
> > >>>> Actually, I manage to get a crash now. I am looking at it.
> > >>>> ========================
> > >>>> Dr Victor Lazzarini
> > >>>> Dean of Arts, Celtic Studies and Philosophy,
> > >>>> Maynooth University,
> > >>>> Maynooth, Co Kildare, Ireland
> > >>>> Tel: 00 353 7086936
> > >>>> Fax: 00 353 1 7086952
> > >>>>
> > >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
> > >>>>>
> > >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> > >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> > >>>>> Can you try them?
> > >>>>>
> > >>>>> ========================
> > >>>>> Dr Victor Lazzarini
> > >>>>> Dean of Arts, Celtic Studies and Philosophy,
> > >>>>> Maynooth University,
> > >>>>> Maynooth, Co Kildare, Ireland
> > >>>>> Tel: 00 353 7086936
> > >>>>> Fax: 00 353 1 7086952
> > >>>>>
> > >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
> > >>>>>>
> > >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> > >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> > >>>>>> But then later I've made a version with no if/then for diskin2
> > >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> > >>>>>> with the same error.
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
> > >>>>>> So what you are saying is that, without the if … then, there is no crash?
> > >>>>>>
> > >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> > >>>>>> the code at all. If the crash is not happening, the reason might be different.
> > >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> > >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> > >>>>>> can track down which one of the two is responsible, we should be able to locate
> > >>>>>> the problem.
> > >>>>>>
> > >>>>>> ========================
> > >>>>>> Dr Victor Lazzarini
> > >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> > >>>>>> Maynooth University,
> > >>>>>> Maynooth, Co Kildare, Ireland
> > >>>>>> Tel: 00 353 7086936
> > >>>>>> Fax: 00 353 1 7086952
> > >>>>>>
> > >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> > >>>>>>>
> > >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> > >>>>>>>
> > >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> > >>>>>>>
> > >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> > >>>>>>> ;if (ichan == 1) then
> > >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> > >>>>>>> ;    ar = al
> > >>>>>>> ;else
> > >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> > >>>>>>> ;endif
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
> > >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> > >>>>>>> It _might_ fix it.
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> > >>>>>>>
> > >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> > >>>>>>> Also code is weak on tye checking
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> > >>>>>>>
> > >>>>>>> It's probably caused by the following line in my code:
> > >>>>>>> ~~~
> > >>>>>>> gSFiles[kChannel] strcpyk SFile
> > >>>>>>> ~~~
> > >>>>>>>
> > >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> > >>>>>>> message
> > >>>>>>>
> > >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
> > >>>>>>>    That backtrace looks like a double free in string_copy_value where
> > >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> > >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> > >>>>>>>
> > >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> > >>>>>>>
> > >>>>>>>          Here is make trace:
> > >>>>>>>          ~~~
> > >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> > >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> > >>>>>>>           i   1 time   220.31819:   100.00100
> > >>>>>>>           i   1 time   220.31819:    80.00100
> > >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> > >>>>>>>          next size (fast):
> > >>>>>>>          0x0000000000843840 ***
> > >>>>>>>
> > >>>>>>>          Program received signal SIGABRT, Aborted.
> > >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> > >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> > >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> > >>>>>>>          file or directory.
> > >>>>>>>          (gdb) bt
> > >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> > >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> > >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> > >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> > >>>>>>>          (do_abort=do_abort@entry=1,
> > >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> > >>>>>>>          %s: 0x%s ***\n")
> > >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> > >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> > >>>>>>>          (ptr=,
> > >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> > >>>>>>>          (fast)", action=1)
> > >>>>>>>              at malloc.c:4996
> > >>>>>>>          #4  _int_free (av=, p=,
> > >>>>>>>          have_lock=0)
> > >>>>>>>              at malloc.c:3840
> > >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> > >>>>>>>          p=0x843850)
> > >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> > >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> > >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> > >>>>>>>              src=0x7b5a70) at
> > >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> > >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> > >>>>>>>          p=0x8d12d0)
> > >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> > >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> > >>>>>>>          (csound=0x604040)
> > >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> > >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> > >>>>>>>          (csound=0x604040)
> > >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> > >>>>>>>          #10 0x000000000040181d in main (argc=2,
> > >>>>>>>          argv=0x7fffffffd7b8)
> > >>>>>>>              at
> > >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> > >>>>>>>          ~~~
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Trimmed as it is messing thedigest
> > >>>>>>>
> > >>>>>>> ==John ff
> > >>>>>>>
> > >>>>>>> Csound mailing list
> > >>>>>>> Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>>> Send bugs reports to
> > >>>>>>>     https://github.com/csound/csound/issues
> > >>>>>>> Discussions of bugs and features can be posted here
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >>>>>>> be posted here
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Csound mailing list
> > >>>>>>> Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>>> Send bugs reports to
> > >>>>>>>    https://github.com/csound/csound/issues
> > >>>>>>> Discussions of bugs and features can be posted here
> > >>>>>>>
> > >>>>>>> Csound mailing list
> > >>>>>>> Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>>> Send bugs reports to
> > >>>>>>>     https://github.com/csound/csound/issues
> > >>>>>>> Discussions of bugs and features can be posted here
> > >>>>>>>
> > >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> > >>>>>>
> > >>>>>> Csound mailing list
> > >>>>>> Csound@listserv.heanet.ie
> > >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>> Send bugs reports to
> > >>>>>>      https://github.com/csound/csound/issues
> > >>>>>> Discussions of bugs and features can be posted here
> > >>>>>>
> > >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> > >>>>>
> > >>>>> Csound mailing list
> > >>>>> Csound@listserv.heanet.ie
> > >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>> Send bugs reports to
> > >>>>>      https://github.com/csound/csound/issues
> > >>>>> Discussions of bugs and features can be posted here
> > >>>>
> > >>>> Csound mailing list
> > >>>> Csound@listserv.heanet.ie
> > >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>> Send bugs reports to
> > >>>>       https://github.com/csound/csound/issues
> > >>>> Discussions of bugs and features can be posted here
> > >>>
> > >>> Csound mailing list
> > >>> Csound@listserv.heanet.ie
> > >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>> Send bugs reports to
> > >>>        https://github.com/csound/csound/issues
> > >>> Discussions of bugs and features can be posted here
> > >>
> > >> Csound mailing list
> > >> Csound@listserv.heanet.ie
> > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> Send bugs reports to
> > >>        https://github.com/csound/csound/issues
> > >> Discussions of bugs and features can be posted here
> > >
> > > Csound mailing list
> > > Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > Send bugs reports to
> > >         https://github.com/csound/csound/issues
> > > Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-26 17:27
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Victor With all those reinstalls from sources I somehow managed
to broke my distro. The step into abyss was to install jack
from sources to the system dir. I don't know why but my 
system wasn't able to identify jack libs so I decided to help it
and broke everything.

I'll report my take on your update a bit later when I get 
sound going from my speakers again.

Thanks for all your efforts!

2016-01-26 17:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 18:31
FromRory Walsh
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Hi Anton. Are you running an audio specific distro? 

On 26 January 2016 at 17:27, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
@Victor With all those reinstalls from sources I somehow managed
to broke my distro. The step into abyss was to install jack
from sources to the system dir. I don't know why but my 
system wasn't able to identify jack libs so I decided to help it
and broke everything.

I'll report my take on your update a bit later when I get 
sound going from my speakers again.

Thanks for all your efforts!

2016-01-26 17:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-28 15:03
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Hi, Rory!

I run Ubuntu Studio with KXstudio repos. Then I started messing around with libjack. And at some point cadence stopped to list ALSA at configure->Drivers so there is no way I can use the alsa and I don't know how to fix it. I've tried to install/uninstall cadence, jackd, alsa. But nothing seems to help. It's sort of nightmare for me. I've tried to reinstall UbuntuStudio and KXStudio but by some reason they fail to install grub. So the installation proceeds up to grub point then it fails. And there is no start up menu. I still keep the broken original distro so that I can use internet and keep my files but it has no sound. 

2016-01-26 21:31 GMT+03:00 Rory Walsh <rorywalsh@ear.ie>:
Hi Anton. Are you running an audio specific distro? 

On 26 January 2016 at 17:27, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
@Victor With all those reinstalls from sources I somehow managed
to broke my distro. The step into abyss was to install jack
from sources to the system dir. I don't know why but my 
system wasn't able to identify jack libs so I decided to help it
and broke everything.

I'll report my take on your update a bit later when I get 
sound going from my speakers again.

Thanks for all your efforts!

2016-01-26 17:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-28 15:17
FromRory Walsh
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
Ouch, that's not a nice situation. Rather than install the full desktop version of KXStudio I simply install what I need from it over my existing distro. That way I can tailor it to me needs. Have you asked at the Linux Musicians forums?
fallTx, the creator of KXStudio can be found there a lot and is usually very responsive to questions.  

On 28 January 2016 at 15:03, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
Hi, Rory!

I run Ubuntu Studio with KXstudio repos. Then I started messing around with libjack. And at some point cadence stopped to list ALSA at configure->Drivers so there is no way I can use the alsa and I don't know how to fix it. I've tried to install/uninstall cadence, jackd, alsa. But nothing seems to help. It's sort of nightmare for me. I've tried to reinstall UbuntuStudio and KXStudio but by some reason they fail to install grub. So the installation proceeds up to grub point then it fails. And there is no start up menu. I still keep the broken original distro so that I can use internet and keep my files but it has no sound. 

2016-01-26 21:31 GMT+03:00 Rory Walsh <rorywalsh@ear.ie>:
Hi Anton. Are you running an audio specific distro? 

On 26 January 2016 at 17:27, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
@Victor With all those reinstalls from sources I somehow managed
to broke my distro. The step into abyss was to install jack
from sources to the system dir. I don't know why but my 
system wasn't able to identify jack libs so I decided to help it
and broke everything.

I'll report my take on your update a bit later when I get 
sound going from my speakers again.

Thanks for all your efforts!

2016-01-26 17:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-28 15:23
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
I haven't. Thanks for suggestion I'll try it out..

2016-01-28 18:17 GMT+03:00 Rory Walsh <rorywalsh@ear.ie>:
Ouch, that's not a nice situation. Rather than install the full desktop version of KXStudio I simply install what I need from it over my existing distro. That way I can tailor it to me needs. Have you asked at the Linux Musicians forums?
fallTx, the creator of KXStudio can be found there a lot and is usually very responsive to questions.  

On 28 January 2016 at 15:03, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
Hi, Rory!

I run Ubuntu Studio with KXstudio repos. Then I started messing around with libjack. And at some point cadence stopped to list ALSA at configure->Drivers so there is no way I can use the alsa and I don't know how to fix it. I've tried to install/uninstall cadence, jackd, alsa. But nothing seems to help. It's sort of nightmare for me. I've tried to reinstall UbuntuStudio and KXStudio but by some reason they fail to install grub. So the installation proceeds up to grub point then it fails. And there is no start up menu. I still keep the broken original distro so that I can use internet and keep my files but it has no sound. 

2016-01-26 21:31 GMT+03:00 Rory Walsh <rorywalsh@ear.ie>:
Hi Anton. Are you running an audio specific distro? 

On 26 January 2016 at 17:27, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
@Victor With all those reinstalls from sources I somehow managed
to broke my distro. The step into abyss was to install jack
from sources to the system dir. I don't know why but my 
system wasn't able to identify jack libs so I decided to help it
and broke everything.

I'll report my take on your update a bit later when I get 
sound going from my speakers again.

Thanks for all your efforts!

2016-01-26 17:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-29 18:18
FromAnton Kholomiov
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
@Viictor I'm back again. The brand new version segfaults with no messages being sent((
Sometimes it can recieve a 4 to 10 messages and segfault.
I've opened an issue on the github:
I've made a test suite to simplify testing (it sends random messages)

Also do you know how to install two versions of csound? One for release and one for testing.
Is there a `make install` command where I can specify a directory here to install.
So that I can use fast csound and supply backtraces if there is a need in them.

Anton




2016-01-26 17:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
Is it ok for the fix?

2016-01-26 17:10 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Jan 2016, at 13:31, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
>
> anyway thanks for all the help and support. At least I know how to build
> csound from sources
>
> I wish I could get so many comments for one of my future csound tracks :)
> It's really smart error that can jump at you when you are about to post
> to mailing list that it's gone.
>
> Anton
>
> 2016-01-26 16:28 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
> @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> string array). The scenario I've posted before is working but if I proceed
> there is always a point where there is a crash.
>
> One of the recent messages
>
> csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
>
> Sometimes it segfaults.
>
> I'd better make an issue on github. I'll try to make a minimal example.
>
> 2016-01-26 15:58 GMT+03:00 Steven Yi <stevenyi@gmail.com>:
> Ah, I see it now. A couple things:
>
> 1. we should add init functions for strings and f-sigs (in
> createString and createFsig in csound_standard_types.c).  They should
> set the default values.
>
> 2. for places we create initialise or resize arrays, we should check
> the array sub type to see if it's init function is set and, if so,
> iterate over the member data and call the init function.
>
> On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> <Victor.Lazzarini@nuim.ie> wrote:
> > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > ========================
> > Dr Victor Lazzarini
> > Dean of Arts, Celtic Studies and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> >> On 26 Jan 2016, at 12:37, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>
> >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> >> be necessary for initialisation of each data member of an array. It's
> >> a bit technical so I've just put it in a github issue
> >> (https://github.com/csound/csound/issues/588) to keep it off this
> >> list.  We should probably discuss on the dev list or through the
> >> github issue.
> >>
> >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> >> <Victor.Lazzarini@nuim.ie> wrote:
> >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> >>> these lines to the top, before your instrument definitions:
> >>>
> >>> ii init 0
> >>> while ii < $SIZE do
> >>>  gSFiles[ii] strcpy ""
> >>>  ii += 1
> >>> od
> >>>
> >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> >>> default to empty strings.
> >>>
> >>> ========================
> >>> Dr Victor Lazzarini
> >>> Dean of Arts, Celtic Studies and Philosophy,
> >>> Maynooth University,
> >>> Maynooth, Co Kildare, Ireland
> >>> Tel: 00 353 7086936
> >>> Fax: 00 353 1 7086952
> >>>
> >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>
> >>>> Actually, I manage to get a crash now. I am looking at it.
> >>>> ========================
> >>>> Dr Victor Lazzarini
> >>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>> Maynooth University,
> >>>> Maynooth, Co Kildare, Ireland
> >>>> Tel: 00 353 7086936
> >>>> Fax: 00 353 1 7086952
> >>>>
> >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> >>>>>
> >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> >>>>> Can you try them?
> >>>>>
> >>>>> ========================
> >>>>> Dr Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>> Maynooth University,
> >>>>> Maynooth, Co Kildare, Ireland
> >>>>> Tel: 00 353 7086936
> >>>>> Fax: 00 353 1 7086952
> >>>>>
> >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>
> >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> >>>>>> But then later I've made a version with no if/then for diskin2
> >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> >>>>>> with the same error.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>>> So what you are saying is that, without the if … then, there is no crash?
> >>>>>>
> >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> >>>>>> the code at all. If the crash is not happening, the reason might be different.
> >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> >>>>>> can track down which one of the two is responsible, we should be able to locate
> >>>>>> the problem.
> >>>>>>
> >>>>>> ========================
> >>>>>> Dr Victor Lazzarini
> >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> >>>>>> Maynooth University,
> >>>>>> Maynooth, Co Kildare, Ireland
> >>>>>> Tel: 00 353 7086936
> >>>>>> Fax: 00 353 1 7086952
> >>>>>>
> >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
> >>>>>>>
> >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> >>>>>>>
> >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> >>>>>>>
> >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> >>>>>>> ;if (ichan == 1) then
> >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> >>>>>>> ;    ar = al
> >>>>>>> ;else
> >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> >>>>>>> ;endif
> >>>>>>>
> >>>>>>>
> >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> >>>>>>> It _might_ fix it.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> >>>>>>>
> >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> >>>>>>> Also code is weak on tye checking
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>> It's probably caused by the following line in my code:
> >>>>>>> ~~~
> >>>>>>> gSFiles[kChannel] strcpyk SFile
> >>>>>>> ~~~
> >>>>>>>
> >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> >>>>>>> message
> >>>>>>>
> >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff <jpff@codemist.co.uk>:
> >>>>>>>    That backtrace looks like a double free in string_copy_value where
> >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> >>>>>>>
> >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> >>>>>>>
> >>>>>>>          Here is make trace:
> >>>>>>>          ~~~
> >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> >>>>>>>           i   1 time   220.31819:   100.00100
> >>>>>>>           i   1 time   220.31819:    80.00100
> >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> >>>>>>>          next size (fast):
> >>>>>>>          0x0000000000843840 ***
> >>>>>>>
> >>>>>>>          Program received signal SIGABRT, Aborted.
> >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> >>>>>>>          file or directory.
> >>>>>>>          (gdb) bt
> >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> >>>>>>>          (do_abort=do_abort@entry=1,
> >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> >>>>>>>          %s: 0x%s ***\n")
> >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> >>>>>>>          (ptr=<optimized out>,
> >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> >>>>>>>          (fast)", action=1)
> >>>>>>>              at malloc.c:4996
> >>>>>>>          #4  _int_free (av=<optimized out>, p=<optimized out>,
> >>>>>>>          have_lock=0)
> >>>>>>>              at malloc.c:3840
> >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> >>>>>>>          p=0x843850)
> >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> >>>>>>>              src=0x7b5a70) at
> >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> >>>>>>>          p=0x8d12d0)
> >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> >>>>>>>          (csound=0x604040)
> >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> >>>>>>>          #10 0x000000000040181d in main (argc=2,
> >>>>>>>          argv=0x7fffffffd7b8)
> >>>>>>>              at
> >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> >>>>>>>          ~~~
> >>>>>>>
> >>>>>>>
> >>>>>>> Trimmed as it is messing thedigest
> >>>>>>>
> >>>>>>> ==John ff
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> >>>>>>> be posted here
> >>>>>>>
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>    https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list
> >>>>>>> Csound@listserv.heanet.ie
> >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>> Send bugs reports to
> >>>>>>>     https://github.com/csound/csound/issues
> >>>>>>> Discussions of bugs and features can be posted here
> >>>>>>>
> >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> Csound@listserv.heanet.ie
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>> Send bugs reports to
> >>>>>>      https://github.com/csound/csound/issues
> >>>>>> Discussions of bugs and features can be posted here
> >>>>>>
> >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> >>>>>
> >>>>> Csound mailing list
> >>>>> Csound@listserv.heanet.ie
> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>> Send bugs reports to
> >>>>>      https://github.com/csound/csound/issues
> >>>>> Discussions of bugs and features can be posted here
> >>>>
> >>>> Csound mailing list
> >>>> Csound@listserv.heanet.ie
> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>> Send bugs reports to
> >>>>       https://github.com/csound/csound/issues
> >>>> Discussions of bugs and features can be posted here
> >>>
> >>> Csound mailing list
> >>> Csound@listserv.heanet.ie
> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>> Send bugs reports to
> >>>        https://github.com/csound/csound/issues
> >>> Discussions of bugs and features can be posted here
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >>        https://github.com/csound/csound/issues
> >> Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-29 18:42
FromVictor Lazzarini
SubjectRe: How to use String filenames, filelen and diskin2 with OSC?
OK, we can track this on github. 
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 29 Jan 2016, at 18:18, Anton Kholomiov  wrote:
> 
> @Viictor I'm back again. The brand new version segfaults with no messages being sent((
> Sometimes it can recieve a 4 to 10 messages and segfault.
> I've opened an issue on the github:
> 
> https://github.com/csound/csound/issues/590
> 
> I've made a test suite to simplify testing (it sends random messages)
> 
> Also do you know how to install two versions of csound? One for release and one for testing.
> Is there a `make install` command where I can specify a directory here to install.
> So that I can use fast csound and supply backtraces if there is a need in them.
> 
> Anton
> 
> 
> 
> 
> 2016-01-26 17:37 GMT+03:00 Anton Kholomiov :
> One question before I try to test. I see changes for strcpy in the commit, but in the code I use strcpyk.
> Is it ok for the fix?
> 
> 2016-01-26 17:10 GMT+03:00 Victor Lazzarini :
> I think I found the bug, I fixed in git. Try to pull, compile and see if it works for you now.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 26 Jan 2016, at 13:31, Anton Kholomiov  wrote:
> >
> > anyway thanks for all the help and support. At least I know how to build
> > csound from sources
> >
> > I wish I could get so many comments for one of my future csound tracks :)
> > It's really smart error that can jump at you when you are about to post
> > to mailing list that it's gone.
> >
> > Anton
> >
> > 2016-01-26 16:28 GMT+03:00 Anton Kholomiov :
> > @Victor I'm sorry to say it but it fails still (with your recent commit and proposal to set values for
> > string array). The scenario I've posted before is working but if I proceed
> > there is always a point where there is a crash.
> >
> > One of the recent messages
> >
> > csound: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
> >
> > Sometimes it segfaults.
> >
> > I'd better make an issue on github. I'll try to make a minimal example.
> >
> > 2016-01-26 15:58 GMT+03:00 Steven Yi :
> > Ah, I see it now. A couple things:
> >
> > 1. we should add init functions for strings and f-sigs (in
> > createString and createFsig in csound_standard_types.c).  They should
> > set the default values.
> >
> > 2. for places we create initialise or resize arrays, we should check
> > the array sub type to see if it's init function is set and, if so,
> > iterate over the member data and call the init function.
> >
> > On Tue, Jan 26, 2016 at 7:44 AM, Victor Lazzarini
> >  wrote:
> > > I had a look, and we could add a new initvar function to S types as we do for numeric types? Do you think that would do it?
> > > ========================
> > > Dr Victor Lazzarini
> > > Dean of Arts, Celtic Studies and Philosophy,
> > > Maynooth University,
> > > Maynooth, Co Kildare, Ireland
> > > Tel: 00 353 7086936
> > > Fax: 00 353 1 7086952
> > >
> > >> On 26 Jan 2016, at 12:37, Steven Yi  wrote:
> > >>
> > >> Wow, that's a good find Victor.  I took a quick to diagnose what would
> > >> be necessary for initialisation of each data member of an array. It's
> > >> a bit technical so I've just put it in a github issue
> > >> (https://github.com/csound/csound/issues/588) to keep it off this
> > >> list.  We should probably discuss on the dev list or through the
> > >> github issue.
> > >>
> > >> On Tue, Jan 26, 2016 at 7:11 AM, Victor Lazzarini
> > >>  wrote:
> > >>> Ok, here’s the problem (it looks like). When you start, some of the strings of the array are NULL, and if you
> > >>> try to read them, you get a crash. If you initialise them to empty strings, then it goes away (it appears). Add
> > >>> these lines to the top, before your instrument definitions:
> > >>>
> > >>> ii init 0
> > >>> while ii < $SIZE do
> > >>>  gSFiles[ii] strcpy ""
> > >>>  ii += 1
> > >>> od
> > >>>
> > >>> From our (devs) perspective, I think we need to consider whether string arrays need to be initialised by
> > >>> default to empty strings.
> > >>>
> > >>> ========================
> > >>> Dr Victor Lazzarini
> > >>> Dean of Arts, Celtic Studies and Philosophy,
> > >>> Maynooth University,
> > >>> Maynooth, Co Kildare, Ireland
> > >>> Tel: 00 353 7086936
> > >>> Fax: 00 353 1 7086952
> > >>>
> > >>>> On 26 Jan 2016, at 11:59, Victor Lazzarini  wrote:
> > >>>>
> > >>>> Actually, I manage to get a crash now. I am looking at it.
> > >>>> ========================
> > >>>> Dr Victor Lazzarini
> > >>>> Dean of Arts, Celtic Studies and Philosophy,
> > >>>> Maynooth University,
> > >>>> Maynooth, Co Kildare, Ireland
> > >>>> Tel: 00 353 7086936
> > >>>> Fax: 00 353 1 7086952
> > >>>>
> > >>>>> On 26 Jan 2016, at 11:47, Victor Lazzarini  wrote:
> > >>>>>
> > >>>>> yes, I wouldn’t think that was the problem. I’ve pushed a new version with some
> > >>>>> changes that could stop the crash (but are not the final solution, just diagnostics).
> > >>>>> Can you try them?
> > >>>>>
> > >>>>> ========================
> > >>>>> Dr Victor Lazzarini
> > >>>>> Dean of Arts, Celtic Studies and Philosophy,
> > >>>>> Maynooth University,
> > >>>>> Maynooth, Co Kildare, Ireland
> > >>>>> Tel: 00 353 7086936
> > >>>>> Fax: 00 353 1 7086952
> > >>>>>
> > >>>>>> On 26 Jan 2016, at 11:35, Anton Kholomiov  wrote:
> > >>>>>>
> > >>>>>> I'm sorry for misinformation. The error is tricky to manifest.
> > >>>>>> Tere was no crash by some happy accident when I've commented the if/thens.
> > >>>>>> But then later I've made a version with no if/then for diskin2
> > >>>>>> (I've put mono and stereo versions at separate instruments) and it fails too
> > >>>>>> with the same error.
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>> 2016-01-26 14:28 GMT+03:00 Victor Lazzarini :
> > >>>>>> So what you are saying is that, without the if … then, there is no crash?
> > >>>>>>
> > >>>>>> Note that the condition will be checked both at i-time and perf-time, so it should affect
> > >>>>>> the code at all. If the crash is not happening, the reason might be different.
> > >>>>>> We know that it seems to be triggered by an array_get(), which is called whenever
> > >>>>>> you are trying to read from an array (as in the filenchnls and diskin2 lines). If we
> > >>>>>> can track down which one of the two is responsible, we should be able to locate
> > >>>>>> the problem.
> > >>>>>>
> > >>>>>> ========================
> > >>>>>> Dr Victor Lazzarini
> > >>>>>> Dean of Arts, Celtic Studies and Philosophy,
> > >>>>>> Maynooth University,
> > >>>>>> Maynooth, Co Kildare, Ireland
> > >>>>>> Tel: 00 353 7086936
> > >>>>>> Fax: 00 353 1 7086952
> > >>>>>>
> > >>>>>>> On 26 Jan 2016, at 09:05, Anton Kholomiov  wrote:
> > >>>>>>>
> > >>>>>>> The code with no osc also fails when I wrap it to python interface(((
> > >>>>>>>
> > >>>>>>> I guess Steven is right. For at least one source of errors. When I comment out conditional code for diskin2 the original bad scenario produces no errors, even with OSC:
> > >>>>>>>
> > >>>>>>> ;ichan filenchnls gSFiles[iChannel]
> > >>>>>>> ;if (ichan == 1) then
> > >>>>>>> ;    al diskin2 gSFiles[iChannel], 1
> > >>>>>>> ;    ar = al
> > >>>>>>> ;else
> > >>>>>>>  al, ar diskin2 gSFiles[iChannel], 1
> > >>>>>>> ;endif
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> 2016-01-26 0:39 GMT+03:00 jpff :
> > >>>>>>> I have pushed a small fix to git in file Opcodes/OSC.c
> > >>>>>>> It _might_ fix it.
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> On Mon, 25 Jan 2016, jpff wrote:
> > >>>>>>>
> > >>>>>>> Found an oddity in OSC receiving strings -- investigating.
> > >>>>>>> Also code is weak on tye checking
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> > >>>>>>>
> > >>>>>>> It's probably caused by the following line in my code:
> > >>>>>>> ~~~
> > >>>>>>> gSFiles[kChannel] strcpyk SFile
> > >>>>>>> ~~~
> > >>>>>>>
> > >>>>>>> Where  kChannel and SFile are filled with values that I receive in the OSC
> > >>>>>>> message
> > >>>>>>>
> > >>>>>>> 2016-01-25 23:25 GMT+03:00 jpff :
> > >>>>>>>    That backtrace looks like a double free in string_copy_value where
> > >>>>>>>    id attempts to delete the space in the dst arument.  Really I
> > >>>>>>>    would love tis run under valgrind or ElectricFence or similar
> > >>>>>>>
> > >>>>>>>    On Mon, 25 Jan 2016, Anton Kholomiov wrote:
> > >>>>>>>
> > >>>>>>>          Here is make trace:
> > >>>>>>>          ~~~
> > >>>>>>>          diskin2: opened '/home/anton/Seashore.wav':
> > >>>>>>>                   44100 Hz, 2 channel(s), 546731 sample frames
> > >>>>>>>           i   1 time   220.31819:   100.00100
> > >>>>>>>           i   1 time   220.31819:    80.00100
> > >>>>>>>          *** Error in `/usr/local/bin/csound': free(): invalid
> > >>>>>>>          next size (fast):
> > >>>>>>>          0x0000000000843840 ***
> > >>>>>>>
> > >>>>>>>          Program received signal SIGABRT, Aborted.
> > >>>>>>>          0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> > >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> > >>>>>>>          56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such
> > >>>>>>>          file or directory.
> > >>>>>>>          (gdb) bt
> > >>>>>>>          #0  0x00007ffff72decc9 in __GI_raise (sig=sig@entry=6)
> > >>>>>>>              at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> > >>>>>>>          #1  0x00007ffff72e20d8 in __GI_abort () at abort.c:89
> > >>>>>>>          #2  0x00007ffff731b394 in __libc_message
> > >>>>>>>          (do_abort=do_abort@entry=1,
> > >>>>>>>              fmt=fmt@entry=0x7ffff7429b28 "*** Error in `%s':
> > >>>>>>>          %s: 0x%s ***\n")
> > >>>>>>>              at ../sysdeps/posix/libc_fatal.c:175
> > >>>>>>>          #3  0x00007ffff732766e in malloc_printerr
> > >>>>>>>          (ptr=,
> > >>>>>>>              str=0x7ffff7429cc8 "free(): invalid next size
> > >>>>>>>          (fast)", action=1)
> > >>>>>>>              at malloc.c:4996
> > >>>>>>>          #4  _int_free (av=, p=,
> > >>>>>>>          have_lock=0)
> > >>>>>>>              at malloc.c:3840
> > >>>>>>>          #5  0x00007ffff78e911f in mfree (csound=0x604040,
> > >>>>>>>          p=0x843850)
> > >>>>>>>              at /home/anton/tools/csound/Engine/memalloc.c:172
> > >>>>>>>          #6  0x00007ffff78fdd44 in string_copy_value
> > >>>>>>>          (csound=0x604040, dest=0x8cc1c8,
> > >>>>>>>              src=0x7b5a70) at
> > >>>>>>>          /home/anton/tools/csound/Engine/csound_standard_types.c:70
> > >>>>>>>          #7  0x00007ffff79cc2d3 in array_get (csound=0x604040,
> > >>>>>>>          p=0x8d12d0)
> > >>>>>>>              at /home/anton/tools/csound/Opcodes/arrays.c:264
> > >>>>>>>          #8  0x00007ffff7a4e8f5 in kperf_nodebug
> > >>>>>>>          (csound=0x604040)
> > >>>>>>>              at /home/anton/tools/csound/Top/csound.c:1552
> > >>>>>>>          #9  0x00007ffff7a500a3 in csoundPerform
> > >>>>>>>          (csound=0x604040)
> > >>>>>>>              at /home/anton/tools/csound/Top/csound.c:2044
> > >>>>>>>          #10 0x000000000040181d in main (argc=2,
> > >>>>>>>          argv=0x7fffffffd7b8)
> > >>>>>>>              at
> > >>>>>>>          /home/anton/tools/csound/frontends/csound/csound_main.c:318
> > >>>>>>>          ~~~
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Trimmed as it is messing thedigest
> > >>>>>>>
> > >>>>>>> ==John ff
> > >>>>>>>
> > >>>>>>> Csound mailing list
> > >>>>>>> Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>>> Send bugs reports to
> > >>>>>>>     https://github.com/csound/csound/issues
> > >>>>>>> Discussions of bugs and features can be posted here
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Csound mailing list Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> > >>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features can
> > >>>>>>> be posted here
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Csound mailing list
> > >>>>>>> Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>>> Send bugs reports to
> > >>>>>>>    https://github.com/csound/csound/issues
> > >>>>>>> Discussions of bugs and features can be posted here
> > >>>>>>>
> > >>>>>>> Csound mailing list
> > >>>>>>> Csound@listserv.heanet.ie
> > >>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>>> Send bugs reports to
> > >>>>>>>     https://github.com/csound/csound/issues
> > >>>>>>> Discussions of bugs and features can be posted here
> > >>>>>>>
> > >>>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> > >>>>>>
> > >>>>>> Csound mailing list
> > >>>>>> Csound@listserv.heanet.ie
> > >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>>> Send bugs reports to
> > >>>>>>      https://github.com/csound/csound/issues
> > >>>>>> Discussions of bugs and features can be posted here
> > >>>>>>
> > >>>>>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> > >>>>>
> > >>>>> Csound mailing list
> > >>>>> Csound@listserv.heanet.ie
> > >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>>> Send bugs reports to
> > >>>>>      https://github.com/csound/csound/issues
> > >>>>> Discussions of bugs and features can be posted here
> > >>>>
> > >>>> Csound mailing list
> > >>>> Csound@listserv.heanet.ie
> > >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>>> Send bugs reports to
> > >>>>       https://github.com/csound/csound/issues
> > >>>> Discussions of bugs and features can be posted here
> > >>>
> > >>> Csound mailing list
> > >>> Csound@listserv.heanet.ie
> > >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >>> Send bugs reports to
> > >>>        https://github.com/csound/csound/issues
> > >>> Discussions of bugs and features can be posted here
> > >>
> > >> Csound mailing list
> > >> Csound@listserv.heanet.ie
> > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > >> Send bugs reports to
> > >>        https://github.com/csound/csound/issues
> > >> Discussions of bugs and features can be posted here
> > >
> > > Csound mailing list
> > > Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > Send bugs reports to
> > >         https://github.com/csound/csound/issues
> > > Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
> >
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here