[Csnd] Question(s) on genarray
Date | 2013-07-24 14:42 |
From | john ffitch |
Subject | [Csnd] Question(s) on genarray |
There has been a discussion about what the genarray opcode should do. This e-mail is to see if there is a consensus. Reminder: genarray writes an array in an arithmetic sequence genarray 1, 4 => [1, 2, 3, 4] genarray 1, 2, 0.5 => [1, 1.5, 2] The current implementation is that genarray is an i-time operation like init. The other suggestion is that it should be a k-rate operation, writing values every perf cycle, and there should be a genarray_i operation that is like the current genarray. This needs to be settled before the next release so as not to break backward compatability say inside a week. Anyone have answers, reasons, etc? ==John ffitch |
Date | 2013-07-24 15:18 |
From | Louis Cohen |
Subject | Re: [Csnd] Question(s) on genarray |
John, It makes good sense to me to have genarray work in i-mode and k-mode. For small arrays, running at k-rate could be very useful. Obviously for large arrays running at k-rate could be unduly time consuming. Maybe: genarrayi genarrayk ? Another thought is to make genarray work ONLY at k-rate, since with appropriate coding it can be made to execute only in the first k-cycle (or, with trickier coding, to operate in some k-cycles but not others.) best, Lou Cohen On Jul 24, 2013, at 9:42 AM, john ffitch |
Date | 2013-07-24 15:44 |
From | Ben Hackbarth |
Subject | Re: [Csnd] Question(s) on genarray |
> genarray 1, 2, 0.5 => [1, 1.5, 2] another option would begenarray 1, 2, 2 -> [1, 2] genarray 1, 2, 5 -> [1, 1.25, 1.5, 1.75, 2] -- ben
On Wed, Jul 24, 2013 at 4:18 PM, Louis Cohen <loucohen@jolc.net> wrote: John, |
Date | 2013-07-24 16:00 |
From | "\\js" |
Subject | Re: [Csnd] Question(s) on genarray |
hi ok, i have not been a part of this discussion at all but i had a thought regarding this part: On 7/24/13 9:42 , john ffitch wrote: > The current implementation is that genarray is an i-time operation > like init. The other suggestion is that it should be a k-rate > operation, writing values every perf cycle, and there should be a > genarray_i operation that is like the current genarray. could you call it have it both ways depending on the return variable? iarr genarray 1, 4 karr genarray 1, 2, 0.5 although, if called to an anonymous return value [don't know if this can happen] you might need the genarray_k and genarray_i functions. if called in an anonymous context without specification, it should probably do what it did before [although k-rate would save cycles, right?]. my reasons are just based on knowing what i know about csound and trying to design the API to allow for maximum flexibility. good luck! -- \js [http://or8.net/~johns/] - |
Date | 2013-07-24 18:00 |
From | Andres Cabrera |
Subject | Re: [Csnd] Question(s) on genarray |
I'm not sure if it makes sense here but arrays in numpy (and possibly other similar systems) are half open ranges like this: Cheers,In [4]: arange(0,3) Out[4]: array([0, 1, 2]) In [5]: range(0,3) Out[5]: [0, 1, 2] In [6]: arange(0,3,0.2) Out[6]: array([ 0. , 0.2, 0.4, 0.6, 0.8, 1. , 1.2, 1.4, 1.6, 1.8, 2. , 2.2, 2.4, 2.6, 2.8]) Andrés On Wed, Jul 24, 2013 at 8:00 AM, \js <johns@or8.net> wrote: hi |