Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Strange issue with csoundGetTable()

Date2012-11-28 05:40
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
yes, did you read my first reply? You are liable to get these intermitent crashes because your code is not thread safe. Place your code in the yield callback or if you are using CsoundPerformanceThread in the performance thread callback

VL


On 28 Nov 2012, at 17:24, Rory Walsh  wrote:

> It seems there is something else at play here as that problem keeps
> returning intermittently. I guess I should employ the
> csoundYieldCallback() function but I'm not quite sure how to? Anyone
> have any example code? Am I right in saying that this callback is
> triggered only when Csound is ready to update internal stuff? Meaning
> that there would be a slight time difference between when a user hits
> say an update table button, and when that actually happens? Or is this
> callback being triggered like the clappers constantly throughout the
> performance?
> 
> 
> 
> On 28 November 2012 15:45, Steven Yi  wrote:
>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>> syntax in C++, got some cognitive dissonance with my C understanding.
>> :)
>> 
>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>  wrote:
>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>> have a table pointer, you pass that in without the ampersand, and the
>>> new value of the pointer is returned in the pointer by reference. It
>>> acts like a pointer to a pointer, but the variable passed is just a
>>> pointer, not the address of a pointer.
>>> 
>>> I'm talking about the C++ function here, not the C function.
>>> 
>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>> Hm, I would imagine the ampersand would be required, because it
>>>> assigns the address to the pointer pointing to an address, rather than
>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>> MYFLT, yeah?
>>>> 
>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>> That's a fair point about performKsmps() being called at the same
>>>>> time. It's constantly going in the background. In fact I put in that
>>>>> loop just to check the validity of the table data, but obviously I
>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>> 
>>>>> On 28 November 2012 13:57, Victor Lazzarini  wrote:
>>>>>> You forgot the &:
>>>>>> 
>>>>>> &temp
>>>>>> 
>>>>>> 
>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>> 
>>>>>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>> segfault?
>>>>>>> 
>>>>>>> MYFLT* temp;
>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>> for(int i=0;i>>>>>> temp[i] = 0;
>>>>>>> }
>>>>>>> 
>>>>>>> I'm happy to use the C interface. No problems there. I still need to
>>>>>>> mess around with this a while, I have a feeling the problem might rear
>>>>>>> its head again.
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>>> Dr Victor Lazzarini
>>>>>> Senior Lecturer
>>>>>> Dept. of Music
>>>>>> NUI Maynooth Ireland
>>>>>> tel.: +353 1 708 3545
>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> 
>>> 
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 05:41
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
AttachmentsNone  None  
exactly

VL


On 28 Nov 2012, at 17:28, Justin Smith <noisesmith@gmail.com> wrote:

IIRC the function passed as a callback will be called between k cycles. If your k rate is not weirdly high, the lag should not be a major issue.


On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh <rorywalsh@ear.ie> wrote:
It seems there is something else at play here as that problem keeps
returning intermittently. I guess I should employ the
csoundYieldCallback() function but I'm not quite sure how to? Anyone
have any example code? Am I right in saying that this callback is
triggered only when Csound is ready to update internal stuff? Meaning
that there would be a slight time difference between when a user hits
say an update table button, and when that actually happens? Or is this
callback being triggered like the clappers constantly throughout the
performance?



On 28 November 2012 15:45, Steven Yi <stevenyi@gmail.com> wrote:
> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
> syntax in C++, got some cognitive dissonance with my C understanding.
> :)
>
> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
> <michael.gogins@gmail.com> wrote:
>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>> have a table pointer, you pass that in without the ampersand, and the
>> new value of the pointer is returned in the pointer by reference. It
>> acts like a pointer to a pointer, but the variable passed is just a
>> pointer, not the address of a pointer.
>>
>> I'm talking about the C++ function here, not the C function.
>>
>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi <stevenyi@gmail.com> wrote:
>>> Hm, I would imagine the ampersand would be required, because it
>>> assigns the address to the pointer pointing to an address, rather than
>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>> MYFLT, yeah?
>>>
>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>> That's a fair point about performKsmps() being called at the same
>>>> time. It's constantly going in the background. In fact I put in that
>>>> loop just to check the validity of the table data, but obviously I
>>>> won't be doing anything like that for real, and if I do overwrite a
>>>> table it will be done between calls to performKsmps. Thanks.
>>>>
>>>> On 28 November 2012 13:57, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>> You forgot the &:
>>>>>
>>>>> &temp
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>
>>>>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>> following updated code(using the Csound class) still causes the
>>>>>> segfault?
>>>>>>
>>>>>> MYFLT* temp;
>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>> for(int i=0;i<tableSize;i++){
>>>>>> temp[i] = 0;
>>>>>> }
>>>>>>
>>>>>> I'm happy to use the C interface. No problems there. I still need to
>>>>>> mess around with this a while, I have a feeling the problem might rear
>>>>>> its head again.
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> Dr Victor Lazzarini
>>>>> Senior Lecturer
>>>>> Dept. of Music
>>>>> NUI Maynooth Ireland
>>>>> tel.: +353 1 708 3545
>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2012-11-28 05:49
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Just code the callback and then register it with Csound. It will be called after each performKsmps.

VL


On 28 Nov 2012, at 17:37, Rory Walsh  wrote:

> Yeah sorry Victor, this is why I'm now asking about
> csoundYieldCallback(), I missed it the first time. I'm not using the
> performance thread
> class so I'll just it directly. After some more tests I can confirm
> that the crashes are exactly for the reason you outlined!
> 
> 
> 
> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>> exactly
>> 
>> VL
>> 
>> 
>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>> 
>> IIRC the function passed as a callback will be called between k cycles. If
>> your k rate is not weirdly high, the lag should not be a major issue.
>> 
>> 
>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>> 
>>> It seems there is something else at play here as that problem keeps
>>> returning intermittently. I guess I should employ the
>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>> have any example code? Am I right in saying that this callback is
>>> triggered only when Csound is ready to update internal stuff? Meaning
>>> that there would be a slight time difference between when a user hits
>>> say an update table button, and when that actually happens? Or is this
>>> callback being triggered like the clappers constantly throughout the
>>> performance?
>>> 
>>> 
>>> 
>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>> :)
>>>> 
>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>  wrote:
>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>> pointer, not the address of a pointer.
>>>>> 
>>>>> I'm talking about the C++ function here, not the C function.
>>>>> 
>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>> MYFLT, yeah?
>>>>>> 
>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>> 
>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>  wrote:
>>>>>>>> You forgot the &:
>>>>>>>> 
>>>>>>>> &temp
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>> 
>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>> But
>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>> segfault?
>>>>>>>>> 
>>>>>>>>> MYFLT* temp;
>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>> for(int i=0;i>>>>>>>> temp[i] = 0;
>>>>>>>>> }
>>>>>>>>> 
>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>> to
>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>> rear
>>>>>>>>> its head again.
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>> curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>> 
>>>>>>>> Dr Victor Lazzarini
>>>>>>>> Senior Lecturer
>>>>>>>> Dept. of Music
>>>>>>>> NUI Maynooth Ireland
>>>>>>>> tel.: +353 1 708 3545
>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>> areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>> areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>> areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Michael Gogins
>>>>> Irreducible Productions
>>>>> http://www.michael-gogins.com
>>>>> Michael dot Gogins at gmail dot com
>>>>> 
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>> areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>> areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> 
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 06:23
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
yes there is. They are not thread safe too, although they seem generally trouble free.

VL


On 28 Nov 2012, at 17:44, Rory Walsh  wrote:

> Yeah, think I got it now. There's no reason to place calls to the
> chanset functions in there though is there?
> 
> 
> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>> 
>> VL
>> 
>> 
>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>> 
>>> Yeah sorry Victor, this is why I'm now asking about
>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>> performance thread
>>> class so I'll just it directly. After some more tests I can confirm
>>> that the crashes are exactly for the reason you outlined!
>>> 
>>> 
>>> 
>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>> exactly
>>>> 
>>>> VL
>>>> 
>>>> 
>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>> 
>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>> 
>>>> 
>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>> 
>>>>> It seems there is something else at play here as that problem keeps
>>>>> returning intermittently. I guess I should employ the
>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>> have any example code? Am I right in saying that this callback is
>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>> that there would be a slight time difference between when a user hits
>>>>> say an update table button, and when that actually happens? Or is this
>>>>> callback being triggered like the clappers constantly throughout the
>>>>> performance?
>>>>> 
>>>>> 
>>>>> 
>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>> :)
>>>>>> 
>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>  wrote:
>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>> pointer, not the address of a pointer.
>>>>>>> 
>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>> 
>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>> MYFLT, yeah?
>>>>>>>> 
>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>> 
>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>  wrote:
>>>>>>>>>> You forgot the &:
>>>>>>>>>> 
>>>>>>>>>> &temp
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>> 
>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>> But
>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>> segfault?
>>>>>>>>>>> 
>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>> for(int i=0;i>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>> }
>>>>>>>>>>> 
>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>> to
>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>> rear
>>>>>>>>>>> its head again.
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>> curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>> 
>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>> Senior Lecturer
>>>>>>>>>> Dept. of Music
>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>> areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Michael Gogins
>>>>>>> Irreducible Productions
>>>>>>> http://www.michael-gogins.com
>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>> areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>> areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> 
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 06:46
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
No need if the function calls  are placed in the yield callback, as far as Csound is concerned. Beyond that, you might have other thread safety needs in your app, I don't know.

VL


On 28 Nov 2012, at 18:30, Rory Walsh  wrote:

> Great. Should I also be looking at using Mutex locks?
> 
> 
> 
> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>> yes there is. They are not thread safe too, although they seem generally trouble free.
>> 
>> VL
>> 
>> 
>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>> 
>>> Yeah, think I got it now. There's no reason to place calls to the
>>> chanset functions in there though is there?
>>> 
>>> 
>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>> 
>>>> VL
>>>> 
>>>> 
>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>> 
>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>> performance thread
>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>> that the crashes are exactly for the reason you outlined!
>>>>> 
>>>>> 
>>>>> 
>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>> exactly
>>>>>> 
>>>>>> VL
>>>>>> 
>>>>>> 
>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>> 
>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>> 
>>>>>> 
>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>> 
>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>> returning intermittently. I guess I should employ the
>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>> performance?
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>> :)
>>>>>>>> 
>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>  wrote:
>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>> 
>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>> 
>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>> 
>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>> 
>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>  wrote:
>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>> 
>>>>>>>>>>>> &temp
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>> 
>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>> But
>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>> 
>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>> }
>>>>>>>>>>>>> 
>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>> to
>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>> rear
>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>> curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>> 
>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> Michael Gogins
>>>>>>>>> Irreducible Productions
>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>> areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> 
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 06:50
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Not really because the control channels are only updated at ksmps boundaries, so there is no wait. 

If you can read Java code, check out how we do this in CsoundAndroid, using the valueCacheable mechanism.
It is solving the same issue.

VL


On 28 Nov 2012, at 18:35, Rory Walsh  wrote:

> Actually, I might be slightly confused about mutex locks! I'm just
> looking for a way to avoid stacking up a list of events that need to
> take place when it's safe to do so? Can I use some kind of mechanism
> whereby I can hold my code from executing until Csound is ready? I'm
> sure there is a standard approach to this issue, or am I making any
> sense here at all? The idea of holding on to a number of slider events
> until Csound is ready seems a little excessive?
> 
> 
> 
> On 28 November 2012 18:30, Rory Walsh  wrote:
>> Great. Should I also be looking at using Mutex locks?
>> 
>> 
>> 
>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>> 
>>> VL
>>> 
>>> 
>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>> 
>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>> chanset functions in there though is there?
>>>> 
>>>> 
>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>> 
>>>>> VL
>>>>> 
>>>>> 
>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>> 
>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>> performance thread
>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>> exactly
>>>>>>> 
>>>>>>> VL
>>>>>>> 
>>>>>>> 
>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>> 
>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>> 
>>>>>>> 
>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>> 
>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>> performance?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>> :)
>>>>>>>>> 
>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>  wrote:
>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>> 
>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>> 
>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>> 
>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>> 
>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>> 
>>>>>>>>>>>>> &temp
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>> But
>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>> to
>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> --
>>>>>>>>>> Michael Gogins
>>>>>>>>>> Irreducible Productions
>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 13:02
FromRory Walsh
Subject[Cs-dev] Strange issue with csoundGetTable()
I seem to be having some problems with csoundGetTable(). Consider the
following code:

//table length = 10687746
MYFLT* temp = new MYFLT[10687746];
int tableSize = csoundGetTable(csound->GetCsound(), &temp, 1);

for(int i=0;i<10687746;i++){
	temp[i] = 0;
}

The for loop causes a "Program received signal SIGSEGV, Segmentation
fault" which would seem to indicate to me that something is corrupt
but if I take out the call to csoundGetTable() it all runs fine. It's
also completely inconsistent, with crashes happening for various
values of 'i'. On top of this I've not been able to recreate the
problem in a basic command line program. It's only when I use this
code with Cabbage something goes wrong. Nothing is writing to the
table when I'm accessing it so it can't be that. Also, there seems to
be no problem with small table sizes, but anything over a minute or so
causes a segfault. I know the code above doesn't make much sense in
terms of function, but it's part of a bigger picture. Am I doing
something stupid here that I can't see?

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 13:09
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Do you do this in a separate thread from the performance? If so, you're getting problems due to 
accessing the resource at the same time. Place the code in a callback (csoundYieldCallback() for instance)
so that it gets called at the right time.

On 28 Nov 2012, at 13:02, Rory Walsh wrote:

> I seem to be having some problems with csoundGetTable(). Consider the
> following code:
> 
> //table length = 10687746
> MYFLT* temp = new MYFLT[10687746];
> int tableSize = csoundGetTable(csound->GetCsound(), &temp, 1);
> 
> for(int i=0;i<10687746;i++){
> 	temp[i] = 0;
> }
> 
> The for loop causes a "Program received signal SIGSEGV, Segmentation
> fault" which would seem to indicate to me that something is corrupt
> but if I take out the call to csoundGetTable() it all runs fine. It's
> also completely inconsistent, with crashes happening for various
> values of 'i'. On top of this I've not been able to recreate the
> problem in a basic command line program. It's only when I use this
> code with Cabbage something goes wrong. Nothing is writing to the
> table when I'm accessing it so it can't be that. Also, there seems to
> be no problem with small table sizes, but anything over a minute or so
> causes a segfault. I know the code above doesn't make much sense in
> terms of function, but it's part of a bigger picture. Am I doing
> something stupid here that I can't see?
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 13:23
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Ops I think your code is wrong as well:

 /**
     * Stores pointer to function table 'tableNum' in *tablePtr,
     * and returns the table length (not including the guard point).
     * If the table does not exist, *tablePtr is set to NULL and
     * -1 is returned.
     */
    PUBLIC int csoundGetTable(CSOUND *, MYFLT **tablePtr, int tableNum);


so:

int len;
MYFLT *temp;

len = csoundGetTable(csound->GetCsound(), &temp, 1);
for(i=0; i< len; i++) temp[i] = 0;


1) don't allocate memory, csound has already done it.
2) loop to table length, not to an arbitrary value


Victor

On 28 Nov 2012, at 13:09, Victor Lazzarini wrote:

> Do you do this in a separate thread from the performance? If so, you're getting problems due to 
> accessing the resource at the same time. Place the code in a callback (csoundYieldCallback() for instance)
> so that it gets called at the right time.
> 
> On 28 Nov 2012, at 13:02, Rory Walsh wrote:
> 
>> I seem to be having some problems with csoundGetTable(). Consider the
>> following code:
>> 
>> //table length = 10687746
>> MYFLT* temp = new MYFLT[10687746];
>> int tableSize = csoundGetTable(csound->GetCsound(), &temp, 1);
>> 
>> for(int i=0;i<10687746;i++){
>> 	temp[i] = 0;
>> }
>> 
>> The for loop causes a "Program received signal SIGSEGV, Segmentation
>> fault" which would seem to indicate to me that something is corrupt
>> but if I take out the call to csoundGetTable() it all runs fine. It's
>> also completely inconsistent, with crashes happening for various
>> values of 'i'. On top of this I've not been able to recreate the
>> problem in a basic command line program. It's only when I use this
>> code with Cabbage something goes wrong. Nothing is writing to the
>> table when I'm accessing it so it can't be that. Also, there seems to
>> be no problem with small table sizes, but anything over a minute or so
>> causes a segfault. I know the code above doesn't make much sense in
>> terms of function, but it's part of a bigger picture. Am I doing
>> something stupid here that I can't see?
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel: 
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 13:51
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Thanks Victor. That arbitrary value was in fact the table length. But
anyway, taking out the memory allocation seemed to have solved the
problem. So continuing backwards to the original problem I find the
following updated code(using the Csound class) still causes the
segfault?

MYFLT* temp;
int tableSize = csound->GetTable(temp, 1);
for(int i=0;i

Date2012-11-28 13:56
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
and this is not competing with a csound performance, ie. at the same time csoundPerformKsmps() is being called elsewhere, or is it?
On 28 Nov 2012, at 13:51, Rory Walsh wrote:

> Thanks Victor. That arbitrary value was in fact the table length. But
> anyway, taking out the memory allocation seemed to have solved the
> problem. So continuing backwards to the original problem I find the
> following updated code(using the Csound class) still causes the
> segfault?
> 
> MYFLT* temp;
> int tableSize = csound->GetTable(temp, 1);
> for(int i=0;i temp[i] = 0;
> }
> 
> I'm happy to use the C interface. No problems there. I still need to
> mess around with this a while, I have a feeling the problem might rear
> its head again.
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 13:57
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
You forgot the &:

&temp


On 28 Nov 2012, at 13:51, Rory Walsh wrote:

> Thanks Victor. That arbitrary value was in fact the table length. But
> anyway, taking out the memory allocation seemed to have solved the
> problem. So continuing backwards to the original problem I find the
> following updated code(using the Csound class) still causes the
> segfault?
> 
> MYFLT* temp;
> int tableSize = csound->GetTable(temp, 1);
> for(int i=0;i temp[i] = 0;
> }
> 
> I'm happy to use the C interface. No problems there. I still need to
> mess around with this a while, I have a feeling the problem might rear
> its head again.
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 14:02
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Or maybe not, it's a reference is it not?

 virtual int GetTable(MYFLT* &tablePtr, int tableNum)
  {
    MYFLT *ftable;
    int   tmp;
    tmp = csoundGetTable(csound, &ftable, tableNum);
    tablePtr = ftable;
    return tmp;
  }

I never used this function.

Victor
On 28 Nov 2012, at 13:57, Victor Lazzarini wrote:

> You forgot the &:
> 
> &temp
> 
> 
> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
> 
>> Thanks Victor. That arbitrary value was in fact the table length. But
>> anyway, taking out the memory allocation seemed to have solved the
>> problem. So continuing backwards to the original problem I find the
>> following updated code(using the Csound class) still causes the
>> segfault?
>> 
>> MYFLT* temp;
>> int tableSize = csound->GetTable(temp, 1);
>> for(int i=0;i> temp[i] = 0;
>> }
>> 
>> I'm happy to use the C interface. No problems there. I still need to
>> mess around with this a while, I have a feeling the problem might rear
>> its head again.
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel: 
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 14:42
FromMichael Gogins
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
It's a reference to a pointer. You pass in a pointer, the pointer's
value is replaced within the GetTable function and returned by
reference.

Regards,
Mike

On Wed, Nov 28, 2012 at 9:02 AM, Victor Lazzarini
 wrote:
> Or maybe not, it's a reference is it not?
>
>  virtual int GetTable(MYFLT* &tablePtr, int tableNum)
>   {
>     MYFLT *ftable;
>     int   tmp;
>     tmp = csoundGetTable(csound, &ftable, tableNum);
>     tablePtr = ftable;
>     return tmp;
>   }
>
> I never used this function.
>
> Victor
> On 28 Nov 2012, at 13:57, Victor Lazzarini wrote:
>
>> You forgot the &:
>>
>> &temp
>>
>>
>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>
>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>> anyway, taking out the memory allocation seemed to have solved the
>>> problem. So continuing backwards to the original problem I find the
>>> following updated code(using the Csound class) still causes the
>>> segfault?
>>>
>>> MYFLT* temp;
>>> int tableSize = csound->GetTable(temp, 1);
>>> for(int i=0;i>> temp[i] = 0;
>>> }
>>>
>>> I'm happy to use the C interface. No problems there. I still need to
>>> mess around with this a while, I have a feeling the problem might rear
>>> its head again.
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 15:01
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
No need for the ampersand when using the Csound::GetTable() method.
That's a fair point about performKsmps() being called at the same
time. It's constantly going in the background. In fact I put in that
loop just to check the validity of the table data, but obviously I
won't be doing anything like that for real, and if I do overwrite a
table it will be done between calls to performKsmps. Thanks.

On 28 November 2012 13:57, Victor Lazzarini  wrote:
> You forgot the &:
>
> &temp
>
>
> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>
>> Thanks Victor. That arbitrary value was in fact the table length. But
>> anyway, taking out the memory allocation seemed to have solved the
>> problem. So continuing backwards to the original problem I find the
>> following updated code(using the Csound class) still causes the
>> segfault?
>>
>> MYFLT* temp;
>> int tableSize = csound->GetTable(temp, 1);
>> for(int i=0;i> temp[i] = 0;
>> }
>>
>> I'm happy to use the C interface. No problems there. I still need to
>> mess around with this a while, I have a feeling the problem might rear
>> its head again.
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 15:11
FromSteven Yi
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Hm, I would imagine the ampersand would be required, because it
assigns the address to the pointer pointing to an address, rather than
just the pointer itself.  If I'm reading it right, you're passing in a
pointer to a MYFLT, but the method takes a pointer to a pointer to a
MYFLT, yeah?

On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
> No need for the ampersand when using the Csound::GetTable() method.
> That's a fair point about performKsmps() being called at the same
> time. It's constantly going in the background. In fact I put in that
> loop just to check the validity of the table data, but obviously I
> won't be doing anything like that for real, and if I do overwrite a
> table it will be done between calls to performKsmps. Thanks.
>
> On 28 November 2012 13:57, Victor Lazzarini  wrote:
>> You forgot the &:
>>
>> &temp
>>
>>
>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>
>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>> anyway, taking out the memory allocation seemed to have solved the
>>> problem. So continuing backwards to the original problem I find the
>>> following updated code(using the Csound class) still causes the
>>> segfault?
>>>
>>> MYFLT* temp;
>>> int tableSize = csound->GetTable(temp, 1);
>>> for(int i=0;i>> temp[i] = 0;
>>> }
>>>
>>> I'm happy to use the C interface. No problems there. I still need to
>>> mess around with this a while, I have a feeling the problem might rear
>>> its head again.
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 15:26
FromMichael Gogins
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
It's not a pointer to a pointer, it's a reference to a pointer. If you
have a table pointer, you pass that in without the ampersand, and the
new value of the pointer is returned in the pointer by reference. It
acts like a pointer to a pointer, but the variable passed is just a
pointer, not the address of a pointer.

I'm talking about the C++ function here, not the C function.

On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
> Hm, I would imagine the ampersand would be required, because it
> assigns the address to the pointer pointing to an address, rather than
> just the pointer itself.  If I'm reading it right, you're passing in a
> pointer to a MYFLT, but the method takes a pointer to a pointer to a
> MYFLT, yeah?
>
> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>> No need for the ampersand when using the Csound::GetTable() method.
>> That's a fair point about performKsmps() being called at the same
>> time. It's constantly going in the background. In fact I put in that
>> loop just to check the validity of the table data, but obviously I
>> won't be doing anything like that for real, and if I do overwrite a
>> table it will be done between calls to performKsmps. Thanks.
>>
>> On 28 November 2012 13:57, Victor Lazzarini  wrote:
>>> You forgot the &:
>>>
>>> &temp
>>>
>>>
>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>
>>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>>> anyway, taking out the memory allocation seemed to have solved the
>>>> problem. So continuing backwards to the original problem I find the
>>>> following updated code(using the Csound class) still causes the
>>>> segfault?
>>>>
>>>> MYFLT* temp;
>>>> int tableSize = csound->GetTable(temp, 1);
>>>> for(int i=0;i>>> temp[i] = 0;
>>>> }
>>>>
>>>> I'm happy to use the C interface. No problems there. I still need to
>>>> mess around with this a while, I have a feeling the problem might rear
>>>> its head again.
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> Dr Victor Lazzarini
>>> Senior Lecturer
>>> Dept. of Music
>>> NUI Maynooth Ireland
>>> tel.: +353 1 708 3545
>>> Victor dot Lazzarini AT nuim dot ie
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 15:45
FromSteven Yi
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
syntax in C++, got some cognitive dissonance with my C understanding.
:)

On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
 wrote:
> It's not a pointer to a pointer, it's a reference to a pointer. If you
> have a table pointer, you pass that in without the ampersand, and the
> new value of the pointer is returned in the pointer by reference. It
> acts like a pointer to a pointer, but the variable passed is just a
> pointer, not the address of a pointer.
>
> I'm talking about the C++ function here, not the C function.
>
> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>> Hm, I would imagine the ampersand would be required, because it
>> assigns the address to the pointer pointing to an address, rather than
>> just the pointer itself.  If I'm reading it right, you're passing in a
>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>> MYFLT, yeah?
>>
>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>> No need for the ampersand when using the Csound::GetTable() method.
>>> That's a fair point about performKsmps() being called at the same
>>> time. It's constantly going in the background. In fact I put in that
>>> loop just to check the validity of the table data, but obviously I
>>> won't be doing anything like that for real, and if I do overwrite a
>>> table it will be done between calls to performKsmps. Thanks.
>>>
>>> On 28 November 2012 13:57, Victor Lazzarini  wrote:
>>>> You forgot the &:
>>>>
>>>> &temp
>>>>
>>>>
>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>
>>>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>> problem. So continuing backwards to the original problem I find the
>>>>> following updated code(using the Csound class) still causes the
>>>>> segfault?
>>>>>
>>>>> MYFLT* temp;
>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>> for(int i=0;i>>>> temp[i] = 0;
>>>>> }
>>>>>
>>>>> I'm happy to use the C interface. No problems there. I still need to
>>>>> mess around with this a while, I have a feeling the problem might rear
>>>>> its head again.
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> Dr Victor Lazzarini
>>>> Senior Lecturer
>>>> Dept. of Music
>>>> NUI Maynooth Ireland
>>>> tel.: +353 1 708 3545
>>>> Victor dot Lazzarini AT nuim dot ie
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> --
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 17:24
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
It seems there is something else at play here as that problem keeps
returning intermittently. I guess I should employ the
csoundYieldCallback() function but I'm not quite sure how to? Anyone
have any example code? Am I right in saying that this callback is
triggered only when Csound is ready to update internal stuff? Meaning
that there would be a slight time difference between when a user hits
say an update table button, and when that actually happens? Or is this
callback being triggered like the clappers constantly throughout the
performance?



On 28 November 2012 15:45, Steven Yi  wrote:
> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
> syntax in C++, got some cognitive dissonance with my C understanding.
> :)
>
> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>  wrote:
>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>> have a table pointer, you pass that in without the ampersand, and the
>> new value of the pointer is returned in the pointer by reference. It
>> acts like a pointer to a pointer, but the variable passed is just a
>> pointer, not the address of a pointer.
>>
>> I'm talking about the C++ function here, not the C function.
>>
>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>> Hm, I would imagine the ampersand would be required, because it
>>> assigns the address to the pointer pointing to an address, rather than
>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>> MYFLT, yeah?
>>>
>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>> That's a fair point about performKsmps() being called at the same
>>>> time. It's constantly going in the background. In fact I put in that
>>>> loop just to check the validity of the table data, but obviously I
>>>> won't be doing anything like that for real, and if I do overwrite a
>>>> table it will be done between calls to performKsmps. Thanks.
>>>>
>>>> On 28 November 2012 13:57, Victor Lazzarini  wrote:
>>>>> You forgot the &:
>>>>>
>>>>> &temp
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>
>>>>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>> following updated code(using the Csound class) still causes the
>>>>>> segfault?
>>>>>>
>>>>>> MYFLT* temp;
>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>> for(int i=0;i>>>>> temp[i] = 0;
>>>>>> }
>>>>>>
>>>>>> I'm happy to use the C interface. No problems there. I still need to
>>>>>> mess around with this a while, I have a feeling the problem might rear
>>>>>> its head again.
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> Dr Victor Lazzarini
>>>>> Senior Lecturer
>>>>> Dept. of Music
>>>>> NUI Maynooth Ireland
>>>>> tel.: +353 1 708 3545
>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 17:28
FromJustin Smith
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
AttachmentsNone  None  
IIRC the function passed as a callback will be called between k cycles. If your k rate is not weirdly high, the lag should not be a major issue.


On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh <rorywalsh@ear.ie> wrote:
It seems there is something else at play here as that problem keeps
returning intermittently. I guess I should employ the
csoundYieldCallback() function but I'm not quite sure how to? Anyone
have any example code? Am I right in saying that this callback is
triggered only when Csound is ready to update internal stuff? Meaning
that there would be a slight time difference between when a user hits
say an update table button, and when that actually happens? Or is this
callback being triggered like the clappers constantly throughout the
performance?



On 28 November 2012 15:45, Steven Yi <stevenyi@gmail.com> wrote:
> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
> syntax in C++, got some cognitive dissonance with my C understanding.
> :)
>
> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
> <michael.gogins@gmail.com> wrote:
>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>> have a table pointer, you pass that in without the ampersand, and the
>> new value of the pointer is returned in the pointer by reference. It
>> acts like a pointer to a pointer, but the variable passed is just a
>> pointer, not the address of a pointer.
>>
>> I'm talking about the C++ function here, not the C function.
>>
>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi <stevenyi@gmail.com> wrote:
>>> Hm, I would imagine the ampersand would be required, because it
>>> assigns the address to the pointer pointing to an address, rather than
>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>> MYFLT, yeah?
>>>
>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>> That's a fair point about performKsmps() being called at the same
>>>> time. It's constantly going in the background. In fact I put in that
>>>> loop just to check the validity of the table data, but obviously I
>>>> won't be doing anything like that for real, and if I do overwrite a
>>>> table it will be done between calls to performKsmps. Thanks.
>>>>
>>>> On 28 November 2012 13:57, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>> You forgot the &:
>>>>>
>>>>> &temp
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>
>>>>>> Thanks Victor. That arbitrary value was in fact the table length. But
>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>> following updated code(using the Csound class) still causes the
>>>>>> segfault?
>>>>>>
>>>>>> MYFLT* temp;
>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>> for(int i=0;i<tableSize;i++){
>>>>>> temp[i] = 0;
>>>>>> }
>>>>>>
>>>>>> I'm happy to use the C interface. No problems there. I still need to
>>>>>> mess around with this a while, I have a feeling the problem might rear
>>>>>> its head again.
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> Dr Victor Lazzarini
>>>>> Senior Lecturer
>>>>> Dept. of Music
>>>>> NUI Maynooth Ireland
>>>>> tel.: +353 1 708 3545
>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-11-28 17:37
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Yeah sorry Victor, this is why I'm now asking about
csoundYieldCallback(), I missed it the first time. I'm not using the
performance thread
class so I'll just it directly. After some more tests I can confirm
that the crashes are exactly for the reason you outlined!



On 28 November 2012 05:41, Victor Lazzarini  wrote:
> exactly
>
> VL
>
>
> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>
> IIRC the function passed as a callback will be called between k cycles. If
> your k rate is not weirdly high, the lag should not be a major issue.
>
>
> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>
>> It seems there is something else at play here as that problem keeps
>> returning intermittently. I guess I should employ the
>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>> have any example code? Am I right in saying that this callback is
>> triggered only when Csound is ready to update internal stuff? Meaning
>> that there would be a slight time difference between when a user hits
>> say an update table button, and when that actually happens? Or is this
>> callback being triggered like the clappers constantly throughout the
>> performance?
>>
>>
>>
>> On 28 November 2012 15:45, Steven Yi  wrote:
>> > Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>> > syntax in C++, got some cognitive dissonance with my C understanding.
>> > :)
>> >
>> > On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>> >  wrote:
>> >> It's not a pointer to a pointer, it's a reference to a pointer. If you
>> >> have a table pointer, you pass that in without the ampersand, and the
>> >> new value of the pointer is returned in the pointer by reference. It
>> >> acts like a pointer to a pointer, but the variable passed is just a
>> >> pointer, not the address of a pointer.
>> >>
>> >> I'm talking about the C++ function here, not the C function.
>> >>
>> >> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>> >>> Hm, I would imagine the ampersand would be required, because it
>> >>> assigns the address to the pointer pointing to an address, rather than
>> >>> just the pointer itself.  If I'm reading it right, you're passing in a
>> >>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>> >>> MYFLT, yeah?
>> >>>
>> >>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>> >>>> No need for the ampersand when using the Csound::GetTable() method.
>> >>>> That's a fair point about performKsmps() being called at the same
>> >>>> time. It's constantly going in the background. In fact I put in that
>> >>>> loop just to check the validity of the table data, but obviously I
>> >>>> won't be doing anything like that for real, and if I do overwrite a
>> >>>> table it will be done between calls to performKsmps. Thanks.
>> >>>>
>> >>>> On 28 November 2012 13:57, Victor Lazzarini
>> >>>>  wrote:
>> >>>>> You forgot the &:
>> >>>>>
>> >>>>> &temp
>> >>>>>
>> >>>>>
>> >>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>> >>>>>
>> >>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>> >>>>>> But
>> >>>>>> anyway, taking out the memory allocation seemed to have solved the
>> >>>>>> problem. So continuing backwards to the original problem I find the
>> >>>>>> following updated code(using the Csound class) still causes the
>> >>>>>> segfault?
>> >>>>>>
>> >>>>>> MYFLT* temp;
>> >>>>>> int tableSize = csound->GetTable(temp, 1);
>> >>>>>> for(int i=0;i> >>>>>> temp[i] = 0;
>> >>>>>> }
>> >>>>>>
>> >>>>>> I'm happy to use the C interface. No problems there. I still need
>> >>>>>> to
>> >>>>>> mess around with this a while, I have a feeling the problem might
>> >>>>>> rear
>> >>>>>> its head again.
>> >>>>>>
>> >>>>>>
>> >>>>>> ------------------------------------------------------------------------------
>> >>>>>> Keep yourself connected to Go Parallel:
>> >>>>>> INSIGHTS What's next for parallel hardware, programming and related
>> >>>>>> areas?
>> >>>>>> Interviews and blogs by thought leaders keep you ahead of the
>> >>>>>> curve.
>> >>>>>> http://goparallel.sourceforge.net
>> >>>>>> _______________________________________________
>> >>>>>> Csound-devel mailing list
>> >>>>>> Csound-devel@lists.sourceforge.net
>> >>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>>>>
>> >>>>> Dr Victor Lazzarini
>> >>>>> Senior Lecturer
>> >>>>> Dept. of Music
>> >>>>> NUI Maynooth Ireland
>> >>>>> tel.: +353 1 708 3545
>> >>>>> Victor dot Lazzarini AT nuim dot ie
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> ------------------------------------------------------------------------------
>> >>>>> Keep yourself connected to Go Parallel:
>> >>>>> INSIGHTS What's next for parallel hardware, programming and related
>> >>>>> areas?
>> >>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> >>>>> http://goparallel.sourceforge.net
>> >>>>> _______________________________________________
>> >>>>> Csound-devel mailing list
>> >>>>> Csound-devel@lists.sourceforge.net
>> >>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>>>
>> >>>>
>> >>>> ------------------------------------------------------------------------------
>> >>>> Keep yourself connected to Go Parallel:
>> >>>> INSIGHTS What's next for parallel hardware, programming and related
>> >>>> areas?
>> >>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> >>>> http://goparallel.sourceforge.net
>> >>>> _______________________________________________
>> >>>> Csound-devel mailing list
>> >>>> Csound-devel@lists.sourceforge.net
>> >>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>>
>> >>>
>> >>> ------------------------------------------------------------------------------
>> >>> Keep yourself connected to Go Parallel:
>> >>> INSIGHTS What's next for parallel hardware, programming and related
>> >>> areas?
>> >>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> >>> http://goparallel.sourceforge.net
>> >>> _______________________________________________
>> >>> Csound-devel mailing list
>> >>> Csound-devel@lists.sourceforge.net
>> >>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>
>> >>
>> >>
>> >> --
>> >> Michael Gogins
>> >> Irreducible Productions
>> >> http://www.michael-gogins.com
>> >> Michael dot Gogins at gmail dot com
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Keep yourself connected to Go Parallel:
>> >> INSIGHTS What's next for parallel hardware, programming and related
>> >> areas?
>> >> Interviews and blogs by thought leaders keep you ahead of the curve.
>> >> http://goparallel.sourceforge.net
>> >> _______________________________________________
>> >> Csound-devel mailing list
>> >> Csound-devel@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Keep yourself connected to Go Parallel:
>> > INSIGHTS What's next for parallel hardware, programming and related
>> > areas?
>> > Interviews and blogs by thought leaders keep you ahead of the curve.
>> > http://goparallel.sourceforge.net
>> > _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
>
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 17:44
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Yeah, think I got it now. There's no reason to place calls to the
chanset functions in there though is there?


On 28 November 2012 05:49, Victor Lazzarini  wrote:
> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>
> VL
>
>
> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>
>> Yeah sorry Victor, this is why I'm now asking about
>> csoundYieldCallback(), I missed it the first time. I'm not using the
>> performance thread
>> class so I'll just it directly. After some more tests I can confirm
>> that the crashes are exactly for the reason you outlined!
>>
>>
>>
>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>> exactly
>>>
>>> VL
>>>
>>>
>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>
>>> IIRC the function passed as a callback will be called between k cycles. If
>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>
>>>
>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>
>>>> It seems there is something else at play here as that problem keeps
>>>> returning intermittently. I guess I should employ the
>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>> have any example code? Am I right in saying that this callback is
>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>> that there would be a slight time difference between when a user hits
>>>> say an update table button, and when that actually happens? Or is this
>>>> callback being triggered like the clappers constantly throughout the
>>>> performance?
>>>>
>>>>
>>>>
>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>> :)
>>>>>
>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>  wrote:
>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>> pointer, not the address of a pointer.
>>>>>>
>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>
>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>> MYFLT, yeah?
>>>>>>>
>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>
>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>  wrote:
>>>>>>>>> You forgot the &:
>>>>>>>>>
>>>>>>>>> &temp
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>
>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>> But
>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>> segfault?
>>>>>>>>>>
>>>>>>>>>> MYFLT* temp;
>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>> for(int i=0;i>>>>>>>>> temp[i] = 0;
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>> to
>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>> rear
>>>>>>>>>> its head again.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>> curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>> Senior Lecturer
>>>>>>>>> Dept. of Music
>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>> areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>> areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Michael Gogins
>>>>>> Irreducible Productions
>>>>>> http://www.michael-gogins.com
>>>>>> Michael dot Gogins at gmail dot com
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>> areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>> areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>>
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 18:30
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Great. Should I also be looking at using Mutex locks?



On 28 November 2012 06:23, Victor Lazzarini  wrote:
> yes there is. They are not thread safe too, although they seem generally trouble free.
>
> VL
>
>
> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>
>> Yeah, think I got it now. There's no reason to place calls to the
>> chanset functions in there though is there?
>>
>>
>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>
>>> VL
>>>
>>>
>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>
>>>> Yeah sorry Victor, this is why I'm now asking about
>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>> performance thread
>>>> class so I'll just it directly. After some more tests I can confirm
>>>> that the crashes are exactly for the reason you outlined!
>>>>
>>>>
>>>>
>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>> exactly
>>>>>
>>>>> VL
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>
>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>
>>>>>
>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>
>>>>>> It seems there is something else at play here as that problem keeps
>>>>>> returning intermittently. I guess I should employ the
>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>> have any example code? Am I right in saying that this callback is
>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>> that there would be a slight time difference between when a user hits
>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>> performance?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>> :)
>>>>>>>
>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>  wrote:
>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>
>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>
>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>> MYFLT, yeah?
>>>>>>>>>
>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>
>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>  wrote:
>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>
>>>>>>>>>>> &temp
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>> But
>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>> segfault?
>>>>>>>>>>>>
>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>> to
>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>> rear
>>>>>>>>>>>> its head again.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>> curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>> Dept. of Music
>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Michael Gogins
>>>>>>>> Irreducible Productions
>>>>>>>> http://www.michael-gogins.com
>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>> areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>> areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>>
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 18:35
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Actually, I might be slightly confused about mutex locks! I'm just
looking for a way to avoid stacking up a list of events that need to
take place when it's safe to do so? Can I use some kind of mechanism
whereby I can hold my code from executing until Csound is ready? I'm
sure there is a standard approach to this issue, or am I making any
sense here at all? The idea of holding on to a number of slider events
until Csound is ready seems a little excessive?



On 28 November 2012 18:30, Rory Walsh  wrote:
> Great. Should I also be looking at using Mutex locks?
>
>
>
> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>
>> VL
>>
>>
>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>
>>> Yeah, think I got it now. There's no reason to place calls to the
>>> chanset functions in there though is there?
>>>
>>>
>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>
>>>> VL
>>>>
>>>>
>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>
>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>> performance thread
>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>> that the crashes are exactly for the reason you outlined!
>>>>>
>>>>>
>>>>>
>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>> exactly
>>>>>>
>>>>>> VL
>>>>>>
>>>>>>
>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>
>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>
>>>>>>
>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>
>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>> returning intermittently. I guess I should employ the
>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>> performance?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>> :)
>>>>>>>>
>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>  wrote:
>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>
>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>
>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>
>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>
>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>  wrote:
>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>
>>>>>>>>>>>> &temp
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>> But
>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>
>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>> to
>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>> rear
>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>> curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Michael Gogins
>>>>>>>>> Irreducible Productions
>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>> areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>>
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 18:39
FromMichael Gogins
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Either use a queue that is threadsafe and a callback to pick up events
from the queue, or write your own performance loop and alternate
between performKsmps and handling events. If you have more than one
thread on your CPU, the first way is better.

Regards,
Mike

On Wed, Nov 28, 2012 at 1:35 PM, Rory Walsh  wrote:
> Actually, I might be slightly confused about mutex locks! I'm just
> looking for a way to avoid stacking up a list of events that need to
> take place when it's safe to do so? Can I use some kind of mechanism
> whereby I can hold my code from executing until Csound is ready? I'm
> sure there is a standard approach to this issue, or am I making any
> sense here at all? The idea of holding on to a number of slider events
> until Csound is ready seems a little excessive?
>
>
>
> On 28 November 2012 18:30, Rory Walsh  wrote:
>> Great. Should I also be looking at using Mutex locks?
>>
>>
>>
>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>>
>>> VL
>>>
>>>
>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>>
>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>> chanset functions in there though is there?
>>>>
>>>>
>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>>
>>>>> VL
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>>
>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>> performance thread
>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>> exactly
>>>>>>>
>>>>>>> VL
>>>>>>>
>>>>>>>
>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>>
>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>>
>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>> performance?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>> :)
>>>>>>>>>
>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>  wrote:
>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>>
>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>>
>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>>
>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>>
>>>>>>>>>>>>> &temp
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>> But
>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>> to
>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Michael Gogins
>>>>>>>>>> Irreducible Productions
>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>> areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 18:48
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Will do. Thanks. I might not have to do too much surgery after. I have
to say that I've never had a single problem with changing channel data
during a ksmps cycle. Thankfully.



On 28 November 2012 06:50, Victor Lazzarini  wrote:
> Not really because the control channels are only updated at ksmps boundaries, so there is no wait.
>
> If you can read Java code, check out how we do this in CsoundAndroid, using the valueCacheable mechanism.
> It is solving the same issue.
>
> VL
>
>
> On 28 Nov 2012, at 18:35, Rory Walsh  wrote:
>
>> Actually, I might be slightly confused about mutex locks! I'm just
>> looking for a way to avoid stacking up a list of events that need to
>> take place when it's safe to do so? Can I use some kind of mechanism
>> whereby I can hold my code from executing until Csound is ready? I'm
>> sure there is a standard approach to this issue, or am I making any
>> sense here at all? The idea of holding on to a number of slider events
>> until Csound is ready seems a little excessive?
>>
>>
>>
>> On 28 November 2012 18:30, Rory Walsh  wrote:
>>> Great. Should I also be looking at using Mutex locks?
>>>
>>>
>>>
>>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>>>
>>>> VL
>>>>
>>>>
>>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>>>
>>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>>> chanset functions in there though is there?
>>>>>
>>>>>
>>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>>>
>>>>>> VL
>>>>>>
>>>>>>
>>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>>>
>>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>>> performance thread
>>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>>> exactly
>>>>>>>>
>>>>>>>> VL
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>>>
>>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>>>
>>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>>> performance?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>>> :)
>>>>>>>>>>
>>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>>  wrote:
>>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>>>
>>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> &temp
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>>> But
>>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Michael Gogins
>>>>>>>>>>> Irreducible Productions
>>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>> areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-28 20:01
FromAndres Cabrera
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
I have heard these problems generally manifest when audience > 100 :)

Cheers,
Andrés

On Wed, Nov 28, 2012 at 10:48 AM, Rory Walsh  wrote:
> Will do. Thanks. I might not have to do too much surgery after. I have
> to say that I've never had a single problem with changing channel data
> during a ksmps cycle. Thankfully.
>
>
>
> On 28 November 2012 06:50, Victor Lazzarini  wrote:
>> Not really because the control channels are only updated at ksmps boundaries, so there is no wait.
>>
>> If you can read Java code, check out how we do this in CsoundAndroid, using the valueCacheable mechanism.
>> It is solving the same issue.
>>
>> VL
>>
>>
>> On 28 Nov 2012, at 18:35, Rory Walsh  wrote:
>>
>>> Actually, I might be slightly confused about mutex locks! I'm just
>>> looking for a way to avoid stacking up a list of events that need to
>>> take place when it's safe to do so? Can I use some kind of mechanism
>>> whereby I can hold my code from executing until Csound is ready? I'm
>>> sure there is a standard approach to this issue, or am I making any
>>> sense here at all? The idea of holding on to a number of slider events
>>> until Csound is ready seems a little excessive?
>>>
>>>
>>>
>>> On 28 November 2012 18:30, Rory Walsh  wrote:
>>>> Great. Should I also be looking at using Mutex locks?
>>>>
>>>>
>>>>
>>>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>>>>
>>>>> VL
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>>>>
>>>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>>>> chanset functions in there though is there?
>>>>>>
>>>>>>
>>>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>>>>
>>>>>>> VL
>>>>>>>
>>>>>>>
>>>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>>>>
>>>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>>>> performance thread
>>>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>>>> exactly
>>>>>>>>>
>>>>>>>>> VL
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>>>>
>>>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>>>>
>>>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>>>> performance?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>>>> :)
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>>>  wrote:
>>>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>>>>
>>>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> &temp
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>>>> But
>>>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Michael Gogins
>>>>>>>>>>>> Irreducible Productions
>>>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>> areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo

Date2012-11-28 20:47
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Good point! Luckily for me my audience numbers always come in short of 10!


On 28 November 2012 20:01, Andres Cabrera  wrote:
> I have heard these problems generally manifest when audience > 100 :)
>
> Cheers,
> Andrés
>
> On Wed, Nov 28, 2012 at 10:48 AM, Rory Walsh  wrote:
>> Will do. Thanks. I might not have to do too much surgery after. I have
>> to say that I've never had a single problem with changing channel data
>> during a ksmps cycle. Thankfully.
>>
>>
>>
>> On 28 November 2012 06:50, Victor Lazzarini  wrote:
>>> Not really because the control channels are only updated at ksmps boundaries, so there is no wait.
>>>
>>> If you can read Java code, check out how we do this in CsoundAndroid, using the valueCacheable mechanism.
>>> It is solving the same issue.
>>>
>>> VL
>>>
>>>
>>> On 28 Nov 2012, at 18:35, Rory Walsh  wrote:
>>>
>>>> Actually, I might be slightly confused about mutex locks! I'm just
>>>> looking for a way to avoid stacking up a list of events that need to
>>>> take place when it's safe to do so? Can I use some kind of mechanism
>>>> whereby I can hold my code from executing until Csound is ready? I'm
>>>> sure there is a standard approach to this issue, or am I making any
>>>> sense here at all? The idea of holding on to a number of slider events
>>>> until Csound is ready seems a little excessive?
>>>>
>>>>
>>>>
>>>> On 28 November 2012 18:30, Rory Walsh  wrote:
>>>>> Great. Should I also be looking at using Mutex locks?
>>>>>
>>>>>
>>>>>
>>>>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>>>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>>>>>
>>>>>> VL
>>>>>>
>>>>>>
>>>>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>>>>>
>>>>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>>>>> chanset functions in there though is there?
>>>>>>>
>>>>>>>
>>>>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>>>>>
>>>>>>>> VL
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>>>>>
>>>>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>>>>> performance thread
>>>>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>>>>> exactly
>>>>>>>>>>
>>>>>>>>>> VL
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>>>>>
>>>>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>>>>>
>>>>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>>>>> performance?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>>>>> :)
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> &temp
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>>>>> But
>>>>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Michael Gogins
>>>>>>>>>>>>> Irreducible Productions
>>>>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>> areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 21:46
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
I'm getting closer now, and things are starting to look up. Just two questions,

1) how do I remove the registered callback safely? I have a feeling
it's not being freed somehow which is causing crashes when I update an
instrument in Cabbage.

2) Can the code below potentially crash Csound? Instrument 1000 is
always on, while instr 1 is being triggered by a keyboard. Instrument
1 is reading ft1, which instrument 1000 can change at any time
depending on the user. Am I right to assume that in this case one
should reorder the instrument numbers so that the table is fully
written before it's read? Or does it matter?

instr 1
knv oscil 5000, 1, 1
asig vco2 p5/4, p4
aflt lpf18 asig, abs(kenv), .5, 0
outs aflt, aflt
endin

instr 1000
katt chnget "att"
kdec chnget "dec"
ksus chnget "sus"
krel chnget "rel"
kchanged changed katt+kdec+ksus+krel
if(kchanged==1) then						;x  y  x                y  x
             y     x     y        x                   y
event "f", 1, 0, 1024, 27,   0, 0, int(katt*(256)), 1,
int(katt*(256))+int(kdec*256), ksus, 1024-int(krel*256), ksus,
1024-int(krel*256)+int(krel*256), 0
endif
endin


On 28 November 2012 20:47, Rory Walsh  wrote:
> Good point! Luckily for me my audience numbers always come in short of 10!
>
>
> On 28 November 2012 20:01, Andres Cabrera  wrote:
>> I have heard these problems generally manifest when audience > 100 :)
>>
>> Cheers,
>> Andrés
>>
>> On Wed, Nov 28, 2012 at 10:48 AM, Rory Walsh  wrote:
>>> Will do. Thanks. I might not have to do too much surgery after. I have
>>> to say that I've never had a single problem with changing channel data
>>> during a ksmps cycle. Thankfully.
>>>
>>>
>>>
>>> On 28 November 2012 06:50, Victor Lazzarini  wrote:
>>>> Not really because the control channels are only updated at ksmps boundaries, so there is no wait.
>>>>
>>>> If you can read Java code, check out how we do this in CsoundAndroid, using the valueCacheable mechanism.
>>>> It is solving the same issue.
>>>>
>>>> VL
>>>>
>>>>
>>>> On 28 Nov 2012, at 18:35, Rory Walsh  wrote:
>>>>
>>>>> Actually, I might be slightly confused about mutex locks! I'm just
>>>>> looking for a way to avoid stacking up a list of events that need to
>>>>> take place when it's safe to do so? Can I use some kind of mechanism
>>>>> whereby I can hold my code from executing until Csound is ready? I'm
>>>>> sure there is a standard approach to this issue, or am I making any
>>>>> sense here at all? The idea of holding on to a number of slider events
>>>>> until Csound is ready seems a little excessive?
>>>>>
>>>>>
>>>>>
>>>>> On 28 November 2012 18:30, Rory Walsh  wrote:
>>>>>> Great. Should I also be looking at using Mutex locks?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>>>>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>>>>>>
>>>>>>> VL
>>>>>>>
>>>>>>>
>>>>>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>>>>>>
>>>>>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>>>>>> chanset functions in there though is there?
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>>>>>>
>>>>>>>>> VL
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>>>>>>
>>>>>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>>>>>> performance thread
>>>>>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>>>>>> exactly
>>>>>>>>>>>
>>>>>>>>>>> VL
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>>>>>>
>>>>>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>>>>>> performance?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>>>>>> :)
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> &temp
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>>>>>> But
>>>>>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>> Michael Gogins
>>>>>>>>>>>>>> Irreducible Productions
>>>>>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>> areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>> http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 22:13
FromMichael Gogins
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Order matters.

Mike

On Thu, Nov 29, 2012 at 4:46 PM, Rory Walsh  wrote:
> I'm getting closer now, and things are starting to look up. Just two questions,
>
> 1) how do I remove the registered callback safely? I have a feeling
> it's not being freed somehow which is causing crashes when I update an
> instrument in Cabbage.
>
> 2) Can the code below potentially crash Csound? Instrument 1000 is
> always on, while instr 1 is being triggered by a keyboard. Instrument
> 1 is reading ft1, which instrument 1000 can change at any time
> depending on the user. Am I right to assume that in this case one
> should reorder the instrument numbers so that the table is fully
> written before it's read? Or does it matter?
>
> instr 1
> knv oscil 5000, 1, 1
> asig vco2 p5/4, p4
> aflt lpf18 asig, abs(kenv), .5, 0
> outs aflt, aflt
> endin
>
> instr 1000
> katt chnget "att"
> kdec chnget "dec"
> ksus chnget "sus"
> krel chnget "rel"
> kchanged changed katt+kdec+ksus+krel
> if(kchanged==1) then                                            ;x  y  x                y  x
>              y     x     y        x                   y
> event "f", 1, 0, 1024, 27,   0, 0, int(katt*(256)), 1,
> int(katt*(256))+int(kdec*256), ksus, 1024-int(krel*256), ksus,
> 1024-int(krel*256)+int(krel*256), 0
> endif
> endin
>
>
> On 28 November 2012 20:47, Rory Walsh  wrote:
>> Good point! Luckily for me my audience numbers always come in short of 10!
>>
>>
>> On 28 November 2012 20:01, Andres Cabrera  wrote:
>>> I have heard these problems generally manifest when audience > 100 :)
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On Wed, Nov 28, 2012 at 10:48 AM, Rory Walsh  wrote:
>>>> Will do. Thanks. I might not have to do too much surgery after. I have
>>>> to say that I've never had a single problem with changing channel data
>>>> during a ksmps cycle. Thankfully.
>>>>
>>>>
>>>>
>>>> On 28 November 2012 06:50, Victor Lazzarini  wrote:
>>>>> Not really because the control channels are only updated at ksmps boundaries, so there is no wait.
>>>>>
>>>>> If you can read Java code, check out how we do this in CsoundAndroid, using the valueCacheable mechanism.
>>>>> It is solving the same issue.
>>>>>
>>>>> VL
>>>>>
>>>>>
>>>>> On 28 Nov 2012, at 18:35, Rory Walsh  wrote:
>>>>>
>>>>>> Actually, I might be slightly confused about mutex locks! I'm just
>>>>>> looking for a way to avoid stacking up a list of events that need to
>>>>>> take place when it's safe to do so? Can I use some kind of mechanism
>>>>>> whereby I can hold my code from executing until Csound is ready? I'm
>>>>>> sure there is a standard approach to this issue, or am I making any
>>>>>> sense here at all? The idea of holding on to a number of slider events
>>>>>> until Csound is ready seems a little excessive?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 28 November 2012 18:30, Rory Walsh  wrote:
>>>>>>> Great. Should I also be looking at using Mutex locks?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 28 November 2012 06:23, Victor Lazzarini  wrote:
>>>>>>>> yes there is. They are not thread safe too, although they seem generally trouble free.
>>>>>>>>
>>>>>>>> VL
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 Nov 2012, at 17:44, Rory Walsh  wrote:
>>>>>>>>
>>>>>>>>> Yeah, think I got it now. There's no reason to place calls to the
>>>>>>>>> chanset functions in there though is there?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28 November 2012 05:49, Victor Lazzarini  wrote:
>>>>>>>>>> Just code the callback and then register it with Csound. It will be called after each performKsmps.
>>>>>>>>>>
>>>>>>>>>> VL
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 28 Nov 2012, at 17:37, Rory Walsh  wrote:
>>>>>>>>>>
>>>>>>>>>>> Yeah sorry Victor, this is why I'm now asking about
>>>>>>>>>>> csoundYieldCallback(), I missed it the first time. I'm not using the
>>>>>>>>>>> performance thread
>>>>>>>>>>> class so I'll just it directly. After some more tests I can confirm
>>>>>>>>>>> that the crashes are exactly for the reason you outlined!
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 28 November 2012 05:41, Victor Lazzarini  wrote:
>>>>>>>>>>>> exactly
>>>>>>>>>>>>
>>>>>>>>>>>> VL
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 28 Nov 2012, at 17:28, Justin Smith  wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> IIRC the function passed as a callback will be called between k cycles. If
>>>>>>>>>>>> your k rate is not weirdly high, the lag should not be a major issue.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Nov 28, 2012 at 9:24 AM, Rory Walsh  wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> It seems there is something else at play here as that problem keeps
>>>>>>>>>>>>> returning intermittently. I guess I should employ the
>>>>>>>>>>>>> csoundYieldCallback() function but I'm not quite sure how to? Anyone
>>>>>>>>>>>>> have any example code? Am I right in saying that this callback is
>>>>>>>>>>>>> triggered only when Csound is ready to update internal stuff? Meaning
>>>>>>>>>>>>> that there would be a slight time difference between when a user hits
>>>>>>>>>>>>> say an update table button, and when that actually happens? Or is this
>>>>>>>>>>>>> callback being triggered like the clappers constantly throughout the
>>>>>>>>>>>>> performance?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 28 November 2012 15:45, Steven Yi  wrote:
>>>>>>>>>>>>>> Ah, I think I get it now.  I wasn't familiar with ref-to-pointer
>>>>>>>>>>>>>> syntax in C++, got some cognitive dissonance with my C understanding.
>>>>>>>>>>>>>> :)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:26 PM, Michael Gogins
>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>> It's not a pointer to a pointer, it's a reference to a pointer. If you
>>>>>>>>>>>>>>> have a table pointer, you pass that in without the ampersand, and the
>>>>>>>>>>>>>>> new value of the pointer is returned in the pointer by reference. It
>>>>>>>>>>>>>>> acts like a pointer to a pointer, but the variable passed is just a
>>>>>>>>>>>>>>> pointer, not the address of a pointer.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I'm talking about the C++ function here, not the C function.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 10:11 AM, Steven Yi  wrote:
>>>>>>>>>>>>>>>> Hm, I would imagine the ampersand would be required, because it
>>>>>>>>>>>>>>>> assigns the address to the pointer pointing to an address, rather than
>>>>>>>>>>>>>>>> just the pointer itself.  If I'm reading it right, you're passing in a
>>>>>>>>>>>>>>>> pointer to a MYFLT, but the method takes a pointer to a pointer to a
>>>>>>>>>>>>>>>> MYFLT, yeah?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Wed, Nov 28, 2012 at 3:01 PM, Rory Walsh  wrote:
>>>>>>>>>>>>>>>>> No need for the ampersand when using the Csound::GetTable() method.
>>>>>>>>>>>>>>>>> That's a fair point about performKsmps() being called at the same
>>>>>>>>>>>>>>>>> time. It's constantly going in the background. In fact I put in that
>>>>>>>>>>>>>>>>> loop just to check the validity of the table data, but obviously I
>>>>>>>>>>>>>>>>> won't be doing anything like that for real, and if I do overwrite a
>>>>>>>>>>>>>>>>> table it will be done between calls to performKsmps. Thanks.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 28 November 2012 13:57, Victor Lazzarini
>>>>>>>>>>>>>>>>>  wrote:
>>>>>>>>>>>>>>>>>> You forgot the &:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> &temp
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On 28 Nov 2012, at 13:51, Rory Walsh wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Thanks Victor. That arbitrary value was in fact the table length.
>>>>>>>>>>>>>>>>>>> But
>>>>>>>>>>>>>>>>>>> anyway, taking out the memory allocation seemed to have solved the
>>>>>>>>>>>>>>>>>>> problem. So continuing backwards to the original problem I find the
>>>>>>>>>>>>>>>>>>> following updated code(using the Csound class) still causes the
>>>>>>>>>>>>>>>>>>> segfault?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> MYFLT* temp;
>>>>>>>>>>>>>>>>>>> int tableSize = csound->GetTable(temp, 1);
>>>>>>>>>>>>>>>>>>> for(int i=0;i>>>>>>>>>>>>>>>>>> temp[i] = 0;
>>>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> I'm happy to use the C interface. No problems there. I still need
>>>>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>>>>> mess around with this a while, I have a feeling the problem might
>>>>>>>>>>>>>>>>>>> rear
>>>>>>>>>>>>>>>>>>> its head again.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the
>>>>>>>>>>>>>>>>>>> curve.
>>>>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Dr Victor Lazzarini
>>>>>>>>>>>>>>>>>> Senior Lecturer
>>>>>>>>>>>>>>>>>> Dept. of Music
>>>>>>>>>>>>>>>>>> NUI Maynooth Ireland
>>>>>>>>>>>>>>>>>> tel.: +353 1 708 3545
>>>>>>>>>>>>>>>>>> Victor dot Lazzarini AT nuim dot ie
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> Michael Gogins
>>>>>>>>>>>>>>> Irreducible Productions
>>>>>>>>>>>>>>> http://www.michael-gogins.com
>>>>>>>>>>>>>>> Michael dot Gogins at gmail dot com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related
>>>>>>>>>>>>>> areas?
>>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>>>> http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>>> http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> INSIGHTS What's next for parallel hardware, programming and related areas?
>>> Interviews and blogs by thought leaders keep you ahead of the curve.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 22:31
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
There still something strange happening when delete and recreate a
Csound object. With no yieldCallback everything works fine, but as
soon as I add one I get a crash when I try to quickly delete and
recreate a Csound object. Is the yieldCallback a red herring? It's a
tricky one to catch in the debugger.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 22:40
FromJustin Smith
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
AttachmentsNone  None  
my guess is the callback tries to use a resource that is tied to that instrument

remember the callback will be called repeatedly, one time actions should be grabbed out of a queue by the callback


On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
There still something strange happening when delete and recreate a
Csound object. With no yieldCallback everything works fine, but as
soon as I add one I get a crash when I try to quickly delete and
recreate a Csound object. Is the yieldCallback a red herring? It's a
tricky one to catch in the debugger.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
VERIFY Test and improve your parallel project with help from experts
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-11-29 22:52
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Does deleting Csound remove the callback set with
csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
function but I do see functions for removing other callbacks?

On 29 November 2012 22:40, Justin Smith  wrote:
> my guess is the callback tries to use a resource that is tied to that
> instrument
>
> remember the callback will be called repeatedly, one time actions should be
> grabbed out of a queue by the callback
>
>
> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>>
>> There still something strange happening when delete and recreate a
>> Csound object. With no yieldCallback everything works fine, but as
>> soon as I add one I get a crash when I try to quickly delete and
>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>> tricky one to catch in the debugger.
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> VERIFY Test and improve your parallel project with help from experts
>> and peers. http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 22:54
FromJustin Smith
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
AttachmentsNone  None  
I think you can just set the callback to a no-op


On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
Does deleting Csound remove the callback set with
csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
function but I do see functions for removing other callbacks?

On 29 November 2012 22:40, Justin Smith <noisesmith@gmail.com> wrote:
> my guess is the callback tries to use a resource that is tied to that
> instrument
>
> remember the callback will be called repeatedly, one time actions should be
> grabbed out of a queue by the callback
>
>
> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
>>
>> There still something strange happening when delete and recreate a
>> Csound object. With no yieldCallback everything works fine, but as
>> soon as I add one I get a crash when I try to quickly delete and
>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>> tricky one to catch in the debugger.
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> VERIFY Test and improve your parallel project with help from experts
>> and peers. http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
VERIFY Test and improve your parallel project with help from experts
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-11-29 22:59
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
Thanks Justin, could you explain to me how that works? My grasp of
computer speak is pretty weak!  Do you mean do something like this:

csound->SetYieldCallback(nullptr);

I gave that a whirl earlier but it caused other issues.


On 29 November 2012 22:54, Justin Smith  wrote:
> I think you can just set the callback to a no-op
>
>
> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>>
>> Does deleting Csound remove the callback set with
>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>> function but I do see functions for removing other callbacks?
>>
>> On 29 November 2012 22:40, Justin Smith  wrote:
>> > my guess is the callback tries to use a resource that is tied to that
>> > instrument
>> >
>> > remember the callback will be called repeatedly, one time actions should
>> > be
>> > grabbed out of a queue by the callback
>> >
>> >
>> > On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>> >>
>> >> There still something strange happening when delete and recreate a
>> >> Csound object. With no yieldCallback everything works fine, but as
>> >> soon as I add one I get a crash when I try to quickly delete and
>> >> recreate a Csound object. Is the yieldCallback a red herring? It's a
>> >> tricky one to catch in the debugger.
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Keep yourself connected to Go Parallel:
>> >> VERIFY Test and improve your parallel project with help from experts
>> >> and peers. http://goparallel.sourceforge.net
>> >> _______________________________________________
>> >> Csound-devel mailing list
>> >> Csound-devel@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Keep yourself connected to Go Parallel:
>> > VERIFY Test and improve your parallel project with help from experts
>> > and peers. http://goparallel.sourceforge.net
>> > _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> VERIFY Test and improve your parallel project with help from experts
>> and peers. http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-29 23:14
FromJustin Smith
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
AttachmentsNone  None  
something like:

void nullCallback() {} /* function that does nothing and returns nothing */

csound->SetYieldCallback(nullCallback);



On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
Thanks Justin, could you explain to me how that works? My grasp of
computer speak is pretty weak!  Do you mean do something like this:

csound->SetYieldCallback(nullptr);

I gave that a whirl earlier but it caused other issues.


On 29 November 2012 22:54, Justin Smith <noisesmith@gmail.com> wrote:
> I think you can just set the callback to a no-op
>
>
> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
>>
>> Does deleting Csound remove the callback set with
>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>> function but I do see functions for removing other callbacks?
>>
>> On 29 November 2012 22:40, Justin Smith <noisesmith@gmail.com> wrote:
>> > my guess is the callback tries to use a resource that is tied to that
>> > instrument
>> >
>> > remember the callback will be called repeatedly, one time actions should
>> > be
>> > grabbed out of a queue by the callback
>> >
>> >
>> > On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
>> >>
>> >> There still something strange happening when delete and recreate a
>> >> Csound object. With no yieldCallback everything works fine, but as
>> >> soon as I add one I get a crash when I try to quickly delete and
>> >> recreate a Csound object. Is the yieldCallback a red herring? It's a
>> >> tricky one to catch in the debugger.
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Keep yourself connected to Go Parallel:
>> >> VERIFY Test and improve your parallel project with help from experts
>> >> and peers. http://goparallel.sourceforge.net
>> >> _______________________________________________
>> >> Csound-devel mailing list
>> >> Csound-devel@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Keep yourself connected to Go Parallel:
>> > VERIFY Test and improve your parallel project with help from experts
>> > and peers. http://goparallel.sourceforge.net
>> > _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> VERIFY Test and improve your parallel project with help from experts
>> and peers. http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
VERIFY Test and improve your parallel project with help from experts
and peers. http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-11-30 00:29
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
My callback has to be declared as int rather than void, but it still
crashes whether I simply return 0 or 1. This is proving tricky. If I
don't set a callback everything works fine, but no matter how I try to
set it and later release it I get a crash. The debugger isn't tell me
much either as the program just seems to hang. When run through gdb it
just hangs in run-time. Am I right in assuming this is because a
thread has not being freed and is still chugging away somewhere?


On 29 November 2012 23:14, Justin Smith  wrote:
> something like:
>
> void nullCallback() {} /* function that does nothing and returns nothing */
>
> csound->SetYieldCallback(nullCallback);
>
>
>
> On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh  wrote:
>>
>> Thanks Justin, could you explain to me how that works? My grasp of
>> computer speak is pretty weak!  Do you mean do something like this:
>>
>> csound->SetYieldCallback(nullptr);
>>
>> I gave that a whirl earlier but it caused other issues.
>>
>>
>> On 29 November 2012 22:54, Justin Smith  wrote:
>> > I think you can just set the callback to a no-op
>> >
>> >
>> > On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>> >>
>> >> Does deleting Csound remove the callback set with
>> >> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>> >> function but I do see functions for removing other callbacks?
>> >>
>> >> On 29 November 2012 22:40, Justin Smith  wrote:
>> >> > my guess is the callback tries to use a resource that is tied to that
>> >> > instrument
>> >> >
>> >> > remember the callback will be called repeatedly, one time actions
>> >> > should
>> >> > be
>> >> > grabbed out of a queue by the callback
>> >> >
>> >> >
>> >> > On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>> >> >>
>> >> >> There still something strange happening when delete and recreate a
>> >> >> Csound object. With no yieldCallback everything works fine, but as
>> >> >> soon as I add one I get a crash when I try to quickly delete and
>> >> >> recreate a Csound object. Is the yieldCallback a red herring? It's a
>> >> >> tricky one to catch in the debugger.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> ------------------------------------------------------------------------------
>> >> >> Keep yourself connected to Go Parallel:
>> >> >> VERIFY Test and improve your parallel project with help from experts
>> >> >> and peers. http://goparallel.sourceforge.net
>> >> >> _______________________________________________
>> >> >> Csound-devel mailing list
>> >> >> Csound-devel@lists.sourceforge.net
>> >> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > ------------------------------------------------------------------------------
>> >> > Keep yourself connected to Go Parallel:
>> >> > VERIFY Test and improve your parallel project with help from experts
>> >> > and peers. http://goparallel.sourceforge.net
>> >> > _______________________________________________
>> >> > Csound-devel mailing list
>> >> > Csound-devel@lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >> >
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Keep yourself connected to Go Parallel:
>> >> VERIFY Test and improve your parallel project with help from experts
>> >> and peers. http://goparallel.sourceforge.net
>> >> _______________________________________________
>> >> Csound-devel mailing list
>> >> Csound-devel@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Keep yourself connected to Go Parallel:
>> > VERIFY Test and improve your parallel project with help from experts
>> > and peers. http://goparallel.sourceforge.net
>> > _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> VERIFY Test and improve your parallel project with help from experts
>> and peers. http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-30 07:27
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
I think you are probably chasing the wrong thing here. I would not think you need to set the callback to something else.
In any case, there is something else you can try. Instead of setting the Yield callback, since you are calling
csound->PerformKsmps() yourself, why don't you place the code from the callback after that, or create a
callback system of your own?

The issue you want to fix here is a competing access to Csound resources from two separate threads. So you just need to
put everything in the same thread (since you are the one who is defining it). 

csoundYieldCallbacks are useful when you don't have access to the inner processing loop (say you are calling in
a single thread csoundPerform() and you want events to be monitored every k-cycle). Here, I am guessing you
have such access.

Victor
On 30 Nov 2012, at 00:29, Rory Walsh wrote:

> My callback has to be declared as int rather than void, but it still
> crashes whether I simply return 0 or 1. This is proving tricky. If I
> don't set a callback everything works fine, but no matter how I try to
> set it and later release it I get a crash. The debugger isn't tell me
> much either as the program just seems to hang. When run through gdb it
> just hangs in run-time. Am I right in assuming this is because a
> thread has not being freed and is still chugging away somewhere?
> 
> 
> On 29 November 2012 23:14, Justin Smith  wrote:
>> something like:
>> 
>> void nullCallback() {} /* function that does nothing and returns nothing */
>> 
>> csound->SetYieldCallback(nullCallback);
>> 
>> 
>> 
>> On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh  wrote:
>>> 
>>> Thanks Justin, could you explain to me how that works? My grasp of
>>> computer speak is pretty weak!  Do you mean do something like this:
>>> 
>>> csound->SetYieldCallback(nullptr);
>>> 
>>> I gave that a whirl earlier but it caused other issues.
>>> 
>>> 
>>> On 29 November 2012 22:54, Justin Smith  wrote:
>>>> I think you can just set the callback to a no-op
>>>> 
>>>> 
>>>> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>>>>> 
>>>>> Does deleting Csound remove the callback set with
>>>>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>>>>> function but I do see functions for removing other callbacks?
>>>>> 
>>>>> On 29 November 2012 22:40, Justin Smith  wrote:
>>>>>> my guess is the callback tries to use a resource that is tied to that
>>>>>> instrument
>>>>>> 
>>>>>> remember the callback will be called repeatedly, one time actions
>>>>>> should
>>>>>> be
>>>>>> grabbed out of a queue by the callback
>>>>>> 
>>>>>> 
>>>>>> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>>>>>>> 
>>>>>>> There still something strange happening when delete and recreate a
>>>>>>> Csound object. With no yieldCallback everything works fine, but as
>>>>>>> soon as I add one I get a crash when I try to quickly delete and
>>>>>>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>>>>>>> tricky one to catch in the debugger.
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>> and peers. http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> VERIFY Test and improve your parallel project with help from experts
>>>> and peers. http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> VERIFY Test and improve your parallel project with help from experts
>>> and peers. http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> VERIFY Test and improve your parallel project with help from experts
>> and peers. http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-30 10:25
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
That's a fair point, and easy to try. I'll let you know how it goes..

On 30 November 2012 07:27, Victor Lazzarini  wrote:
> I think you are probably chasing the wrong thing here. I would not think you need to set the callback to something else.
> In any case, there is something else you can try. Instead of setting the Yield callback, since you are calling
> csound->PerformKsmps() yourself, why don't you place the code from the callback after that, or create a
> callback system of your own?
>
> The issue you want to fix here is a competing access to Csound resources from two separate threads. So you just need to
> put everything in the same thread (since you are the one who is defining it).
>
> csoundYieldCallbacks are useful when you don't have access to the inner processing loop (say you are calling in
> a single thread csoundPerform() and you want events to be monitored every k-cycle). Here, I am guessing you
> have such access.
>
> Victor
> On 30 Nov 2012, at 00:29, Rory Walsh wrote:
>
>> My callback has to be declared as int rather than void, but it still
>> crashes whether I simply return 0 or 1. This is proving tricky. If I
>> don't set a callback everything works fine, but no matter how I try to
>> set it and later release it I get a crash. The debugger isn't tell me
>> much either as the program just seems to hang. When run through gdb it
>> just hangs in run-time. Am I right in assuming this is because a
>> thread has not being freed and is still chugging away somewhere?
>>
>>
>> On 29 November 2012 23:14, Justin Smith  wrote:
>>> something like:
>>>
>>> void nullCallback() {} /* function that does nothing and returns nothing */
>>>
>>> csound->SetYieldCallback(nullCallback);
>>>
>>>
>>>
>>> On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh  wrote:
>>>>
>>>> Thanks Justin, could you explain to me how that works? My grasp of
>>>> computer speak is pretty weak!  Do you mean do something like this:
>>>>
>>>> csound->SetYieldCallback(nullptr);
>>>>
>>>> I gave that a whirl earlier but it caused other issues.
>>>>
>>>>
>>>> On 29 November 2012 22:54, Justin Smith  wrote:
>>>>> I think you can just set the callback to a no-op
>>>>>
>>>>>
>>>>> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>>>>>>
>>>>>> Does deleting Csound remove the callback set with
>>>>>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>>>>>> function but I do see functions for removing other callbacks?
>>>>>>
>>>>>> On 29 November 2012 22:40, Justin Smith  wrote:
>>>>>>> my guess is the callback tries to use a resource that is tied to that
>>>>>>> instrument
>>>>>>>
>>>>>>> remember the callback will be called repeatedly, one time actions
>>>>>>> should
>>>>>>> be
>>>>>>> grabbed out of a queue by the callback
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>>>>>>>>
>>>>>>>> There still something strange happening when delete and recreate a
>>>>>>>> Csound object. With no yieldCallback everything works fine, but as
>>>>>>>> soon as I add one I get a crash when I try to quickly delete and
>>>>>>>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>>>>>>>> tricky one to catch in the debugger.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>> and peers. http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> VERIFY Test and improve your parallel project with help from experts
>>>> and peers. http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> VERIFY Test and improve your parallel project with help from experts
>>> and peers. http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> TUNE You got it built. Now make it sing. Tune shows you how.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-30 10:53
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
I think have this sorted now. Thanks for all the help. Victor was
right, it wasn't to do with the callback function. It had something to
do with my processing thread. Bottom line is it now works with either
a yieldCallback function, or if I simply use my own method and call it
between performsKsmps() calls. One last question. In my yield callback
function I do something like this:

int CabbagePluginAudioProcessor::yieldCallback(CSOUND* csound){
CabbagePluginAudioProcessor* ud = (CabbagePluginAudioProcessor *)
csoundGetHostData(csound);
if(ud)
((CabbagePluginAudioProcessorEditor*)ud->getActiveEditor())->ksmpsYieldCallback();
(...)

If I just call my ksmpsYieldCallback() after performKsmps() I don't
need to call csoundGetHostData() as I can just call my
ksmpsYieldCallback() method directly. As varying rates of ksmps can
cause frequent calls to my yieldCallback function will things be more
efficient if I don't have to continuously keep calling
csoundGetHostData? Or does it make much difference?






On 30 November 2012 10:25, Rory Walsh  wrote:
> That's a fair point, and easy to try. I'll let you know how it goes..
>
> On 30 November 2012 07:27, Victor Lazzarini  wrote:
>> I think you are probably chasing the wrong thing here. I would not think you need to set the callback to something else.
>> In any case, there is something else you can try. Instead of setting the Yield callback, since you are calling
>> csound->PerformKsmps() yourself, why don't you place the code from the callback after that, or create a
>> callback system of your own?
>>
>> The issue you want to fix here is a competing access to Csound resources from two separate threads. So you just need to
>> put everything in the same thread (since you are the one who is defining it).
>>
>> csoundYieldCallbacks are useful when you don't have access to the inner processing loop (say you are calling in
>> a single thread csoundPerform() and you want events to be monitored every k-cycle). Here, I am guessing you
>> have such access.
>>
>> Victor
>> On 30 Nov 2012, at 00:29, Rory Walsh wrote:
>>
>>> My callback has to be declared as int rather than void, but it still
>>> crashes whether I simply return 0 or 1. This is proving tricky. If I
>>> don't set a callback everything works fine, but no matter how I try to
>>> set it and later release it I get a crash. The debugger isn't tell me
>>> much either as the program just seems to hang. When run through gdb it
>>> just hangs in run-time. Am I right in assuming this is because a
>>> thread has not being freed and is still chugging away somewhere?
>>>
>>>
>>> On 29 November 2012 23:14, Justin Smith  wrote:
>>>> something like:
>>>>
>>>> void nullCallback() {} /* function that does nothing and returns nothing */
>>>>
>>>> csound->SetYieldCallback(nullCallback);
>>>>
>>>>
>>>>
>>>> On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh  wrote:
>>>>>
>>>>> Thanks Justin, could you explain to me how that works? My grasp of
>>>>> computer speak is pretty weak!  Do you mean do something like this:
>>>>>
>>>>> csound->SetYieldCallback(nullptr);
>>>>>
>>>>> I gave that a whirl earlier but it caused other issues.
>>>>>
>>>>>
>>>>> On 29 November 2012 22:54, Justin Smith  wrote:
>>>>>> I think you can just set the callback to a no-op
>>>>>>
>>>>>>
>>>>>> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>>>>>>>
>>>>>>> Does deleting Csound remove the callback set with
>>>>>>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>>>>>>> function but I do see functions for removing other callbacks?
>>>>>>>
>>>>>>> On 29 November 2012 22:40, Justin Smith  wrote:
>>>>>>>> my guess is the callback tries to use a resource that is tied to that
>>>>>>>> instrument
>>>>>>>>
>>>>>>>> remember the callback will be called repeatedly, one time actions
>>>>>>>> should
>>>>>>>> be
>>>>>>>> grabbed out of a queue by the callback
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>>>>>>>>>
>>>>>>>>> There still something strange happening when delete and recreate a
>>>>>>>>> Csound object. With no yieldCallback everything works fine, but as
>>>>>>>>> soon as I add one I get a crash when I try to quickly delete and
>>>>>>>>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>>>>>>>>> tricky one to catch in the debugger.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>> and peers. http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> VERIFY Test and improve your parallel project with help from experts
>>>> and peers. http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> TUNE You got it built. Now make it sing. Tune shows you how.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> TUNE You got it built. Now make it sing. Tune shows you how.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-30 11:20
FromVictor Lazzarini
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
No, I don't think getting the hostdata pointer is much of a burden here.
But it's probably simpler anyway not to use the Yield callback, as you have access to your loop code.

Victor

On 30 Nov 2012, at 10:53, Rory Walsh wrote:

> I think have this sorted now. Thanks for all the help. Victor was
> right, it wasn't to do with the callback function. It had something to
> do with my processing thread. Bottom line is it now works with either
> a yieldCallback function, or if I simply use my own method and call it
> between performsKsmps() calls. One last question. In my yield callback
> function I do something like this:
> 
> int CabbagePluginAudioProcessor::yieldCallback(CSOUND* csound){
> CabbagePluginAudioProcessor* ud = (CabbagePluginAudioProcessor *)
> csoundGetHostData(csound);
> if(ud)
> ((CabbagePluginAudioProcessorEditor*)ud->getActiveEditor())->ksmpsYieldCallback();
> (...)
> 
> If I just call my ksmpsYieldCallback() after performKsmps() I don't
> need to call csoundGetHostData() as I can just call my
> ksmpsYieldCallback() method directly. As varying rates of ksmps can
> cause frequent calls to my yieldCallback function will things be more
> efficient if I don't have to continuously keep calling
> csoundGetHostData? Or does it make much difference?
> 
> 
> 
> 
> 
> 
> On 30 November 2012 10:25, Rory Walsh  wrote:
>> That's a fair point, and easy to try. I'll let you know how it goes..
>> 
>> On 30 November 2012 07:27, Victor Lazzarini  wrote:
>>> I think you are probably chasing the wrong thing here. I would not think you need to set the callback to something else.
>>> In any case, there is something else you can try. Instead of setting the Yield callback, since you are calling
>>> csound->PerformKsmps() yourself, why don't you place the code from the callback after that, or create a
>>> callback system of your own?
>>> 
>>> The issue you want to fix here is a competing access to Csound resources from two separate threads. So you just need to
>>> put everything in the same thread (since you are the one who is defining it).
>>> 
>>> csoundYieldCallbacks are useful when you don't have access to the inner processing loop (say you are calling in
>>> a single thread csoundPerform() and you want events to be monitored every k-cycle). Here, I am guessing you
>>> have such access.
>>> 
>>> Victor
>>> On 30 Nov 2012, at 00:29, Rory Walsh wrote:
>>> 
>>>> My callback has to be declared as int rather than void, but it still
>>>> crashes whether I simply return 0 or 1. This is proving tricky. If I
>>>> don't set a callback everything works fine, but no matter how I try to
>>>> set it and later release it I get a crash. The debugger isn't tell me
>>>> much either as the program just seems to hang. When run through gdb it
>>>> just hangs in run-time. Am I right in assuming this is because a
>>>> thread has not being freed and is still chugging away somewhere?
>>>> 
>>>> 
>>>> On 29 November 2012 23:14, Justin Smith  wrote:
>>>>> something like:
>>>>> 
>>>>> void nullCallback() {} /* function that does nothing and returns nothing */
>>>>> 
>>>>> csound->SetYieldCallback(nullCallback);
>>>>> 
>>>>> 
>>>>> 
>>>>> On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh  wrote:
>>>>>> 
>>>>>> Thanks Justin, could you explain to me how that works? My grasp of
>>>>>> computer speak is pretty weak!  Do you mean do something like this:
>>>>>> 
>>>>>> csound->SetYieldCallback(nullptr);
>>>>>> 
>>>>>> I gave that a whirl earlier but it caused other issues.
>>>>>> 
>>>>>> 
>>>>>> On 29 November 2012 22:54, Justin Smith  wrote:
>>>>>>> I think you can just set the callback to a no-op
>>>>>>> 
>>>>>>> 
>>>>>>> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>>>>>>>> 
>>>>>>>> Does deleting Csound remove the callback set with
>>>>>>>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>>>>>>>> function but I do see functions for removing other callbacks?
>>>>>>>> 
>>>>>>>> On 29 November 2012 22:40, Justin Smith  wrote:
>>>>>>>>> my guess is the callback tries to use a resource that is tied to that
>>>>>>>>> instrument
>>>>>>>>> 
>>>>>>>>> remember the callback will be called repeatedly, one time actions
>>>>>>>>> should
>>>>>>>>> be
>>>>>>>>> grabbed out of a queue by the callback
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>>>>>>>>>> 
>>>>>>>>>> There still something strange happening when delete and recreate a
>>>>>>>>>> Csound object. With no yieldCallback everything works fine, but as
>>>>>>>>>> soon as I add one I get a crash when I try to quickly delete and
>>>>>>>>>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>>>>>>>>>> tricky one to catch in the debugger.
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>>> 
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>> and peers. http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> TUNE You got it built. Now make it sing. Tune shows you how.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> Dr Victor Lazzarini
>>> Senior Lecturer
>>> Dept. of Music
>>> NUI Maynooth Ireland
>>> tel.: +353 1 708 3545
>>> Victor dot Lazzarini AT nuim dot ie
>>> 
>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Keep yourself connected to Go Parallel:
>>> TUNE You got it built. Now make it sing. Tune shows you how.
>>> http://goparallel.sourceforge.net
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

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




------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-11-30 11:39
FromRory Walsh
SubjectRe: [Cs-dev] Strange issue with csoundGetTable()
I'll probably do that, cheers.

On 30 November 2012 11:20, Victor Lazzarini  wrote:
> No, I don't think getting the hostdata pointer is much of a burden here.
> But it's probably simpler anyway not to use the Yield callback, as you have access to your loop code.
>
> Victor
>
> On 30 Nov 2012, at 10:53, Rory Walsh wrote:
>
>> I think have this sorted now. Thanks for all the help. Victor was
>> right, it wasn't to do with the callback function. It had something to
>> do with my processing thread. Bottom line is it now works with either
>> a yieldCallback function, or if I simply use my own method and call it
>> between performsKsmps() calls. One last question. In my yield callback
>> function I do something like this:
>>
>> int CabbagePluginAudioProcessor::yieldCallback(CSOUND* csound){
>> CabbagePluginAudioProcessor* ud = (CabbagePluginAudioProcessor *)
>> csoundGetHostData(csound);
>> if(ud)
>> ((CabbagePluginAudioProcessorEditor*)ud->getActiveEditor())->ksmpsYieldCallback();
>> (...)
>>
>> If I just call my ksmpsYieldCallback() after performKsmps() I don't
>> need to call csoundGetHostData() as I can just call my
>> ksmpsYieldCallback() method directly. As varying rates of ksmps can
>> cause frequent calls to my yieldCallback function will things be more
>> efficient if I don't have to continuously keep calling
>> csoundGetHostData? Or does it make much difference?
>>
>>
>>
>>
>>
>>
>> On 30 November 2012 10:25, Rory Walsh  wrote:
>>> That's a fair point, and easy to try. I'll let you know how it goes..
>>>
>>> On 30 November 2012 07:27, Victor Lazzarini  wrote:
>>>> I think you are probably chasing the wrong thing here. I would not think you need to set the callback to something else.
>>>> In any case, there is something else you can try. Instead of setting the Yield callback, since you are calling
>>>> csound->PerformKsmps() yourself, why don't you place the code from the callback after that, or create a
>>>> callback system of your own?
>>>>
>>>> The issue you want to fix here is a competing access to Csound resources from two separate threads. So you just need to
>>>> put everything in the same thread (since you are the one who is defining it).
>>>>
>>>> csoundYieldCallbacks are useful when you don't have access to the inner processing loop (say you are calling in
>>>> a single thread csoundPerform() and you want events to be monitored every k-cycle). Here, I am guessing you
>>>> have such access.
>>>>
>>>> Victor
>>>> On 30 Nov 2012, at 00:29, Rory Walsh wrote:
>>>>
>>>>> My callback has to be declared as int rather than void, but it still
>>>>> crashes whether I simply return 0 or 1. This is proving tricky. If I
>>>>> don't set a callback everything works fine, but no matter how I try to
>>>>> set it and later release it I get a crash. The debugger isn't tell me
>>>>> much either as the program just seems to hang. When run through gdb it
>>>>> just hangs in run-time. Am I right in assuming this is because a
>>>>> thread has not being freed and is still chugging away somewhere?
>>>>>
>>>>>
>>>>> On 29 November 2012 23:14, Justin Smith  wrote:
>>>>>> something like:
>>>>>>
>>>>>> void nullCallback() {} /* function that does nothing and returns nothing */
>>>>>>
>>>>>> csound->SetYieldCallback(nullCallback);
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Nov 29, 2012 at 2:59 PM, Rory Walsh  wrote:
>>>>>>>
>>>>>>> Thanks Justin, could you explain to me how that works? My grasp of
>>>>>>> computer speak is pretty weak!  Do you mean do something like this:
>>>>>>>
>>>>>>> csound->SetYieldCallback(nullptr);
>>>>>>>
>>>>>>> I gave that a whirl earlier but it caused other issues.
>>>>>>>
>>>>>>>
>>>>>>> On 29 November 2012 22:54, Justin Smith  wrote:
>>>>>>>> I think you can just set the callback to a no-op
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Nov 29, 2012 at 2:52 PM, Rory Walsh  wrote:
>>>>>>>>>
>>>>>>>>> Does deleting Csound remove the callback set with
>>>>>>>>> csoundSetYieldCallback()? I don't see any csoundRemoveYieldCallback()
>>>>>>>>> function but I do see functions for removing other callbacks?
>>>>>>>>>
>>>>>>>>> On 29 November 2012 22:40, Justin Smith  wrote:
>>>>>>>>>> my guess is the callback tries to use a resource that is tied to that
>>>>>>>>>> instrument
>>>>>>>>>>
>>>>>>>>>> remember the callback will be called repeatedly, one time actions
>>>>>>>>>> should
>>>>>>>>>> be
>>>>>>>>>> grabbed out of a queue by the callback
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Nov 29, 2012 at 2:31 PM, Rory Walsh  wrote:
>>>>>>>>>>>
>>>>>>>>>>> There still something strange happening when delete and recreate a
>>>>>>>>>>> Csound object. With no yieldCallback everything works fine, but as
>>>>>>>>>>> soon as I add one I get a crash when I try to quickly delete and
>>>>>>>>>>> recreate a Csound object. Is the yieldCallback a red herring? It's a
>>>>>>>>>>> tricky one to catch in the debugger.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Csound-devel mailing list
>>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Keep yourself connected to Go Parallel:
>>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Keep yourself connected to Go Parallel:
>>>>>> VERIFY Test and improve your parallel project with help from experts
>>>>>> and peers. http://goparallel.sourceforge.net
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Keep yourself connected to Go Parallel:
>>>>> TUNE You got it built. Now make it sing. Tune shows you how.
>>>>> http://goparallel.sourceforge.net
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> Dr Victor Lazzarini
>>>> Senior Lecturer
>>>> Dept. of Music
>>>> NUI Maynooth Ireland
>>>> tel.: +353 1 708 3545
>>>> Victor dot Lazzarini AT nuim dot ie
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Keep yourself connected to Go Parallel:
>>>> TUNE You got it built. Now make it sing. Tune shows you how.
>>>> http://goparallel.sourceforge.net
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel:
>> TUNE You got it built. Now make it sing. Tune shows you how.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net