Sorry, I had to report for jury duty yesterday which threw off my entire day and resulted in pretty much my morning and evening devoted to making up for lost time at work. I'm still a little confused over the type arg, but not in the C function but rather in Csound code. Let's say I want to use a named channel at a-rate, but init it with an i-time variable. How will csound know to make it an a-rate signal? What about not offering arate and only using it for i/k/S? steven On 9/9/05, Istvan Varga wrote: > Well, having no reponse I think I will remove the functions for now. > > Istvan Varga wrote: > > > So, does anyone have comments ? If no one is interested, I will > > remove what code is already there. > > > > Istvan Varga wrote: > > > >> Here is my current idea of the interface and opcodes (these most probably > >> need to be changed/renamed). Any suggestions are welcome. > >> > >> 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 > >> > >> Write to a channel. If it does not exist yet, it is allocated, > >> otherwise the type must be compatible. > > > > > > -- > 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