Csound Csound-dev Csound-tekno Search About

[Csnd-dev] plugin opcodes / API Changes

Date2024-11-07 20:21
FromEduardo Moguillansky
Subject[Csnd-dev] plugin opcodes / API Changes
As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?

At a first glance, I have problems with the following:

* GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
* GetKr: same as GetSr
* GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
* RegisterDeinitCallback is gone. How can a plugin implement this?
* insert_score_event_at_sample
* GetInputArgCnt
* GetInputArgName
* GetOutputArgCnt
* hfgens

cheers
Eduardo

Date2024-11-07 22:33
Fromvlz
SubjectRe: [Csnd-dev] plugin opcodes / API Changes
There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.

> On 7 Nov 2024, at 20:21, Eduardo Moguillansky  wrote:
> 
> 
> As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
> 
> At a first glance, I have problems with the following:
> 
> * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?

You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.

> * GetKr: same as GetSr

as above. I just noticed there's some old fixme comments left over from a merge, just ignore them

> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

GetInstrumentNumber? It's an inline

> * RegisterDeinitCallback is gone. How can a plugin implement this?

There is no deinit callback anymore. You can provide a deinit function when registering the opcode.

> * insert_score_event_at_sample

InsertScoreEvent

> * GetInputArgCnt
> * GetInputArgName
> * GetOutputArgCnt

All inline functions now

> * hfgens

FTCreate

> cheers
> Eduardo

Date2024-11-07 23:14
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] plugin opcodes / API Changes
Thanks for the clarification.

>> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

> GetInstrumentNumber? It's an inline

There was a function csound->GetInstrument with the signature
INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);

On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.

> On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>
> 
> As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>
> At a first glance, I have problems with the following:
>
> * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?

You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.

> * GetKr: same as GetSr

as above. I just noticed there's some old fixme comments left over from a merge, just ignore them

> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

GetInstrumentNumber? It's an inline

> * RegisterDeinitCallback is gone. How can a plugin implement this?

There is no deinit callback anymore. You can provide a deinit function when registering the opcode.

> * insert_score_event_at_sample

InsertScoreEvent

> * GetInputArgCnt
> * GetInputArgName
> * GetOutputArgCnt

All inline functions now

> * hfgens

FTCreate

> cheers
> Eduardo

Date2024-11-08 00:03
Fromvlz
SubjectRe: [Csnd-dev] plugin opcodes / API Changes
GetInstrumentList() gives the full instrument array. 

You can pick up an instrument by number (index) or name (by checking the relevant field):

INSTRTXT *GetInstrument(CSOUND *csound,
    int32_t n, const char *name) {

INSTRTXT **list = csound->GetInstrumentList(csound);

if(name){
   INTRTXT *instr = list[0];
   while((instr = instr->instrnxt) != NULL) 
       if(strcmp(name, instr) == 0) break;
    return instr;
} else return list[n];
}
 

Prof. Victor Lazzarini
Maynooth University
Ireland

On 7 Nov 2024, at 23:14, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:


Thanks for the clarification.

>> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

> GetInstrumentNumber? It's an inline

There was a function csound->GetInstrument with the signature
INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);

On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.

> On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>
> 
> As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>
> At a first glance, I have problems with the following:
>
> * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?

You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.

> * GetKr: same as GetSr

as above. I just noticed there's some old fixme comments left over from a merge, just ignore them

> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

GetInstrumentNumber? It's an inline

> * RegisterDeinitCallback is gone. How can a plugin implement this?

There is no deinit callback anymore. You can provide a deinit function when registering the opcode.

> * insert_score_event_at_sample

InsertScoreEvent

> * GetInputArgCnt
> * GetInputArgName
> * GetOutputArgCnt

All inline functions now

> * hfgens

FTCreate

> cheers
> Eduardo

Date2024-11-11 01:13
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] plugin opcodes / API Changes
I found more missing API calls:

* GetStrsmax
* GetStrsets

I could not find an obvious replacement. Any ideas?

On Fri, Nov 8, 2024 at 1:03 AM vlz <viclazzarini@gmail.com> wrote:
GetInstrumentList() gives the full instrument array. 

You can pick up an instrument by number (index) or name (by checking the relevant field):

INSTRTXT *GetInstrument(CSOUND *csound,
    int32_t n, const char *name) {

INSTRTXT **list = csound->GetInstrumentList(csound);

if(name){
   INTRTXT *instr = list[0];
   while((instr = instr->instrnxt) != NULL) 
       if(strcmp(name, instr) == 0) break;
    return instr;
} else return list[n];
}
 

Prof. Victor Lazzarini
Maynooth University
Ireland

On 7 Nov 2024, at 23:14, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:


Thanks for the clarification.

>> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

> GetInstrumentNumber? It's an inline

There was a function csound->GetInstrument with the signature
INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);

On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.

> On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>
> 
> As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>
> At a first glance, I have problems with the following:
>
> * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?

You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.

> * GetKr: same as GetSr

as above. I just noticed there's some old fixme comments left over from a merge, just ignore them

> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?

GetInstrumentNumber? It's an inline

> * RegisterDeinitCallback is gone. How can a plugin implement this?

There is no deinit callback anymore. You can provide a deinit function when registering the opcode.

> * insert_score_event_at_sample

InsertScoreEvent

> * GetInputArgCnt
> * GetInputArgName
> * GetOutputArgCnt

All inline functions now

> * hfgens

FTCreate

> cheers
> Eduardo

Date2024-11-11 07:06
Fromvlz
SubjectRe: [Csnd-dev] plugin opcodes / API Changes
These have been added in the PR #2030

> On 11 Nov 2024, at 01:13, Eduardo Moguillansky  wrote:
> 
> I found more missing API calls:
> 
> * GetStrsmax
> * GetStrsets
> 
> I could not find an obvious replacement. Any ideas?
> 
> On Fri, Nov 8, 2024 at 1:03 AM vlz  wrote:
> GetInstrumentList() gives the full instrument array. 
> 
> You can pick up an instrument by number (index) or name (by checking the relevant field):
> 
> INSTRTXT *GetInstrument(CSOUND *csound,
>     int32_t n, const char *name) {
> 
> INSTRTXT **list = csound->GetInstrumentList(csound);
> 
> if(name){
>    INTRTXT *instr = list[0];
>    while((instr = instr->instrnxt) != NULL) 
>        if(strcmp(name, instr) == 0) break;
>     return instr;
> } else return list[n];
> }
>  
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 7 Nov 2024, at 23:14, Eduardo Moguillansky  wrote:
>> 
>> Thanks for the clarification.
>> 
>> >> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality? 
>> > GetInstrumentNumber? It's an inline
>> 
>> There was a function csound->GetInstrument with the signature
>> INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
>> 
>> On Thu, Nov 7, 2024 at 11:33 PM vlz  wrote:
>> There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.
>> 
>> > On 7 Nov 2024, at 20:21, Eduardo Moguillansky  wrote:
>> > 
>> > 
>> > As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>> > 
>> > At a first glance, I have problems with the following:
>> > 
>> > * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
>> 
>> You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.
>> 
>> > * GetKr: same as GetSr
>> 
>> as above. I just noticed there's some old fixme comments left over from a merge, just ignore them
>> 
>> > * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>> 
>> GetInstrumentNumber? It's an inline
>> 
>> > * RegisterDeinitCallback is gone. How can a plugin implement this?
>> 
>> There is no deinit callback anymore. You can provide a deinit function when registering the opcode.
>> 
>> > * insert_score_event_at_sample
>> 
>> InsertScoreEvent
>> 
>> > * GetInputArgCnt
>> > * GetInputArgName
>> > * GetOutputArgCnt
>> 
>> All inline functions now
>> 
>> > * hfgens
>> 
>> FTCreate
>> 
>> > cheers
>> > Eduardo

Date2024-11-19 15:29
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] plugin opcodes / API Changes
I miss these API functions:

csoundNewOpcodeList and csoundDisposeOpcodeList. I use those to check available opcodes and thus determine missing plugins. Could those be provided again, or some other way to obtain a list of available opcodes?

Thanks!
Eduardo

On Mon, Nov 11, 2024 at 8:06 AM vlz <viclazzarini@gmail.com> wrote:
These have been added in the PR #2030

> On 11 Nov 2024, at 01:13, Eduardo Moguillansky <eduardo.moguillansky@GMAIL.COM> wrote:
>
> I found more missing API calls:
>
> * GetStrsmax
> * GetStrsets
>
> I could not find an obvious replacement. Any ideas?
>
> On Fri, Nov 8, 2024 at 1:03 AM vlz <viclazzarini@gmail.com> wrote:
> GetInstrumentList() gives the full instrument array.
>
> You can pick up an instrument by number (index) or name (by checking the relevant field):
>
> INSTRTXT *GetInstrument(CSOUND *csound,
>     int32_t n, const char *name) {
>
> INSTRTXT **list = csound->GetInstrumentList(csound);
>
> if(name){
>    INTRTXT *instr = list[0];
>    while((instr = instr->instrnxt) != NULL)
>        if(strcmp(name, instr) == 0) break;
>     return instr;
> } else return list[n];
> }

> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 7 Nov 2024, at 23:14, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>>
>> Thanks for the clarification.
>>
>> >> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>> > GetInstrumentNumber? It's an inline
>>
>> There was a function csound->GetInstrument with the signature
>> INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
>>
>> On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
>> There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.
>>
>> > On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>> >
>> > 
>> > As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>> >
>> > At a first glance, I have problems with the following:
>> >
>> > * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
>>
>> You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.
>>
>> > * GetKr: same as GetSr
>>
>> as above. I just noticed there's some old fixme comments left over from a merge, just ignore them
>>
>> > * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>>
>> GetInstrumentNumber? It's an inline
>>
>> > * RegisterDeinitCallback is gone. How can a plugin implement this?
>>
>> There is no deinit callback anymore. You can provide a deinit function when registering the opcode.
>>
>> > * insert_score_event_at_sample
>>
>> InsertScoreEvent
>>
>> > * GetInputArgCnt
>> > * GetInputArgName
>> > * GetOutputArgCnt
>>
>> All inline functions now
>>
>> > * hfgens
>>
>> FTCreate
>>
>> > cheers
>> > Eduardo

Date2024-11-19 16:18
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] plugin opcodes / API Changes
Is this for the host API (csound.h) or module API (CSOUND member)? 


Prof. Victor Lazzarini
Maynooth University
Ireland

On 19 Nov 2024, at 15:29, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I miss these API functions:

csoundNewOpcodeList and csoundDisposeOpcodeList. I use those to check available opcodes and thus determine missing plugins. Could those be provided again, or some other way to obtain a list of available opcodes?

Thanks!
Eduardo

On Mon, Nov 11, 2024 at 8:06 AM vlz <viclazzarini@gmail.com> wrote:
These have been added in the PR #2030

> On 11 Nov 2024, at 01:13, Eduardo Moguillansky <eduardo.moguillansky@GMAIL.COM> wrote:
>
> I found more missing API calls:
>
> * GetStrsmax
> * GetStrsets
>
> I could not find an obvious replacement. Any ideas?
>
> On Fri, Nov 8, 2024 at 1:03 AM vlz <viclazzarini@gmail.com> wrote:
> GetInstrumentList() gives the full instrument array.
>
> You can pick up an instrument by number (index) or name (by checking the relevant field):
>
> INSTRTXT *GetInstrument(CSOUND *csound,
>     int32_t n, const char *name) {
>
> INSTRTXT **list = csound->GetInstrumentList(csound);
>
> if(name){
>    INTRTXT *instr = list[0];
>    while((instr = instr->instrnxt) != NULL)
>        if(strcmp(name, instr) == 0) break;
>     return instr;
> } else return list[n];
> }

> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 7 Nov 2024, at 23:14, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>>
>> Thanks for the clarification.
>>
>> >> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>> > GetInstrumentNumber? It's an inline
>>
>> There was a function csound->GetInstrument with the signature
>> INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
>>
>> On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
>> There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.
>>
>> > On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>> >
>> > 
>> > As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>> >
>> > At a first glance, I have problems with the following:
>> >
>> > * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
>>
>> You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.
>>
>> > * GetKr: same as GetSr
>>
>> as above. I just noticed there's some old fixme comments left over from a merge, just ignore them
>>
>> > * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>>
>> GetInstrumentNumber? It's an inline
>>
>> > * RegisterDeinitCallback is gone. How can a plugin implement this?
>>
>> There is no deinit callback anymore. You can provide a deinit function when registering the opcode.
>>
>> > * insert_score_event_at_sample
>>
>> InsertScoreEvent
>>
>> > * GetInputArgCnt
>> > * GetInputArgName
>> > * GetOutputArgCnt
>>
>> All inline functions now
>>
>> > * hfgens
>>
>> FTCreate
>>
>> > cheers
>> > Eduardo

Date2024-11-19 16:40
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] plugin opcodes / API Changes
This is for the host API, actually.

On Tue, Nov 19, 2024 at 5:18 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Is this for the host API (csound.h) or module API (CSOUND member)? 


Prof. Victor Lazzarini
Maynooth University
Ireland

On 19 Nov 2024, at 15:29, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I miss these API functions:

csoundNewOpcodeList and csoundDisposeOpcodeList. I use those to check available opcodes and thus determine missing plugins. Could those be provided again, or some other way to obtain a list of available opcodes?

Thanks!
Eduardo

On Mon, Nov 11, 2024 at 8:06 AM vlz <viclazzarini@gmail.com> wrote:
These have been added in the PR #2030

> On 11 Nov 2024, at 01:13, Eduardo Moguillansky <eduardo.moguillansky@GMAIL.COM> wrote:
>
> I found more missing API calls:
>
> * GetStrsmax
> * GetStrsets
>
> I could not find an obvious replacement. Any ideas?
>
> On Fri, Nov 8, 2024 at 1:03 AM vlz <viclazzarini@gmail.com> wrote:
> GetInstrumentList() gives the full instrument array.
>
> You can pick up an instrument by number (index) or name (by checking the relevant field):
>
> INSTRTXT *GetInstrument(CSOUND *csound,
>     int32_t n, const char *name) {
>
> INSTRTXT **list = csound->GetInstrumentList(csound);
>
> if(name){
>    INTRTXT *instr = list[0];
>    while((instr = instr->instrnxt) != NULL)
>        if(strcmp(name, instr) == 0) break;
>     return instr;
> } else return list[n];
> }

> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 7 Nov 2024, at 23:14, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>>
>> Thanks for the clarification.
>>
>> >> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>> > GetInstrumentNumber? It's an inline
>>
>> There was a function csound->GetInstrument with the signature
>> INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
>>
>> On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
>> There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.
>>
>> > On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>> >
>> > 
>> > As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>> >
>> > At a first glance, I have problems with the following:
>> >
>> > * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
>>
>> You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.
>>
>> > * GetKr: same as GetSr
>>
>> as above. I just noticed there's some old fixme comments left over from a merge, just ignore them
>>
>> > * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>>
>> GetInstrumentNumber? It's an inline
>>
>> > * RegisterDeinitCallback is gone. How can a plugin implement this?
>>
>> There is no deinit callback anymore. You can provide a deinit function when registering the opcode.
>>
>> > * insert_score_event_at_sample
>>
>> InsertScoreEvent
>>
>> > * GetInputArgCnt
>> > * GetInputArgName
>> > * GetOutputArgCnt
>>
>> All inline functions now
>>
>> > * hfgens
>>
>> FTCreate
>>
>> > cheers
>> > Eduardo

Date2024-11-19 17:08
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] plugin opcodes / API Changes
Ok will put a PR
Prof. Victor Lazzarini
Maynooth University
Ireland

On 19 Nov 2024, at 16:44, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:


This is for the host API, actually.

On Tue, Nov 19, 2024 at 5:18 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Is this for the host API (csound.h) or module API (CSOUND member)? 


Prof. Victor Lazzarini
Maynooth University
Ireland

On 19 Nov 2024, at 15:29, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I miss these API functions:

csoundNewOpcodeList and csoundDisposeOpcodeList. I use those to check available opcodes and thus determine missing plugins. Could those be provided again, or some other way to obtain a list of available opcodes?

Thanks!
Eduardo

On Mon, Nov 11, 2024 at 8:06 AM vlz <viclazzarini@gmail.com> wrote:
These have been added in the PR #2030

> On 11 Nov 2024, at 01:13, Eduardo Moguillansky <eduardo.moguillansky@GMAIL.COM> wrote:
>
> I found more missing API calls:
>
> * GetStrsmax
> * GetStrsets
>
> I could not find an obvious replacement. Any ideas?
>
> On Fri, Nov 8, 2024 at 1:03 AM vlz <viclazzarini@gmail.com> wrote:
> GetInstrumentList() gives the full instrument array.
>
> You can pick up an instrument by number (index) or name (by checking the relevant field):
>
> INSTRTXT *GetInstrument(CSOUND *csound,
>     int32_t n, const char *name) {
>
> INSTRTXT **list = csound->GetInstrumentList(csound);
>
> if(name){
>    INTRTXT *instr = list[0];
>    while((instr = instr->instrnxt) != NULL)
>        if(strcmp(name, instr) == 0) break;
>     return instr;
> } else return list[n];
> }

> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 7 Nov 2024, at 23:14, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>>
>> Thanks for the clarification.
>>
>> >> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>> > GetInstrumentNumber? It's an inline
>>
>> There was a function csound->GetInstrument with the signature
>> INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
>>
>> On Thu, Nov 7, 2024 at 11:33 PM vlz <viclazzarini@gmail.com> wrote:
>> There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.
>>
>> > On 7 Nov 2024, at 20:21, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
>> >
>> > 
>> > As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>> >
>> > At a first glance, I have problems with the following:
>> >
>> > * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
>>
>> You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.
>>
>> > * GetKr: same as GetSr
>>
>> as above. I just noticed there's some old fixme comments left over from a merge, just ignore them
>>
>> > * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>>
>> GetInstrumentNumber? It's an inline
>>
>> > * RegisterDeinitCallback is gone. How can a plugin implement this?
>>
>> There is no deinit callback anymore. You can provide a deinit function when registering the opcode.
>>
>> > * insert_score_event_at_sample
>>
>> InsertScoreEvent
>>
>> > * GetInputArgCnt
>> > * GetInputArgName
>> > * GetOutputArgCnt
>>
>> All inline functions now
>>
>> > * hfgens
>>
>> FTCreate
>>
>> > cheers
>> > Eduardo

Date2024-11-19 20:21
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] plugin opcodes / API Changes
Ok there’s a PR with this

https://github.com/csound/csound/pull/2041

the functions have been added to csound_misc.h

> On 19 Nov 2024, at 17:08, vlz  wrote:
> 
> Ok will put a PR
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 19 Nov 2024, at 16:44, Eduardo Moguillansky  wrote:
>> 
>> This is for the host API, actually. 
>> 
>> On Tue, Nov 19, 2024 at 5:18 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> Is this for the host API (csound.h) or module API (CSOUND member)? 
>> 
>> 
>> Prof. Victor Lazzarini 
>> Maynooth University
>> Ireland
>> 
>>> On 19 Nov 2024, at 15:29, Eduardo Moguillansky  wrote:
>>> 
>>>  *Warning*
>>> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>> I miss these API functions:
>>> 
>>> csoundNewOpcodeList and csoundDisposeOpcodeList. I use those to check available opcodes and thus determine missing plugins. Could those be provided again, or some other way to obtain a list of available opcodes?
>>> 
>>> Thanks!
>>> Eduardo
>>> 
>>> On Mon, Nov 11, 2024 at 8:06 AM vlz  wrote:
>>> These have been added in the PR #2030
>>> 
>>> > On 11 Nov 2024, at 01:13, Eduardo Moguillansky  wrote:
>>> > 
>>> > I found more missing API calls:
>>> > 
>>> > * GetStrsmax
>>> > * GetStrsets
>>> > 
>>> > I could not find an obvious replacement. Any ideas?
>>> > 
>>> > On Fri, Nov 8, 2024 at 1:03 AM vlz  wrote:
>>> > GetInstrumentList() gives the full instrument array. 
>>> > 
>>> > You can pick up an instrument by number (index) or name (by checking the relevant field):
>>> > 
>>> > INSTRTXT *GetInstrument(CSOUND *csound,
>>> >     int32_t n, const char *name) {
>>> > 
>>> > INSTRTXT **list = csound->GetInstrumentList(csound);
>>> > 
>>> > if(name){
>>> >    INTRTXT *instr = list[0];
>>> >    while((instr = instr->instrnxt) != NULL) 
>>> >        if(strcmp(name, instr) == 0) break;
>>> >     return instr;
>>> > } else return list[n];
>>> > }
>>> >  
>>> > Prof. Victor Lazzarini
>>> > Maynooth University
>>> > Ireland
>>> > 
>>> >> On 7 Nov 2024, at 23:14, Eduardo Moguillansky  wrote:
>>> >> 
>>> >> Thanks for the clarification.
>>> >> 
>>> >> >> * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality? 
>>> >> > GetInstrumentNumber? It's an inline
>>> >> 
>>> >> There was a function csound->GetInstrument with the signature
>>> >> INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
>>> >> 
>>> >> On Thu, Nov 7, 2024 at 11:33 PM vlz  wrote:
>>> >> There's an API migration document under docs, but at the moment it only covers the host API. I've got to annotate the module API better so we can have a clean doxygen output.
>>> >> 
>>> >> > On 7 Nov 2024, at 20:21, Eduardo Moguillansky  wrote:
>>> >> > 
>>> >> > 
>>> >> > As a first approach to making plugins compatible with csound7: is there any document regarding the changes in the API exposed for opcodes (methods renamed, removed, etc in the csound struct)?
>>> >> > 
>>> >> > At a first glance, I have problems with the following:
>>> >> > 
>>> >> > * GetSr is missing. There are some ugly macros, like CS_ESR which seem to do the "right" thing, should plugins use that?
>>> >> 
>>> >> You can use the macros, or you can use the inline functions GetLocalSr() etc. There is no GetSr() because SR is now local. Opcodes should use that.
>>> >> 
>>> >> > * GetKr: same as GetSr
>>> >> 
>>> >> as above. I just noticed there's some old fixme comments left over from a merge, just ignore them
>>> >> 
>>> >> > * GetInstrument is gone. Was it renamed? Or is it no longer possible to provide the functionality?
>>> >> 
>>> >> GetInstrumentNumber? It's an inline
>>> >> 
>>> >> > * RegisterDeinitCallback is gone. How can a plugin implement this?
>>> >> 
>>> >> There is no deinit callback anymore. You can provide a deinit function when registering the opcode.
>>> >> 
>>> >> > * insert_score_event_at_sample
>>> >> 
>>> >> InsertScoreEvent
>>> >> 
>>> >> > * GetInputArgCnt
>>> >> > * GetInputArgName
>>> >> > * GetOutputArgCnt
>>> >> 
>>> >> All inline functions now
>>> >> 
>>> >> > * hfgens
>>> >> 
>>> >> FTCreate
>>> >> 
>>> >> > cheers
>>> >> > Eduardo