Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] API, was Broken again

Date2005-03-25 15:49
FromMichael Gogins
SubjectRe: [Cs-dev] API, was Broken again
I mean global variables that are declared in the Csound orchestra. Can your API access these variables? If so that is great.

Or conversely, can your API create variables that are in scope of the Csound orchestra?

-----Original Message-----
From: Istvan Varga 
Sent: Mar 25, 2005 10:37 AM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] API, was Broken again

Michael Gogins wrote:

> Global variables.

I still do not know what kind of "global variables" you want.
The following functions exist for a few months now, but I assume
you request something different that needs more explanation.

   /**
    * Allocate nbytes bytes of memory that can be accessed later by calling
    * csoundQueryGlobalVariable() with the specified name; the space is
    * cleared to zero.
    * Returns CSOUND_SUCCESS on success, CSOUND_ERROR in case of invalid
    * parameters (zero nbytes, invalid or already used name), or
    * CSOUND_MEMORY if there is not enough memory.
    */
   PUBLIC int csoundCreateGlobalVariable(void *csound, const char *name,
                                         size_t nbytes);

   /**
    * Get pointer to space allocated with the name "name".
    * Returns NULL if the specified name is not defined.
    */
   PUBLIC void *csoundQueryGlobalVariable(void *csound, const char *name);

   /**
    * This function is the same as csoundQueryGlobalVariable(), except the
    * variable is assumed to exist and no error checking is done.
    * Faster, but may crash or return an invalid pointer if 'name' is
    * not defined.
    */
   PUBLIC void *csoundQueryGlobalVariableNoCheck(void *csound, const char *name);

   /**
    * Free memory allocated for "name" and remove "name" from the database.
    * Return value is CSOUND_SUCCESS on success, or CSOUND_ERROR if the name is
    * not defined.
    */
   PUBLIC int csoundDestroyGlobalVariable(void *csound, const char *name);


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-25 16:10
FromIstvan Varga
SubjectRe: [Cs-dev] API, was Broken again
Michael Gogins wrote:

> I mean global variables that are declared in the Csound orchestra.

Like gaVariable, gkVariable, or giVariable, dynamically at performance time ?
I do not think that is possible, definitely not with the current parser.

However, if you are talking about named "variables" that can be created
or accessed with special Csound opcodes (as well as through the API), that
is very possible (even though not implemented yet), and I can surely
implement it. What opcode names and syntax would you like ?


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net