Re: [Csnd-dev] CPOF - omit outargs?

vlz <[email protected]>
Newsgroups gmane.comp.audio.csound.devel
Message-ID <[email protected]>
You should use the InPlug base class instead of PlugIn. It has only one template argument.


Prof. Victor Lazzarini
Maynooth University
Ireland

> On 6 Jul 2024, at 08:45, Pierre Clisson <[email protected]> wrote:
> 
> Hi,
> 
> I have an opcode that expects an array as input:
> 
> csnd::plugin<MyOpcode>(csound, "myopcode", "k[]", "k[]", csnd::thread::k);
> 
> For performance reasons, I modify this array in place instead of instantiating a new object:
> 
> csnd::Vector<MYFLT> &in = inargs.vector_data<MYFLT>(0)
> csnd::Vector<MYFLT> &out = in;
> // ...
> 
> So, it doesn't make sense to return anything from this opcode. But if I declare the opcode like this, the code builds but segfaults during execution:
> 
> struct MyOpcode : csnd::Plugin<0, 1> {
> // ...
> };
> csnd::plugin<MyOpcode>(csound, "myopcode", "", "k[]", csnd::thread::k);
> 
> How can I omit outargs?
> 
> Thanks,
> 
> Pierre
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.