Hi Istvan, I the functionality sounds good. As for names, could we perhaps use a common prefix so that the opcodes stay together in terms of manual and my own memory? i.e. chnget chnset chn_k Also, just to get it straight in my head, will it be possible to initialize a channel with chn_a and then setchn with an ival, as well as read from a chn_k channel into an irate variable? chn seems a little short to remember, maybe it would be alright to just use setchannel and getchannel? And are these too close in name to chani/chano? I also feel that Matt's idea of somehow unifying all of these different busses and channel opcodes would be nice, but due to different different usage patterns between zak and chani/chano and setchn/getchn, as well as backwards compatibility, I'm not sure if there will be a way to do so. Thanks! steven On 9/10/05, Istvan Varga wrote: > Michael Gogins wrote: > > > I think Istvan's suggestion is very sensible, especially for hosts > > that drive csound by performing ksmps at a time. In that case the host > > always knows Csound isn't doing anything when the host changes the value > > of a variable, and Csound knows the host isn't going to monkey with a > > variable while Csound is computing. > > So, should it be implemented as documented below, or does anyone > suggest changes (even if something simple like different names etc.) ? > > ---------------------------------------------------------------------- > > API FUNCTIONS > > PUBLIC int csoundGetChannelPtr(CSOUND *csound, > MYFLT **p, const char *name, int type); > > Stores a pointer to the specified channel in *p. The channel is > automatically created and initialized to zero if it does not exist yet. > > 'name' must be a non-NULL, non-empty string composed of letters, digits, > and the underscore character, and the first character must be a letter. > > 'type' should be one of the following: > > 1: k-rate (single MYFLT value) > 2: a-rate (vector of csoundGetKsmps(csound) MYFLT values) > 3: S-rate (vector of MYFLT values with enough space for storing > csoundGetStrVarMaxLen(csound) - 1 characters) > > Note: types 2 and 3 should only be used after the orchestra is > successfully compiled with csoundCompile(), otherwise the vector > sizes are undefined. > > Returns zero on success, or one of the following error codes: > > CSOUND_ERROR invalid parameters > CSOUND_MEMORY memory allocation failure > any positive value the channel already exists with a different type > that is returned as the error code > > PUBLIC int csoundListChannels(CSOUND *csound, char ***names, int **types); > > Creates an alphabetically sorted list of all available channels, > storing names in *names, and types (see above) in *types; (*types)[n] > corresponds to (*names)[n]. If not NULL, both arrays should be freed > when no longer needed with free(). > Returns the number of channels, possibly zero if there are none, > or a negative error code. > > OPCODES > > chn_k Sname > chn_a Sname > chn_S Sname > > Allocate a k-, a-, or S-rate channel with the specified name. > If it already exists with the same type, the opcode is ignored, > however, an init error occurs if the channel exists with a different type. > > ival getchn Sname > kval getchn Sname > aval getchn Sname > Sval getchn Sname > > Read from a channel (allocated if does not exist yet); > the type must be compatible. > > setchn Sname, ival > setchn Sname, kval > setchn Sname, aval > setchn Sname, Sval > -- > Send bugs reports to this list. > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk > -- Send bugs reports to this list. To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk