Csound Csound-dev Csound-tekno Search About

[Csnd-dev] New API progress report

Date2024-07-25 16:27
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd-dev] New API progress report
Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper 
- Updated the csPerformanceThread code 
- Modified frontends to use it 
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think. 

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 10:31
FromFrancois PINOT
SubjectRe: [Csnd-dev] New API progress report
I just built Csound from the feature/newapi branch. I'm using it  to sync the Python wrapper. I'll let you know when it's ready.

François

Le jeu. 25 juil. 2024 à 17:27, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> a écrit :

Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper
- Updated the csPerformanceThread code
- Modified frontends to use it
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think.

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 10:44
Fromvlz
SubjectRe: [Csnd-dev] New API progress report
Great.
Let me know if you think we should add things to the interface.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 26 Jul 2024, at 10:31, Francois PINOT <fggpinot@gmail.com> wrote:


I just built Csound from the feature/newapi branch. I'm using it  to sync the Python wrapper. I'll let you know when it's ready.

François

Le jeu. 25 juil. 2024 à 17:27, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> a écrit :

Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper
- Updated the csPerformanceThread code
- Modified frontends to use it
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think.

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 10:50
FromFrancois PINOT
SubjectRe: [Csnd-dev] New API progress report
I realized that when I wrote ctcsound.py I used camelCase to name the functions. The norm in Python is to use underscore to separate the components of a function name: for example, csound_create instead of csoundCreate. Do you think it's worth it to do so writing the new python wrapper for the API?  This way, we would follow the Python rules and it could be an easy way to differentiate the new API wrapper from the old one.

François

Le ven. 26 juil. 2024 à 11:31, Francois PINOT <fggpinot@gmail.com> a écrit :
I just built Csound from the feature/newapi branch. I'm using it  to sync the Python wrapper. I'll let you know when it's ready.

François

Le jeu. 25 juil. 2024 à 17:27, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> a écrit :

Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper
- Updated the csPerformanceThread code
- Modified frontends to use it
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think.

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 11:06
Fromvlz
SubjectRe: [Csnd-dev] New API progress report
yes, I think it is a good idea on both counts.

Also I am wondering whether we should call it csound.py instead of ctcsound.py? Would it make more sense since it's wrapping csound.h?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 26 Jul 2024, at 10:50, Francois PINOT <fggpinot@gmail.com> wrote:


I realized that when I wrote ctcsound.py I used camelCase to name the functions. The norm in Python is to use underscore to separate the components of a function name: for example, csound_create instead of csoundCreate. Do you think it's worth it to do so writing the new python wrapper for the API?  This way, we would follow the Python rules and it could be an easy way to differentiate the new API wrapper from the old one.

François

Le ven. 26 juil. 2024 à 11:31, Francois PINOT <fggpinot@gmail.com> a écrit :
I just built Csound from the feature/newapi branch. I'm using it  to sync the Python wrapper. I'll let you know when it's ready.

François

Le jeu. 25 juil. 2024 à 17:27, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> a écrit :

Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper
- Updated the csPerformanceThread code
- Modified frontends to use it
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think.

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 12:55
FromFrancois PINOT
SubjectRe: [Csnd-dev] New API progress report
There are different ways to interface Python with c libraries:
- the hard way, using the Python C-API
- FFI, using ctypes,
- Cython, there's a project recently discussed on the list for this
- SWIG, the way you did it before.

I used the ct prefix to highlight the fact that it was based on ctypes, which gives us a pure python unit without any need for extra tools. Well, there's still the numpy dependency, to give easy access to the huge set of scientific computing libraries around Python.

And in a way, I like the association with the city: Csound in the city, vs Csound on the beach, vs Csound in the countryside, etc ;) (just kidding)

François


Le ven. 26 juil. 2024 à 12:06, vlz <viclazzarini@gmail.com> a écrit :
yes, I think it is a good idea on both counts.

Also I am wondering whether we should call it csound.py instead of ctcsound.py? Would it make more sense since it's wrapping csound.h?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 26 Jul 2024, at 10:50, Francois PINOT <fggpinot@gmail.com> wrote:


I realized that when I wrote ctcsound.py I used camelCase to name the functions. The norm in Python is to use underscore to separate the components of a function name: for example, csound_create instead of csoundCreate. Do you think it's worth it to do so writing the new python wrapper for the API?  This way, we would follow the Python rules and it could be an easy way to differentiate the new API wrapper from the old one.

François

Le ven. 26 juil. 2024 à 11:31, Francois PINOT <fggpinot@gmail.com> a écrit :
I just built Csound from the feature/newapi branch. I'm using it  to sync the Python wrapper. I'll let you know when it's ready.

François

Le jeu. 25 juil. 2024 à 17:27, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> a écrit :

Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper
- Updated the csPerformanceThread code
- Modified frontends to use it
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think.

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 14:38
FromSteven Yi
SubjectRe: [Csnd-dev] New API progress report
I haven't had a chance to look at the new branch yet, as I was stuck
on the message callback system for the Java FFM binding (though, I
just realized I got around valist in Csound JNI by using
csoundSetMessageStringCallback). I'm just about finished getting
Csound FFM up to speed with CS6. I think it shouldn't be too hard to
make it work with both CS6 and CS7.  To note, the Csound FFM code
looks very similar to ctcsound.py as Python FFI and Java FFM are
somewhat similar. I'll follow Francois's lead and try to sync with
ctcsound.py changes for cs7.

On Fri, Jul 26, 2024 at 7:56 AM Francois PINOT  wrote:
>
> There are different ways to interface Python with c libraries:
> - the hard way, using the Python C-API
> - FFI, using ctypes,
> - Cython, there's a project recently discussed on the list for this
> - SWIG, the way you did it before.
>
> I used the ct prefix to highlight the fact that it was based on ctypes, which gives us a pure python unit without any need for extra tools. Well, there's still the numpy dependency, to give easy access to the huge set of scientific computing libraries around Python.
>
> And in a way, I like the association with the city: Csound in the city, vs Csound on the beach, vs Csound in the countryside, etc ;) (just kidding)
>
> François
>
>
> Le ven. 26 juil. 2024 à 12:06, vlz  a écrit :
>>
>> yes, I think it is a good idea on both counts.
>>
>> Also I am wondering whether we should call it csound.py instead of ctcsound.py? Would it make more sense since it's wrapping csound.h?
>>
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> On 26 Jul 2024, at 10:50, Francois PINOT  wrote:
>>
>> 
>> I realized that when I wrote ctcsound.py I used camelCase to name the functions. The norm in Python is to use underscore to separate the components of a function name: for example, csound_create instead of csoundCreate. Do you think it's worth it to do so writing the new python wrapper for the API?  This way, we would follow the Python rules and it could be an easy way to differentiate the new API wrapper from the old one.
>>
>> François
>>
>> Le ven. 26 juil. 2024 à 11:31, Francois PINOT  a écrit :
>>>
>>> I just built Csound from the feature/newapi branch. I'm using it  to sync the Python wrapper. I'll let you know when it's ready.
>>>
>>> François
>>>
>>> Le jeu. 25 juil. 2024 à 17:27, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> a écrit :
>>>>
>>>>
>>>> Just another progress report for the feature/newapi branch
>>>>
>>>> - I have now mainlined the new API in csound.h
>>>> - Updated the csound.hpp wrapper
>>>> - Updated the csPerformanceThread code
>>>> - Modified frontends to use it
>>>> - Modified the C++ test suite
>>>>
>>>> It is all working, I guess frontend developers can take a look and see what they
>>>> think.
>>>>
>>>> François: could you take a look at the Python wrapper? It is out of sync now.
>>>>
>>>> Victor
>>>>
>>>>

Date2024-07-26 20:29
FromTarmo Johannes
SubjectRe: [Csnd-dev] New API progress report
Hi!

I tried out the new API from feature/newapi branch.

Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.

First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:

when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?

Then I went to CsoundQt and of course that is much, much more complex  case.

First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 

CsoundQt used the following functions that are not to be there any more:

csoundGetModule
csoundSetMIDIModule
csoundSetRTAudioModule

I commented these lines out for now to move on. What covers their functionality?

There is no more circular buffer functions:
csoundCreateCircularBuffer
csoundReadCircularBuffer
etc

CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
For example reading MIDI data one should set the callback like:
        csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);

CsoundQt used to have such a function for the callback:

int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
{
    CsoundUserData *ud = (CsoundUserData *) ud_;
    Q_UNUSED(csound);
    int count, countVirtual;
    count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
    countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
    return count + countVirtual;
}

Should the host implement writing to the buffer and handling the index itself?

Is it so that csoundSetHostImplementedMIDIIO is replaced now with  
PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);

How to deal with global variables?
csoundQueryGlobalVariable
csoundCreateGlobalVariable
are gone,

csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?

at the moment I replaced them with Qt specific functions to deal with environment variables.

What is the correct environment variable for the plugins directory, OPCODE7DIR64?

I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.

Exciting!
tarmo

Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:

Just another progress report for the feature/newapi branch

- I have now mainlined the new API in csound.h
- Updated the csound.hpp wrapper
- Updated the csPerformanceThread code
- Modified frontends to use it
- Modified the C++ test suite

It is all working, I guess frontend developers can take a look and see what they
think.

François: could you take a look at the Python wrapper? It is out of sync now.

Victor



Date2024-07-26 22:39
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Thanks for this. Responses below

> On 26 Jul 2024, at 20:29, Tarmo Johannes  wrote:
> Hi!
> 
> I tried out the new API from feature/newapi branch.
> 
> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
> 
> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> 
> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?

csoundStop() was only needed if we were running csoundPerform(), but since that’s gone, we do not need it.
Also csoundCleanup() is not really necessary now, csoundReset() suffices.

Also I am enforcing csoundStart() at all times now (before it was confusing that sometimes we did not need it).

> Then I went to CsoundQt and of course that is much, much more complex  case.
> 
> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 

There is only one library, and CsPerformanceThread is included in it, so you can use it directly now. I guess that is the only class in
that library that was consistently used.

> CsoundQt used the following functions that are not to be there any more:
> 
> csoundGetModule
> csoundSetMIDIModule
> csoundSetRTAudioModule
> 
> I commented these lines out for now to move on. What covers their functionality?

Normally, I would have thought that the command line options were sufficient for module setting, but if you
use these functions, I will put them back

> There is no more circular buffer functions:
> csoundCreateCircularBuffer
> csoundReadCircularBuffer
> etc
> 
> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> For example reading MIDI data one should set the callback like:
>         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> 
> CsoundQt used to have such a function for the callback:
> 
> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> {
>     CsoundUserData *ud = (CsoundUserData *) ud_;
>     Q_UNUSED(csound);
>     int count, countVirtual;
>     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>     return count + countVirtual;
> }
> 
> Should the host implement writing to the buffer and handling the index itself?

I can put them back, I did not know they were used. No point on re-writing them if they worked for you.

> 
> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> 

yes

> How to deal with global variables?
> csoundQueryGlobalVariable
> csoundCreateGlobalVariable
> are gone,

The “global variables” that these functions refer to are variables added to the CSOUND data structure
dynamically so that opcodes can share data. Hosts should not need them as you can hold anything in
your hostdata etc.

I removed these because they really only make sense for the module API.

What is your use case for those?

> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> 
> at the moment I replaced them with Qt specific functions to deal with environment variables.

I think that is a good idea, but if you need csoundSetEnv() I can add it back

> 
> What is the correct environment variable for the plugins directory, OPCODE7DIR64?

yes, OPCODE7DIR64 and OPCODE7DIR (for floats)

> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.

Keep me posted.

> Exciting!
> tarmo
> 
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> 
> Just another progress report for the feature/newapi branch
> 
> - I have now mainlined the new API in csound.h
> - Updated the csound.hpp wrapper 
> - Updated the csPerformanceThread code 
> - Modified frontends to use it 
> - Modified the C++ test suite
> 
> It is all working, I guess frontend developers can take a look and see what they
> think. 
> 
> François: could you take a look at the Python wrapper? It is out of sync now.
> 
> Victor
> 
> 


Date2024-07-26 22:55
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hi Tarmo,

I put back 

> csoundGetModule
> csoundSetMIDIModule
> csoundSetRTAudioModule

plus the set global env and the circular buffer functions. It’s in the repo now.

Best

Victor

> On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
> Hi!
> 
> I tried out the new API from feature/newapi branch.
> 
> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
> 
> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> 
> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> 
> Then I went to CsoundQt and of course that is much, much more complex  case.
> 
> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
> 
> CsoundQt used the following functions that are not to be there any more:
> 
> csoundGetModule
> csoundSetMIDIModule
> csoundSetRTAudioModule
> 
> I commented these lines out for now to move on. What covers their functionality?
> 
> There is no more circular buffer functions:
> csoundCreateCircularBuffer
> csoundReadCircularBuffer
> etc
> 
> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> For example reading MIDI data one should set the callback like:
>         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> 
> CsoundQt used to have such a function for the callback:
> 
> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> {
>     CsoundUserData *ud = (CsoundUserData *) ud_;
>     Q_UNUSED(csound);
>     int count, countVirtual;
>     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>     return count + countVirtual;
> }
> 
> Should the host implement writing to the buffer and handling the index itself?
> 
> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> 
> How to deal with global variables?
> csoundQueryGlobalVariable
> csoundCreateGlobalVariable
> are gone, 
> 
> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> 
> at the moment I replaced them with Qt specific functions to deal with environment variables.
> 
> What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> 
> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> 
> Exciting!
> tarmo
> 
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> 
> Just another progress report for the feature/newapi branch
> 
> - I have now mainlined the new API in csound.h
> - Updated the csound.hpp wrapper 
> - Updated the csPerformanceThread code 
> - Modified frontends to use it 
> - Modified the C++ test suite
> 
> It is all working, I guess frontend developers can take a look and see what they
> think. 
> 
> François: could you take a look at the Python wrapper? It is out of sync now.
> 
> Victor
> 
> 


Date2024-07-27 09:31
FromTarmo Johannes
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hi Victor!

Thank you for the changes, it helps a lot.

> csoundGetModule
> csoundSetMIDIModule
> csoundSetRTAudioModule

Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.

I still get crash when running a csd.
MYFLT *outputBuffer = csoundGetSpout(udata->csound);
returns 0 in some reason, I will see if I can figure out the reason later.

Thanks!
tarmo

Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
Hi Tarmo,

I put back

> csoundGetModule
> csoundSetMIDIModule
> csoundSetRTAudioModule

plus the set global env and the circular buffer functions. It’s in the repo now.

Best

Victor

> On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> Hi!
>
> I tried out the new API from feature/newapi branch.
>
> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>
> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>
> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>
> Then I went to CsoundQt and of course that is much, much more complex  case.
>
> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>
> CsoundQt used the following functions that are not to be there any more:
>
> csoundGetModule
> csoundSetMIDIModule
> csoundSetRTAudioModule
>
> I commented these lines out for now to move on. What covers their functionality?
>
> There is no more circular buffer functions:
> csoundCreateCircularBuffer
> csoundReadCircularBuffer
> etc
>
> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> For example reading MIDI data one should set the callback like:
>         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>
> CsoundQt used to have such a function for the callback:
>
> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> {
>     CsoundUserData *ud = (CsoundUserData *) ud_;
>     Q_UNUSED(csound);
>     int count, countVirtual;
>     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>     return count + countVirtual;
> }
>
> Should the host implement writing to the buffer and handling the index itself?
>
> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>
> How to deal with global variables?
> csoundQueryGlobalVariable
> csoundCreateGlobalVariable
> are gone,
>
> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>
> at the moment I replaced them with Qt specific functions to deal with environment variables.
>
> What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>
> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>
> Exciting!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>
> Just another progress report for the feature/newapi branch
>
> - I have now mainlined the new API in csound.h
> - Updated the csound.hpp wrapper
> - Updated the csPerformanceThread code
> - Modified frontends to use it
> - Modified the C++ test suite
>
> It is all working, I guess frontend developers can take a look and see what they
> think.
>
> François: could you take a look at the Python wrapper? It is out of sync now.
>
> Victor
>
>


Date2024-07-27 10:20
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
> 
> Hi Victor!
> 
> Thank you for the changes, it helps a lot. 
> 
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> 
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> 
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
> 
> Thanks!
> tarmo
> 
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
> 
> I put back 
> 
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> 
> plus the set global env and the circular buffer functions. It’s in the repo now.
> 
> Best
> 
> Victor
> 
> > On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
> > Hi!
> > 
> > I tried out the new API from feature/newapi branch.
> > 
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
> > 
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > 
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > 
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> > 
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
> > 
> > CsoundQt used the following functions that are not to be there any more:
> > 
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> > 
> > I commented these lines out for now to move on. What covers their functionality?
> > 
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> > 
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > 
> > CsoundQt used to have such a function for the callback:
> > 
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> > 
> > Should the host implement writing to the buffer and handling the index itself?
> > 
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > 
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone, 
> > 
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > 
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > 
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > 
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > 
> > Exciting!
> > tarmo
> > 
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > 
> > Just another progress report for the feature/newapi branch
> > 
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper 
> > - Updated the csPerformanceThread code 
> > - Modified frontends to use it 
> > - Modified the C++ test suite
> > 
> > It is all working, I guess frontend developers can take a look and see what they
> > think. 
> > 
> > François: could you take a look at the Python wrapper? It is out of sync now.
> > 
> > Victor
> > 
> > 
> 


Date2024-07-27 11:12
FromRory Walsh
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 11:51
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 11:58
FromRory Walsh
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
I can access host data using the CPOF? I never thought of this. 

On Sat, 27 Jul 2024 at 12:51, vlz <viclazzarini@gmail.com> wrote:
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 12:03
FromRory Walsh
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
I see it now in plugin.h, that's great. I'll give it a go for Cabbage 3. Actually, I can start using it now with Csound 6 right?

On Sat 27 Jul 2024, 12:58 Rory Walsh, <rorywalsh@ear.ie> wrote:
I can access host data using the CPOF? I never thought of this. 

On Sat, 27 Jul 2024 at 12:51, vlz <viclazzarini@gmail.com> wrote:
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 12:10
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
yes, that's right.
Btw you can access any functions from the CSOUND structure by taking the CSOUND pointer with the relevant method in CPOF.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 12:04, Rory Walsh <rorywalsh@ear.ie> wrote:


I see it now in plugin.h, that's great. I'll give it a go for Cabbage 3. Actually, I can start using it now with Csound 6 right?

On Sat 27 Jul 2024, 12:58 Rory Walsh, <rorywalsh@ear.ie> wrote:
I can access host data using the CPOF? I never thought of this. 

On Sat, 27 Jul 2024 at 12:51, vlz <viclazzarini@gmail.com> wrote:
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 13:12
FromMichael Gogins
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report

what is CPOF?


On Sat, Jul 27, 2024, 07:10 vlz <viclazzarini@gmail.com> wrote:
yes, that's right.
Btw you can access any functions from the CSOUND structure by taking the CSOUND pointer with the relevant method in CPOF.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 12:04, Rory Walsh <rorywalsh@ear.ie> wrote:


I see it now in plugin.h, that's great. I'll give it a go for Cabbage 3. Actually, I can start using it now with Csound 6 right?

On Sat 27 Jul 2024, 12:58 Rory Walsh, <rorywalsh@ear.ie> wrote:
I can access host data using the CPOF? I never thought of this. 

On Sat, 27 Jul 2024 at 12:51, vlz <viclazzarini@gmail.com> wrote:
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 13:54
FromRory Walsh
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report

On Sat 27 Jul 2024, 14:13 Michael Gogins, <michael.gogins@gmail.com> wrote:

what is CPOF?


On Sat, Jul 27, 2024, 07:10 vlz <viclazzarini@gmail.com> wrote:
yes, that's right.
Btw you can access any functions from the CSOUND structure by taking the CSOUND pointer with the relevant method in CPOF.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 12:04, Rory Walsh <rorywalsh@ear.ie> wrote:


I see it now in plugin.h, that's great. I'll give it a go for Cabbage 3. Actually, I can start using it now with Csound 6 right?

On Sat 27 Jul 2024, 12:58 Rory Walsh, <rorywalsh@ear.ie> wrote:
I can access host data using the CPOF? I never thought of this. 

On Sat, 27 Jul 2024 at 12:51, vlz <viclazzarini@gmail.com> wrote:
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 13:54
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Attachmentsfavicon.ico  

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 13:13, Michael Gogins <michael.gogins@gmail.com> wrote:



what is CPOF?


On Sat, Jul 27, 2024, 07:10 vlz <viclazzarini@gmail.com> wrote:
yes, that's right.
Btw you can access any functions from the CSOUND structure by taking the CSOUND pointer with the relevant method in CPOF.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 12:04, Rory Walsh <rorywalsh@ear.ie> wrote:


I see it now in plugin.h, that's great. I'll give it a go for Cabbage 3. Actually, I can start using it now with Csound 6 right?

On Sat 27 Jul 2024, 12:58 Rory Walsh, <rorywalsh@ear.ie> wrote:
I can access host data using the CPOF? I never thought of this. 

On Sat, 27 Jul 2024 at 12:51, vlz <viclazzarini@gmail.com> wrote:
I think you should use hostdata for passing anything from host to Csound and vice-versa.

It is probably more straightforward as you just pass the pointers directly. Would that be a problem?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 11:12, Rory Walsh <rorywalsh@ear.ie> wrote:


With regards to:

> csoundQueryGlobalVariable
> csoundCreateGlobalVariable

I have been using these methods to pass custom data structs between my opcodes and my host. I should have mentioned this earlier, but they slipped my attention. For example, some of my Csound opcodes can access widget classes owned by Cabbage. Perhaps it was never meant to be used in this way, but it's super powerful. I'm not sure how I can do this without them?  

On Sat, 27 Jul 2024 at 11:20, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 16:37
FromTarmo Johannes
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hi Victor,

Regarding your issue, make sure the call is always after csoundStart()
Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
CsoundQt crashes when destroying the circular buffer.

    csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);

I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.

Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.

Anyway - it is a step forward!

tarmo

Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
Hi Tarmo,

that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
needs of users.

Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
not have been created. Here’s a simple test to show it

    csoundStart(Csound);
    MYFLT *spout = csoundGetSpout(Csound);
    printf("spout = %p \n", spout)

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor!
>
> Thank you for the changes, it helps a lot.
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>
> I still get crash when running a csd.
> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> returns 0 in some reason, I will see if I can figure out the reason later.
>
> Thanks!
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> Hi Tarmo,
>
> I put back
>
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
>
> plus the set global env and the circular buffer functions. It’s in the repo now.
>
> Best
>
> Victor
>
> > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > Hi!
> >
> > I tried out the new API from feature/newapi branch.
> >
> > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >
> > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >
> > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >
> > Then I went to CsoundQt and of course that is much, much more complex  case.
> >
> > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> >
> > CsoundQt used the following functions that are not to be there any more:
> >
> > csoundGetModule
> > csoundSetMIDIModule
> > csoundSetRTAudioModule
> >
> > I commented these lines out for now to move on. What covers their functionality?
> >
> > There is no more circular buffer functions:
> > csoundCreateCircularBuffer
> > csoundReadCircularBuffer
> > etc
> >
> > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > For example reading MIDI data one should set the callback like:
> >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >
> > CsoundQt used to have such a function for the callback:
> >
> > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > {
> >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >     Q_UNUSED(csound);
> >     int count, countVirtual;
> >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >     return count + countVirtual;
> > }
> >
> > Should the host implement writing to the buffer and handling the index itself?
> >
> > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >
> > How to deal with global variables?
> > csoundQueryGlobalVariable
> > csoundCreateGlobalVariable
> > are gone,
> >
> > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >
> > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >
> > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >
> > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >
> > Exciting!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >
> > Just another progress report for the feature/newapi branch
> >
> > - I have now mainlined the new API in csound.h
> > - Updated the csound.hpp wrapper
> > - Updated the csPerformanceThread code
> > - Modified frontends to use it
> > - Modified the C++ test suite
> >
> > It is all working, I guess frontend developers can take a look and see what they
> > think.
> >
> > François: could you take a look at the Python wrapper? It is out of sync now.
> >
> > Victor
> >
> >
>


Date2024-07-27 17:16
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Make sure the csound instance is still in existence before you call that function.
In fact, if you destroy Csound before calling that, the circular buffer memory will
be released as well, so you probably don’t even need to do it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
> 
> Hi Victor, 
> 
> Regarding your issue, make sure the call is always after csoundStart()
> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> CsoundQt crashes when destroying the circular buffer.
> 
>     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
> 
> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
> 
> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
> 
> Anyway - it is a step forward!
> 
> tarmo
> 
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> Hi Tarmo,
> 
> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> needs of users.
> 
> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> not have been created. Here’s a simple test to show it
> 
>     csoundStart(Csound);
>     MYFLT *spout = csoundGetSpout(Csound);
>     printf("spout = %p \n", spout)
> 
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
> > 
> > Hi Victor!
> > 
> > Thank you for the changes, it helps a lot. 
> > 
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > 
> > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> > 
> > I still get crash when running a csd.
> > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> > returns 0 in some reason, I will see if I can figure out the reason later.
> > 
> > Thanks!
> > tarmo
> > 
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> > Hi Tarmo,
> > 
> > I put back 
> > 
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > 
> > plus the set global env and the circular buffer functions. It’s in the repo now.
> > 
> > Best
> > 
> > Victor
> > 
> > > On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
> > > Hi!
> > > 
> > > I tried out the new API from feature/newapi branch.
> > > 
> > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
> > > 
> > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > > 
> > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > > 
> > > Then I went to CsoundQt and of course that is much, much more complex  case.
> > > 
> > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
> > > 
> > > CsoundQt used the following functions that are not to be there any more:
> > > 
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > > 
> > > I commented these lines out for now to move on. What covers their functionality?
> > > 
> > > There is no more circular buffer functions:
> > > csoundCreateCircularBuffer
> > > csoundReadCircularBuffer
> > > etc
> > > 
> > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > > For example reading MIDI data one should set the callback like:
> > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > > 
> > > CsoundQt used to have such a function for the callback:
> > > 
> > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > > {
> > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> > >     Q_UNUSED(csound);
> > >     int count, countVirtual;
> > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> > >     return count + countVirtual;
> > > }
> > > 
> > > Should the host implement writing to the buffer and handling the index itself?
> > > 
> > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > > 
> > > How to deal with global variables?
> > > csoundQueryGlobalVariable
> > > csoundCreateGlobalVariable
> > > are gone, 
> > > 
> > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > > 
> > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > > 
> > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > > 
> > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > > 
> > > Exciting!
> > > tarmo
> > > 
> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > > 
> > > Just another progress report for the feature/newapi branch
> > > 
> > > - I have now mainlined the new API in csound.h
> > > - Updated the csound.hpp wrapper 
> > > - Updated the csPerformanceThread code 
> > > - Modified frontends to use it 
> > > - Modified the C++ test suite
> > > 
> > > It is all working, I guess frontend developers can take a look and see what they
> > > think. 
> > > 
> > > François: could you take a look at the Python wrapper? It is out of sync now.
> > > 
> > > Victor
> > > 
> > > 
> > 
> 


Date2024-07-27 19:46
FromWerner Mendizabal
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hello,

I tried the new changes of the new API and I was able to easily integrate them into the Godot game engine using my gdextension bindings.  Everything is working great.
I did have a few suggestions that I think could help facilitate using the api.
I encountered a few methods that take a parameter to change behaviour of the method.
Example:
PUBLIC uint32_t csoundGetChannels(CSOUND *, int isInput);
PUBLIC int csoundCompileCSD(CSOUND *csound, const char *csd, int mode);

I think it might be easier for consumers of the api to have separate methods for some of these.
Example:
PUBLIC uint32_t csoundGetInputChannels(CSOUND *);
PUBLIC uint32_t csoundGetOutputChannels(CSOUND *);

PUBLIC int csoundCompileCSD(CSOUND *csound, const char *csd);
PUBLIC int csoundCompileCSDString(CSOUND *csound, const char *csd);


I believe that with these changes it makes it easier to use the methods without having to read through the documentation and it is also easier to type when using the api.

Thanks,
    Werner.


On Sat, Jul 27, 2024 at 11:17 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Make sure the csound instance is still in existence before you call that function.
In fact, if you destroy Csound before calling that, the circular buffer memory will
be released as well, so you probably don’t even need to do it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor,
>
> Regarding your issue, make sure the call is always after csoundStart()
> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> CsoundQt crashes when destroying the circular buffer.
>
>     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>
> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>
> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>
> Anyway - it is a step forward!
>
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> Hi Tarmo,
>
> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> needs of users.
>
> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> not have been created. Here’s a simple test to show it
>
>     csoundStart(Csound);
>     MYFLT *spout = csoundGetSpout(Csound);
>     printf("spout = %p \n", spout)
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
> >
> > Hi Victor!
> >
> > Thank you for the changes, it helps a lot.
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >
> > I still get crash when running a csd.
> > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> > returns 0 in some reason, I will see if I can figure out the reason later.
> >
> > Thanks!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> > Hi Tarmo,
> >
> > I put back
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > plus the set global env and the circular buffer functions. It’s in the repo now.
> >
> > Best
> >
> > Victor
> >
> > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > > Hi!
> > >
> > > I tried out the new API from feature/newapi branch.
> > >
> > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> > >
> > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > >
> > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > >
> > > Then I went to CsoundQt and of course that is much, much more complex  case.
> > >
> > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> > >
> > > CsoundQt used the following functions that are not to be there any more:
> > >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > >
> > > I commented these lines out for now to move on. What covers their functionality?
> > >
> > > There is no more circular buffer functions:
> > > csoundCreateCircularBuffer
> > > csoundReadCircularBuffer
> > > etc
> > >
> > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > > For example reading MIDI data one should set the callback like:
> > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > >
> > > CsoundQt used to have such a function for the callback:
> > >
> > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > > {
> > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> > >     Q_UNUSED(csound);
> > >     int count, countVirtual;
> > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> > >     return count + countVirtual;
> > > }
> > >
> > > Should the host implement writing to the buffer and handling the index itself?
> > >
> > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > >
> > > How to deal with global variables?
> > > csoundQueryGlobalVariable
> > > csoundCreateGlobalVariable
> > > are gone,
> > >
> > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > >
> > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > >
> > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > >
> > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > >
> > > Exciting!
> > > tarmo
> > >
> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > >
> > > Just another progress report for the feature/newapi branch
> > >
> > > - I have now mainlined the new API in csound.h
> > > - Updated the csound.hpp wrapper
> > > - Updated the csPerformanceThread code
> > > - Modified frontends to use it
> > > - Modified the C++ test suite
> > >
> > > It is all working, I guess frontend developers can take a look and see what they
> > > think.
> > >
> > > François: could you take a look at the Python wrapper? It is out of sync now.
> > >
> > > Victor
> > >
> > >
> >
>


Date2024-07-27 20:05
FromTarmo Johannes
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hi,

Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.

Best!
tarmo

Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
Make sure the csound instance is still in existence before you call that function.
In fact, if you destroy Csound before calling that, the circular buffer memory will
be released as well, so you probably don’t even need to do it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor,
>
> Regarding your issue, make sure the call is always after csoundStart()
> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> CsoundQt crashes when destroying the circular buffer.
>
>     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>
> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>
> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>
> Anyway - it is a step forward!
>
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> Hi Tarmo,
>
> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> needs of users.
>
> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> not have been created. Here’s a simple test to show it
>
>     csoundStart(Csound);
>     MYFLT *spout = csoundGetSpout(Csound);
>     printf("spout = %p \n", spout)
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
> >
> > Hi Victor!
> >
> > Thank you for the changes, it helps a lot.
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >
> > I still get crash when running a csd.
> > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> > returns 0 in some reason, I will see if I can figure out the reason later.
> >
> > Thanks!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> > Hi Tarmo,
> >
> > I put back
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > plus the set global env and the circular buffer functions. It’s in the repo now.
> >
> > Best
> >
> > Victor
> >
> > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > > Hi!
> > >
> > > I tried out the new API from feature/newapi branch.
> > >
> > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> > >
> > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > >
> > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > >
> > > Then I went to CsoundQt and of course that is much, much more complex  case.
> > >
> > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> > >
> > > CsoundQt used the following functions that are not to be there any more:
> > >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > >
> > > I commented these lines out for now to move on. What covers their functionality?
> > >
> > > There is no more circular buffer functions:
> > > csoundCreateCircularBuffer
> > > csoundReadCircularBuffer
> > > etc
> > >
> > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > > For example reading MIDI data one should set the callback like:
> > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > >
> > > CsoundQt used to have such a function for the callback:
> > >
> > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > > {
> > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> > >     Q_UNUSED(csound);
> > >     int count, countVirtual;
> > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> > >     return count + countVirtual;
> > > }
> > >
> > > Should the host implement writing to the buffer and handling the index itself?
> > >
> > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > >
> > > How to deal with global variables?
> > > csoundQueryGlobalVariable
> > > csoundCreateGlobalVariable
> > > are gone,
> > >
> > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > >
> > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > >
> > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > >
> > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > >
> > > Exciting!
> > > tarmo
> > >
> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > >
> > > Just another progress report for the feature/newapi branch
> > >
> > > - I have now mainlined the new API in csound.h
> > > - Updated the csound.hpp wrapper
> > > - Updated the csPerformanceThread code
> > > - Modified frontends to use it
> > > - Modified the C++ test suite
> > >
> > > It is all working, I guess frontend developers can take a look and see what they
> > > think.
> > >
> > > François: could you take a look at the Python wrapper? It is out of sync now.
> > >
> > > Victor
> > >
> > >
> >
>


Date2024-07-27 21:01
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Thanks for this. I think your suggestions are good, I'll see how I can accommodate them.

best
Prof. Victor Lazzarini
Maynooth University
Ireland

On 27 Jul 2024, at 19:57, Werner Mendizabal <nonameentername@gmail.com> wrote:


You don't often get email from nonameentername@gmail.com. Learn why this is important
Hello,

I tried the new changes of the new API and I was able to easily integrate them into the Godot game engine using my gdextension bindings.  Everything is working great.
I did have a few suggestions that I think could help facilitate using the api.
I encountered a few methods that take a parameter to change behaviour of the method.
Example:
PUBLIC uint32_t csoundGetChannels(CSOUND *, int isInput);
PUBLIC int csoundCompileCSD(CSOUND *csound, const char *csd, int mode);

I think it might be easier for consumers of the api to have separate methods for some of these.
Example:
PUBLIC uint32_t csoundGetInputChannels(CSOUND *);
PUBLIC uint32_t csoundGetOutputChannels(CSOUND *);

PUBLIC int csoundCompileCSD(CSOUND *csound, const char *csd);
PUBLIC int csoundCompileCSDString(CSOUND *csound, const char *csd);


I believe that with these changes it makes it easier to use the methods without having to read through the documentation and it is also easier to type when using the api.

Thanks,
    Werner.


On Sat, Jul 27, 2024 at 11:17 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Make sure the csound instance is still in existence before you call that function.
In fact, if you destroy Csound before calling that, the circular buffer memory will
be released as well, so you probably don’t even need to do it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor,
>
> Regarding your issue, make sure the call is always after csoundStart()
> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> CsoundQt crashes when destroying the circular buffer.
>
>     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>
> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>
> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>
> Anyway - it is a step forward!
>
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> Hi Tarmo,
>
> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> needs of users.
>
> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> not have been created. Here’s a simple test to show it
>
>     csoundStart(Csound);
>     MYFLT *spout = csoundGetSpout(Csound);
>     printf("spout = %p \n", spout)
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
> >
> > Hi Victor!
> >
> > Thank you for the changes, it helps a lot.
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >
> > I still get crash when running a csd.
> > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> > returns 0 in some reason, I will see if I can figure out the reason later.
> >
> > Thanks!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> > Hi Tarmo,
> >
> > I put back
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > plus the set global env and the circular buffer functions. It’s in the repo now.
> >
> > Best
> >
> > Victor
> >
> > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > > Hi!
> > >
> > > I tried out the new API from feature/newapi branch.
> > >
> > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> > >
> > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > >
> > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > >
> > > Then I went to CsoundQt and of course that is much, much more complex  case.
> > >
> > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> > >
> > > CsoundQt used the following functions that are not to be there any more:
> > >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > >
> > > I commented these lines out for now to move on. What covers their functionality?
> > >
> > > There is no more circular buffer functions:
> > > csoundCreateCircularBuffer
> > > csoundReadCircularBuffer
> > > etc
> > >
> > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > > For example reading MIDI data one should set the callback like:
> > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > >
> > > CsoundQt used to have such a function for the callback:
> > >
> > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > > {
> > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> > >     Q_UNUSED(csound);
> > >     int count, countVirtual;
> > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> > >     return count + countVirtual;
> > > }
> > >
> > > Should the host implement writing to the buffer and handling the index itself?
> > >
> > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > >
> > > How to deal with global variables?
> > > csoundQueryGlobalVariable
> > > csoundCreateGlobalVariable
> > > are gone,
> > >
> > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > >
> > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > >
> > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > >
> > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > >
> > > Exciting!
> > > tarmo
> > >
> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > >
> > > Just another progress report for the feature/newapi branch
> > >
> > > - I have now mainlined the new API in csound.h
> > > - Updated the csound.hpp wrapper
> > > - Updated the csPerformanceThread code
> > > - Modified frontends to use it
> > > - Modified the C++ test suite
> > >
> > > It is all working, I guess frontend developers can take a look and see what they
> > > think.
> > >
> > > François: could you take a look at the Python wrapper? It is out of sync now.
> > >
> > > Victor
> > >
> > >
> >
>


Date2024-07-27 21:03
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Thanks. That part hasn't changed, so hopefully it won't be a problem.

best
Victor

On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Hi,

Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.

Best!
tarmo

Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
Make sure the csound instance is still in existence before you call that function.
In fact, if you destroy Csound before calling that, the circular buffer memory will
be released as well, so you probably don’t even need to do it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor,
>
> Regarding your issue, make sure the call is always after csoundStart()
> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> CsoundQt crashes when destroying the circular buffer.
>
>     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>
> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>
> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>
> Anyway - it is a step forward!
>
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> Hi Tarmo,
>
> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> needs of users.
>
> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> not have been created. Here’s a simple test to show it
>
>     csoundStart(Csound);
>     MYFLT *spout = csoundGetSpout(Csound);
>     printf("spout = %p \n", spout)
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
> >
> > Hi Victor!
> >
> > Thank you for the changes, it helps a lot.
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >
> > I still get crash when running a csd.
> > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> > returns 0 in some reason, I will see if I can figure out the reason later.
> >
> > Thanks!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> > Hi Tarmo,
> >
> > I put back
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > plus the set global env and the circular buffer functions. It’s in the repo now.
> >
> > Best
> >
> > Victor
> >
> > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > > Hi!
> > >
> > > I tried out the new API from feature/newapi branch.
> > >
> > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> > >
> > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > >
> > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > >
> > > Then I went to CsoundQt and of course that is much, much more complex  case.
> > >
> > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> > >
> > > CsoundQt used the following functions that are not to be there any more:
> > >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > >
> > > I commented these lines out for now to move on. What covers their functionality?
> > >
> > > There is no more circular buffer functions:
> > > csoundCreateCircularBuffer
> > > csoundReadCircularBuffer
> > > etc
> > >
> > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > > For example reading MIDI data one should set the callback like:
> > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > >
> > > CsoundQt used to have such a function for the callback:
> > >
> > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > > {
> > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> > >     Q_UNUSED(csound);
> > >     int count, countVirtual;
> > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> > >     return count + countVirtual;
> > > }
> > >
> > > Should the host implement writing to the buffer and handling the index itself?
> > >
> > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > >
> > > How to deal with global variables?
> > > csoundQueryGlobalVariable
> > > csoundCreateGlobalVariable
> > > are gone,
> > >
> > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > >
> > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > >
> > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > >
> > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > >
> > > Exciting!
> > > tarmo
> > >
> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > >
> > > Just another progress report for the feature/newapi branch
> > >
> > > - I have now mainlined the new API in csound.h
> > > - Updated the csound.hpp wrapper
> > > - Updated the csPerformanceThread code
> > > - Modified frontends to use it
> > > - Modified the C++ test suite
> > >
> > > It is all working, I guess frontend developers can take a look and see what they
> > > think.
> > >
> > > François: could you take a look at the Python wrapper? It is out of sync now.
> > >
> > > Victor
> > >
> > >
> >
>


Date2024-10-04 07:00
FromBlake Mitchell
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.

A few follow-ups:
  • The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
  • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
  • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.

On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Thanks. That part hasn't changed, so hopefully it won't be a problem.

best
Victor

On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Hi,

Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.

Best!
tarmo

Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
Make sure the csound instance is still in existence before you call that function.
In fact, if you destroy Csound before calling that, the circular buffer memory will
be released as well, so you probably don’t even need to do it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> Hi Victor,
>
> Regarding your issue, make sure the call is always after csoundStart()
> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> CsoundQt crashes when destroying the circular buffer.
>
>     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>
> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>
> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>
> Anyway - it is a step forward!
>
> tarmo
>
> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> Hi Tarmo,
>
> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> needs of users.
>
> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> not have been created. Here’s a simple test to show it
>
>     csoundStart(Csound);
>     MYFLT *spout = csoundGetSpout(Csound);
>     printf("spout = %p \n", spout)
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
> >
> > Hi Victor!
> >
> > Thank you for the changes, it helps a lot.
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >
> > I still get crash when running a csd.
> > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> > returns 0 in some reason, I will see if I can figure out the reason later.
> >
> > Thanks!
> > tarmo
> >
> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> > Hi Tarmo,
> >
> > I put back
> >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> >
> > plus the set global env and the circular buffer functions. It’s in the repo now.
> >
> > Best
> >
> > Victor
> >
> > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
> > > Hi!
> > >
> > > I tried out the new API from feature/newapi branch.
> > >
> > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> > >
> > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> > >
> > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> > >
> > > Then I went to CsoundQt and of course that is much, much more complex  case.
> > >
> > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
> > >
> > > CsoundQt used the following functions that are not to be there any more:
> > >
> > > csoundGetModule
> > > csoundSetMIDIModule
> > > csoundSetRTAudioModule
> > >
> > > I commented these lines out for now to move on. What covers their functionality?
> > >
> > > There is no more circular buffer functions:
> > > csoundCreateCircularBuffer
> > > csoundReadCircularBuffer
> > > etc
> > >
> > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> > > For example reading MIDI data one should set the callback like:
> > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> > >
> > > CsoundQt used to have such a function for the callback:
> > >
> > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> > > {
> > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> > >     Q_UNUSED(csound);
> > >     int count, countVirtual;
> > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> > >     return count + countVirtual;
> > > }
> > >
> > > Should the host implement writing to the buffer and handling the index itself?
> > >
> > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> > >
> > > How to deal with global variables?
> > > csoundQueryGlobalVariable
> > > csoundCreateGlobalVariable
> > > are gone,
> > >
> > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> > >
> > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> > >
> > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> > >
> > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> > >
> > > Exciting!
> > > tarmo
> > >
> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> > >
> > > Just another progress report for the feature/newapi branch
> > >
> > > - I have now mainlined the new API in csound.h
> > > - Updated the csound.hpp wrapper
> > > - Updated the csPerformanceThread code
> > > - Modified frontends to use it
> > > - Modified the C++ test suite
> > >
> > > It is all working, I guess frontend developers can take a look and see what they
> > > think.
> > >
> > > François: could you take a look at the Python wrapper? It is out of sync now.
> > >
> > > Victor
> > >
> > >
> >
>


Date2024-10-04 08:27
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Thanks.

I’ll work on those things.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 07:00, Blake Mitchell  wrote:
> 
> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
> 
> A few follow-ups:
>     • 
> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
> 
> 
> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> Thanks. That part hasn't changed, so hopefully it won't be a problem.
> 
> best
> Victor
> 
>> On 27 Jul 2024, at 20:06, Tarmo Johannes  wrote:
>> 
>>  Hi,
>> 
>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>> 
>> Best!
>> tarmo
>> 
>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> Make sure the csound instance is still in existence before you call that function.
>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> be released as well, so you probably don’t even need to do it.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>> > On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
>> > 
>> > Hi Victor, 
>> > 
>> > Regarding your issue, make sure the call is always after csoundStart()
>> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> > CsoundQt crashes when destroying the circular buffer.
>> > 
>> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> > 
>> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> > 
>> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> > 
>> > Anyway - it is a step forward!
>> > 
>> > tarmo
>> > 
>> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> > Hi Tarmo,
>> > 
>> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> > needs of users.
>> > 
>> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> > not have been created. Here’s a simple test to show it
>> > 
>> >     csoundStart(Csound);
>> >     MYFLT *spout = csoundGetSpout(Csound);
>> >     printf("spout = %p \n", spout)
>> > 
>> > best
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> > 
>> > > On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
>> > > 
>> > > Hi Victor!
>> > > 
>> > > Thank you for the changes, it helps a lot. 
>> > > 
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > 
>> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> > > 
>> > > I still get crash when running a csd.
>> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> > > 
>> > > Thanks!
>> > > tarmo
>> > > 
>> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> > > Hi Tarmo,
>> > > 
>> > > I put back 
>> > > 
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > 
>> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> > > 
>> > > Best
>> > > 
>> > > Victor
>> > > 
>> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
>> > > > Hi!
>> > > > 
>> > > > I tried out the new API from feature/newapi branch.
>> > > > 
>> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
>> > > > 
>> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> > > > 
>> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> > > > 
>> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> > > > 
>> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
>> > > > 
>> > > > CsoundQt used the following functions that are not to be there any more:
>> > > > 
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > > 
>> > > > I commented these lines out for now to move on. What covers their functionality?
>> > > > 
>> > > > There is no more circular buffer functions:
>> > > > csoundCreateCircularBuffer
>> > > > csoundReadCircularBuffer
>> > > > etc
>> > > > 
>> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> > > > For example reading MIDI data one should set the callback like:
>> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> > > > 
>> > > > CsoundQt used to have such a function for the callback:
>> > > > 
>> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> > > > {
>> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> > > >     Q_UNUSED(csound);
>> > > >     int count, countVirtual;
>> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> > > >     return count + countVirtual;
>> > > > }
>> > > > 
>> > > > Should the host implement writing to the buffer and handling the index itself?
>> > > > 
>> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> > > > 
>> > > > How to deal with global variables?
>> > > > csoundQueryGlobalVariable
>> > > > csoundCreateGlobalVariable
>> > > > are gone, 
>> > > > 
>> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> > > > 
>> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> > > > 
>> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> > > > 
>> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> > > > 
>> > > > Exciting!
>> > > > tarmo
>> > > > 
>> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> > > > 
>> > > > Just another progress report for the feature/newapi branch
>> > > > 
>> > > > - I have now mainlined the new API in csound.h
>> > > > - Updated the csound.hpp wrapper 
>> > > > - Updated the csPerformanceThread code 
>> > > > - Modified frontends to use it 
>> > > > - Modified the C++ test suite
>> > > > 
>> > > > It is all working, I guess frontend developers can take a look and see what they
>> > > > think. 
>> > > > 
>> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> > > > 
>> > > > Victor
>> > > > 
>> > > > 
>> > > 
>> > 
>> 


Date2024-10-04 08:52
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Not sure why you are getting these versions. These are defined in the CMakeLists.txt

# Project definitions
set(APIVERSION "7.0")
set(CS_VERSION "7")
set(CS_SUBVER "0")
set(CS_PATCHLEVEL "0”)

and are written to header files. 

Testing with this program on my system

#include 
#include 

int main() {
  int version = csoundGetVersion()/1000;
  int subversion = (csoundGetVersion() - version * 1000)/10;
  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
 return 0;
}

I get

7.0.0


Maybe there is more than one version and your build is
picking up the wrong header files. 

The comments have been removed in this PR

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

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 07:00, Blake Mitchell  wrote:
> 
> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
> 
> A few follow-ups:
>     • 
> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
> 
> 
> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> Thanks. That part hasn't changed, so hopefully it won't be a problem.
> 
> best
> Victor
> 
>> On 27 Jul 2024, at 20:06, Tarmo Johannes  wrote:
>> 
>>  Hi,
>> 
>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>> 
>> Best!
>> tarmo
>> 
>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> Make sure the csound instance is still in existence before you call that function.
>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> be released as well, so you probably don’t even need to do it.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>> > On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
>> > 
>> > Hi Victor, 
>> > 
>> > Regarding your issue, make sure the call is always after csoundStart()
>> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> > CsoundQt crashes when destroying the circular buffer.
>> > 
>> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> > 
>> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> > 
>> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> > 
>> > Anyway - it is a step forward!
>> > 
>> > tarmo
>> > 
>> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> > Hi Tarmo,
>> > 
>> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> > needs of users.
>> > 
>> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> > not have been created. Here’s a simple test to show it
>> > 
>> >     csoundStart(Csound);
>> >     MYFLT *spout = csoundGetSpout(Csound);
>> >     printf("spout = %p \n", spout)
>> > 
>> > best
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> > 
>> > > On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
>> > > 
>> > > Hi Victor!
>> > > 
>> > > Thank you for the changes, it helps a lot. 
>> > > 
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > 
>> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> > > 
>> > > I still get crash when running a csd.
>> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> > > 
>> > > Thanks!
>> > > tarmo
>> > > 
>> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> > > Hi Tarmo,
>> > > 
>> > > I put back 
>> > > 
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > 
>> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> > > 
>> > > Best
>> > > 
>> > > Victor
>> > > 
>> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
>> > > > Hi!
>> > > > 
>> > > > I tried out the new API from feature/newapi branch.
>> > > > 
>> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
>> > > > 
>> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> > > > 
>> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> > > > 
>> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> > > > 
>> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
>> > > > 
>> > > > CsoundQt used the following functions that are not to be there any more:
>> > > > 
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > > 
>> > > > I commented these lines out for now to move on. What covers their functionality?
>> > > > 
>> > > > There is no more circular buffer functions:
>> > > > csoundCreateCircularBuffer
>> > > > csoundReadCircularBuffer
>> > > > etc
>> > > > 
>> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> > > > For example reading MIDI data one should set the callback like:
>> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> > > > 
>> > > > CsoundQt used to have such a function for the callback:
>> > > > 
>> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> > > > {
>> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> > > >     Q_UNUSED(csound);
>> > > >     int count, countVirtual;
>> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> > > >     return count + countVirtual;
>> > > > }
>> > > > 
>> > > > Should the host implement writing to the buffer and handling the index itself?
>> > > > 
>> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> > > > 
>> > > > How to deal with global variables?
>> > > > csoundQueryGlobalVariable
>> > > > csoundCreateGlobalVariable
>> > > > are gone, 
>> > > > 
>> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> > > > 
>> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> > > > 
>> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> > > > 
>> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> > > > 
>> > > > Exciting!
>> > > > tarmo
>> > > > 
>> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> > > > 
>> > > > Just another progress report for the feature/newapi branch
>> > > > 
>> > > > - I have now mainlined the new API in csound.h
>> > > > - Updated the csound.hpp wrapper 
>> > > > - Updated the csPerformanceThread code 
>> > > > - Modified frontends to use it 
>> > > > - Modified the C++ test suite
>> > > > 
>> > > > It is all working, I guess frontend developers can take a look and see what they
>> > > > think. 
>> > > > 
>> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> > > > 
>> > > > Victor
>> > > > 
>> > > > 
>> > > 
>> > 
>> 


Date2024-10-04 15:58
FromBlake Mitchell
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Hi Victor,

I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".

Thanks for taking a look at and fixing the documentation!

On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Not sure why you are getting these versions. These are defined in the CMakeLists.txt

# Project definitions
set(APIVERSION "7.0")
set(CS_VERSION "7")
set(CS_SUBVER "0")
set(CS_PATCHLEVEL "0”)

and are written to header files.

Testing with this program on my system

#include <CsoundLib64/csound.h>
#include <iostream>

int main() {
  int version = csoundGetVersion()/1000;
  int subversion = (csoundGetVersion() - version * 1000)/10;
  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
 return 0;
}

I get

7.0.0


Maybe there is more than one version and your build is
picking up the wrong header files.

The comments have been removed in this PR

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

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>
> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>
> A few follow-ups:
>     •
> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>
>
> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>
> best
> Victor
>
>> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>>
>>  Hi,
>>
>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>
>> Best!
>> tarmo
>>
>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> Make sure the csound instance is still in existence before you call that function.
>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> be released as well, so you probably don’t even need to do it.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> >
>> > Hi Victor,
>> >
>> > Regarding your issue, make sure the call is always after csoundStart()
>> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> > CsoundQt crashes when destroying the circular buffer.
>> >
>> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> >
>> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> >
>> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> >
>> > Anyway - it is a step forward!
>> >
>> > tarmo
>> >
>> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> > Hi Tarmo,
>> >
>> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> > needs of users.
>> >
>> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> > not have been created. Here’s a simple test to show it
>> >
>> >     csoundStart(Csound);
>> >     MYFLT *spout = csoundGetSpout(Csound);
>> >     printf("spout = %p \n", spout)
>> >
>> > best
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> > > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> > >
>> > > Hi Victor!
>> > >
>> > > Thank you for the changes, it helps a lot.
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> > >
>> > > I still get crash when running a csd.
>> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> > >
>> > > Thanks!
>> > > tarmo
>> > >
>> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> > > Hi Tarmo,
>> > >
>> > > I put back
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> > >
>> > > Best
>> > >
>> > > Victor
>> > >
>> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>> > > > Hi!
>> > > >
>> > > > I tried out the new API from feature/newapi branch.
>> > > >
>> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>> > > >
>> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> > > >
>> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> > > >
>> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> > > >
>> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>> > > >
>> > > > CsoundQt used the following functions that are not to be there any more:
>> > > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > >
>> > > > I commented these lines out for now to move on. What covers their functionality?
>> > > >
>> > > > There is no more circular buffer functions:
>> > > > csoundCreateCircularBuffer
>> > > > csoundReadCircularBuffer
>> > > > etc
>> > > >
>> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> > > > For example reading MIDI data one should set the callback like:
>> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> > > >
>> > > > CsoundQt used to have such a function for the callback:
>> > > >
>> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> > > > {
>> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> > > >     Q_UNUSED(csound);
>> > > >     int count, countVirtual;
>> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> > > >     return count + countVirtual;
>> > > > }
>> > > >
>> > > > Should the host implement writing to the buffer and handling the index itself?
>> > > >
>> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> > > >
>> > > > How to deal with global variables?
>> > > > csoundQueryGlobalVariable
>> > > > csoundCreateGlobalVariable
>> > > > are gone,
>> > > >
>> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> > > >
>> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> > > >
>> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> > > >
>> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> > > >
>> > > > Exciting!
>> > > > tarmo
>> > > >
>> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> > > >
>> > > > Just another progress report for the feature/newapi branch
>> > > >
>> > > > - I have now mainlined the new API in csound.h
>> > > > - Updated the csound.hpp wrapper
>> > > > - Updated the csPerformanceThread code
>> > > > - Modified frontends to use it
>> > > > - Modified the C++ test suite
>> > > >
>> > > > It is all working, I guess frontend developers can take a look and see what they
>> > > > think.
>> > > >
>> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> > > >
>> > > > Victor
>> > > >
>> > > >
>> > >
>> >
>>


Date2024-10-04 16:12
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Ok, so there's something wrong with the build, but the version set in the codebase is correct.

When you run csound in the command line what version is reported?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 4 Oct 2024, at 15:58, Blake Mitchell <bmitchell33@gmail.com> wrote:


Hi Victor,

I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".

Thanks for taking a look at and fixing the documentation!

On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Not sure why you are getting these versions. These are defined in the CMakeLists.txt

# Project definitions
set(APIVERSION "7.0")
set(CS_VERSION "7")
set(CS_SUBVER "0")
set(CS_PATCHLEVEL "0”)

and are written to header files.

Testing with this program on my system

#include <CsoundLib64/csound.h>
#include <iostream>

int main() {
  int version = csoundGetVersion()/1000;
  int subversion = (csoundGetVersion() - version * 1000)/10;
  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
 return 0;
}

I get

7.0.0


Maybe there is more than one version and your build is
picking up the wrong header files.

The comments have been removed in this PR

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

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>
> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>
> A few follow-ups:
>     •
> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>
>
> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>
> best
> Victor
>
>> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>>
>>  Hi,
>>
>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>
>> Best!
>> tarmo
>>
>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> Make sure the csound instance is still in existence before you call that function.
>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> be released as well, so you probably don’t even need to do it.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> >
>> > Hi Victor,
>> >
>> > Regarding your issue, make sure the call is always after csoundStart()
>> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> > CsoundQt crashes when destroying the circular buffer.
>> >
>> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> >
>> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> >
>> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> >
>> > Anyway - it is a step forward!
>> >
>> > tarmo
>> >
>> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> > Hi Tarmo,
>> >
>> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> > needs of users.
>> >
>> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> > not have been created. Here’s a simple test to show it
>> >
>> >     csoundStart(Csound);
>> >     MYFLT *spout = csoundGetSpout(Csound);
>> >     printf("spout = %p \n", spout)
>> >
>> > best
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> > > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> > >
>> > > Hi Victor!
>> > >
>> > > Thank you for the changes, it helps a lot.
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> > >
>> > > I still get crash when running a csd.
>> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> > >
>> > > Thanks!
>> > > tarmo
>> > >
>> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> > > Hi Tarmo,
>> > >
>> > > I put back
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> > >
>> > > Best
>> > >
>> > > Victor
>> > >
>> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>> > > > Hi!
>> > > >
>> > > > I tried out the new API from feature/newapi branch.
>> > > >
>> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>> > > >
>> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> > > >
>> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> > > >
>> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> > > >
>> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>> > > >
>> > > > CsoundQt used the following functions that are not to be there any more:
>> > > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > >
>> > > > I commented these lines out for now to move on. What covers their functionality?
>> > > >
>> > > > There is no more circular buffer functions:
>> > > > csoundCreateCircularBuffer
>> > > > csoundReadCircularBuffer
>> > > > etc
>> > > >
>> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> > > > For example reading MIDI data one should set the callback like:
>> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> > > >
>> > > > CsoundQt used to have such a function for the callback:
>> > > >
>> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> > > > {
>> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> > > >     Q_UNUSED(csound);
>> > > >     int count, countVirtual;
>> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> > > >     return count + countVirtual;
>> > > > }
>> > > >
>> > > > Should the host implement writing to the buffer and handling the index itself?
>> > > >
>> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> > > >
>> > > > How to deal with global variables?
>> > > > csoundQueryGlobalVariable
>> > > > csoundCreateGlobalVariable
>> > > > are gone,
>> > > >
>> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> > > >
>> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> > > >
>> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> > > >
>> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> > > >
>> > > > Exciting!
>> > > > tarmo
>> > > >
>> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> > > >
>> > > > Just another progress report for the feature/newapi branch
>> > > >
>> > > > - I have now mainlined the new API in csound.h
>> > > > - Updated the csound.hpp wrapper
>> > > > - Updated the csPerformanceThread code
>> > > > - Modified frontends to use it
>> > > > - Modified the C++ test suite
>> > > >
>> > > > It is all working, I guess frontend developers can take a look and see what they
>> > > > think.
>> > > >
>> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> > > >
>> > > > Victor
>> > > >
>> > > >
>> > >
>> >
>>


Date2024-10-04 16:14
FromBlake Mitchell
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Here's the output:

 > csound --version
--Csound version 6.18 (double samples) Nov 23 2022
[commit: a1580f9cdf331c35dceb486f4231871ce0b00266]

On Fri, Oct 4, 2024 at 11:12 AM vlz <viclazzarini@gmail.com> wrote:
Ok, so there's something wrong with the build, but the version set in the codebase is correct.

When you run csound in the command line what version is reported?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 4 Oct 2024, at 15:58, Blake Mitchell <bmitchell33@gmail.com> wrote:


Hi Victor,

I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".

Thanks for taking a look at and fixing the documentation!

On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Not sure why you are getting these versions. These are defined in the CMakeLists.txt

# Project definitions
set(APIVERSION "7.0")
set(CS_VERSION "7")
set(CS_SUBVER "0")
set(CS_PATCHLEVEL "0”)

and are written to header files.

Testing with this program on my system

#include <CsoundLib64/csound.h>
#include <iostream>

int main() {
  int version = csoundGetVersion()/1000;
  int subversion = (csoundGetVersion() - version * 1000)/10;
  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
 return 0;
}

I get

7.0.0


Maybe there is more than one version and your build is
picking up the wrong header files.

The comments have been removed in this PR

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

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>
> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>
> A few follow-ups:
>     •
> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>
>
> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>
> best
> Victor
>
>> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>>
>>  Hi,
>>
>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>
>> Best!
>> tarmo
>>
>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> Make sure the csound instance is still in existence before you call that function.
>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> be released as well, so you probably don’t even need to do it.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> >
>> > Hi Victor,
>> >
>> > Regarding your issue, make sure the call is always after csoundStart()
>> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> > CsoundQt crashes when destroying the circular buffer.
>> >
>> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> >
>> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> >
>> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> >
>> > Anyway - it is a step forward!
>> >
>> > tarmo
>> >
>> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> > Hi Tarmo,
>> >
>> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> > needs of users.
>> >
>> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> > not have been created. Here’s a simple test to show it
>> >
>> >     csoundStart(Csound);
>> >     MYFLT *spout = csoundGetSpout(Csound);
>> >     printf("spout = %p \n", spout)
>> >
>> > best
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> > > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> > >
>> > > Hi Victor!
>> > >
>> > > Thank you for the changes, it helps a lot.
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> > >
>> > > I still get crash when running a csd.
>> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> > >
>> > > Thanks!
>> > > tarmo
>> > >
>> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> > > Hi Tarmo,
>> > >
>> > > I put back
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> > >
>> > > Best
>> > >
>> > > Victor
>> > >
>> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>> > > > Hi!
>> > > >
>> > > > I tried out the new API from feature/newapi branch.
>> > > >
>> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>> > > >
>> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> > > >
>> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> > > >
>> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> > > >
>> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>> > > >
>> > > > CsoundQt used the following functions that are not to be there any more:
>> > > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > >
>> > > > I commented these lines out for now to move on. What covers their functionality?
>> > > >
>> > > > There is no more circular buffer functions:
>> > > > csoundCreateCircularBuffer
>> > > > csoundReadCircularBuffer
>> > > > etc
>> > > >
>> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> > > > For example reading MIDI data one should set the callback like:
>> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> > > >
>> > > > CsoundQt used to have such a function for the callback:
>> > > >
>> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> > > > {
>> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> > > >     Q_UNUSED(csound);
>> > > >     int count, countVirtual;
>> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> > > >     return count + countVirtual;
>> > > > }
>> > > >
>> > > > Should the host implement writing to the buffer and handling the index itself?
>> > > >
>> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> > > >
>> > > > How to deal with global variables?
>> > > > csoundQueryGlobalVariable
>> > > > csoundCreateGlobalVariable
>> > > > are gone,
>> > > >
>> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> > > >
>> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> > > >
>> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> > > >
>> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> > > >
>> > > > Exciting!
>> > > > tarmo
>> > > >
>> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> > > >
>> > > > Just another progress report for the feature/newapi branch
>> > > >
>> > > > - I have now mainlined the new API in csound.h
>> > > > - Updated the csound.hpp wrapper
>> > > > - Updated the csPerformanceThread code
>> > > > - Modified frontends to use it
>> > > > - Modified the C++ test suite
>> > > >
>> > > > It is all working, I guess frontend developers can take a look and see what they
>> > > > think.
>> > > >
>> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> > > >
>> > > > Victor
>> > > >
>> > > >
>> > >
>> >
>>


Date2024-10-04 16:23
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
And you only have 1 version of Csound installed, nothing else lying around in your system?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 4 Oct 2024, at 16:15, Blake Mitchell <bmitchell33@gmail.com> wrote:


Here's the output:

 > csound --version
--Csound version 6.18 (double samples) Nov 23 2022
[commit: a1580f9cdf331c35dceb486f4231871ce0b00266]

On Fri, Oct 4, 2024 at 11:12 AM vlz <viclazzarini@gmail.com> wrote:
Ok, so there's something wrong with the build, but the version set in the codebase is correct.

When you run csound in the command line what version is reported?

Prof. Victor Lazzarini
Maynooth University
Ireland

On 4 Oct 2024, at 15:58, Blake Mitchell <bmitchell33@gmail.com> wrote:


Hi Victor,

I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".

Thanks for taking a look at and fixing the documentation!

On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Not sure why you are getting these versions. These are defined in the CMakeLists.txt

# Project definitions
set(APIVERSION "7.0")
set(CS_VERSION "7")
set(CS_SUBVER "0")
set(CS_PATCHLEVEL "0”)

and are written to header files.

Testing with this program on my system

#include <CsoundLib64/csound.h>
#include <iostream>

int main() {
  int version = csoundGetVersion()/1000;
  int subversion = (csoundGetVersion() - version * 1000)/10;
  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
 return 0;
}

I get

7.0.0


Maybe there is more than one version and your build is
picking up the wrong header files.

The comments have been removed in this PR

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

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>
> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>
> A few follow-ups:
>     •
> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>
>
> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>
> best
> Victor
>
>> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>>
>>  Hi,
>>
>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>
>> Best!
>> tarmo
>>
>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> Make sure the csound instance is still in existence before you call that function.
>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> be released as well, so you probably don’t even need to do it.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> >
>> > Hi Victor,
>> >
>> > Regarding your issue, make sure the call is always after csoundStart()
>> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> > CsoundQt crashes when destroying the circular buffer.
>> >
>> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> >
>> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> >
>> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> >
>> > Anyway - it is a step forward!
>> >
>> > tarmo
>> >
>> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> > Hi Tarmo,
>> >
>> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> > needs of users.
>> >
>> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> > not have been created. Here’s a simple test to show it
>> >
>> >     csoundStart(Csound);
>> >     MYFLT *spout = csoundGetSpout(Csound);
>> >     printf("spout = %p \n", spout)
>> >
>> > best
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> > > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> > >
>> > > Hi Victor!
>> > >
>> > > Thank you for the changes, it helps a lot.
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> > >
>> > > I still get crash when running a csd.
>> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> > >
>> > > Thanks!
>> > > tarmo
>> > >
>> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> > > Hi Tarmo,
>> > >
>> > > I put back
>> > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > >
>> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> > >
>> > > Best
>> > >
>> > > Victor
>> > >
>> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>> > > > Hi!
>> > > >
>> > > > I tried out the new API from feature/newapi branch.
>> > > >
>> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>> > > >
>> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> > > >
>> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> > > >
>> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> > > >
>> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>> > > >
>> > > > CsoundQt used the following functions that are not to be there any more:
>> > > >
>> > > > csoundGetModule
>> > > > csoundSetMIDIModule
>> > > > csoundSetRTAudioModule
>> > > >
>> > > > I commented these lines out for now to move on. What covers their functionality?
>> > > >
>> > > > There is no more circular buffer functions:
>> > > > csoundCreateCircularBuffer
>> > > > csoundReadCircularBuffer
>> > > > etc
>> > > >
>> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> > > > For example reading MIDI data one should set the callback like:
>> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> > > >
>> > > > CsoundQt used to have such a function for the callback:
>> > > >
>> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> > > > {
>> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> > > >     Q_UNUSED(csound);
>> > > >     int count, countVirtual;
>> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> > > >     return count + countVirtual;
>> > > > }
>> > > >
>> > > > Should the host implement writing to the buffer and handling the index itself?
>> > > >
>> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> > > >
>> > > > How to deal with global variables?
>> > > > csoundQueryGlobalVariable
>> > > > csoundCreateGlobalVariable
>> > > > are gone,
>> > > >
>> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> > > >
>> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> > > >
>> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> > > >
>> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> > > >
>> > > > Exciting!
>> > > > tarmo
>> > > >
>> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> > > >
>> > > > Just another progress report for the feature/newapi branch
>> > > >
>> > > > - I have now mainlined the new API in csound.h
>> > > > - Updated the csound.hpp wrapper
>> > > > - Updated the csPerformanceThread code
>> > > > - Modified frontends to use it
>> > > > - Modified the C++ test suite
>> > > >
>> > > > It is all working, I guess frontend developers can take a look and see what they
>> > > > think.
>> > > >
>> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> > > >
>> > > > Victor
>> > > >
>> > > >
>> > >
>> >
>>


Date2024-10-04 16:26
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
That’s a very old version, looking by the commit

victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
Merge: be2520225 f9f44bada
Author: John ffitch 
Date:   Wed Nov 23 19:53:55 2022 +0000

    Merge branch 'csound6' of github.com:csound/csound into csound6

and also the date of the build confirms it. 

I don’t think you are picking up the latest build when running that command.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 16:14, Blake Mitchell  wrote:
> 
> Here's the output:
> 
>  > csound --version
> --Csound version 6.18 (double samples) Nov 23 2022
> [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
> 
> On Fri, Oct 4, 2024 at 11:12 AM vlz  wrote:
> Ok, so there's something wrong with the build, but the version set in the codebase is correct.
> 
> When you run csound in the command line what version is reported?
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 4 Oct 2024, at 15:58, Blake Mitchell  wrote:
>> 
>> Hi Victor,
>> 
>> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
>> 
>> Thanks for taking a look at and fixing the documentation!
>> 
>> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
>> 
>> # Project definitions
>> set(APIVERSION "7.0")
>> set(CS_VERSION "7")
>> set(CS_SUBVER "0")
>> set(CS_PATCHLEVEL "0”)
>> 
>> and are written to header files. 
>> 
>> Testing with this program on my system
>> 
>> #include 
>> #include 
>> 
>> int main() {
>>   int version = csoundGetVersion()/1000;
>>   int subversion = (csoundGetVersion() - version * 1000)/10;
>>   int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
>>   std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
>>  return 0;
>> }
>> 
>> I get
>> 
>> 7.0.0
>> 
>> 
>> Maybe there is more than one version and your build is
>> picking up the wrong header files. 
>> 
>> The comments have been removed in this PR
>> 
>> https://github.com/csound/csound/pull/1982
>> 
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>> > On 4 Oct 2024, at 07:00, Blake Mitchell  wrote:
>> > 
>> > I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>> > 
>> > A few follow-ups:
>> >     • 
>> > The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>> >     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>> >     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>> > 
>> > 
>> > On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> > Thanks. That part hasn't changed, so hopefully it won't be a problem.
>> > 
>> > best
>> > Victor
>> > 
>> >> On 27 Jul 2024, at 20:06, Tarmo Johannes  wrote:
>> >> 
>> >>  Hi,
>> >> 
>> >> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>> >> 
>> >> Best!
>> >> tarmo
>> >> 
>> >> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> >> Make sure the csound instance is still in existence before you call that function.
>> >> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> >> be released as well, so you probably don’t even need to do it.
>> >> ========================
>> >> Prof. Victor Lazzarini
>> >> Maynooth University
>> >> Ireland
>> >> 
>> >> > On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
>> >> > 
>> >> > Hi Victor, 
>> >> > 
>> >> > Regarding your issue, make sure the call is always after csoundStart()
>> >> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> >> > CsoundQt crashes when destroying the circular buffer.
>> >> > 
>> >> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> >> > 
>> >> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> >> > 
>> >> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> >> > 
>> >> > Anyway - it is a step forward!
>> >> > 
>> >> > tarmo
>> >> > 
>> >> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> >> > Hi Tarmo,
>> >> > 
>> >> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> >> > needs of users.
>> >> > 
>> >> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> >> > not have been created. Here’s a simple test to show it
>> >> > 
>> >> >     csoundStart(Csound);
>> >> >     MYFLT *spout = csoundGetSpout(Csound);
>> >> >     printf("spout = %p \n", spout)
>> >> > 
>> >> > best
>> >> > ========================
>> >> > Prof. Victor Lazzarini
>> >> > Maynooth University
>> >> > Ireland
>> >> > 
>> >> > > On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
>> >> > > 
>> >> > > Hi Victor!
>> >> > > 
>> >> > > Thank you for the changes, it helps a lot. 
>> >> > > 
>> >> > > > csoundGetModule
>> >> > > > csoundSetMIDIModule
>> >> > > > csoundSetRTAudioModule
>> >> > > 
>> >> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> >> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> >> > > 
>> >> > > I still get crash when running a csd.
>> >> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> >> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> >> > > 
>> >> > > Thanks!
>> >> > > tarmo
>> >> > > 
>> >> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> >> > > Hi Tarmo,
>> >> > > 
>> >> > > I put back 
>> >> > > 
>> >> > > > csoundGetModule
>> >> > > > csoundSetMIDIModule
>> >> > > > csoundSetRTAudioModule
>> >> > > 
>> >> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> >> > > 
>> >> > > Best
>> >> > > 
>> >> > > Victor
>> >> > > 
>> >> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
>> >> > > > Hi!
>> >> > > > 
>> >> > > > I tried out the new API from feature/newapi branch.
>> >> > > > 
>> >> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
>> >> > > > 
>> >> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> >> > > > 
>> >> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> >> > > > 
>> >> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> >> > > > 
>> >> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
>> >> > > > 
>> >> > > > CsoundQt used the following functions that are not to be there any more:
>> >> > > > 
>> >> > > > csoundGetModule
>> >> > > > csoundSetMIDIModule
>> >> > > > csoundSetRTAudioModule
>> >> > > > 
>> >> > > > I commented these lines out for now to move on. What covers their functionality?
>> >> > > > 
>> >> > > > There is no more circular buffer functions:
>> >> > > > csoundCreateCircularBuffer
>> >> > > > csoundReadCircularBuffer
>> >> > > > etc
>> >> > > > 
>> >> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> >> > > > For example reading MIDI data one should set the callback like:
>> >> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> >> > > > 
>> >> > > > CsoundQt used to have such a function for the callback:
>> >> > > > 
>> >> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> >> > > > {
>> >> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> >> > > >     Q_UNUSED(csound);
>> >> > > >     int count, countVirtual;
>> >> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> >> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> >> > > >     return count + countVirtual;
>> >> > > > }
>> >> > > > 
>> >> > > > Should the host implement writing to the buffer and handling the index itself?
>> >> > > > 
>> >> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> >> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> >> > > > 
>> >> > > > How to deal with global variables?
>> >> > > > csoundQueryGlobalVariable
>> >> > > > csoundCreateGlobalVariable
>> >> > > > are gone, 
>> >> > > > 
>> >> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> >> > > > 
>> >> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> >> > > > 
>> >> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> >> > > > 
>> >> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> >> > > > 
>> >> > > > Exciting!
>> >> > > > tarmo
>> >> > > > 
>> >> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> >> > > > 
>> >> > > > Just another progress report for the feature/newapi branch
>> >> > > > 
>> >> > > > - I have now mainlined the new API in csound.h
>> >> > > > - Updated the csound.hpp wrapper 
>> >> > > > - Updated the csPerformanceThread code 
>> >> > > > - Modified frontends to use it 
>> >> > > > - Modified the C++ test suite
>> >> > > > 
>> >> > > > It is all working, I guess frontend developers can take a look and see what they
>> >> > > > think. 
>> >> > > > 
>> >> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> >> > > > 
>> >> > > > Victor
>> >> > > > 
>> >> > > > 
>> >> > > 
>> >> > 
>> >> 
>> 


Date2024-10-04 16:32
FromBlake Mitchell
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Whoops. I ran that `csound --version` command local to the Csound 7 download directory, but for some reason, it still picked up the csound in my path. Sorry about that. Here is the correct output from the csound.exe I downloaded.

> C:\Users\<username>\Downloads\csound-7.0.0-2839-windows-x64-binaries\build\Release\csound.exe --version
--Csound version 7.0 (double samples) Oct  1 2024

For the API, though, is the csound64.dll completely self-contained? I had assumed it was, but given that the version of Csound in my path is 6.18.1 and the API returned version 6181, I'm guessing that the csound64.dll still relies on csound.exe? If so, that would explain the version returned by the API.

On Fri, Oct 4, 2024 at 11:26 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
That’s a very old version, looking by the commit

victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
Merge: be2520225 f9f44bada
Author: John ffitch <jpff@codemist.co.uk>
Date:   Wed Nov 23 19:53:55 2022 +0000

    Merge branch 'csound6' of github.com:csound/csound into csound6

and also the date of the build confirms it.

I don’t think you are picking up the latest build when running that command.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 16:14, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>
> Here's the output:
>
>  > csound --version
> --Csound version 6.18 (double samples) Nov 23 2022
> [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
>
> On Fri, Oct 4, 2024 at 11:12 AM vlz <viclazzarini@gmail.com> wrote:
> Ok, so there's something wrong with the build, but the version set in the codebase is correct.
>
> When you run csound in the command line what version is reported?
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 4 Oct 2024, at 15:58, Blake Mitchell <bmitchell33@gmail.com> wrote:
>>
>> Hi Victor,
>>
>> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
>>
>> Thanks for taking a look at and fixing the documentation!
>>
>> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
>>
>> # Project definitions
>> set(APIVERSION "7.0")
>> set(CS_VERSION "7")
>> set(CS_SUBVER "0")
>> set(CS_PATCHLEVEL "0”)
>>
>> and are written to header files.
>>
>> Testing with this program on my system
>>
>> #include <CsoundLib64/csound.h>
>> #include <iostream>
>>
>> int main() {
>>   int version = csoundGetVersion()/1000;
>>   int subversion = (csoundGetVersion() - version * 1000)/10;
>>   int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
>>   std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
>>  return 0;
>> }
>>
>> I get
>>
>> 7.0.0
>>
>>
>> Maybe there is more than one version and your build is
>> picking up the wrong header files.
>>
>> The comments have been removed in this PR
>>
>> https://github.com/csound/csound/pull/1982
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>> >
>> > I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>> >
>> > A few follow-ups:
>> >     •
>> > The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>> >     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>> >     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>> >
>> >
>> > On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> > Thanks. That part hasn't changed, so hopefully it won't be a problem.
>> >
>> > best
>> > Victor
>> >
>> >> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>> >>
>> >>  Hi,
>> >>
>> >> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>> >>
>> >> Best!
>> >> tarmo
>> >>
>> >> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>> >> Make sure the csound instance is still in existence before you call that function.
>> >> In fact, if you destroy Csound before calling that, the circular buffer memory will
>> >> be released as well, so you probably don’t even need to do it.
>> >> ========================
>> >> Prof. Victor Lazzarini
>> >> Maynooth University
>> >> Ireland
>> >>
>> >> > On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> >> >
>> >> > Hi Victor,
>> >> >
>> >> > Regarding your issue, make sure the call is always after csoundStart()
>> >> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>> >> > CsoundQt crashes when destroying the circular buffer.
>> >> >
>> >> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>> >> >
>> >> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>> >> >
>> >> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>> >> >
>> >> > Anyway - it is a step forward!
>> >> >
>> >> > tarmo
>> >> >
>> >> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>> >> > Hi Tarmo,
>> >> >
>> >> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>> >> > needs of users.
>> >> >
>> >> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>> >> > not have been created. Here’s a simple test to show it
>> >> >
>> >> >     csoundStart(Csound);
>> >> >     MYFLT *spout = csoundGetSpout(Csound);
>> >> >     printf("spout = %p \n", spout)
>> >> >
>> >> > best
>> >> > ========================
>> >> > Prof. Victor Lazzarini
>> >> > Maynooth University
>> >> > Ireland
>> >> >
>> >> > > On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>> >> > >
>> >> > > Hi Victor!
>> >> > >
>> >> > > Thank you for the changes, it helps a lot.
>> >> > >
>> >> > > > csoundGetModule
>> >> > > > csoundSetMIDIModule
>> >> > > > csoundSetRTAudioModule
>> >> > >
>> >> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>> >> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>> >> > >
>> >> > > I still get crash when running a csd.
>> >> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>> >> > > returns 0 in some reason, I will see if I can figure out the reason later.
>> >> > >
>> >> > > Thanks!
>> >> > > tarmo
>> >> > >
>> >> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>> >> > > Hi Tarmo,
>> >> > >
>> >> > > I put back
>> >> > >
>> >> > > > csoundGetModule
>> >> > > > csoundSetMIDIModule
>> >> > > > csoundSetRTAudioModule
>> >> > >
>> >> > > plus the set global env and the circular buffer functions. It’s in the repo now.
>> >> > >
>> >> > > Best
>> >> > >
>> >> > > Victor
>> >> > >
>> >> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>> >> > > > Hi!
>> >> > > >
>> >> > > > I tried out the new API from feature/newapi branch.
>> >> > > >
>> >> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>> >> > > >
>> >> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>> >> > > >
>> >> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>> >> > > >
>> >> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
>> >> > > >
>> >> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>> >> > > >
>> >> > > > CsoundQt used the following functions that are not to be there any more:
>> >> > > >
>> >> > > > csoundGetModule
>> >> > > > csoundSetMIDIModule
>> >> > > > csoundSetRTAudioModule
>> >> > > >
>> >> > > > I commented these lines out for now to move on. What covers their functionality?
>> >> > > >
>> >> > > > There is no more circular buffer functions:
>> >> > > > csoundCreateCircularBuffer
>> >> > > > csoundReadCircularBuffer
>> >> > > > etc
>> >> > > >
>> >> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>> >> > > > For example reading MIDI data one should set the callback like:
>> >> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>> >> > > >
>> >> > > > CsoundQt used to have such a function for the callback:
>> >> > > >
>> >> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>> >> > > > {
>> >> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
>> >> > > >     Q_UNUSED(csound);
>> >> > > >     int count, countVirtual;
>> >> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>> >> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>> >> > > >     return count + countVirtual;
>> >> > > > }
>> >> > > >
>> >> > > > Should the host implement writing to the buffer and handling the index itself?
>> >> > > >
>> >> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>> >> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>> >> > > >
>> >> > > > How to deal with global variables?
>> >> > > > csoundQueryGlobalVariable
>> >> > > > csoundCreateGlobalVariable
>> >> > > > are gone,
>> >> > > >
>> >> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>> >> > > >
>> >> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
>> >> > > >
>> >> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>> >> > > >
>> >> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>> >> > > >
>> >> > > > Exciting!
>> >> > > > tarmo
>> >> > > >
>> >> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>> >> > > >
>> >> > > > Just another progress report for the feature/newapi branch
>> >> > > >
>> >> > > > - I have now mainlined the new API in csound.h
>> >> > > > - Updated the csound.hpp wrapper
>> >> > > > - Updated the csPerformanceThread code
>> >> > > > - Modified frontends to use it
>> >> > > > - Modified the C++ test suite
>> >> > > >
>> >> > > > It is all working, I guess frontend developers can take a look and see what they
>> >> > > > think.
>> >> > > >
>> >> > > > François: could you take a look at the Python wrapper? It is out of sync now.
>> >> > > >
>> >> > > > Victor
>> >> > > >
>> >> > > >
>> >> > >
>> >> >
>> >>
>>


Date2024-10-04 16:52
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
It’s the other way round, csound.exe is linked to Csound64.dll. The csound.exe is only a frontend.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 16:32, Blake Mitchell  wrote:
> 
> Whoops. I ran that `csound --version` command local to the Csound 7 download directory, but for some reason, it still picked up the csound in my path. Sorry about that. Here is the correct output from the csound.exe I downloaded.
> 
> > C:\Users\\Downloads\csound-7.0.0-2839-windows-x64-binaries\build\Release\csound.exe --version
> --Csound version 7.0 (double samples) Oct  1 2024
> 
> For the API, though, is the csound64.dll completely self-contained? I had assumed it was, but given that the version of Csound in my path is 6.18.1 and the API returned version 6181, I'm guessing that the csound64.dll still relies on csound.exe? If so, that would explain the version returned by the API.
> 
> On Fri, Oct 4, 2024 at 11:26 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> That’s a very old version, looking by the commit
> 
> victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
> commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
> Merge: be2520225 f9f44bada
> Author: John ffitch 
> Date:   Wed Nov 23 19:53:55 2022 +0000
> 
>     Merge branch 'csound6' of github.com:csound/csound into csound6
> 
> and also the date of the build confirms it. 
> 
> I don’t think you are picking up the latest build when running that command.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 4 Oct 2024, at 16:14, Blake Mitchell  wrote:
> > 
> > Here's the output:
> > 
> >  > csound --version
> > --Csound version 6.18 (double samples) Nov 23 2022
> > [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
> > 
> > On Fri, Oct 4, 2024 at 11:12 AM vlz  wrote:
> > Ok, so there's something wrong with the build, but the version set in the codebase is correct.
> > 
> > When you run csound in the command line what version is reported?
> > 
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> >> On 4 Oct 2024, at 15:58, Blake Mitchell  wrote:
> >> 
> >> Hi Victor,
> >> 
> >> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
> >> 
> >> Thanks for taking a look at and fixing the documentation!
> >> 
> >> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> >> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
> >> 
> >> # Project definitions
> >> set(APIVERSION "7.0")
> >> set(CS_VERSION "7")
> >> set(CS_SUBVER "0")
> >> set(CS_PATCHLEVEL "0”)
> >> 
> >> and are written to header files. 
> >> 
> >> Testing with this program on my system
> >> 
> >> #include 
> >> #include 
> >> 
> >> int main() {
> >>   int version = csoundGetVersion()/1000;
> >>   int subversion = (csoundGetVersion() - version * 1000)/10;
> >>   int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
> >>   std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
> >>  return 0;
> >> }
> >> 
> >> I get
> >> 
> >> 7.0.0
> >> 
> >> 
> >> Maybe there is more than one version and your build is
> >> picking up the wrong header files. 
> >> 
> >> The comments have been removed in this PR
> >> 
> >> https://github.com/csound/csound/pull/1982
> >> 
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >> 
> >> > On 4 Oct 2024, at 07:00, Blake Mitchell  wrote:
> >> > 
> >> > I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
> >> > 
> >> > A few follow-ups:
> >> >     • 
> >> > The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
> >> >     • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
> >> >     • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
> >> > 
> >> > 
> >> > On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> >> > Thanks. That part hasn't changed, so hopefully it won't be a problem.
> >> > 
> >> > best
> >> > Victor
> >> > 
> >> >> On 27 Jul 2024, at 20:06, Tarmo Johannes  wrote:
> >> >> 
> >> >>  Hi,
> >> >> 
> >> >> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
> >> >> 
> >> >> Best!
> >> >> tarmo
> >> >> 
> >> >> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
> >> >> Make sure the csound instance is still in existence before you call that function.
> >> >> In fact, if you destroy Csound before calling that, the circular buffer memory will
> >> >> be released as well, so you probably don’t even need to do it.
> >> >> ========================
> >> >> Prof. Victor Lazzarini
> >> >> Maynooth University
> >> >> Ireland
> >> >> 
> >> >> > On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
> >> >> > 
> >> >> > Hi Victor, 
> >> >> > 
> >> >> > Regarding your issue, make sure the call is always after csoundStart()
> >> >> > Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> >> >> > CsoundQt crashes when destroying the circular buffer.
> >> >> > 
> >> >> >     csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
> >> >> > 
> >> >> > I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
> >> >> > 
> >> >> > Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
> >> >> > 
> >> >> > Anyway - it is a step forward!
> >> >> > 
> >> >> > tarmo
> >> >> > 
> >> >> > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> >> >> > Hi Tarmo,
> >> >> > 
> >> >> > that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> >> >> > needs of users.
> >> >> > 
> >> >> > Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> >> >> > not have been created. Here’s a simple test to show it
> >> >> > 
> >> >> >     csoundStart(Csound);
> >> >> >     MYFLT *spout = csoundGetSpout(Csound);
> >> >> >     printf("spout = %p \n", spout)
> >> >> > 
> >> >> > best
> >> >> > ========================
> >> >> > Prof. Victor Lazzarini
> >> >> > Maynooth University
> >> >> > Ireland
> >> >> > 
> >> >> > > On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
> >> >> > > 
> >> >> > > Hi Victor!
> >> >> > > 
> >> >> > > Thank you for the changes, it helps a lot. 
> >> >> > > 
> >> >> > > > csoundGetModule
> >> >> > > > csoundSetMIDIModule
> >> >> > > > csoundSetRTAudioModule
> >> >> > > 
> >> >> > > Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> >> >> > > I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >> >> > > 
> >> >> > > I still get crash when running a csd.
> >> >> > > MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> >> >> > > returns 0 in some reason, I will see if I can figure out the reason later.
> >> >> > > 
> >> >> > > Thanks!
> >> >> > > tarmo
> >> >> > > 
> >> >> > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> >> >> > > Hi Tarmo,
> >> >> > > 
> >> >> > > I put back 
> >> >> > > 
> >> >> > > > csoundGetModule
> >> >> > > > csoundSetMIDIModule
> >> >> > > > csoundSetRTAudioModule
> >> >> > > 
> >> >> > > plus the set global env and the circular buffer functions. It’s in the repo now.
> >> >> > > 
> >> >> > > Best
> >> >> > > 
> >> >> > > Victor
> >> >> > > 
> >> >> > > > On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
> >> >> > > > Hi!
> >> >> > > > 
> >> >> > > > I tried out the new API from feature/newapi branch.
> >> >> > > > 
> >> >> > > > Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path. 
> >> >> > > > 
> >> >> > > > First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >> >> > > > 
> >> >> > > > when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >> >> > > > 
> >> >> > > > Then I went to CsoundQt and of course that is much, much more complex  case.
> >> >> > > > 
> >> >> > > > First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
> >> >> > > > 
> >> >> > > > CsoundQt used the following functions that are not to be there any more:
> >> >> > > > 
> >> >> > > > csoundGetModule
> >> >> > > > csoundSetMIDIModule
> >> >> > > > csoundSetRTAudioModule
> >> >> > > > 
> >> >> > > > I commented these lines out for now to move on. What covers their functionality?
> >> >> > > > 
> >> >> > > > There is no more circular buffer functions:
> >> >> > > > csoundCreateCircularBuffer
> >> >> > > > csoundReadCircularBuffer
> >> >> > > > etc
> >> >> > > > 
> >> >> > > > CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> >> >> > > > For example reading MIDI data one should set the callback like:
> >> >> > > >         csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >> >> > > > 
> >> >> > > > CsoundQt used to have such a function for the callback:
> >> >> > > > 
> >> >> > > > int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> >> >> > > > {
> >> >> > > >     CsoundUserData *ud = (CsoundUserData *) ud_;
> >> >> > > >     Q_UNUSED(csound);
> >> >> > > >     int count, countVirtual;
> >> >> > > >     count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >> >> > > >     countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >> >> > > >     return count + countVirtual;
> >> >> > > > }
> >> >> > > > 
> >> >> > > > Should the host implement writing to the buffer and handling the index itself?
> >> >> > > > 
> >> >> > > > Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> >> >> > > > PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >> >> > > > 
> >> >> > > > How to deal with global variables?
> >> >> > > > csoundQueryGlobalVariable
> >> >> > > > csoundCreateGlobalVariable
> >> >> > > > are gone, 
> >> >> > > > 
> >> >> > > > csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >> >> > > > 
> >> >> > > > at the moment I replaced them with Qt specific functions to deal with environment variables.
> >> >> > > > 
> >> >> > > > What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >> >> > > > 
> >> >> > > > I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >> >> > > > 
> >> >> > > > Exciting!
> >> >> > > > tarmo
> >> >> > > > 
> >> >> > > > Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >> >> > > > 
> >> >> > > > Just another progress report for the feature/newapi branch
> >> >> > > > 
> >> >> > > > - I have now mainlined the new API in csound.h
> >> >> > > > - Updated the csound.hpp wrapper 
> >> >> > > > - Updated the csPerformanceThread code 
> >> >> > > > - Modified frontends to use it 
> >> >> > > > - Modified the C++ test suite
> >> >> > > > 
> >> >> > > > It is all working, I guess frontend developers can take a look and see what they
> >> >> > > > think. 
> >> >> > > > 
> >> >> > > > François: could you take a look at the Python wrapper? It is out of sync now.
> >> >> > > > 
> >> >> > > > Victor
> >> >> > > > 
> >> >> > > > 
> >> >> > > 
> >> >> > 
> >> >> 
> >> 
> 


Date2024-10-04 17:09
From"Dr. Richard Boulanger"
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
For Csound7 and beyond...

Would it be worth creating some sort of script/makefile/brew/??? that could/would completely uninstall Csound and all its dependencies?

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

> On Oct 4, 2024, at 11:52 AM, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> 
> It’s the other way round, csound.exe is linked to Csound64.dll. The csound.exe is only a frontend.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 4 Oct 2024, at 16:32, Blake Mitchell  wrote:
>> 
>> Whoops. I ran that `csound --version` command local to the Csound 7 download directory, but for some reason, it still picked up the csound in my path. Sorry about that. Here is the correct output from the csound.exe I downloaded.
>> 
>>> C:\Users\\Downloads\csound-7.0.0-2839-windows-x64-binaries\build\Release\csound.exe --version
>> --Csound version 7.0 (double samples) Oct  1 2024
>> 
>> For the API, though, is the csound64.dll completely self-contained? I had assumed it was, but given that the version of Csound in my path is 6.18.1 and the API returned version 6181, I'm guessing that the csound64.dll still relies on csound.exe? If so, that would explain the version returned by the API.
>> 
>> On Fri, Oct 4, 2024 at 11:26 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> That’s a very old version, looking by the commit
>> 
>> victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
>> commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
>> Merge: be2520225 f9f44bada
>> Author: John ffitch 
>> Date:   Wed Nov 23 19:53:55 2022 +0000
>> 
>>    Merge branch 'csound6' of github.com:csound/csound into csound6
>> 
>> and also the date of the build confirms it.
>> 
>> I don’t think you are picking up the latest build when running that command.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>>>> On 4 Oct 2024, at 16:14, Blake Mitchell  wrote:
>>> 
>>> Here's the output:
>>> 
>>>> csound --version
>>> --Csound version 6.18 (double samples) Nov 23 2022
>>> [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
>>> 
>>>> On Fri, Oct 4, 2024 at 11:12 AM vlz  wrote:
>>> Ok, so there's something wrong with the build, but the version set in the codebase is correct.
>>> 
>>> When you run csound in the command line what version is reported?
>>> 
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>> 
>>>> On 4 Oct 2024, at 15:58, Blake Mitchell  wrote:
>>>> 
>>>> Hi Victor,
>>>> 
>>>> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
>>>> 
>>>> Thanks for taking a look at and fixing the documentation!
>>>> 
>>>> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
>>>> 
>>>> # Project definitions
>>>> set(APIVERSION "7.0")
>>>> set(CS_VERSION "7")
>>>> set(CS_SUBVER "0")
>>>> set(CS_PATCHLEVEL "0”)
>>>> 
>>>> and are written to header files.
>>>> 
>>>> Testing with this program on my system
>>>> 
>>>> #include 
>>>> #include 
>>>> 
>>>> int main() {
>>>>  int version = csoundGetVersion()/1000;
>>>>  int subversion = (csoundGetVersion() - version * 1000)/10;
>>>>  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
>>>>  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
>>>> return 0;
>>>> }
>>>> 
>>>> I get
>>>> 
>>>> 7.0.0
>>>> 
>>>> 
>>>> Maybe there is more than one version and your build is
>>>> picking up the wrong header files.
>>>> 
>>>> The comments have been removed in this PR
>>>> 
>>>> https://www.google.com/url?q=https://github.com/csound/csound/pull/1982&source=gmail-imap&ust=1728661966000000&usg=AOvVaw0QV_ueBBHY6quQ9KLpc9Tl
>>>> 
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>> 
>>>>> On 4 Oct 2024, at 07:00, Blake Mitchell  wrote:
>>>>> 
>>>>> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>>>>> 
>>>>> A few follow-ups:
>>>>>    •
>>>>> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>>>>>    • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>>>>>    • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>>>>> 
>>>>> 
>>>>> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>>> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>>>>> 
>>>>> best
>>>>> Victor
>>>>> 
>>>>>> On 27 Jul 2024, at 20:06, Tarmo Johannes  wrote:
>>>>>> 
>>>>>>  Hi,
>>>>>> 
>>>>>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>>>>> 
>>>>>> Best!
>>>>>> tarmo
>>>>>> 
>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>>>>>> Make sure the csound instance is still in existence before you call that function.
>>>>>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>>>>>> be released as well, so you probably don’t even need to do it.
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>> 
>>>>>>> On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
>>>>>>> 
>>>>>>> Hi Victor,
>>>>>>> 
>>>>>>> Regarding your issue, make sure the call is always after csoundStart()
>>>>>>> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>>>>>>> CsoundQt crashes when destroying the circular buffer.
>>>>>>> 
>>>>>>>    csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>>>>>>> 
>>>>>>> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>>>>>>> 
>>>>>>> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>>>>>>> 
>>>>>>> Anyway - it is a step forward!
>>>>>>> 
>>>>>>> tarmo
>>>>>>> 
>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>>>>>>> Hi Tarmo,
>>>>>>> 
>>>>>>> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>>>>>>> needs of users.
>>>>>>> 
>>>>>>> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>>>>>>> not have been created. Here’s a simple test to show it
>>>>>>> 
>>>>>>>    csoundStart(Csound);
>>>>>>>    MYFLT *spout = csoundGetSpout(Csound);
>>>>>>>    printf("spout = %p \n", spout)
>>>>>>> 
>>>>>>> best
>>>>>>> ========================
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>> 
>>>>>>>> On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
>>>>>>>> 
>>>>>>>> Hi Victor!
>>>>>>>> 
>>>>>>>> Thank you for the changes, it helps a lot.
>>>>>>>> 
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>> 
>>>>>>>> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>>>>>>>> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>>>>>>>> 
>>>>>>>> I still get crash when running a csd.
>>>>>>>> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>>>>>>>> returns 0 in some reason, I will see if I can figure out the reason later.
>>>>>>>> 
>>>>>>>> Thanks!
>>>>>>>> tarmo
>>>>>>>> 
>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>>>>>>>> Hi Tarmo,
>>>>>>>> 
>>>>>>>> I put back
>>>>>>>> 
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>> 
>>>>>>>> plus the set global env and the circular buffer functions. It’s in the repo now.
>>>>>>>> 
>>>>>>>> Best
>>>>>>>> 
>>>>>>>> Victor
>>>>>>>> 
>>>>>>>>> On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
>>>>>>>>> Hi!
>>>>>>>>> 
>>>>>>>>> I tried out the new API from feature/newapi branch.
>>>>>>>>> 
>>>>>>>>> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>>>>>>>>> 
>>>>>>>>> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>>>>>>>>> 
>>>>>>>>> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>>>>>>>>> 
>>>>>>>>> Then I went to CsoundQt and of course that is much, much more complex  case.
>>>>>>>>> 
>>>>>>>>> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
>>>>>>>>> 
>>>>>>>>> CsoundQt used the following functions that are not to be there any more:
>>>>>>>>> 
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>> 
>>>>>>>>> I commented these lines out for now to move on. What covers their functionality?
>>>>>>>>> 
>>>>>>>>> There is no more circular buffer functions:
>>>>>>>>> csoundCreateCircularBuffer
>>>>>>>>> csoundReadCircularBuffer
>>>>>>>>> etc
>>>>>>>>> 
>>>>>>>>> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>>>>>>>>> For example reading MIDI data one should set the callback like:
>>>>>>>>>        csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>>>>>>>>> 
>>>>>>>>> CsoundQt used to have such a function for the callback:
>>>>>>>>> 
>>>>>>>>> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>>>>>>>>> {
>>>>>>>>>    CsoundUserData *ud = (CsoundUserData *) ud_;
>>>>>>>>>    Q_UNUSED(csound);
>>>>>>>>>    int count, countVirtual;
>>>>>>>>>    count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>>>>>>>>>    countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>>>>>>>>>    return count + countVirtual;
>>>>>>>>> }
>>>>>>>>> 
>>>>>>>>> Should the host implement writing to the buffer and handling the index itself?
>>>>>>>>> 
>>>>>>>>> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>>>>>>>>> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>>>>>>>>> 
>>>>>>>>> How to deal with global variables?
>>>>>>>>> csoundQueryGlobalVariable
>>>>>>>>> csoundCreateGlobalVariable
>>>>>>>>> are gone,
>>>>>>>>> 
>>>>>>>>> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>>>>>>>>> 
>>>>>>>>> at the moment I replaced them with Qt specific functions to deal with environment variables.
>>>>>>>>> 
>>>>>>>>> What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>>>>>>>>> 
>>>>>>>>> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>>>>>>>>> 
>>>>>>>>> Exciting!
>>>>>>>>> tarmo
>>>>>>>>> 
>>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>>>>>>>>> 
>>>>>>>>> Just another progress report for the feature/newapi branch
>>>>>>>>> 
>>>>>>>>> - I have now mainlined the new API in csound.h
>>>>>>>>> - Updated the csound.hpp wrapper
>>>>>>>>> - Updated the csPerformanceThread code
>>>>>>>>> - Modified frontends to use it
>>>>>>>>> - Modified the C++ test suite
>>>>>>>>> 
>>>>>>>>> It is all working, I guess frontend developers can take a look and see what they
>>>>>>>>> think.
>>>>>>>>> 
>>>>>>>>> François: could you take a look at the Python wrapper? It is out of sync now.
>>>>>>>>> 
>>>>>>>>> Victor
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>> 
> 

Date2024-10-04 21:20
FromBlake Mitchell
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
At least for Windows, there is already an uninstaller for Csound 6.

So, it turns out that my bindings were finding the csound64.dll for Csound 6 in my path. (I thought I was passing in a path to the new Csound 7 DLL, but that's on my side to figure out.) It just so happens that my bindings, despite being built for the Csound 7 API, were working with the Csound 6 API. A few notes:
  • csoundGetVersion now returns a version 7
  • But csoundGetAPIVersion still returns "400"
  • I noticed that the function `csoundCompileCSD` is referred to as `csoundCompileCsd` in some of the documentation in `csound.h`
Sorry about the confusion here. I'll keep plugging away now that I know I'm dealing with the right DLL.

And thank you for the heads up on the DLL and EXE relationship. Just to double-check: csound64.dll require no other dependencies, correct?

Thank you!

On Fri, Oct 4, 2024 at 12:09 PM Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
For Csound7 and beyond...

Would it be worth creating some sort of script/makefile/brew/??? that could/would completely uninstall Csound and all its dependencies?

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

> On Oct 4, 2024, at 11:52 AM, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>
> It’s the other way round, csound.exe is linked to Csound64.dll. The csound.exe is only a frontend.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 4 Oct 2024, at 16:32, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>>
>> Whoops. I ran that `csound --version` command local to the Csound 7 download directory, but for some reason, it still picked up the csound in my path. Sorry about that. Here is the correct output from the csound.exe I downloaded.
>>
>>> C:\Users\<username>\Downloads\csound-7.0.0-2839-windows-x64-binaries\build\Release\csound.exe --version
>> --Csound version 7.0 (double samples) Oct  1 2024
>>
>> For the API, though, is the csound64.dll completely self-contained? I had assumed it was, but given that the version of Csound in my path is 6.18.1 and the API returned version 6181, I'm guessing that the csound64.dll still relies on csound.exe? If so, that would explain the version returned by the API.
>>
>> On Fri, Oct 4, 2024 at 11:26 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> That’s a very old version, looking by the commit
>>
>> victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
>> commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
>> Merge: be2520225 f9f44bada
>> Author: John ffitch <jpff@codemist.co.uk>
>> Date:   Wed Nov 23 19:53:55 2022 +0000
>>
>>    Merge branch 'csound6' of github.com:csound/csound into csound6
>>
>> and also the date of the build confirms it.
>>
>> I don’t think you are picking up the latest build when running that command.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>>> On 4 Oct 2024, at 16:14, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>>>
>>> Here's the output:
>>>
>>>> csound --version
>>> --Csound version 6.18 (double samples) Nov 23 2022
>>> [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
>>>
>>>> On Fri, Oct 4, 2024 at 11:12 AM vlz <viclazzarini@gmail.com> wrote:
>>> Ok, so there's something wrong with the build, but the version set in the codebase is correct.
>>>
>>> When you run csound in the command line what version is reported?
>>>
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>
>>>> On 4 Oct 2024, at 15:58, Blake Mitchell <bmitchell33@gmail.com> wrote:
>>>>
>>>> Hi Victor,
>>>>
>>>> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
>>>>
>>>> Thanks for taking a look at and fixing the documentation!
>>>>
>>>> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
>>>>
>>>> # Project definitions
>>>> set(APIVERSION "7.0")
>>>> set(CS_VERSION "7")
>>>> set(CS_SUBVER "0")
>>>> set(CS_PATCHLEVEL "0”)
>>>>
>>>> and are written to header files.
>>>>
>>>> Testing with this program on my system
>>>>
>>>> #include <CsoundLib64/csound.h>
>>>> #include <iostream>
>>>>
>>>> int main() {
>>>>  int version = csoundGetVersion()/1000;
>>>>  int subversion = (csoundGetVersion() - version * 1000)/10;
>>>>  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
>>>>  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
>>>> return 0;
>>>> }
>>>>
>>>> I get
>>>>
>>>> 7.0.0
>>>>
>>>>
>>>> Maybe there is more than one version and your build is
>>>> picking up the wrong header files.
>>>>
>>>> The comments have been removed in this PR
>>>>
>>>> https://www.google.com/url?q=https://github.com/csound/csound/pull/1982&source=gmail-imap&ust=1728661966000000&usg=AOvVaw0QV_ueBBHY6quQ9KLpc9Tl
>>>>
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>>>>>
>>>>> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>>>>>
>>>>> A few follow-ups:
>>>>>    •
>>>>> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>>>>>    • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>>>>>    • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>>>>>
>>>>>
>>>>> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>>> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>>>>>
>>>>> best
>>>>> Victor
>>>>>
>>>>>> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>>>>>
>>>>>> Best!
>>>>>> tarmo
>>>>>>
>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>>>>>> Make sure the csound instance is still in existence before you call that function.
>>>>>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>>>>>> be released as well, so you probably don’t even need to do it.
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>>>>>>>
>>>>>>> Hi Victor,
>>>>>>>
>>>>>>> Regarding your issue, make sure the call is always after csoundStart()
>>>>>>> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>>>>>>> CsoundQt crashes when destroying the circular buffer.
>>>>>>>
>>>>>>>    csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>>>>>>>
>>>>>>> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>>>>>>>
>>>>>>> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>>>>>>>
>>>>>>> Anyway - it is a step forward!
>>>>>>>
>>>>>>> tarmo
>>>>>>>
>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>>>>>>> Hi Tarmo,
>>>>>>>
>>>>>>> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>>>>>>> needs of users.
>>>>>>>
>>>>>>> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>>>>>>> not have been created. Here’s a simple test to show it
>>>>>>>
>>>>>>>    csoundStart(Csound);
>>>>>>>    MYFLT *spout = csoundGetSpout(Csound);
>>>>>>>    printf("spout = %p \n", spout)
>>>>>>>
>>>>>>> best
>>>>>>> ========================
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>>
>>>>>>>> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>>>>>>>>
>>>>>>>> Hi Victor!
>>>>>>>>
>>>>>>>> Thank you for the changes, it helps a lot.
>>>>>>>>
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>
>>>>>>>> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>>>>>>>> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>>>>>>>>
>>>>>>>> I still get crash when running a csd.
>>>>>>>> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>>>>>>>> returns 0 in some reason, I will see if I can figure out the reason later.
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>> tarmo
>>>>>>>>
>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>>>>>>>> Hi Tarmo,
>>>>>>>>
>>>>>>>> I put back
>>>>>>>>
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>
>>>>>>>> plus the set global env and the circular buffer functions. It’s in the repo now.
>>>>>>>>
>>>>>>>> Best
>>>>>>>>
>>>>>>>> Victor
>>>>>>>>
>>>>>>>>> On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>>>>>>>>> Hi!
>>>>>>>>>
>>>>>>>>> I tried out the new API from feature/newapi branch.
>>>>>>>>>
>>>>>>>>> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>>>>>>>>>
>>>>>>>>> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>>>>>>>>>
>>>>>>>>> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>>>>>>>>>
>>>>>>>>> Then I went to CsoundQt and of course that is much, much more complex  case.
>>>>>>>>>
>>>>>>>>> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>>>>>>>>>
>>>>>>>>> CsoundQt used the following functions that are not to be there any more:
>>>>>>>>>
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>>
>>>>>>>>> I commented these lines out for now to move on. What covers their functionality?
>>>>>>>>>
>>>>>>>>> There is no more circular buffer functions:
>>>>>>>>> csoundCreateCircularBuffer
>>>>>>>>> csoundReadCircularBuffer
>>>>>>>>> etc
>>>>>>>>>
>>>>>>>>> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>>>>>>>>> For example reading MIDI data one should set the callback like:
>>>>>>>>>        csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>>>>>>>>>
>>>>>>>>> CsoundQt used to have such a function for the callback:
>>>>>>>>>
>>>>>>>>> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>>>>>>>>> {
>>>>>>>>>    CsoundUserData *ud = (CsoundUserData *) ud_;
>>>>>>>>>    Q_UNUSED(csound);
>>>>>>>>>    int count, countVirtual;
>>>>>>>>>    count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>>>>>>>>>    countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>>>>>>>>>    return count + countVirtual;
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Should the host implement writing to the buffer and handling the index itself?
>>>>>>>>>
>>>>>>>>> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>>>>>>>>> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>>>>>>>>>
>>>>>>>>> How to deal with global variables?
>>>>>>>>> csoundQueryGlobalVariable
>>>>>>>>> csoundCreateGlobalVariable
>>>>>>>>> are gone,
>>>>>>>>>
>>>>>>>>> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>>>>>>>>>
>>>>>>>>> at the moment I replaced them with Qt specific functions to deal with environment variables.
>>>>>>>>>
>>>>>>>>> What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>>>>>>>>>
>>>>>>>>> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>>>>>>>>>
>>>>>>>>> Exciting!
>>>>>>>>> tarmo
>>>>>>>>>
>>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>>>>>>>>>
>>>>>>>>> Just another progress report for the feature/newapi branch
>>>>>>>>>
>>>>>>>>> - I have now mainlined the new API in csound.h
>>>>>>>>> - Updated the csound.hpp wrapper
>>>>>>>>> - Updated the csPerformanceThread code
>>>>>>>>> - Modified frontends to use it
>>>>>>>>> - Modified the C++ test suite
>>>>>>>>>
>>>>>>>>> It is all working, I guess frontend developers can take a look and see what they
>>>>>>>>> think.
>>>>>>>>>
>>>>>>>>> François: could you take a look at the Python wrapper? It is out of sync now.
>>>>>>>>>
>>>>>>>>> Victor
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>
>

Date2024-10-04 21:33
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
It will depend on the build, whether libsndfile is use as a dll or just .lib. Csound uses libsndfile but I don't know how the actual CI build does it.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 4 Oct 2024, at 21:20, Blake Mitchell <bmitchell33@gmail.com> wrote:


At least for Windows, there is already an uninstaller for Csound 6.

So, it turns out that my bindings were finding the csound64.dll for Csound 6 in my path. (I thought I was passing in a path to the new Csound 7 DLL, but that's on my side to figure out.) It just so happens that my bindings, despite being built for the Csound 7 API, were working with the Csound 6 API. A few notes:
  • csoundGetVersion now returns a version 7
  • But csoundGetAPIVersion still returns "400"
  • I noticed that the function `csoundCompileCSD` is referred to as `csoundCompileCsd` in some of the documentation in `csound.h`
Sorry about the confusion here. I'll keep plugging away now that I know I'm dealing with the right DLL.

And thank you for the heads up on the DLL and EXE relationship. Just to double-check: csound64.dll require no other dependencies, correct?

Thank you!

On Fri, Oct 4, 2024 at 12:09 PM Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
For Csound7 and beyond...

Would it be worth creating some sort of script/makefile/brew/??? that could/would completely uninstall Csound and all its dependencies?

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

> On Oct 4, 2024, at 11:52 AM, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>
> It’s the other way round, csound.exe is linked to Csound64.dll. The csound.exe is only a frontend.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 4 Oct 2024, at 16:32, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>>
>> Whoops. I ran that `csound --version` command local to the Csound 7 download directory, but for some reason, it still picked up the csound in my path. Sorry about that. Here is the correct output from the csound.exe I downloaded.
>>
>>> C:\Users\<username>\Downloads\csound-7.0.0-2839-windows-x64-binaries\build\Release\csound.exe --version
>> --Csound version 7.0 (double samples) Oct  1 2024
>>
>> For the API, though, is the csound64.dll completely self-contained? I had assumed it was, but given that the version of Csound in my path is 6.18.1 and the API returned version 6181, I'm guessing that the csound64.dll still relies on csound.exe? If so, that would explain the version returned by the API.
>>
>> On Fri, Oct 4, 2024 at 11:26 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> That’s a very old version, looking by the commit
>>
>> victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
>> commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
>> Merge: be2520225 f9f44bada
>> Author: John ffitch <jpff@codemist.co.uk>
>> Date:   Wed Nov 23 19:53:55 2022 +0000
>>
>>    Merge branch 'csound6' of github.com:csound/csound into csound6
>>
>> and also the date of the build confirms it.
>>
>> I don’t think you are picking up the latest build when running that command.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>>> On 4 Oct 2024, at 16:14, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>>>
>>> Here's the output:
>>>
>>>> csound --version
>>> --Csound version 6.18 (double samples) Nov 23 2022
>>> [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
>>>
>>>> On Fri, Oct 4, 2024 at 11:12 AM vlz <viclazzarini@gmail.com> wrote:
>>> Ok, so there's something wrong with the build, but the version set in the codebase is correct.
>>>
>>> When you run csound in the command line what version is reported?
>>>
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>
>>>> On 4 Oct 2024, at 15:58, Blake Mitchell <bmitchell33@gmail.com> wrote:
>>>>
>>>> Hi Victor,
>>>>
>>>> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
>>>>
>>>> Thanks for taking a look at and fixing the documentation!
>>>>
>>>> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
>>>>
>>>> # Project definitions
>>>> set(APIVERSION "7.0")
>>>> set(CS_VERSION "7")
>>>> set(CS_SUBVER "0")
>>>> set(CS_PATCHLEVEL "0”)
>>>>
>>>> and are written to header files.
>>>>
>>>> Testing with this program on my system
>>>>
>>>> #include <CsoundLib64/csound.h>
>>>> #include <iostream>
>>>>
>>>> int main() {
>>>>  int version = csoundGetVersion()/1000;
>>>>  int subversion = (csoundGetVersion() - version * 1000)/10;
>>>>  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
>>>>  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
>>>> return 0;
>>>> }
>>>>
>>>> I get
>>>>
>>>> 7.0.0
>>>>
>>>>
>>>> Maybe there is more than one version and your build is
>>>> picking up the wrong header files.
>>>>
>>>> The comments have been removed in this PR
>>>>
>>>> https://www.google.com/url?q=https://github.com/csound/csound/pull/1982&source=gmail-imap&ust=1728661966000000&usg=AOvVaw0QV_ueBBHY6quQ9KLpc9Tl
>>>>
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 4 Oct 2024, at 07:00, Blake Mitchell <bmitchell33@GMAIL.COM> wrote:
>>>>>
>>>>> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
>>>>>
>>>>> A few follow-ups:
>>>>>    •
>>>>> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
>>>>>    • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
>>>>>    • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
>>>>>
>>>>>
>>>>> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>>> Thanks. That part hasn't changed, so hopefully it won't be a problem.
>>>>>
>>>>> best
>>>>> Victor
>>>>>
>>>>>> On 27 Jul 2024, at 20:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
>>>>>>
>>>>>> Best!
>>>>>> tarmo
>>>>>>
>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
>>>>>> Make sure the csound instance is still in existence before you call that function.
>>>>>> In fact, if you destroy Csound before calling that, the circular buffer memory will
>>>>>> be released as well, so you probably don’t even need to do it.
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 27 Jul 2024, at 16:37, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>>>>>>>
>>>>>>> Hi Victor,
>>>>>>>
>>>>>>> Regarding your issue, make sure the call is always after csoundStart()
>>>>>>> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
>>>>>>> CsoundQt crashes when destroying the circular buffer.
>>>>>>>
>>>>>>>    csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
>>>>>>>
>>>>>>> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
>>>>>>>
>>>>>>> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
>>>>>>>
>>>>>>> Anyway - it is a step forward!
>>>>>>>
>>>>>>> tarmo
>>>>>>>
>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
>>>>>>> Hi Tarmo,
>>>>>>>
>>>>>>> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
>>>>>>> needs of users.
>>>>>>>
>>>>>>> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
>>>>>>> not have been created. Here’s a simple test to show it
>>>>>>>
>>>>>>>    csoundStart(Csound);
>>>>>>>    MYFLT *spout = csoundGetSpout(Csound);
>>>>>>>    printf("spout = %p \n", spout)
>>>>>>>
>>>>>>> best
>>>>>>> ========================
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>>
>>>>>>>> On 27 Jul 2024, at 09:31, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>>>>>>>>
>>>>>>>> Hi Victor!
>>>>>>>>
>>>>>>>> Thank you for the changes, it helps a lot.
>>>>>>>>
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>
>>>>>>>> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
>>>>>>>> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
>>>>>>>>
>>>>>>>> I still get crash when running a csd.
>>>>>>>> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
>>>>>>>> returns 0 in some reason, I will see if I can figure out the reason later.
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>> tarmo
>>>>>>>>
>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
>>>>>>>> Hi Tarmo,
>>>>>>>>
>>>>>>>> I put back
>>>>>>>>
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>
>>>>>>>> plus the set global env and the circular buffer functions. It’s in the repo now.
>>>>>>>>
>>>>>>>> Best
>>>>>>>>
>>>>>>>> Victor
>>>>>>>>
>>>>>>>>> On 26 Jul 2024, at 20:29, Tarmo Johannes <trmjhnns@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.
>>>>>>>>> Hi!
>>>>>>>>>
>>>>>>>>> I tried out the new API from feature/newapi branch.
>>>>>>>>>
>>>>>>>>> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
>>>>>>>>>
>>>>>>>>> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
>>>>>>>>>
>>>>>>>>> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
>>>>>>>>>
>>>>>>>>> Then I went to CsoundQt and of course that is much, much more complex  case.
>>>>>>>>>
>>>>>>>>> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part. 
>>>>>>>>>
>>>>>>>>> CsoundQt used the following functions that are not to be there any more:
>>>>>>>>>
>>>>>>>>> csoundGetModule
>>>>>>>>> csoundSetMIDIModule
>>>>>>>>> csoundSetRTAudioModule
>>>>>>>>>
>>>>>>>>> I commented these lines out for now to move on. What covers their functionality?
>>>>>>>>>
>>>>>>>>> There is no more circular buffer functions:
>>>>>>>>> csoundCreateCircularBuffer
>>>>>>>>> csoundReadCircularBuffer
>>>>>>>>> etc
>>>>>>>>>
>>>>>>>>> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
>>>>>>>>> For example reading MIDI data one should set the callback like:
>>>>>>>>>        csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
>>>>>>>>>
>>>>>>>>> CsoundQt used to have such a function for the callback:
>>>>>>>>>
>>>>>>>>> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
>>>>>>>>> {
>>>>>>>>>    CsoundUserData *ud = (CsoundUserData *) ud_;
>>>>>>>>>    Q_UNUSED(csound);
>>>>>>>>>    int count, countVirtual;
>>>>>>>>>    count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
>>>>>>>>>    countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
>>>>>>>>>    return count + countVirtual;
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Should the host implement writing to the buffer and handling the index itself?
>>>>>>>>>
>>>>>>>>> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
>>>>>>>>> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
>>>>>>>>>
>>>>>>>>> How to deal with global variables?
>>>>>>>>> csoundQueryGlobalVariable
>>>>>>>>> csoundCreateGlobalVariable
>>>>>>>>> are gone,
>>>>>>>>>
>>>>>>>>> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
>>>>>>>>>
>>>>>>>>> at the moment I replaced them with Qt specific functions to deal with environment variables.
>>>>>>>>>
>>>>>>>>> What is the correct environment variable for the plugins directory, OPCODE7DIR64?
>>>>>>>>>
>>>>>>>>> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
>>>>>>>>>
>>>>>>>>> Exciting!
>>>>>>>>> tarmo
>>>>>>>>>
>>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
>>>>>>>>>
>>>>>>>>> Just another progress report for the feature/newapi branch
>>>>>>>>>
>>>>>>>>> - I have now mainlined the new API in csound.h
>>>>>>>>> - Updated the csound.hpp wrapper
>>>>>>>>> - Updated the csPerformanceThread code
>>>>>>>>> - Modified frontends to use it
>>>>>>>>> - Modified the C++ test suite
>>>>>>>>>
>>>>>>>>> It is all working, I guess frontend developers can take a look and see what they
>>>>>>>>> think.
>>>>>>>>>
>>>>>>>>> François: could you take a look at the Python wrapper? It is out of sync now.
>>>>>>>>>
>>>>>>>>> Victor
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>
>

Date2024-10-05 09:03
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] New API progress report
Thanks, the APIVERSION was hardcode so I correct that in a recent PR. Need to chase the Csd versus CSD as the function name
changed.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Oct 2024, at 21:20, Blake Mitchell  wrote:
> 
> At least for Windows, there is already an uninstaller for Csound 6.
> 
> So, it turns out that my bindings were finding the csound64.dll for Csound 6 in my path. (I thought I was passing in a path to the new Csound 7 DLL, but that's on my side to figure out.) It just so happens that my bindings, despite being built for the Csound 7 API, were working with the Csound 6 API. A few notes:
>     • 
> csoundGetVersion now returns a version 7
>     • But csoundGetAPIVersion still returns "400"
>     • I noticed that the function `csoundCompileCSD` is referred to as `csoundCompileCsd` in some of the documentation in `csound.h`
> Sorry about the confusion here. I'll keep plugging away now that I know I'm dealing with the right DLL.
> 
> And thank you for the heads up on the DLL and EXE relationship. Just to double-check: csound64.dll require no other dependencies, correct?
> 
> Thank you!
> 
> On Fri, Oct 4, 2024 at 12:09 PM Dr. Richard Boulanger  wrote:
> For Csound7 and beyond...
> 
> Would it be worth creating some sort of script/makefile/brew/??? that could/would completely uninstall Csound and all its dependencies?
> 
> Dr. Richard Boulanger
> Professor
> Electronic Production and Design
> Berklee College of Music
> 
> > On Oct 4, 2024, at 11:52 AM, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> > 
> > It’s the other way round, csound.exe is linked to Csound64.dll. The csound.exe is only a frontend.
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> >> On 4 Oct 2024, at 16:32, Blake Mitchell  wrote:
> >> 
> >> Whoops. I ran that `csound --version` command local to the Csound 7 download directory, but for some reason, it still picked up the csound in my path. Sorry about that. Here is the correct output from the csound.exe I downloaded.
> >> 
> >>> C:\Users\\Downloads\csound-7.0.0-2839-windows-x64-binaries\build\Release\csound.exe --version
> >> --Csound version 7.0 (double samples) Oct  1 2024
> >> 
> >> For the API, though, is the csound64.dll completely self-contained? I had assumed it was, but given that the version of Csound in my path is 6.18.1 and the API returned version 6181, I'm guessing that the csound64.dll still relies on csound.exe? If so, that would explain the version returned by the API.
> >> 
> >> On Fri, Oct 4, 2024 at 11:26 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> >> That’s a very old version, looking by the commit
> >> 
> >> victor@firebird debug % git log a1580f9cdf331c35dceb486f4231871ce0b00266
> >> commit a1580f9cdf331c35dceb486f4231871ce0b00266 (tag: 6.18.1, origin/master, master)
> >> Merge: be2520225 f9f44bada
> >> Author: John ffitch 
> >> Date:   Wed Nov 23 19:53:55 2022 +0000
> >> 
> >>    Merge branch 'csound6' of github.com:csound/csound into csound6
> >> 
> >> and also the date of the build confirms it.
> >> 
> >> I don’t think you are picking up the latest build when running that command.
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >> 
> >>>> On 4 Oct 2024, at 16:14, Blake Mitchell  wrote:
> >>> 
> >>> Here's the output:
> >>> 
> >>>> csound --version
> >>> --Csound version 6.18 (double samples) Nov 23 2022
> >>> [commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
> >>> 
> >>>> On Fri, Oct 4, 2024 at 11:12 AM vlz  wrote:
> >>> Ok, so there's something wrong with the build, but the version set in the codebase is correct.
> >>> 
> >>> When you run csound in the command line what version is reported?
> >>> 
> >>> Prof. Victor Lazzarini
> >>> Maynooth University
> >>> Ireland
> >>> 
> >>>> On 4 Oct 2024, at 15:58, Blake Mitchell  wrote:
> >>>> 
> >>>> Hi Victor,
> >>>> 
> >>>> I got the builds from the GitHub Actions. I just scrolled down to the most recent `develop` build and downloaded the .zip file for Windows. If it helps, here's the exact name of the .zip file: "csound-7.0.0-2839-windows-x64-binaries.zip".
> >>>> 
> >>>> Thanks for taking a look at and fixing the documentation!
> >>>> 
> >>>> On Fri, Oct 4, 2024 at 3:52 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> >>>> Not sure why you are getting these versions. These are defined in the CMakeLists.txt
> >>>> 
> >>>> # Project definitions
> >>>> set(APIVERSION "7.0")
> >>>> set(CS_VERSION "7")
> >>>> set(CS_SUBVER "0")
> >>>> set(CS_PATCHLEVEL "0”)
> >>>> 
> >>>> and are written to header files.
> >>>> 
> >>>> Testing with this program on my system
> >>>> 
> >>>> #include 
> >>>> #include 
> >>>> 
> >>>> int main() {
> >>>>  int version = csoundGetVersion()/1000;
> >>>>  int subversion = (csoundGetVersion() - version * 1000)/10;
> >>>>  int patchlevel = csoundGetVersion()  - version * 1000 - subversion*10;
> >>>>  std::cout << version <<  "." << subversion << "." << patchlevel << std::endl;
> >>>> return 0;
> >>>> }
> >>>> 
> >>>> I get
> >>>> 
> >>>> 7.0.0
> >>>> 
> >>>> 
> >>>> Maybe there is more than one version and your build is
> >>>> picking up the wrong header files.
> >>>> 
> >>>> The comments have been removed in this PR
> >>>> 
> >>>> https://www.google.com/url?q=https://github.com/csound/csound/pull/1982&source=gmail-imap&ust=1728661966000000&usg=AOvVaw0QV_ueBBHY6quQ9KLpc9Tl
> >>>> 
> >>>> ========================
> >>>> Prof. Victor Lazzarini
> >>>> Maynooth University
> >>>> Ireland
> >>>> 
> >>>>> On 4 Oct 2024, at 07:00, Blake Mitchell  wrote:
> >>>>> 
> >>>>> I finally got around to testing out the new Csound 7 API with my .NET wrappers and updating what I had partially done for Csound 6. Things are working okay so far.
> >>>>> 
> >>>>> A few follow-ups:
> >>>>>    •
> >>>>> The `csound.h` header file documentation references removed functions such as `csoundPerformBuffer`, `csoundStop`, `csoundCleanup`. There might be others.
> >>>>>    • `csoundGetVersion` still returns version 6. The exact value on Windows is `6181`.
> >>>>>    • `csoundGetAPIVersion` returns a major version 4. Is this correct? What is the Csound API version? As far as I understand, the API tracks the Csound version, so I'm not sure how `csoundGetAPIVersion` and `csoundGetVersion` are supposed to differ.
> >>>>> 
> >>>>> 
> >>>>> On Sat, Jul 27, 2024 at 4:03 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> >>>>> Thanks. That part hasn't changed, so hopefully it won't be a problem.
> >>>>> 
> >>>>> best
> >>>>> Victor
> >>>>> 
> >>>>>> On 27 Jul 2024, at 20:06, Tarmo Johannes  wrote:
> >>>>>> 
> >>>>>>  Hi,
> >>>>>> 
> >>>>>> Yes, now it works as expected. I made now the most simple build of CsoundQt, later I will test  with rtmidi and html support that might bring out more questions. At least in very initial variant of CsoundQt+Csound 7 works. It need much testing and might be unstable, of course.
> >>>>>> 
> >>>>>> Best!
> >>>>>> tarmo
> >>>>>> 
> >>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 19:17:
> >>>>>> Make sure the csound instance is still in existence before you call that function.
> >>>>>> In fact, if you destroy Csound before calling that, the circular buffer memory will
> >>>>>> be released as well, so you probably don’t even need to do it.
> >>>>>> ========================
> >>>>>> Prof. Victor Lazzarini
> >>>>>> Maynooth University
> >>>>>> Ireland
> >>>>>> 
> >>>>>>> On 27 Jul 2024, at 16:37, Tarmo Johannes  wrote:
> >>>>>>> 
> >>>>>>> Hi Victor,
> >>>>>>> 
> >>>>>>> Regarding your issue, make sure the call is always after csoundStart()
> >>>>>>> Yes, that was it! I added it before starting the perfromance thread. Now sound works, only thing is that is exit
> >>>>>>> CsoundQt crashes when destroying the circular buffer.
> >>>>>>> 
> >>>>>>>    csoundDestroyCircularBuffer(ud->csound, ud->midiBuffer);
> >>>>>>> 
> >>>>>>> I tried to build Csound in debug mode to look into it  (unchecked BUILD_RELEASE) but somehow CsoundQt did not find the plugins any more after that.
> >>>>>>> 
> >>>>>>> Most likely the problem is in CsoundQt code and I guess now the Csound object  gets destroyed before. I will test more later.
> >>>>>>> 
> >>>>>>> Anyway - it is a step forward!
> >>>>>>> 
> >>>>>>> tarmo
> >>>>>>> 
> >>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 12:20:
> >>>>>>> Hi Tarmo,
> >>>>>>> 
> >>>>>>> that’s great, this is one of the reasons we needed your input, so the API can be tailored to the
> >>>>>>> needs of users.
> >>>>>>> 
> >>>>>>> Regarding your issue, make sure the call is always after csoundStart(), otherwise the spout will
> >>>>>>> not have been created. Here’s a simple test to show it
> >>>>>>> 
> >>>>>>>    csoundStart(Csound);
> >>>>>>>    MYFLT *spout = csoundGetSpout(Csound);
> >>>>>>>    printf("spout = %p \n", spout)
> >>>>>>> 
> >>>>>>> best
> >>>>>>> ========================
> >>>>>>> Prof. Victor Lazzarini
> >>>>>>> Maynooth University
> >>>>>>> Ireland
> >>>>>>> 
> >>>>>>>> On 27 Jul 2024, at 09:31, Tarmo Johannes  wrote:
> >>>>>>>> 
> >>>>>>>> Hi Victor!
> >>>>>>>> 
> >>>>>>>> Thank you for the changes, it helps a lot.
> >>>>>>>> 
> >>>>>>>>> csoundGetModule
> >>>>>>>>> csoundSetMIDIModule
> >>>>>>>>> csoundSetRTAudioModule
> >>>>>>>> 
> >>>>>>>> Are used in config dialog to populate a menu to list the available modules. Now it works fine again.
> >>>>>>>> I reverted some of my changes, left libcsnd out of libraries (this is good news that it is not needed any more!) and CsoundQt build fine.
> >>>>>>>> 
> >>>>>>>> I still get crash when running a csd.
> >>>>>>>> MYFLT *outputBuffer = csoundGetSpout(udata->csound);
> >>>>>>>> returns 0 in some reason, I will see if I can figure out the reason later.
> >>>>>>>> 
> >>>>>>>> Thanks!
> >>>>>>>> tarmo
> >>>>>>>> 
> >>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval L, 27. juuli 2024 kell 00:55:
> >>>>>>>> Hi Tarmo,
> >>>>>>>> 
> >>>>>>>> I put back
> >>>>>>>> 
> >>>>>>>>> csoundGetModule
> >>>>>>>>> csoundSetMIDIModule
> >>>>>>>>> csoundSetRTAudioModule
> >>>>>>>> 
> >>>>>>>> plus the set global env and the circular buffer functions. It’s in the repo now.
> >>>>>>>> 
> >>>>>>>> Best
> >>>>>>>> 
> >>>>>>>> Victor
> >>>>>>>> 
> >>>>>>>>> On 26 Jul 2024, at 20:29, Tarmo Johannes  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.
> >>>>>>>>> Hi!
> >>>>>>>>> 
> >>>>>>>>> I tried out the new API from feature/newapi branch.
> >>>>>>>>> 
> >>>>>>>>> Building csound7 went fine, I installed it to $HOME/.local (Linux) and added  $HOME/.local/lib to ldconfig libraries' path.
> >>>>>>>>> 
> >>>>>>>>> First I tried it with a relatively simple Qt project using Csound C++ API (csound.hpp). After some changes everything worked fine. One question:
> >>>>>>>>> 
> >>>>>>>>> when before there was Csound::stop() / csoundStop() , how is it now the proper way to end Csound's work? Also csoundCleanup() is gone. is csoundReset() it that does it all?
> >>>>>>>>> 
> >>>>>>>>> Then I went to CsoundQt and of course that is much, much more complex  case.
> >>>>>>>>> 
> >>>>>>>>> First -  I guess libcsnd7 is not  is built by default? Is it still existing, how should I configure it?  CsoundQt uses that for recording. Maybe there is now a better way to rewrite the recording part.  
> >>>>>>>>> 
> >>>>>>>>> CsoundQt used the following functions that are not to be there any more:
> >>>>>>>>> 
> >>>>>>>>> csoundGetModule
> >>>>>>>>> csoundSetMIDIModule
> >>>>>>>>> csoundSetRTAudioModule
> >>>>>>>>> 
> >>>>>>>>> I commented these lines out for now to move on. What covers their functionality?
> >>>>>>>>> 
> >>>>>>>>> There is no more circular buffer functions:
> >>>>>>>>> csoundCreateCircularBuffer
> >>>>>>>>> csoundReadCircularBuffer
> >>>>>>>>> etc
> >>>>>>>>> 
> >>>>>>>>> CsoundQt leaned heavily on them for internal MIDI handling. What is the correct way to handle it now?
> >>>>>>>>> For example reading MIDI data one should set the callback like:
> >>>>>>>>>        csoundSetExternalMidiReadCallback(ud->csound, &midiReadCb);
> >>>>>>>>> 
> >>>>>>>>> CsoundQt used to have such a function for the callback:
> >>>>>>>>> 
> >>>>>>>>> int CsoundEngine::midiReadCb(CSOUND *csound, void *ud_, unsigned char *buf, int nBytes)
> >>>>>>>>> {
> >>>>>>>>>    CsoundUserData *ud = (CsoundUserData *) ud_;
> >>>>>>>>>    Q_UNUSED(csound);
> >>>>>>>>>    int count, countVirtual;
> >>>>>>>>>    count =  csoundReadCircularBuffer(ud->csound, ud->midiBuffer, buf, nBytes);
> >>>>>>>>>    countVirtual =  csoundReadCircularBuffer(ud->csound, ud->virtualMidiBuffer, buf + count, nBytes - count);
> >>>>>>>>>    return count + countVirtual;
> >>>>>>>>> }
> >>>>>>>>> 
> >>>>>>>>> Should the host implement writing to the buffer and handling the index itself?
> >>>>>>>>> 
> >>>>>>>>> Is it so that csoundSetHostImplementedMIDIIO is replaced now with   
> >>>>>>>>> PUBLIC void csoundSetHostMIDIIO(CSOUND *csound);
> >>>>>>>>> 
> >>>>>>>>> How to deal with global variables?
> >>>>>>>>> csoundQueryGlobalVariable
> >>>>>>>>> csoundCreateGlobalVariable
> >>>>>>>>> are gone,
> >>>>>>>>> 
> >>>>>>>>> csoundGetEnv is there but no csoundSetEnv, csoundSetGlobalEnv or similar?
> >>>>>>>>> 
> >>>>>>>>> at the moment I replaced them with Qt specific functions to deal with environment variables.
> >>>>>>>>> 
> >>>>>>>>> What is the correct environment variable for the plugins directory, OPCODE7DIR64?
> >>>>>>>>> 
> >>>>>>>>> I got CsoundQt building but it crashes when I run a file. I did not have time yet to dig into it,  there are many possible reasons.  I hope to continue tomorrow.
> >>>>>>>>> 
> >>>>>>>>> Exciting!
> >>>>>>>>> tarmo
> >>>>>>>>> 
> >>>>>>>>> Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 25. juuli 2024 kell 18:27:
> >>>>>>>>> 
> >>>>>>>>> Just another progress report for the feature/newapi branch
> >>>>>>>>> 
> >>>>>>>>> - I have now mainlined the new API in csound.h
> >>>>>>>>> - Updated the csound.hpp wrapper
> >>>>>>>>> - Updated the csPerformanceThread code
> >>>>>>>>> - Modified frontends to use it
> >>>>>>>>> - Modified the C++ test suite
> >>>>>>>>> 
> >>>>>>>>> It is all working, I guess frontend developers can take a look and see what they
> >>>>>>>>> think.
> >>>>>>>>> 
> >>>>>>>>> François: could you take a look at the Python wrapper? It is out of sync now.
> >>>>>>>>> 
> >>>>>>>>> Victor
> >>>>>>>>> 
> >>>>>>>>> 
> >>>>>>>> 
> >>>>>>> 
> >>>>>> 
> >>>> 
> >> 
> >