Csound Csound-dev Csound-tekno Search About

[Csnd-dev] passing arrays from host to Csound with csoundSetChannelPtr()

Date2017-04-08 20:05
FromRory 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? 

Date2017-04-08 20:23
FromVictor Lazzarini
SubjectRe: [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  wrote:
> 
> Is this something that can be done already? Also, the docs state that csoundGetChannelPtr() is not thread safe, I thought Victor addressed this some

Date2017-04-08 21:23
FromRory Walsh
SubjectRe: [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.

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 <rorywalsh@EAR.IE> wrote:
>
> 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?

Date2017-04-08 21:33
FromVictor Lazzarini
SubjectRe: [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

On 8 Apr 2017, at 21:23, Rory Walsh <rorywalsh@EAR.IE> wrote:

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.

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 <rorywalsh@EAR.IE> wrote:
>
> 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?

Date2017-04-10 03:03
FromSteven Yi
SubjectRe: [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
 wrote:
> 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
>
> On 8 Apr 2017, at 21:23, Rory Walsh  wrote:
>
> 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"  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.
>>
>> 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  wrote:
>> >
>> > Is this something that can be done already? Also, the docs state that
>> > csoundGetChannelPtr() is not thread safe, I thought Victor addressed this

Date2017-04-10 08:58
FromRory Walsh
SubjectRe: [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
(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
<Victor.Lazzarini@nuim.ie> wrote:
> 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
>
> On 8 Apr 2017, at 21:23, Rory Walsh <rorywalsh@EAR.IE> wrote:
>
> 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.
>>
>> 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 <rorywalsh@EAR.IE> wrote:
>> >
>> > 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?