[Csnd-dev] Fwd: inrg with arrays broken on develop?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd-dev] Fwd: inrg with arrays broken on develop?

Justin Smith
with the latest develop branch of csound, inrg with an a-array seems to be broken

am I misusing the array or is this an error with inrg?

attached is a working csd that uses inch with an array, and a broken csd that is identical in all other respects, but uses inrg instead of inch

the inrg opcode seems to read only 0s, while inch prints various noise-floor numbers even with no inputs on my sound card (as expected)

I tried with regular a variables and those worked as expected with inrg

inrg-array.csd (1K) Download Attachment
inch-array.csd (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Steven Yi
Hi Justin,

I'm going to guess this is related to the change of having discrete
vs. interleaved channels (the code is in newgabops.c and uses
cs->spin, which I think needs to be updated?).

Victor or John may be able to quickly diagnose here (I haven't
followed too closely myself these changes.)

steven

On Wed, Apr 19, 2017 at 8:35 PM, Justin Smith <[hidden email]> wrote:

> with the latest develop branch of csound, inrg with an a-array seems to be
> broken
>
> am I misusing the array or is this an error with inrg?
>
> attached is a working csd that uses inch with an array, and a broken csd
> that is identical in all other respects, but uses inrg instead of inch
>
> the inrg opcode seems to read only 0s, while inch prints various noise-floor
> numbers even with no inputs on my sound card (as expected)
>
> I tried with regular a variables and those worked as expected with inrg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Victor Lazzarini
I don't think spin has changed, only spout. Could you open a ticket?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 20 Apr 2017, at 17:16, Steven Yi <[hidden email]> wrote:
>
> Hi Justin,
>
> I'm going to guess this is related to the change of having discrete
> vs. interleaved channels (the code is in newgabops.c and uses
> cs->spin, which I think needs to be updated?).
>
> Victor or John may be able to quickly diagnose here (I haven't
> followed too closely myself these changes.)
>
> steven
>
>> On Wed, Apr 19, 2017 at 8:35 PM, Justin Smith <[hidden email]> wrote:
>> with the latest develop branch of csound, inrg with an a-array seems to be
>> broken
>>
>> am I misusing the array or is this an error with inrg?
>>
>> attached is a working csd that uses inch with an array, and a broken csd
>> that is identical in all other respects, but uses inrg instead of inch
>>
>> the inrg opcode seems to read only 0s, while inch prints various noise-floor
>> numbers even with no inputs on my sound card (as expected)
>>
>> I tried with regular a variables and those worked as expected with inrg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

jpff
In reply to this post by Steven Yi
I did not tink inrg knew about arrays.  Can you post a test csd fie?


On Thu, 20 Apr 2017, Steven Yi wrote:

> Hi Justin,
>
> I'm going to guess this is related to the change of having discrete
> vs. interleaved channels (the code is in newgabops.c and uses
> cs->spin, which I think needs to be updated?).
>
> Victor or John may be able to quickly diagnose here (I haven't
> followed too closely myself these changes.)
>
> steven
>
> On Wed, Apr 19, 2017 at 8:35 PM, Justin Smith <[hidden email]> wrote:
>> with the latest develop branch of csound, inrg with an a-array seems to be
>> broken
>>
>> am I misusing the array or is this an error with inrg?
>>
>> attached is a working csd that uses inch with an array, and a broken csd
>> that is identical in all other respects, but uses inrg instead of inch
>>
>> the inrg opcode seems to read only 0s, while inch prints various noise-floor
>> numbers even with no inputs on my sound card (as expected)
>>
>> I tried with regular a variables and those worked as expected with inrg
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Justin Smith
I thought I'd posted the test csds before

I'm not handing an array as a single arg to inrg (which I didn't expect to work), just giving it the array elements as output args.

On Thu, Apr 20, 2017 at 1:58 PM jpff <[hidden email]> wrote:
I did not tink inrg knew about arrays.  Can you post a test csd fie?


On Thu, 20 Apr 2017, Steven Yi wrote:

> Hi Justin,
>
> I'm going to guess this is related to the change of having discrete
> vs. interleaved channels (the code is in newgabops.c and uses
> cs->spin, which I think needs to be updated?).
>
> Victor or John may be able to quickly diagnose here (I haven't
> followed too closely myself these changes.)
>
> steven
>
> On Wed, Apr 19, 2017 at 8:35 PM, Justin Smith <[hidden email]> wrote:
>> with the latest develop branch of csound, inrg with an a-array seems to be
>> broken
>>
>> am I misusing the array or is this an error with inrg?
>>
>> attached is a working csd that uses inch with an array, and a broken csd
>> that is identical in all other respects, but uses inrg instead of inch
>>
>> the inrg opcode seems to read only 0s, while inch prints various noise-floor
>> numbers even with no inputs on my sound card (as expected)
>>
>> I tried with regular a variables and those worked as expected with inrg
>

inrg-array.csd (1K) Download Attachment
inch-array.csd (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

jpff
Apologies; my mailer does not like.csd attachments.

Sent from TypeApp
On 20 Apr 2017, at 22:10, Justin Smith <[hidden email]> wrote:
I thought I'd posted the test csds before

I'm not handing an array as a single arg to inrg (which I didn't expect to work), just giving it the array elements as output args.

On Thu, Apr 20, 2017 at 1:58 PM jpff < [hidden email]> wrote:
I did not tink inrg knew about arrays.  Can you post a test csd fie?


On Thu, 20 Apr 2017, Steven Yi wrote:

> Hi Justin,
>
> I'm going to guess this is related to the change of having discrete
> vs. interleaved channels (the code is in newgabops.c and uses
> cs->spin, which I think needs to be updated?).
>
> Victor or John may be able to quickly diagnose here (I haven't
> followed too closely myself these changes.)
>
> steven
>
> On Wed, Apr 19, 2017 at 8:35 PM, Justin Smith < [hidden email]> wrote:
>> with the latest develop branch of csound, inrg with an a-array seems to be
>> broken
>>
>> am I misusing the array or is this an error with inrg?
>>
>> attached is a working csd that uses inch with an array, and a broken csd
>> that is identical in all other respects, but uses inrg instead of inch
>>
>> the inrg opcode seems to read only 0s, while inch prints various noise-floor
>> numbers even with no inputs on my sound card (as expected)
>>
>> I tried with regular a variables and those worked as expected with inrg
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

jpff
In reply to this post by Justin Smith
I think  it is fixed in git -- please try

On Thu, 20 Apr 2017, Justin Smith wrote:

>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Justin Smith
excellent, I'll check it out this evening, thank you

On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
I think  it is fixed in git -- please try

On Thu, 20 Apr 2017, Justin Smith wrote:

>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Justin Smith
I just pulled from origin/develop (I'm up to date with commit 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the issue.

If it helps, I was able to reproduce the error with regular stereo - here's two instruments, i1 will get nothing but zeros from the sound card, and i2 gets the actual audio data

instr 1
aS[] init 2
     inrg 1, aS[0], aS[1]
     outrg 1, aS[0], aS[1]
endin

instr 2
a0, a1 inch 1, 2
     outrg 1, a0, a1
endin

On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]> wrote:
excellent, I'll check it out this evening, thank you

On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
I think  it is fixed in git -- please try

On Thu, 20 Apr 2017, Justin Smith wrote:

>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Steven Yi
Oh, I should have looked at the CSD code; that certainly won't work.
What is happening is that because inrg writes to the right-hand side
variables, it's actually writing to temp vars. The translated opcode
list should look something like:

#a0 array_get aS, 0
#a1 array_get aS, 1
inrg 1, #a0, #a1
...

I know inrg had some code changes, but we may need to double check
whether those were necessary at all.

Note you should be able to do this though:

aS[] init 2
aS[0], aS[1]  inch 1,2

That would an opcode list of something like:

#a0, #a1 inch 1,2,
array_set aS, 0, #a0
array_set aS, 0, #a1


On Sat, Apr 22, 2017 at 2:22 PM, Justin Smith <[hidden email]> wrote:

> I just pulled from origin/develop (I'm up to date with commit
> 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the issue.
>
> If it helps, I was able to reproduce the error with regular stereo - here's
> two instruments, i1 will get nothing but zeros from the sound card, and i2
> gets the actual audio data
>
> instr 1
> aS[] init 2
>      inrg 1, aS[0], aS[1]
>      outrg 1, aS[0], aS[1]
> endin
>
> instr 2
> a0, a1 inch 1, 2
>      outrg 1, a0, a1
> endin
>
> On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]> wrote:
>>
>> excellent, I'll check it out this evening, thank you
>>
>> On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
>>>
>>> I think  it is fixed in git -- please try
>>>
>>> On Thu, 20 Apr 2017, Justin Smith wrote:
>>>
>>> >
>>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Justin Smith
Oh, so arrays wont work as right hand side "output args"; I can of course use an alternative opcode (and am currently), I reported the issue in case csound was meant to support this sort of usage. Happy to accept that it is Not A Bug with this explanatio (but perhaps the Array docs should mention cases like this?).

On Sat, Apr 22, 2017 at 3:21 PM Steven Yi <[hidden email]> wrote:
Oh, I should have looked at the CSD code; that certainly won't work.
What is happening is that because inrg writes to the right-hand side
variables, it's actually writing to temp vars. The translated opcode
list should look something like:

#a0 array_get aS, 0
#a1 array_get aS, 1
inrg 1, #a0, #a1
...

I know inrg had some code changes, but we may need to double check
whether those were necessary at all.

Note you should be able to do this though:

aS[] init 2
aS[0], aS[1]  inch 1,2

That would an opcode list of something like:

#a0, #a1 inch 1,2,
array_set aS, 0, #a0
array_set aS, 0, #a1


On Sat, Apr 22, 2017 at 2:22 PM, Justin Smith <[hidden email]> wrote:
> I just pulled from origin/develop (I'm up to date with commit
> 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the issue.
>
> If it helps, I was able to reproduce the error with regular stereo - here's
> two instruments, i1 will get nothing but zeros from the sound card, and i2
> gets the actual audio data
>
> instr 1
> aS[] init 2
>      inrg 1, aS[0], aS[1]
>      outrg 1, aS[0], aS[1]
> endin
>
> instr 2
> a0, a1 inch 1, 2
>      outrg 1, a0, a1
> endin
>
> On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]> wrote:
>>
>> excellent, I'll check it out this evening, thank you
>>
>> On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
>>>
>>> I think  it is fixed in git -- please try
>>>
>>> On Thu, 20 Apr 2017, Justin Smith wrote:
>>>
>>> >
>>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Steven Yi
Yes, perhaps we should have additional information added to the manual
to explain this.  Could you kindly file an issue for this in the
manual repository?

That said, I was going through mentally to see what might be possible.
Because we have contiguous memory for array members without the types
between each member, we can't just expose the member's address.  For
example, we have something like this now:

[array type][a type][member 0][member 1][member 2]

and not:

[array type][a type][member 0][a type][member 1][a type][member 2]

If we had the latter in memory, we could actually do without
array_set/array_get and synthesizing variables, as opcodes could
directly write to memory of members and RTTI would work fine.  On the
other hand, we get into some tricky bits as we do reallocation of
arrays and we only set pointers for opcode arguments once at
init-time.

(I think what we have is something like packed arrays as mentioned in:

https://www.ibm.com/support/knowledgecenter/SSYKE2_7.1.0/com.ibm.java.win.71.doc/user/packed_arrays.html

)

Anyways, I don't know whether anyone here would want to investigate
this kind of thing further, but I'm happy enough to leave it here for
the moment.  Perhaps the above information may be useful for future
work.


On Sat, Apr 22, 2017 at 6:44 PM, Justin Smith <[hidden email]> wrote:

> Oh, so arrays wont work as right hand side "output args"; I can of course
> use an alternative opcode (and am currently), I reported the issue in case
> csound was meant to support this sort of usage. Happy to accept that it is
> Not A Bug with this explanatio (but perhaps the Array docs should mention
> cases like this?).
>
> On Sat, Apr 22, 2017 at 3:21 PM Steven Yi <[hidden email]> wrote:
>>
>> Oh, I should have looked at the CSD code; that certainly won't work.
>> What is happening is that because inrg writes to the right-hand side
>> variables, it's actually writing to temp vars. The translated opcode
>> list should look something like:
>>
>> #a0 array_get aS, 0
>> #a1 array_get aS, 1
>> inrg 1, #a0, #a1
>> ...
>>
>> I know inrg had some code changes, but we may need to double check
>> whether those were necessary at all.
>>
>> Note you should be able to do this though:
>>
>> aS[] init 2
>> aS[0], aS[1]  inch 1,2
>>
>> That would an opcode list of something like:
>>
>> #a0, #a1 inch 1,2,
>> array_set aS, 0, #a0
>> array_set aS, 0, #a1
>>
>>
>> On Sat, Apr 22, 2017 at 2:22 PM, Justin Smith <[hidden email]>
>> wrote:
>> > I just pulled from origin/develop (I'm up to date with commit
>> > 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the
>> > issue.
>> >
>> > If it helps, I was able to reproduce the error with regular stereo -
>> > here's
>> > two instruments, i1 will get nothing but zeros from the sound card, and
>> > i2
>> > gets the actual audio data
>> >
>> > instr 1
>> > aS[] init 2
>> >      inrg 1, aS[0], aS[1]
>> >      outrg 1, aS[0], aS[1]
>> > endin
>> >
>> > instr 2
>> > a0, a1 inch 1, 2
>> >      outrg 1, a0, a1
>> > endin
>> >
>> > On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]>
>> > wrote:
>> >>
>> >> excellent, I'll check it out this evening, thank you
>> >>
>> >> On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
>> >>>
>> >>> I think  it is fixed in git -- please try
>> >>>
>> >>> On Thu, 20 Apr 2017, Justin Smith wrote:
>> >>>
>> >>> >
>> >>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Justin Smith
I've downloaded the documentation repository and I' making a quick attempt editing math/array.xml, I'll likely end up with something that needs editing but at least it could be a start

On Sat, Apr 22, 2017 at 4:13 PM Steven Yi <[hidden email]> wrote:
Yes, perhaps we should have additional information added to the manual
to explain this.  Could you kindly file an issue for this in the
manual repository?

That said, I was going through mentally to see what might be possible.
Because we have contiguous memory for array members without the types
between each member, we can't just expose the member's address.  For
example, we have something like this now:

[array type][a type][member 0][member 1][member 2]

and not:

[array type][a type][member 0][a type][member 1][a type][member 2]

If we had the latter in memory, we could actually do without
array_set/array_get and synthesizing variables, as opcodes could
directly write to memory of members and RTTI would work fine.  On the
other hand, we get into some tricky bits as we do reallocation of
arrays and we only set pointers for opcode arguments once at
init-time.

(I think what we have is something like packed arrays as mentioned in:

https://www.ibm.com/support/knowledgecenter/SSYKE2_7.1.0/com.ibm.java.win.71.doc/user/packed_arrays.html

)

Anyways, I don't know whether anyone here would want to investigate
this kind of thing further, but I'm happy enough to leave it here for
the moment.  Perhaps the above information may be useful for future
work.


On Sat, Apr 22, 2017 at 6:44 PM, Justin Smith <[hidden email]> wrote:
> Oh, so arrays wont work as right hand side "output args"; I can of course
> use an alternative opcode (and am currently), I reported the issue in case
> csound was meant to support this sort of usage. Happy to accept that it is
> Not A Bug with this explanatio (but perhaps the Array docs should mention
> cases like this?).
>
> On Sat, Apr 22, 2017 at 3:21 PM Steven Yi <[hidden email]> wrote:
>>
>> Oh, I should have looked at the CSD code; that certainly won't work.
>> What is happening is that because inrg writes to the right-hand side
>> variables, it's actually writing to temp vars. The translated opcode
>> list should look something like:
>>
>> #a0 array_get aS, 0
>> #a1 array_get aS, 1
>> inrg 1, #a0, #a1
>> ...
>>
>> I know inrg had some code changes, but we may need to double check
>> whether those were necessary at all.
>>
>> Note you should be able to do this though:
>>
>> aS[] init 2
>> aS[0], aS[1]  inch 1,2
>>
>> That would an opcode list of something like:
>>
>> #a0, #a1 inch 1,2,
>> array_set aS, 0, #a0
>> array_set aS, 0, #a1
>>
>>
>> On Sat, Apr 22, 2017 at 2:22 PM, Justin Smith <[hidden email]>
>> wrote:
>> > I just pulled from origin/develop (I'm up to date with commit
>> > 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the
>> > issue.
>> >
>> > If it helps, I was able to reproduce the error with regular stereo -
>> > here's
>> > two instruments, i1 will get nothing but zeros from the sound card, and
>> > i2
>> > gets the actual audio data
>> >
>> > instr 1
>> > aS[] init 2
>> >      inrg 1, aS[0], aS[1]
>> >      outrg 1, aS[0], aS[1]
>> > endin
>> >
>> > instr 2
>> > a0, a1 inch 1, 2
>> >      outrg 1, a0, a1
>> > endin
>> >
>> > On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]>
>> > wrote:
>> >>
>> >> excellent, I'll check it out this evening, thank you
>> >>
>> >> On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
>> >>>
>> >>> I think  it is fixed in git -- please try
>> >>>
>> >>> On Thu, 20 Apr 2017, Justin Smith wrote:
>> >>>
>> >>> >
>> >>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Steven Yi
That's fantastic, thanks so much for taking the initiative on this.

On Sat, Apr 22, 2017 at 7:46 PM, Justin Smith <[hidden email]> wrote:

> I've downloaded the documentation repository and I' making a quick attempt
> editing math/array.xml, I'll likely end up with something that needs editing
> but at least it could be a start
>
> On Sat, Apr 22, 2017 at 4:13 PM Steven Yi <[hidden email]> wrote:
>>
>> Yes, perhaps we should have additional information added to the manual
>> to explain this.  Could you kindly file an issue for this in the
>> manual repository?
>>
>> That said, I was going through mentally to see what might be possible.
>> Because we have contiguous memory for array members without the types
>> between each member, we can't just expose the member's address.  For
>> example, we have something like this now:
>>
>> [array type][a type][member 0][member 1][member 2]
>>
>> and not:
>>
>> [array type][a type][member 0][a type][member 1][a type][member 2]
>>
>> If we had the latter in memory, we could actually do without
>> array_set/array_get and synthesizing variables, as opcodes could
>> directly write to memory of members and RTTI would work fine.  On the
>> other hand, we get into some tricky bits as we do reallocation of
>> arrays and we only set pointers for opcode arguments once at
>> init-time.
>>
>> (I think what we have is something like packed arrays as mentioned in:
>>
>>
>> https://www.ibm.com/support/knowledgecenter/SSYKE2_7.1.0/com.ibm.java.win.71.doc/user/packed_arrays.html
>>
>> )
>>
>> Anyways, I don't know whether anyone here would want to investigate
>> this kind of thing further, but I'm happy enough to leave it here for
>> the moment.  Perhaps the above information may be useful for future
>> work.
>>
>>
>> On Sat, Apr 22, 2017 at 6:44 PM, Justin Smith <[hidden email]>
>> wrote:
>> > Oh, so arrays wont work as right hand side "output args"; I can of
>> > course
>> > use an alternative opcode (and am currently), I reported the issue in
>> > case
>> > csound was meant to support this sort of usage. Happy to accept that it
>> > is
>> > Not A Bug with this explanatio (but perhaps the Array docs should
>> > mention
>> > cases like this?).
>> >
>> > On Sat, Apr 22, 2017 at 3:21 PM Steven Yi <[hidden email]> wrote:
>> >>
>> >> Oh, I should have looked at the CSD code; that certainly won't work.
>> >> What is happening is that because inrg writes to the right-hand side
>> >> variables, it's actually writing to temp vars. The translated opcode
>> >> list should look something like:
>> >>
>> >> #a0 array_get aS, 0
>> >> #a1 array_get aS, 1
>> >> inrg 1, #a0, #a1
>> >> ...
>> >>
>> >> I know inrg had some code changes, but we may need to double check
>> >> whether those were necessary at all.
>> >>
>> >> Note you should be able to do this though:
>> >>
>> >> aS[] init 2
>> >> aS[0], aS[1]  inch 1,2
>> >>
>> >> That would an opcode list of something like:
>> >>
>> >> #a0, #a1 inch 1,2,
>> >> array_set aS, 0, #a0
>> >> array_set aS, 0, #a1
>> >>
>> >>
>> >> On Sat, Apr 22, 2017 at 2:22 PM, Justin Smith <[hidden email]>
>> >> wrote:
>> >> > I just pulled from origin/develop (I'm up to date with commit
>> >> > 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the
>> >> > issue.
>> >> >
>> >> > If it helps, I was able to reproduce the error with regular stereo -
>> >> > here's
>> >> > two instruments, i1 will get nothing but zeros from the sound card,
>> >> > and
>> >> > i2
>> >> > gets the actual audio data
>> >> >
>> >> > instr 1
>> >> > aS[] init 2
>> >> >      inrg 1, aS[0], aS[1]
>> >> >      outrg 1, aS[0], aS[1]
>> >> > endin
>> >> >
>> >> > instr 2
>> >> > a0, a1 inch 1, 2
>> >> >      outrg 1, a0, a1
>> >> > endin
>> >> >
>> >> > On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]>
>> >> > wrote:
>> >> >>
>> >> >> excellent, I'll check it out this evening, thank you
>> >> >>
>> >> >> On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
>> >> >>>
>> >> >>> I think  it is fixed in git -- please try
>> >> >>>
>> >> >>> On Thu, 20 Apr 2017, Justin Smith wrote:
>> >> >>>
>> >> >>> >
>> >> >>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Fwd: inrg with arrays broken on develop?

Victor Lazzarini
In reply to this post by Steven Yi
We could introduce references, maybe, to expose array memory? Off the top
of my head

opcode   ref(arr[0])

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 22 Apr 2017, at 20:14, Steven Yi <[hidden email]> wrote:
>
> Yes, perhaps we should have additional information added to the manual
> to explain this.  Could you kindly file an issue for this in the
> manual repository?
>
> That said, I was going through mentally to see what might be possible.
> Because we have contiguous memory for array members without the types
> between each member, we can't just expose the member's address.  For
> example, we have something like this now:
>
> [array type][a type][member 0][member 1][member 2]
>
> and not:
>
> [array type][a type][member 0][a type][member 1][a type][member 2]
>
> If we had the latter in memory, we could actually do without
> array_set/array_get and synthesizing variables, as opcodes could
> directly write to memory of members and RTTI would work fine.  On the
> other hand, we get into some tricky bits as we do reallocation of
> arrays and we only set pointers for opcode arguments once at
> init-time.
>
> (I think what we have is something like packed arrays as mentioned in:
>
> https://www.ibm.com/support/knowledgecenter/SSYKE2_7.1.0/com.ibm.java.win.71.doc/user/packed_arrays.html
>
> )
>
> Anyways, I don't know whether anyone here would want to investigate
> this kind of thing further, but I'm happy enough to leave it here for
> the moment.  Perhaps the above information may be useful for future
> work.
>
>
>> On Sat, Apr 22, 2017 at 6:44 PM, Justin Smith <[hidden email]> wrote:
>> Oh, so arrays wont work as right hand side "output args"; I can of course
>> use an alternative opcode (and am currently), I reported the issue in case
>> csound was meant to support this sort of usage. Happy to accept that it is
>> Not A Bug with this explanatio (but perhaps the Array docs should mention
>> cases like this?).
>>
>>> On Sat, Apr 22, 2017 at 3:21 PM Steven Yi <[hidden email]> wrote:
>>>
>>> Oh, I should have looked at the CSD code; that certainly won't work.
>>> What is happening is that because inrg writes to the right-hand side
>>> variables, it's actually writing to temp vars. The translated opcode
>>> list should look something like:
>>>
>>> #a0 array_get aS, 0
>>> #a1 array_get aS, 1
>>> inrg 1, #a0, #a1
>>> ...
>>>
>>> I know inrg had some code changes, but we may need to double check
>>> whether those were necessary at all.
>>>
>>> Note you should be able to do this though:
>>>
>>> aS[] init 2
>>> aS[0], aS[1]  inch 1,2
>>>
>>> That would an opcode list of something like:
>>>
>>> #a0, #a1 inch 1,2,
>>> array_set aS, 0, #a0
>>> array_set aS, 0, #a1
>>>
>>>
>>> On Sat, Apr 22, 2017 at 2:22 PM, Justin Smith <[hidden email]>
>>> wrote:
>>>> I just pulled from origin/develop (I'm up to date with commit
>>>> 1e666280da3dce4442c5ac4fb5568ce7dec37a07) and I'm still seeing the
>>>> issue.
>>>>
>>>> If it helps, I was able to reproduce the error with regular stereo -
>>>> here's
>>>> two instruments, i1 will get nothing but zeros from the sound card, and
>>>> i2
>>>> gets the actual audio data
>>>>
>>>> instr 1
>>>> aS[] init 2
>>>>     inrg 1, aS[0], aS[1]
>>>>     outrg 1, aS[0], aS[1]
>>>> endin
>>>>
>>>> instr 2
>>>> a0, a1 inch 1, 2
>>>>     outrg 1, a0, a1
>>>> endin
>>>>
>>>> On Fri, Apr 21, 2017 at 6:43 AM Justin Smith <[hidden email]>
>>>> wrote:
>>>>>
>>>>> excellent, I'll check it out this evening, thank you
>>>>>
>>>>>> On Fri, Apr 21, 2017 at 6:15 AM jpff <[hidden email]> wrote:
>>>>>>
>>>>>> I think  it is fixed in git -- please try
>>>>>>
>>>>>>> On Thu, 20 Apr 2017, Justin Smith wrote:
>>>>>>>
>>>>>>>
>>>>>>>
Loading...