| Sounds in the right direction. Plus the functions that
Anthony mentioned. However, we are rendering plugin
code quite a lot incompatible with it. Would that be
a problem?
What about Matt's suggestion of an opcode API with
these functions using the same old names?
Victor
>
> Hi Victor,
>
> If I understand correctly, I believe that global variables
> allocated by the csoundCreateGlobalVariable is
> automatically cleared at the end of a run, with the
> following code in csoundReset:
>
> csoundDeleteAllConfigurationVariables(csound);
> csoundDeleteAllGlobalVariables(csound);
>
> But as Istvan and you have pointed out, the two features
> are different.
>
> So how do the following sound to everyone:
>
> void csoundAuxAlloc(ENVIRON * csound, long nbytes,
AUXCH *
> auxchp) FUNC * csoundFtFind(ENVIRON * csound, MYFLT
*
> arg) MYFLT * csoundGetTable(ENVIRON * csound, int
> tableNum)
>
> ?
>
> steven
>
>
>
>
>
>
> On Sun, 27 Mar 2005 22:30:40 +0100, Victor Lazzarini
> wrote:
> > I think that certainly it is better to be able to obtain
> > a pointer to a table rather than having to call
> > an API function to get a value each time.
> >
> > The memory allocation function is there alright, but
> > you'd have to be able to de-allocate things, isn't it?
> > So it's not the same as the auxalloc mechanism, which
> > I think is one great thing that csound has.
> > I think the two things are there for different jobs.
> >
> > Adding ftfind() etc to the API should be a good idea.
> > As it is, we can still use it, but if things are going
> > to be locked away and hidden in the future (a good idea)
> > , then these facilities have to be there.
> >
> > With all these things, opcodes are starting to look
> > quite different now, between cs4.23 and 5.
> >
> > Victor
> >
> > PS.: I hadn't looked at the csound API for a couple
> > of months now, it is looking more and more impressive!
> > Good job, lads!
> >
> > >
> > > These still not include auxalloc which is frequently
> > > used for things like delay lines etc. The csound5 API
> > > does include auxalloc (actually, with the name
> > > auxalloc_, but I assume these ugly underscored names
> > > are only for compatibility with the - even uglier -
> > > macros, and thus may eventually be replaced). It is
> > > interesting that the table functions do not include
> > > one that returns a MYFLT* pointer to the table data.
> > >
> > > Steven Yi wrote:
> > >
> > > > Plugins can probably use these functions for those
> > > > operations:
> > > > /**
> > > > * Returns the length of a function table, or -1
> > > > if the table does * not exist.
> > > > */
> > > > PUBLIC int csoundTableLength(void *csound, int
> > > table); >
> > > > /**
> > > > * Returns the value of a slot in a function
> > > > table. */
> > > > PUBLIC MYFLT csoundTableGet(void *csound, int
> > > > table, int index);
> > > > /**
> > > > * Sets the value of a slot in a function table.
> > > > */
> > > > PUBLIC void csoundTableSet(void *csound, int
table
> > > > , int index, MYFLT value);
> > > > /**
> > > > * 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
> 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
> 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 |