[Csnd] mediank array

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] mediank array

Andreas Bergsland-2

Hi

I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.

I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.

I now get a segfault with:

 

SECTION 1:

new alloc for instr 1:

instr 1:  icnt = 1.000

instr 1:  icnt = 0.000

PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised

kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            

   note aborted

csound command: Segmentation fault

 

Does anybody have an idea what to do here?

(I am on 6.10.0 on osx 10.12.6)

Best,

Andreas

 

                opcode Mediank_array, k[], k[]kio

kArr_in[], kwinsize, imaxsize, icnt            xin

iLen                       lenarray               kArr_in

kArr[]    init                         iLen

kDum[] init                         iLen

if icnt >=              iLen-1 igoto cont

kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1

cont:

kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize

print      icnt

xout      kArr

endop

 

instr       1

kArr_in[]                             init                                         2

kArr_in[0]                           lfo                                          1, 2, 1

kArr_in[1]                           lfo                                          -1, 2, 1

kArr_out[]                          init                                         (lenarray(kArr_in))

kArr_out                             Mediank_array kArr_in, 5, 10

endin

 

-- 

Andreas Bergsland

 

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Victor Lazzarini-2
I have to investigate the segfault (nothing should segfault), but there are problems with your design. Each recursive instance will have its own kArr, and only one of then is output to the instrument. Maybe passing a kArr as input to hold the final output might work (have to think more about it).

For some reason the opcode initialisation is either not complete or is being skipped.
We need to check this. 

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

On 17 Mar 2018, at 13:49, Andreas Bergsland <[hidden email]> wrote:

Hi

I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.

I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.

I now get a segfault with:

 

SECTION 1:

new alloc for instr 1:

instr 1:  icnt = 1.000

instr 1:  icnt = 0.000

PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised

kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            

   note aborted

csound command: Segmentation fault

 

Does anybody have an idea what to do here?

(I am on 6.10.0 on osx 10.12.6)

Best,

Andreas

 

                opcode Mediank_array, k[], k[]kio

kArr_in[], kwinsize, imaxsize, icnt            xin

iLen                       lenarray               kArr_in

kArr[]    init                         iLen

kDum[] init                         iLen

if icnt >=              iLen-1 igoto cont

kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1

cont:

kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize

print      icnt

xout      kArr

endop

 

instr       1

kArr_in[]                             init                                         2

kArr_in[0]                           lfo                                          1, 2, 1

kArr_in[1]                           lfo                                          -1, 2, 1

kArr_out[]                          init                                         (lenarray(kArr_in))

kArr_out                             Mediank_array kArr_in, 5, 10

endin

 

-- 

Andreas Bergsland

 

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Victor Lazzarini-2
In reply to this post by Andreas Bergsland-2
Just spotted something wrong: you are using igoto, when it needs to be goto (which is i & k time). That is
the reason for the not initialised message
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 17 Mar 2018, at 13:48, Andreas Bergsland <[hidden email]> wrote:
>
> Hi
> I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.
> I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.
> I now get a segfault with:
>  
> SECTION 1:
> new alloc for instr 1:
> instr 1:  icnt = 1.000
> instr 1:  icnt = 0.000
> PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised
> kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            
>    note aborted
> csound command: Segmentation fault
>  
> Does anybody have an idea what to do here?
> (I am on 6.10.0 on osx 10.12.6)
> Best,
> Andreas
>  
>                 opcode Mediank_array, k[], k[]kio
> kArr_in[], kwinsize, imaxsize, icnt            xin
> iLen                       lenarray               kArr_in
> kArr[]    init                         iLen
> kDum[] init                         iLen
> if icnt >=              iLen-1 igoto cont
> kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1
> cont:
> kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize
> print      icnt
> xout      kArr
> endop
>  
> instr       1
> kArr_in[]                             init                                         2
> kArr_in[0]                           lfo                                          1, 2, 1
> kArr_in[1]                           lfo                                          -1, 2, 1
> kArr_out[]                          init                                         (lenarray(kArr_in))
> kArr_out                             Mediank_array kArr_in, 5, 10
> endin
>  
> --
> Andreas Bergsland
>  
> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issuesDiscussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Victor Lazzarini-2
fixed the segfault on git.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 17 Mar 2018, at 14:41, Victor Lazzarini <[hidden email]> wrote:
>
> Just spotted something wrong: you are using igoto, when it needs to be goto (which is i & k time). That is
> the reason for the not initialised message
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 17 Mar 2018, at 13:48, Andreas Bergsland <[hidden email]> wrote:
>>
>> Hi
>> I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.
>> I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.
>> I now get a segfault with:
>>
>> SECTION 1:
>> new alloc for instr 1:
>> instr 1:  icnt = 1.000
>> instr 1:  icnt = 0.000
>> PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised
>> kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            
>>   note aborted
>> csound command: Segmentation fault
>>
>> Does anybody have an idea what to do here?
>> (I am on 6.10.0 on osx 10.12.6)
>> Best,
>> Andreas
>>
>>                opcode Mediank_array, k[], k[]kio
>> kArr_in[], kwinsize, imaxsize, icnt            xin
>> iLen                       lenarray               kArr_in
>> kArr[]    init                         iLen
>> kDum[] init                         iLen
>> if icnt >=              iLen-1 igoto cont
>> kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1
>> cont:
>> kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize
>> print      icnt
>> xout      kArr
>> endop
>>
>> instr       1
>> kArr_in[]                             init                                         2
>> kArr_in[0]                           lfo                                          1, 2, 1
>> kArr_in[1]                           lfo                                          -1, 2, 1
>> kArr_out[]                          init                                         (lenarray(kArr_in))
>> kArr_out                             Mediank_array kArr_in, 5, 10
>> endin
>>
>> --
>> Andreas Bergsland
>>
>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issuesDiscussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Andreas Bergsland-2
In reply to this post by Victor Lazzarini-2

Thanks for looking into it Victor. It might not be possible then, to use recursion to solve this task due to kArr be overwritten?

Best, Andreas

 

From: A discussion list for users of Csound <[hidden email]> on behalf of Victor Lazzarini <[hidden email]>
Reply-To: A discussion list for users of Csound <[hidden email]>
Date: Saturday, 17 March 2018 at 15:34
To: "[hidden email]" <[hidden email]>
Subject: Re: [Csnd] mediank array

 

I have to investigate the segfault (nothing should segfault), but there are problems with your design. Each recursive instance will have its own kArr, and only one of then is output to the instrument. Maybe passing a kArr as input to hold the final output might work (have to think more about it).

 

For some reason the opcode initialisation is either not complete or is being skipped.

We need to check this. 

Victor Lazzarini

Dean of Arts, Celtic Studies, and Philosophy

Maynooth University

Ireland


On 17 Mar 2018, at 13:49, Andreas Bergsland <
[hidden email]> wrote:

Hi

I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.

I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.

I now get a segfault with:

 

SECTION 1:

new alloc for instr 1:

instr 1:  icnt = 1.000

instr 1:  icnt = 0.000

PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised

kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            

   note aborted

csound command: Segmentation fault

 

Does anybody have an idea what to do here?

(I am on 6.10.0 on osx 10.12.6)

Best,

Andreas

 

                opcode Mediank_array, k[], k[]kio

kArr_in[], kwinsize, imaxsize, icnt            xin

iLen                       lenarray               kArr_in

kArr[]    init                         iLen

kDum[] init                         iLen

if icnt >=              iLen-1 igoto cont

kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1

cont:

kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize

print      icnt

xout      kArr

endop

 

instr       1

kArr_in[]                             init                                         2

kArr_in[0]                           lfo                                          1, 2, 1

kArr_in[1]                           lfo                                          -1, 2, 1

kArr_out[]                          init                                         (lenarray(kArr_in))

kArr_out                             Mediank_array kArr_in, 5, 10

endin

 

-- 

Andreas Bergsland

 

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Victor Lazzarini-2
No, I am not saying that. The particular design you offered would not work, but you can try
replacing the data in the input array rather than creating new arrays inside each UDO instance.

The other issue with your code was your use of igoto instead of goto. That cause the missing
initialisation error.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 19 Mar 2018, at 06:39, Andreas Bergsland <[hidden email]> wrote:
>
> Thanks for looking into it Victor. It might not be possible then, to use recursion to solve this task due to kArr be overwritten?
> Best, Andreas
>  
> From: A discussion list for users of Csound <[hidden email]> on behalf of Victor Lazzarini <[hidden email]>
> Reply-To: A discussion list for users of Csound <[hidden email]>
> Date: Saturday, 17 March 2018 at 15:34
> To: "[hidden email]" <[hidden email]>
> Subject: Re: [Csnd] mediank array
>  
> I have to investigate the segfault (nothing should segfault), but there are problems with your design. Each recursive instance will have its own kArr, and only one of then is output to the instrument. Maybe passing a kArr as input to hold the final output might work (have to think more about it).
>  
> For some reason the opcode initialisation is either not complete or is being skipped.
> We need to check this.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 17 Mar 2018, at 13:49, Andreas Bergsland <[hidden email]> wrote:
>
> Hi
> I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.
> I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.
> I now get a segfault with:
>  
> SECTION 1:
> new alloc for instr 1:
> instr 1:  icnt = 1.000
> instr 1:  icnt = 0.000
> PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised
> kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            
>    note aborted
> csound command: Segmentation fault
>  
> Does anybody have an idea what to do here?
> (I am on 6.10.0 on osx 10.12.6)
> Best,
> Andreas
>  
>                 opcode Mediank_array, k[], k[]kio
> kArr_in[], kwinsize, imaxsize, icnt            xin
> iLen                       lenarray               kArr_in
> kArr[]    init                         iLen
> kDum[] init                         iLen
> if icnt >=              iLen-1 igoto cont
> kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1
> cont:
> kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize
> print      icnt
> xout      kArr
> endop
>  
> instr       1
> kArr_in[]                             init                                         2
> kArr_in[0]                           lfo                                          1, 2, 1
> kArr_in[1]                           lfo                                          -1, 2, 1
> kArr_out[]                          init                                         (lenarray(kArr_in))
> kArr_out                             Mediank_array kArr_in, 5, 10
> endin
>  
> --
> Andreas Bergsland
>  
> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issuesDiscussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Victor Lazzarini-2
This is  a trivial example of what I meant

opcode Test,k[],k[]o
kArr[],icnt xin
if icnt >= lenarray(kArr)-1 goto body
kArr[] Test kArr,icnt+1
body:
 kArr[icnt] = icnt;
 xout kArr
endop



 
instr       1
kArr[] init 4
kArr[] Test kArr
kcnt = 0
while kcnt < lenarray(kArr) do
   printk2 kArr[kcnt]
   printk2 kcnt
   kcnt += 1
od


========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 20 Mar 2018, at 14:51, Victor Lazzarini <[hidden email]> wrote:
>
> No, I am not saying that. The particular design you offered would not work, but you can try
> replacing the data in the input array rather than creating new arrays inside each UDO instance.
>
> The other issue with your code was your use of igoto instead of goto. That cause the missing
> initialisation error.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 19 Mar 2018, at 06:39, Andreas Bergsland <[hidden email]> wrote:
>>
>> Thanks for looking into it Victor. It might not be possible then, to use recursion to solve this task due to kArr be overwritten?
>> Best, Andreas
>>
>> From: A discussion list for users of Csound <[hidden email]> on behalf of Victor Lazzarini <[hidden email]>
>> Reply-To: A discussion list for users of Csound <[hidden email]>
>> Date: Saturday, 17 March 2018 at 15:34
>> To: "[hidden email]" <[hidden email]>
>> Subject: Re: [Csnd] mediank array
>>
>> I have to investigate the segfault (nothing should segfault), but there are problems with your design. Each recursive instance will have its own kArr, and only one of then is output to the instrument. Maybe passing a kArr as input to hold the final output might work (have to think more about it).
>>
>> For some reason the opcode initialisation is either not complete or is being skipped.
>> We need to check this.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>> On 17 Mar 2018, at 13:49, Andreas Bergsland <[hidden email]> wrote:
>>
>> Hi
>> I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.
>> I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.
>> I now get a segfault with:
>>
>> SECTION 1:
>> new alloc for instr 1:
>> instr 1:  icnt = 1.000
>> instr 1:  icnt = 0.000
>> PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised
>> kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            
>>   note aborted
>> csound command: Segmentation fault
>>
>> Does anybody have an idea what to do here?
>> (I am on 6.10.0 on osx 10.12.6)
>> Best,
>> Andreas
>>
>>                opcode Mediank_array, k[], k[]kio
>> kArr_in[], kwinsize, imaxsize, icnt            xin
>> iLen                       lenarray               kArr_in
>> kArr[]    init                         iLen
>> kDum[] init                         iLen
>> if icnt >=              iLen-1 igoto cont
>> kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1
>> cont:
>> kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize
>> print      icnt
>> xout      kArr
>> endop
>>
>> instr       1
>> kArr_in[]                             init                                         2
>> kArr_in[0]                           lfo                                          1, 2, 1
>> kArr_in[1]                           lfo                                          -1, 2, 1
>> kArr_out[]                          init                                         (lenarray(kArr_in))
>> kArr_out                             Mediank_array kArr_in, 5, 10
>> endin
>>
>> --
>> Andreas Bergsland
>>
>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issuesDiscussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] mediank array

Andreas Bergsland-2
Great! So, I tried

opcode Test,k[],k[]o
kArr[],icnt xin
if icnt >= lenarray(kArr)-1 goto body
kArr[] Test kArr,icnt+1
body:
kArr[icnt] mediank kArr[icnt], 500, 501
xout kArr
endop

and it seemed to work as desired.
Thanks!

´╗┐On 20/03/2018, 16:06, "A discussion list for users of Csound on behalf of Victor Lazzarini" <[hidden email] on behalf of [hidden email]> wrote:

    This is  a trivial example of what I meant
   
    opcode Test,k[],k[]o
    kArr[],icnt xin
    if icnt >= lenarray(kArr)-1 goto body
    kArr[] Test kArr,icnt+1
    body:
     kArr[icnt] = icnt;
     xout kArr
    endop
   
   
   
     
    instr       1
    kArr[] init 4
    kArr[] Test kArr
    kcnt = 0
    while kcnt < lenarray(kArr) do
       printk2 kArr[kcnt]
       printk2 kcnt
       kcnt += 1
    od
   
   
    ========================
    Prof. Victor Lazzarini
    Dean of Arts, Celtic Studies, and Philosophy,
    Maynooth University,
    Maynooth, Co Kildare, Ireland
    Tel: 00 353 7086936
    Fax: 00 353 1 7086952
   
    > On 20 Mar 2018, at 14:51, Victor Lazzarini <[hidden email]> wrote:
    >
    > No, I am not saying that. The particular design you offered would not work, but you can try
    > replacing the data in the input array rather than creating new arrays inside each UDO instance.
    >
    > The other issue with your code was your use of igoto instead of goto. That cause the missing
    > initialisation error.
    > ========================
    > Prof. Victor Lazzarini
    > Dean of Arts, Celtic Studies, and Philosophy,
    > Maynooth University,
    > Maynooth, Co Kildare, Ireland
    > Tel: 00 353 7086936
    > Fax: 00 353 1 7086952
    >
    >> On 19 Mar 2018, at 06:39, Andreas Bergsland <[hidden email]> wrote:
    >>
    >> Thanks for looking into it Victor. It might not be possible then, to use recursion to solve this task due to kArr be overwritten?
    >> Best, Andreas
    >>
    >> From: A discussion list for users of Csound <[hidden email]> on behalf of Victor Lazzarini <[hidden email]>
    >> Reply-To: A discussion list for users of Csound <[hidden email]>
    >> Date: Saturday, 17 March 2018 at 15:34
    >> To: "[hidden email]" <[hidden email]>
    >> Subject: Re: [Csnd] mediank array
    >>
    >> I have to investigate the segfault (nothing should segfault), but there are problems with your design. Each recursive instance will have its own kArr, and only one of then is output to the instrument. Maybe passing a kArr as input to hold the final output might work (have to think more about it).
    >>
    >> For some reason the opcode initialisation is either not complete or is being skipped.
    >> We need to check this.
    >>
    >> Victor Lazzarini
    >> Dean of Arts, Celtic Studies, and Philosophy
    >> Maynooth University
    >> Ireland
    >>
    >> On 17 Mar 2018, at 13:49, Andreas Bergsland <[hidden email]> wrote:
    >>
    >> Hi
    >> I a m trying to make an udo with a median filter for k-rate arrays, and I thought that I could do it by way of recursion.
    >> I am not sure if this is the right approach at all, but I thought that in this way the mediank opcode would be called as many times as there were elements in the array.
    >> I now get a segfault with:
    >>
    >> SECTION 1:
    >> new alloc for instr 1:
    >> instr 1:  icnt = 1.000
    >> instr 1:  icnt = 0.000
    >> PERF ERROR in instr 1 (opcode Mediank_array): Mediank_array: not initialised
    >> kDum    Mediank_array kArr_in kwinsize              imaxsize              #i2          0            
    >>   note aborted
    >> csound command: Segmentation fault
    >>
    >> Does anybody have an idea what to do here?
    >> (I am on 6.10.0 on osx 10.12.6)
    >> Best,
    >> Andreas
    >>
    >>                opcode Mediank_array, k[], k[]kio
    >> kArr_in[], kwinsize, imaxsize, icnt            xin
    >> iLen                       lenarray               kArr_in
    >> kArr[]    init                         iLen
    >> kDum[] init                         iLen
    >> if icnt >=              iLen-1 igoto cont
    >> kDum                   Mediank_array kArr_in, kwinsize, imaxsize, icnt+1
    >> cont:
    >> kArr[icnt]                            mediank              kArr_in[icnt], kwinsize, imaxsize
    >> print      icnt
    >> xout      kArr
    >> endop
    >>
    >> instr       1
    >> kArr_in[]                             init                                         2
    >> kArr_in[0]                           lfo                                          1, 2, 1
    >> kArr_in[1]                           lfo                                          -1, 2, 1
    >> kArr_out[]                          init                                         (lenarray(kArr_in))
    >> kArr_out                             Mediank_array kArr_in, 5, 10
    >> endin
    >>
    >> --
    >> Andreas Bergsland
    >>
    >> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
    >> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
    >> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issuesDiscussions of bugs and features can be posted here
    >
    > Csound mailing list
    > [hidden email]
    > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    > Send bugs reports to
    >        https://github.com/csound/csound/issues
    > Discussions of bugs and features can be posted here
   
    Csound mailing list
    [hidden email]
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    Send bugs reports to
            https://github.com/csound/csound/issues
    Discussions of bugs and features can be posted here
   


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here