| 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 |