Csound Csound-dev Csound-tekno Search About

[Cs-dev] UDO : k vs. K

Date2013-04-13 22:08
FromSteven Yi
Subject[Cs-dev] UDO : k vs. K
Hi All,

I'm finding it odd that there's a K and a k, where the only difference
is in K, there's a value copy done at init-time in addition to
perf-time.  As far as I can imagine, there isn't a case where a k-var
wouldn't cause a problem to be copied at init-time as well, but the
flipside is that not having initialization can cause problems.  For
example, imagine this code:

opcode test, a,k
kval xin
...
xout asig
endop

instr 1
kval init 99
a1 test kval
outs a1, a1
endin

If you assume that test's kval will be 99 at start, that'd be
incorrect as it's not initialized.  The above doesn't quite illustrate
the problem exactly, but for me in Blue, where using a gkval that is
generated from widgets, I get subtle problems to find if k is used
instead of K when passing a gkvalue from an instr to a UDO.

I wondered if anyone had any issues if I changed k to behave the same
way as K, thus making K essentially the same as k.

Thanks!
steven

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-04-13 23:52
FromSteven Yi
SubjectRe: [Cs-dev] UDO : k vs. K
Nevermind, I think I understand what caused the problem now, and it's
something I can fix with better top-level code. (It had to do with
code using i(gkvar) that I moved into a UDO, where I should have
changed the input args to the UDO to i instead of k or K).  I retract
this request now, thanks!

On Sat, Apr 13, 2013 at 10:08 PM, Steven Yi  wrote:
> Hi All,
>
> I'm finding it odd that there's a K and a k, where the only difference
> is in K, there's a value copy done at init-time in addition to
> perf-time.  As far as I can imagine, there isn't a case where a k-var
> wouldn't cause a problem to be copied at init-time as well, but the
> flipside is that not having initialization can cause problems.  For
> example, imagine this code:
>
> opcode test, a,k
> kval xin
> ...
> xout asig
> endop
>
> instr 1
> kval init 99
> a1 test kval
> outs a1, a1
> endin
>
> If you assume that test's kval will be 99 at start, that'd be
> incorrect as it's not initialized.  The above doesn't quite illustrate
> the problem exactly, but for me in Blue, where using a gkval that is
> generated from widgets, I get subtle problems to find if k is used
> instead of K when passing a gkvalue from an instr to a UDO.
>
> I wondered if anyone had any issues if I changed k to behave the same
> way as K, thus making K essentially the same as k.
>
> Thanks!
> steven

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net