Csound Csound-dev Csound-tekno Search About

[Csnd] UDO Feature Request

Date2012-06-18 04:44
FromJim Aikin
Subject[Csnd] UDO Feature Request
In my tests, it appears that the code in a UDO is always visited on each
k-rate pass, even if the in-type(s) and out-type(s) are i-rate. For certain
purposes (such as, perhaps, shuffling the contents of a numerical data table
at the start of a musical phrase), this can prove rather awkward or
inconvenient -- especially if you don't expect it.

I'd like to suggest an opcode called opcode_i, which would allow only
init-pass in- and out-types, and would be called only on the init-pass of
the calling instrument and ignored on the k-rate passes.

--Jim Aikin

--
View this message in context: http://csound.1045644.n5.nabble.com/UDO-Feature-Request-tp5713842.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-06-18 09:17
FromLouis Cohen
SubjectRe: [Csnd] UDO Feature Request
Jim,

I think your proposal is a good one.

But because I have always been confused by some of the subtleties of i- 
rate variables, I have settled into a coding practice that makes  
everything clear to me. If you're not using this technique, I  
recommend it:

ktrig init 1 ;happens only at init-time
if(ktrig==1) then
	...your one-time code here, for example:
         call your favorite UDO, even using k-rate inputs and outputs
         ktrig = 0;ensures that the ktrig will never be 1 again
endif
...the rest of your instrument here, runs every k-cycle

The code inside the if/endif gets executed just once, on the first k- 
cycle. The UDO call inside the if/endif occurs just once.

best,
Lou Cohen


On Jun 17, 2012, at 11:44 PM, Jim Aikin wrote:

> In my tests, it appears that the code in a UDO is always visited on  
> each
> k-rate pass, even if the in-type(s) and out-type(s) are i-rate. For  
> certain
> purposes (such as, perhaps, shuffling the contents of a numerical  
> data table
> at the start of a musical phrase), this can prove rather awkward or
> inconvenient -- especially if you don't expect it.
>
> I'd like to suggest an opcode called opcode_i, which would allow only
> init-pass in- and out-types, and would be called only on the init- 
> pass of
> the calling instrument and ignored on the k-rate passes.
>
> --Jim Aikin
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/UDO-Feature-Request-tp5713842.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>


Date2012-06-18 16:41
FromJim Aikin
Subject[Csnd] Re: UDO Feature Request
Thanks, Louis. I was already using a slightly different version of that
concept. It works perfectly.

--
View this message in context: http://csound.1045644.n5.nabble.com/UDO-Feature-Request-tp5713842p5713853.html
Sent from the Csound - General mailing list archive at Nabble.com.