Csound Csound-dev Csound-tekno Search About

Crashes when using Csound API with real-time MIDI

Date2017-01-17 16:54
FromAsaf
SubjectCrashes when using Csound API with real-time MIDI
Hi there!

I wasn't sure whether this belongs to "Csound - General" or "Csound -
Dev"...

I'm experimenting with the Csound C++ API on windows 10, Visual Studio 2017
RC.
I get crashes when using "portmidi" - as soon as it establishes connection
to the input midi port (exception thrown from pmidi.dll). When using Csound
directly (without programming through the API) it works fine.

When I switch to using "winmm", it crashes a bit later (exception thrown
from ntdll.dll) - a soon as I send a MIDI message to that port (either by
using an external keyboard or by using Microsoft Winmm function calls).
Again, when using Csound directly (without programming through the API) it
works fine.

When using the API without MIDI, to play a simple csd with a score,
everything works fine.

Maybe someone can help me.
Thanks,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 17:13
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
The best would be to prepare a simple C++ example and accompanying .csd file that illustrate the issue. Should make it easier for people to help. Both of the lists you mentioned are fine to post to, although these days the github issue tracker seems to be the most popular place for dealing with low level stuff including the host API. 
 

On 17 January 2017 at 16:54, Asaf <lieder29@gmail.com> wrote:
Hi there!

I wasn't sure whether this belongs to "Csound - General" or "Csound -
Dev"...

I'm experimenting with the Csound C++ API on windows 10, Visual Studio 2017
RC.
I get crashes when using "portmidi" - as soon as it establishes connection
to the input midi port (exception thrown from pmidi.dll). When using Csound
directly (without programming through the API) it works fine.

When I switch to using "winmm", it crashes a bit later (exception thrown
from ntdll.dll) - a soon as I send a MIDI message to that port (either by
using an external keyboard or by using Microsoft Winmm function calls).
Again, when using Csound directly (without programming through the API) it
works fine.

When using the API without MIDI, to play a simple csd with a score,
everything works fine.

Maybe someone can help me.
Thanks,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 17:15
FromVictor Lazzarini
SubjectRe: Crashes when using Csound API with real-time MIDI
But that's not a Csound issue yet. Please don't open tickets unless they are to do
with bugs in Csound.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 17 Jan 2017, at 17:13, Rory Walsh <rorywalsh@EAR.IE> wrote:

The best would be to prepare a simple C++ example and accompanying .csd file that illustrate the issue. Should make it easier for people to help. Both of the lists you mentioned are fine to post to, although these days the github issue tracker seems to be the most popular place for dealing with low level stuff including the host API. 
 

On 17 January 2017 at 16:54, Asaf <lieder29@gmail.com> wrote:
Hi there!

I wasn't sure whether this belongs to "Csound - General" or "Csound -
Dev"...

I'm experimenting with the Csound C++ API on windows 10, Visual Studio 2017
RC.
I get crashes when using "portmidi" - as soon as it establishes connection
to the input midi port (exception thrown from pmidi.dll). When using Csound
directly (without programming through the API) it works fine.

When I switch to using "winmm", it crashes a bit later (exception thrown
from ntdll.dll) - a soon as I send a MIDI message to that port (either by
using an external keyboard or by using Microsoft Winmm function calls).
Again, when using Csound directly (without programming through the API) it
works fine.

When using the API without MIDI, to play a simple csd with a score,
everything works fine.

Maybe someone can help me.
Thanks,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 17:21
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
Ok. Let's see what's up then first... 

On 17 January 2017 at 17:15, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
But that's not a Csound issue yet. Please don't open tickets unless they are to do
with bugs in Csound.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 17 Jan 2017, at 17:13, Rory Walsh <rorywalsh@EAR.IE> wrote:

The best would be to prepare a simple C++ example and accompanying .csd file that illustrate the issue. Should make it easier for people to help. Both of the lists you mentioned are fine to post to, although these days the github issue tracker seems to be the most popular place for dealing with low level stuff including the host API. 
 

On 17 January 2017 at 16:54, Asaf <lieder29@gmail.com> wrote:
Hi there!

I wasn't sure whether this belongs to "Csound - General" or "Csound -
Dev"...

I'm experimenting with the Csound C++ API on windows 10, Visual Studio 2017
RC.
I get crashes when using "portmidi" - as soon as it establishes connection
to the input midi port (exception thrown from pmidi.dll). When using Csound
directly (without programming through the API) it works fine.

When I switch to using "winmm", it crashes a bit later (exception thrown
from ntdll.dll) - a soon as I send a MIDI message to that port (either by
using an external keyboard or by using Microsoft Winmm function calls).
Again, when using Csound directly (without programming through the API) it
works fine.

When using the API without MIDI, to play a simple csd with a score,
everything works fine.

Maybe someone can help me.
Thanks,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 17:40
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
myrtmidi.cpp   
myrtmidi.csd
  

Hi and thank you both for posting,

I'm trying to attach 2 files that generate these errors here.
In addition, I pass the following arguments:
*-odac* (this one is optional and does not relate to the errors)
*-+rtmidi=portmidi* / *-+rtmidi=winmm*
*-M0* (this port is confirmed to be the one I wish to open)
*myrtmidi.csd*

The cpp file is the most basic one:

#include 
#include "csound.hpp"

int main(int argc, char *argv[])
{
	//Create an instance of Csound
	Csound* csound = new Csound();

	//compile instance of csound.
	csound->Compile(argc, argv); // this version of Compile already calls
Start, so I commented it out

	//prepare Csound for performance
//	csound->Start();

	//perform entire score
	csound->Perform();

	delete csound;

	return 0;
}

the csd file is an example by Andrés Cabrera, except that I removed the
CsOptions, as it is more convenient for me to pass them all as the argv
arguemnts.

Thanks again,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753990.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 20:05
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
It's working for me fine here. What Csound package are you using? 

On 17 January 2017 at 17:40, Asaf <lieder29@gmail.com> wrote:
myrtmidi.cpp <http://csound.1045644.n5.nabble.com/file/n5753990/myrtmidi.cpp>
myrtmidi.csd
<http://csound.1045644.n5.nabble.com/file/n5753990/myrtmidi.csd>

Hi and thank you both for posting,

I'm trying to attach 2 files that generate these errors here.
In addition, I pass the following arguments:
*-odac* (this one is optional and does not relate to the errors)
*-+rtmidi=portmidi* / *-+rtmidi=winmm*
*-M0* (this port is confirmed to be the one I wish to open)
*myrtmidi.csd*

The cpp file is the most basic one:

#include <stdio.h>
#include "csound.hpp"

int main(int argc, char *argv[])
{
        //Create an instance of Csound
        Csound* csound = new Csound();

        //compile instance of csound.
        csound->Compile(argc, argv); // this version of Compile already calls
Start, so I commented it out

        //prepare Csound for performance
//      csound->Start();

        //perform entire score
        csound->Perform();

        delete csound;

        return 0;
}

the csd file is an example by Andrés Cabrera, except that I removed the
CsOptions, as it is more convenient for me to pass them all as the argv
arguemnts.

Thanks again,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753990.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 20:07
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
Btw, the only changes I made, which shouldn't make a difference, is to pass the name of the csd to the Compile():

csound->Compile("myrtmidi.csd");

And to pass the rtmidi options directly to the <CsOptions> section in the .csd file. And finally, I'm using this package:




On 17 January 2017 at 20:05, Rory Walsh <rorywalsh@ear.ie> wrote:
It's working for me fine here. What Csound package are you using? 

On 17 January 2017 at 17:40, Asaf <lieder29@gmail.com> wrote:
myrtmidi.cpp <http://csound.1045644.n5.nabble.com/file/n5753990/myrtmidi.cpp>
myrtmidi.csd
<http://csound.1045644.n5.nabble.com/file/n5753990/myrtmidi.csd>

Hi and thank you both for posting,

I'm trying to attach 2 files that generate these errors here.
In addition, I pass the following arguments:
*-odac* (this one is optional and does not relate to the errors)
*-+rtmidi=portmidi* / *-+rtmidi=winmm*
*-M0* (this port is confirmed to be the one I wish to open)
*myrtmidi.csd*

The cpp file is the most basic one:

#include <stdio.h>
#include "csound.hpp"

int main(int argc, char *argv[])
{
        //Create an instance of Csound
        Csound* csound = new Csound();

        //compile instance of csound.
        csound->Compile(argc, argv); // this version of Compile already calls
Start, so I commented it out

        //prepare Csound for performance
//      csound->Start();

        //perform entire score
        csound->Perform();

        delete csound;

        return 0;
}

the csd file is an example by Andrés Cabrera, except that I removed the
CsOptions, as it is more convenient for me to pass them all as the argv
arguemnts.

Thanks again,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753990.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 20:24
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
Hi Rory, thanks.

I tried it with both the full 64-bit 6.08 and full 64-bit 6.07.
I actually also downloaded the minimal 64-bit 6.08. I wanted to try that one
too, but it became a bit tricky... I'd like to remove the full version
first, then try the minimal.

I'll do it now and let you know.
Thanks again,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753994.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 20:47
FromVictor Lazzarini
SubjectRe: Crashes when using Csound API with real-time MIDI
are you using the same compiler? I suspected MSVC has issues linking to
mingwin binaries.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 17 Jan 2017, at 20:05, Rory Walsh <rorywalsh@EAR.IE> wrote:

It's working for me fine here. What Csound package are you using? 

On 17 January 2017 at 17:40, Asaf <lieder29@gmail.com> wrote:
myrtmidi.cpp <http://csound.1045644.n5.nabble.com/file/n5753990/myrtmidi.cpp>
myrtmidi.csd
<http://csound.1045644.n5.nabble.com/file/n5753990/myrtmidi.csd>

Hi and thank you both for posting,

I'm trying to attach 2 files that generate these errors here.
In addition, I pass the following arguments:
*-odac* (this one is optional and does not relate to the errors)
*-+rtmidi=portmidi* / *-+rtmidi=winmm*
*-M0* (this port is confirmed to be the one I wish to open)
*myrtmidi.csd*

The cpp file is the most basic one:

#include <stdio.h>
#include "csound.hpp"

int main(int argc, char *argv[])
{
        //Create an instance of Csound
        Csound* csound = new Csound();

        //compile instance of csound.
        csound->Compile(argc, argv); // this version of Compile already calls
Start, so I commented it out

        //prepare Csound for performance
//      csound->Start();

        //perform entire score
        csound->Perform();

        delete csound;

        return 0;
}

the csd file is an example by Andrés Cabrera, except that I removed the
CsOptions, as it is more convenient for me to pass them all as the argv
arguemnts.

Thanks again,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753990.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 20:50
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
BTW, I still have to use "pexports" to get the def file from the dll and then
"lib" to get the lib file itself, right?
Or maybe I got something wrong right there...




--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753996.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 20:55
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
Ah, I'm using mingw. There is an msvc import lib with the minimal zip package. No need to create one yourself any more.  

On 17 Jan 2017 20:50, "Asaf" <lieder29@gmail.com> wrote:
BTW, I still have to use "pexports" to get the def file from the dll and then
"lib" to get the lib file itself, right?
Or maybe I got something wrong right there...




--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753996.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 21:00
FromVictor Lazzarini
SubjectRe: Crashes when using Csound API with real-time MIDI
yes, but the trouble is some sort of binary
incompatibility, I think. Have you tried using
MSVC lately?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 17 Jan 2017, at 20:55, Rory Walsh <rorywalsh@EAR.IE> wrote:

Ah, I'm using mingw. There is an msvc import lib with the minimal zip package. No need to create one yourself any more.  

On 17 Jan 2017 20:50, "Asaf" <lieder29@gmail.com> wrote:
BTW, I still have to use "pexports" to get the def file from the dll and then
"lib" to get the lib file itself, right?
Or maybe I got something wrong right there...




--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753996.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 21:02
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
OK, thanks. I'll figure it out and try it and report later.



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753999.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 21:06
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
I haven't, but I've been toying with the idea of using it again for Csound projects. Might have to rethink this...


On 17 Jan 2017 21:00, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> wrote:
yes, but the trouble is some sort of binary
incompatibility, I think. Have you tried using
MSVC lately?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 17 Jan 2017, at 20:55, Rory Walsh <rorywalsh@EAR.IE> wrote:

Ah, I'm using mingw. There is an msvc import lib with the minimal zip package. No need to create one yourself any more.  

On 17 Jan 2017 20:50, "Asaf" <lieder29@gmail.com> wrote:
BTW, I still have to use "pexports" to get the def file from the dll and then
"lib" to get the lib file itself, right?
Or maybe I got something wrong right there...




--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753996.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 21:07
FromMichael Gogins
SubjectRe: Crashes when using Csound API with real-time MIDI
There is no binary incompatibility that I am aware of. I have built  programs and DLLs with MSVC 2013 and 2015 linking to mingw64 Csound in the past week or so.

Are we sure we are compiling everything for the same CPU architecture? The same runtime library, static or dynamic?

Regards,
Mike

On Jan 17, 2017 4:00 PM, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> wrote:
yes, but the trouble is some sort of binary
incompatibility, I think. Have you tried using
MSVC lately?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 17 Jan 2017, at 20:55, Rory Walsh <rorywalsh@EAR.IE> wrote:

Ah, I'm using mingw. There is an msvc import lib with the minimal zip package. No need to create one yourself any more.  

On 17 Jan 2017 20:50, "Asaf" <lieder29@gmail.com> wrote:
BTW, I still have to use "pexports" to get the def file from the dll and then
"lib" to get the lib file itself, right?
Or maybe I got something wrong right there...




--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753996.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-17 22:11
FromMichael Gogins
SubjectRe: Crashes when using Csound API with real-time MIDI
In the example, my only change was "const char *argv[]" in place of
"char *argv[]".

I built the example on Linux:

g++ myrtmidi.cpp -omyrtmidi -lcsound64 -I/usr/local/include/csound

I ran it thus:

./myrtmidi myrtmidi.csd -+rtmidi=virtual -M1

It worked fine.

I built the example on Windows using MinGW in my csound/mingw64 build directory:

g++ myrtmidi.cpp -omyrtmidi -lcsound64 -L. -I ../include

I ran it thus (note the different number for the MIDI interface on Windows):

./myrtmidi myrtmidi.csd -+rtmidi=virtual -M0

It worked fine.

I built the example on Windows using MSVC 2013 from my Csound
installation directory in the MSVS x64 native tools command shell:

C:\Program Files\Csound6_x64>cl
d:\msys64\home\restore\csound\mingw64\myrtmidi.cpp
/Id:\msys64\home\restore\csound\include
d:\msys64\home\restore\csound\mingw64
\csound64.lib

I ran it thus:

myrtmidi d:\msys64\home\restore\csound\mingw64\myrtmidi.csd -+rtmidi=virtual -M0

It worked fine.

Regards,
Mike





I ran it thus:

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jan 17, 2017 at 4:07 PM, Michael Gogins
 wrote:
> There is no binary incompatibility that I am aware of. I have built
> programs and DLLs with MSVC 2013 and 2015 linking to mingw64 Csound in the
> past week or so.
>
> Are we sure we are compiling everything for the same CPU architecture? The
> same runtime library, static or dynamic?
>
> Regards,
> Mike
>
> On Jan 17, 2017 4:00 PM, "Victor Lazzarini" 
> wrote:
>>
>> yes, but the trouble is some sort of binary
>> incompatibility, I think. Have you tried using
>> MSVC lately?
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>> On 17 Jan 2017, at 20:55, Rory Walsh  wrote:
>>
>> Ah, I'm using mingw. There is an msvc import lib with the minimal zip
>> package. No need to create one yourself any more.
>>
>> On 17 Jan 2017 20:50, "Asaf"  wrote:
>>>
>>> BTW, I still have to use "pexports" to get the def file from the dll and
>>> then
>>> "lib" to get the lib file itself, right?
>>> Or maybe I got something wrong right there...
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5753996.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 22:44
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
Thanks, Michael.

My problem was not with -+rtmidi=virtual, but with both -+rtmidi=portmidi
and -+rtmidi=winmm. I wrote about it in my first post.

It appears that I have a different kind of problem with -+rtmidi=virtual
(does not even recognize the module if I try to use it with my compiled
program, unlike the other two modules), but that wasn't my initial concern.

Regards,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754008.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-17 22:56
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
But thank you so much for your time going through all these different
compilation paths.
Maybe I can try compiling it from the command line like you did, but it is
something completely new to me, so it might take me some time to go through
it.

Thanks again!
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754009.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-18 01:09
FromMichael Gogins
SubjectRe: Crashes when using Csound API with real-time MIDI
I do not have a MIDI controller here with which to test portmidi or
winmm. But I should be able to test it in a few days.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jan 17, 2017 at 5:44 PM, Asaf  wrote:
> Thanks, Michael.
>
> My problem was not with -+rtmidi=virtual, but with both -+rtmidi=portmidi
> and -+rtmidi=winmm. I wrote about it in my first post.
>
> It appears that I have a different kind of problem with -+rtmidi=virtual
> (does not even recognize the module if I try to use it with my compiled
> program, unlike the other two modules), but that wasn't my initial concern.
>
> Regards,
> Asaf
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754008.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-18 11:01
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
Thanks, Mike.
I checked it again today and with -+rtmidi=virtual everything works fine.
The problems remain with portmidi and winmm.
If you get a chance to try building it with MSVC, that would be great!

Thanks again,
Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754014.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-18 12:05
FromAsaf
SubjectRe: Crashes when using Csound API with real-time MIDI
I installed mingw-w64 and followed Mike's g++ build command (with adjustments
to make all the paths correct) and it worked! Built and run correctly, both
with portmidi and winmm.

So this means the problem is MSVC-related (BTW, I'll mention again that I'm
using the latest Visual Studio Community 2017 RC).

Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754015.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-01-18 20:05
FromRory Walsh
SubjectRe: Crashes when using Csound API with real-time MIDI
I just tried here with again MSVC and I also get a crash when trying to interact with a MIDI keyboard. It's not easy to debug this one as MSVC was not used to create the Csound library, therefore I can't step through with a debugger. Mike has far more experience than I with these tools. Perhaps he can help once he gets his hands on a MIDI keyboard. 

On 18 January 2017 at 12:05, Asaf <lieder29@gmail.com> wrote:
I installed mingw-w64 and followed Mike's g++ build command (with adjustments
to make all the paths correct) and it worked! Built and run correctly, both
with portmidi and winmm.

So this means the problem is MSVC-related (BTW, I'll mention again that I'm
using the latest Visual Studio Community 2017 RC).

Asaf



--
View this message in context: http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754015.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-18 20:47
FromMichael Gogins
SubjectRe: Crashes when using Csound API with real-time MIDI
You can attach gdb to a running process. Start Csound, find its
process id, start gdb, attach to that process id, then try to play the
keyboard and see what happens.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Jan 18, 2017 at 3:05 PM, Rory Walsh  wrote:
> I just tried here with again MSVC and I also get a crash when trying to
> interact with a MIDI keyboard. It's not easy to debug this one as MSVC was
> not used to create the Csound library, therefore I can't step through with a
> debugger. Mike has far more experience than I with these tools. Perhaps he
> can help once he gets his hands on a MIDI keyboard.
>
> On 18 January 2017 at 12:05, Asaf  wrote:
>>
>> I installed mingw-w64 and followed Mike's g++ build command (with
>> adjustments
>> to make all the paths correct) and it worked! Built and run correctly,
>> both
>> with portmidi and winmm.
>>
>> So this means the problem is MSVC-related (BTW, I'll mention again that
>> I'm
>> using the latest Visual Studio Community 2017 RC).
>>
>> Asaf
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/Crashes-when-using-Csound-API-with-real-time-MIDI-tp5753986p5754015.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here