Csound Csound-dev Csound-tekno Search About

[Csnd-dev] array oddities

Date2016-01-12 00:26
FromSteven Yi
Subject[Csnd-dev] array oddities
Attachmentstest_mvclpf3.csd  
Hi All,

I was experimenting with some array stuff for testing mvclpf3 just now
and ran into a couple of oddities:

1. Writing a UDO that should only be I-time is producing UDO's that
have a perf-pass.  Maybe this is a UDO thing, but I expected the
concat and repeat UDOs in the example to only user init-time code.
Instead, I got an error from Csound saying that perf-time code not
allowed when calling this from instr 0. (I ended up moving everything
in the "start" instrument to get around it.)

2. Reading from and writing to the same array looks to not work
correctly.  The commented out code in the start instrument did
concatenation.  I'm not sure what the issue is there but I would have
expected that one to work.

For arrays, I was thinking it would be nice to have something like
concat built-in, as well as arraycopy which would have the same
signature as Java's System.arrayCopy():

arraycopy src, srcPos, dest, destPos, length

I think with something like this, it'd be efficient to implement an
array-backed list using usercode.

Thanks!
steven