Csound Csound-dev Csound-tekno Search About

[Csnd] Python and Midiout with noteondur2

Date2018-01-06 17:38
FromBen McAllister
Subject[Csnd] Python and Midiout with noteondur2
Attachmentsmidiout_test.py  test.orc  test.sco  
Hello Csounders!

I'm trying to run csound from python to generate midi events. The attached orc and sco run fine from the cmdline, but running the same from the csound API via python fails to generate Midi out due to a PortMidi error: "*** PortMIDI: MIDI out: error writing message".  

My csound command:
csound  -odac -Q0 -b64 -B64 test.orc test.sco

I'm on Mac 10.13.2, Python 2.7.14, and Midi device 0 on my machine is an IAC bus.  Any advice in diagnosing the issue?

Thanks in advance!


-- 
Ben McAllister | listenfaster.com |  @listenfaster 


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

Date2018-01-08 15:54
FromSteven Yi
SubjectRe: [Csnd] Python and Midiout with noteondur2
Hi Ben,

A couple thoughts:

1. You might try to list the midi devices both with Csound commandline
and in Python using:

--midi-devices[=in|out] list available audio devices and exit

(Ignore that it says audio devices, seems the text for the --help has a typo)

2. You might want to switch to using ctcsound.py instead. I don't know
if it is packaged with the installer, but you can find it online (and
interestingly, just saw it on pypi:
https://pypi.python.org/pypi/ctcsound/0.0.2 ).

Maybe #1 will give some information, but maybe #2 will fix the issue.
I think at this point too, we should all be moving to ctcsound.py
since we're going to drop the generated Python language in CS7.

steven

On Sat, Jan 6, 2018 at 12:38 PM, Ben McAllister  wrote:
> Hello Csounders!
>
> I'm trying to run csound from python to generate midi events. The attached
> orc and sco run fine from the cmdline, but running the same from the csound
> API via python fails to generate Midi out due to a PortMidi error: "***
> PortMIDI: MIDI out: error writing message".
>
> My csound command:
> csound  -odac -Q0 -b64 -B64 test.orc test.sco
>
> I'm on Mac 10.13.2, Python 2.7.14, and Midi device 0 on my machine is an IAC
> bus.  Any advice in diagnosing the issue?
>
> Thanks in advance!
>
>
> --
> Ben McAllister | listenfaster.com |  @listenfaster
>
>
> 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

Date2018-01-16 22:36
FromBen McAllister
SubjectRe: [Csnd] Python and Midiout with noteondur2
Thanks for the tips. Unfortunately, the PortMidi error remains. I'd like to setup a debug environment around the csound executable to see where things are breaking - what are Csound devs using for an IDE on Mac?  Or should just debug via logging? 

On Mon, Jan 8, 2018 at 7:54 AM, Steven Yi <stevenyi@gmail.com> wrote:
Hi Ben,

A couple thoughts:

1. You might try to list the midi devices both with Csound commandline
and in Python using:

--midi-devices[=in|out] list available audio devices and exit

(Ignore that it says audio devices, seems the text for the --help has a typo)

2. You might want to switch to using ctcsound.py instead. I don't know
if it is packaged with the installer, but you can find it online (and
interestingly, just saw it on pypi:
https://pypi.python.org/pypi/ctcsound/0.0.2 ).

Maybe #1 will give some information, but maybe #2 will fix the issue.
I think at this point too, we should all be moving to ctcsound.py
since we're going to drop the generated Python language in CS7.

steven

On Sat, Jan 6, 2018 at 12:38 PM, Ben McAllister <benmca@gmail.com> wrote:
> Hello Csounders!
>
> I'm trying to run csound from python to generate midi events. The attached
> orc and sco run fine from the cmdline, but running the same from the csound
> API via python fails to generate Midi out due to a PortMidi error: "***
> PortMIDI: MIDI out: error writing message".
>
> My csound command:
> csound  -odac -Q0 -b64 -B64 test.orc test.sco
>
> I'm on Mac 10.13.2, Python 2.7.14, and Midi device 0 on my machine is an IAC
> bus.  Any advice in diagnosing the issue?
>
> Thanks in advance!
>
>
> --
> Ben McAllister | listenfaster.com |  @listenfaster
>
>
> 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



--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
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

Date2018-01-16 22:45
FromVictor Lazzarini
SubjectRe: [Csnd] Python and Midiout with noteondur2
Hang on, you said that the csound was working, but not via Python, so debugging needs to happen
in your python script, not the csound executable. 

We could help if you shared the Python program that is not working. Maybe something in the
order of the API calls.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 16 Jan 2018, at 22:36, Ben McAllister  wrote:
> 
> Thanks for the tips. Unfortunately, the PortMidi error remains. I'd like to setup a debug environment around the csound executable to see where things are breaking - what are Csound devs using for an IDE on Mac?  Or should just debug via logging? 
> 
> On Mon, Jan 8, 2018 at 7:54 AM, Steven Yi  wrote:
> Hi Ben,
> 
> A couple thoughts:
> 
> 1. You might try to list the midi devices both with Csound commandline
> and in Python using:
> 
> --midi-devices[=in|out] list available audio devices and exit
> 
> (Ignore that it says audio devices, seems the text for the --help has a typo)
> 
> 2. You might want to switch to using ctcsound.py instead. I don't know
> if it is packaged with the installer, but you can find it online (and
> interestingly, just saw it on pypi:
> https://pypi.python.org/pypi/ctcsound/0.0.2 ).
> 
> Maybe #1 will give some information, but maybe #2 will fix the issue.
> I think at this point too, we should all be moving to ctcsound.py
> since we're going to drop the generated Python language in CS7.
> 
> steven
> 
> On Sat, Jan 6, 2018 at 12:38 PM, Ben McAllister  wrote:
> > Hello Csounders!
> >
> > I'm trying to run csound from python to generate midi events. The attached
> > orc and sco run fine from the cmdline, but running the same from the csound
> > API via python fails to generate Midi out due to a PortMidi error: "***
> > PortMIDI: MIDI out: error writing message".
> >
> > My csound command:
> > csound  -odac -Q0 -b64 -B64 test.orc test.sco
> >
> > I'm on Mac 10.13.2, Python 2.7.14, and Midi device 0 on my machine is an IAC
> > bus.  Any advice in diagnosing the issue?
> >
> > Thanks in advance!
> >
> >
> > --
> > Ben McAllister | listenfaster.com |  @listenfaster
> >
> >
> > 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
> 
> 
> 
> -- 
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
> 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

Date2018-01-17 19:36
FromBen McAllister
SubjectRe: [Csnd] Python and Midiout with noteondur2
Thanks for the response. 

I attached the screenshot script and associated orc and sco to my original post - do you see them?. Csound runs fine, generating notes from the score and reporting the start times correctly, etc, but every note generates the Le PortMidi error I mention. Maybe you can repro. Im interested in any advice on an IDE for Mac, regardless.

On Jan 16, 2018 2:45 PM, "Victor Lazzarini" <Victor.Lazzarini@mu.ie> wrote:
Hang on, you said that the csound was working, but not via Python, so debugging needs to happen
in your python script, not the csound executable.

We could help if you shared the Python program that is not working. Maybe something in the
order of the API calls.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 16 Jan 2018, at 22:36, Ben McAllister <benmca@gmail.com> wrote:
>
> Thanks for the tips. Unfortunately, the PortMidi error remains. I'd like to setup a debug environment around the csound executable to see where things are breaking - what are Csound devs using for an IDE on Mac?  Or should just debug via logging?
>
> On Mon, Jan 8, 2018 at 7:54 AM, Steven Yi <stevenyi@gmail.com> wrote:
> Hi Ben,
>
> A couple thoughts:
>
> 1. You might try to list the midi devices both with Csound commandline
> and in Python using:
>
> --midi-devices[=in|out] list available audio devices and exit
>
> (Ignore that it says audio devices, seems the text for the --help has a typo)
>
> 2. You might want to switch to using ctcsound.py instead. I don't know
> if it is packaged with the installer, but you can find it online (and
> interestingly, just saw it on pypi:
> https://pypi.python.org/pypi/ctcsound/0.0.2 ).
>
> Maybe #1 will give some information, but maybe #2 will fix the issue.
> I think at this point too, we should all be moving to ctcsound.py
> since we're going to drop the generated Python language in CS7.
>
> steven
>
> On Sat, Jan 6, 2018 at 12:38 PM, Ben McAllister <benmca@gmail.com> wrote:
> > Hello Csounders!
> >
> > I'm trying to run csound from python to generate midi events. The attached
> > orc and sco run fine from the cmdline, but running the same from the csound
> > API via python fails to generate Midi out due to a PortMidi error: "***
> > PortMIDI: MIDI out: error writing message".
> >
> > My csound command:
> > csound  -odac -Q0 -b64 -B64 test.orc test.sco
> >
> > I'm on Mac 10.13.2, Python 2.7.14, and Midi device 0 on my machine is an IAC
> > bus.  Any advice in diagnosing the issue?
> >
> > Thanks in advance!
> >
> >
> > --
> > Ben McAllister | listenfaster.com |  @listenfaster
> >
> >
> > 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
>
>
>
> --
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
> 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