Re: [Csnd-dev] New host API
Francois PINOT <[email protected]>
| Newsgroups | gmane.comp.audio.csound.devel |
|---|---|
| Message-ID | <CAKXOhLmyBuPfGVzcR1qiiG_EY3D2P6+5kqaLO-694F-cAcy+Ug@mail.gmail.com> |
Effectively, csoundEventString() does the job. CsoundGetSpin() and CsoundGetSpout() share memory too. I think people who use the host API should be aware of the risks of sharing memory with Csound. I prefer to keep csoundGetTable() and remove the copy functions. Sharing memory allows us to use numpy ndarray to access directly Csound memory: a powerful but evidently dangerous feature. François Le ven. 2 août 2024 à 09:48, vlz <[email protected]> a écrit : > The csoundReadScore functions are renamed as > > csoundEventString() > > (and consolidated). > > The reason I wasn't sure if we should keep csoundGetTable() is whether it > is safe to share the memory. If we feel it is ok, then we should remove the > copy functions because the host can easily implement them. > > > Prof. Victor Lazzarini > Maynooth University > Ireland > > > On 2 Aug 2024, at 08:19, Francois PINOT <[email protected]> wrote: > > > > > > I nearly finished refactoring ctcsound.py for the new host API. I'd like > to reintroduce the following functions in csound.h: > > > > csoundReadScore, csoundReadScoreAsync (maybe merged with an async_mode > flag), csoundGetTable and csoundGetTableArgs. > > > > Reading score from a string is useful when coupled with csoundCompileOrc. > > csoundGetTable is interesting because it gives direct access to the > memory data of the function table. > > csoundGetTableArgs can be useful when dealing with a lot of tables. > > > > François >