[Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr()
Date | 2017-04-08 20:05 |
From | Rory Walsh |
Subject | [Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr() |
Is this something that can be done already? Also, the docs state that csoundGetChannelPtr() is not thread safe, I thought Victor addressed this some time ago?
|
Date | 2017-04-08 20:23 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr() |
getting the pointer is not threadsafe because it is impossible to tell what you will do with the pointer. The setter/getter functions are threadsafe, though. There is no channel support for arrays at the moment, but I can't see any impediment to adding it besides getting someone to do it. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 8 Apr 2017, at 20:06, Rory Walsh |
Date | 2017-04-08 21:23 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr() |
Ah yes, that's it. I might take a look at passing arrays but I think we would need to also pass the size of the array, which would mean either updating the chnget Opcodes or writing a new one. An extra parameter could be passed after the channel name I guess. On 8 Apr 2017 8:23 pm, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> wrote: getting the pointer is not threadsafe because it is impossible to tell what you will do with the pointer. The setter/getter functions are threadsafe, though. |
Date | 2017-04-08 21:33 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr() |
Arrays hold their own size and can be dynamic, so I don't think we need a different set of parameters, just an overload. The channel system that is underlying will
need to be extended too, but I see no roadblocks, since strings are there and essentially arrays might follow them
closely.
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-04-10 03:03 |
From | Steven Yi |
Subject | Re: [Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr() |
I had done some work on this for issue #444 (https://github.com/csound/csound/issues/444) but haven't gotten back to it. Issue #691 is related (https://github.com/csound/csound/issues/691). I thinking having access to Visual Studio now makes this all a bit simpler for me to develop, but I am not sure when I'll have time to look at it myself. (If someone has time, feel free to take it over.) I'd recommend at this point we work on releasing 6.09 first as I think these API changes might benefit from a longer period of testing to make sure they will be stable and also work for CS7 changes. On Sat, Apr 8, 2017 at 4:33 PM, Victor Lazzarini |
Date | 2017-04-10 08:58 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr() |
Agreed. On 10 Apr 2017 03:03, "Steven Yi" <stevenyi@gmail.com> wrote: I had done some work on this for issue #444 |