Csound Csound-dev Csound-tekno Search About

[Csnd] Csound (csoundQT) and USB midi keyboard

Date2020-04-22 00:26
FromMark J Butsch
Subject[Csnd] Csound (csoundQT) and USB midi keyboard

Hello,

 

I am new to Csound, CsoundQT, and USB MIDI keyboards and I am, not having any luck getting MIDI data into csound. I am running Version 0.9.7 of CsoundQT with Csound 6.14 on Windows 10 Home version 1909

I have a nectar LX25+ keyboard that does with work with other DAW software and I have used Pocket MIDI to verify that it does send data to the PC.

I have tried lots of example .csd programs with midi input and have not gotten any to work. Often, CsoundQT just locks up. I have run other example .cds files and they do yield sound.

I found a MIDI debugging .csd by Iain McCurdy, but it hasn’t helped me.

---

<CsoundSynthesizer>

<CsOptions>

-Ma -m0

; activates all midi devices, suppress note printings

</CsOptions>

 

<CsInstruments>

; Example by Iain McCurdy

 

; no audio so 'sr' or 'nchnls' aren't relevant

ksmps = 32

 

; using massign with these arguments disables default instrument triggering

massign 0,0

 

instr 1

kstatus, kchan, kdata1, kdata2 midiin ;read in midi

ktrigger changed kstatus, kchan, kdata1, kdata2 ;trigger if midi data changes

if ktrigger=1 && kstatus!=0 then ;if status byte is non-zero...

; -- print midi data to the terminal with formatting --

printks "status:%d%tchannel:%d%tdata1:%d%tdata2:%d%n"\

,0,kstatus,kchan,kdata1,kdata2

endif

endin

 

</CsInstruments>

<CsScore>

i 1 0 3600 ; instr 1 plays for 1 hour

</CsScore>

</CsoundSynthesizer>

---

if I run in terminal I get “csound command: Segmentation violation”.

If I “run” it,  I get “PortAudio: failed to obtain device info.

                                Failed to initialise real time audio input

 

If “Render” it, it appears to run, but nothing is output.

 

--------------------------------------------------------------------------------

I originally posted this in the csoundQT mailing list, where  Eduardo Moguillansky provided a .csd to try.

“Use this .csd to check for midi in csound. In many cases, if csound crashes it brings CsoundQt down with it. “

https://github.com/CsoundQt/CsoundQt/wiki/Test-MIDI

I did that and the results were as follows:

----

C:\Program Files\Csound6_x64\examples>csound miditest.csd

0dBFS level = 32768.0

--Csound version 6.14 (double samples) Feb  2 2020

[commit: ac9b164e308b64c9f09c945c8f956c071dddd918]

libsndfile-1.0.29pre1

WARNING: could not open library 'C:\Program Files\Csound6_x64\plugins64\\py.dll' (-1)

UnifiedCSD:  miditest.csd

STARTING FILE

Creating options

Creating orchestra

closing tag

Creating score

rtaudio: PortAudio module enabled ...

using callback interface

rtmidi: PortMIDI module enabled

sorting score ...

        ... done

midi channel 1 using instr 1

midi channel 2 using instr 1

midi channel 3 using instr 1

midi channel 4 using instr 1

midi channel 5 using instr 1

midi channel 6 using instr 1

midi channel 7 using instr 1

midi channel 8 using instr 1

midi channel 9 using instr 1

midi channel 10 using instr 1

midi channel 11 using instr 1

midi channel 12 using instr 1

midi channel 13 using instr 1

midi channel 14 using instr 1

midi channel 15 using instr 1

midi channel 16 using instr 1

midi channel 17 using instr 1

midi channel 18 using instr 1

midi channel 19 using instr 1

midi channel 20 using instr 1

midi channel 21 using instr 1

midi channel 22 using instr 1

midi channel 23 using instr 1

midi channel 24 using instr 1

midi channel 25 using instr 1

midi channel 26 using instr 1

midi channel 27 using instr 1

midi channel 28 using instr 1

midi channel 29 using instr 1

midi channel 30 using instr 1

midi channel 31 using instr 1

midi channel 32 using instr 1

midi channel 33 using instr 1

midi channel 34 using instr 1

midi channel 35 using instr 1

midi channel 36 using instr 1

midi channel 37 using instr 1

midi channel 38 using instr 1

midi channel 39 using instr 1

midi channel 40 using instr 1

midi channel 41 using instr 1

midi channel 42 using instr 1

midi channel 43 using instr 1

midi channel 44 using instr 1

midi channel 45 using instr 1

midi channel 46 using instr 1

midi channel 47 using instr 1

midi channel 48 using instr 1

midi channel 49 using instr 1

midi channel 50 using instr 1

midi channel 51 using instr 1

midi channel 52 using instr 1

midi channel 53 using instr 1

midi channel 54 using instr 1

midi channel 55 using instr 1

midi channel 56 using instr 1

midi channel 57 using instr 1

midi channel 58 using instr 1

midi channel 59 using instr 1

midi channel 60 using instr 1

midi channel 61 using instr 1

midi channel 62 using instr 1

midi channel 63 using instr 1

midi channel 64 using instr 1

displays suppressed

0dBFS level = 32768.0

0: Impact LX25+ (portmidi)

1: MIDIIN2 (Impact LX25+) (portmidi)

PortMIDI: Activated input device 0: 'Impact LX25+' (MMSystem)

 

csound command: Segmentation violation

 

C:\Program Files\Csound6_x64\examples>

----

Based on this result, Tarmo Johannes suggested that I post to this mailing list.

 

If you have any suggestions on how to resolve this, log files to look at, others to ask, etc., I would appreciate it.

 

Thank you,

Mark Butsch

 


Date2020-04-22 19:27
FromPete Goodeve
SubjectRe: [Csnd] Csound (csoundQT) and USB midi keyboard
AttachmentsNone  

Date2020-04-22 19:30
Fromjoachim heintz
SubjectRe: [Csnd] Csound (csoundQT) and USB midi keyboard
hi mark -

i'd recommend to try first whether you get the terminal example working 
in any way.  it is strange that you get a segmentation fault with it.

i have two ideas:
1. instead of the option -Ma (in the CsOptions tag), try -M0 or -M1.
2. if this does not help, try to add the option -+rtmidi=mme or 
-+rtmidi=winmm.  i have no windows, but according to the manual it 
should load another midi modul.

hope this helps -
	joachim


On 22/04/2020 01:26, Mark J Butsch wrote:
> Hello,
> 
> I am new to Csound, CsoundQT, and USB MIDI keyboards and I am, not 
> having any luck getting MIDI data into csound. I am running Version 
> 0.9.7 of CsoundQT with Csound 6.14 on Windows 10 Home version 1909
> 
> I have a nectar LX25+ keyboard that does with work with other DAW 
> software and I have used Pocket MIDI to verify that it does send data to 
> the PC.
> 
> I have tried lots of example .csd programs with midi input and have not 
> gotten any to work. Often, CsoundQT just locks up. I have run other 
> example .cds files and they do yield sound.
> 
> I found a MIDI debugging .csd by Iain McCurdy, but it hasn’t helped me.
> 
> ---
> 
> 
> 
> 
> 
> -Ma -m0
> 
> ; activates all midi devices, suppress note printings
> 
> 
> 
> 
> 
> ; Example by Iain McCurdy
> 
> ; no audio so 'sr' or 'nchnls' aren't relevant
> 
> ksmps = 32
> 
> ; using massign with these arguments disables default instrument triggering
> 
> massign 0,0
> 
> instr 1
> 
> kstatus, kchan, kdata1, kdata2 midiin ;read in midi
> 
> ktrigger changed kstatus, kchan, kdata1, kdata2 ;trigger if midi data 
> changes
> 
> if ktrigger=1 && kstatus!=0 then ;if status byte is non-zero...
> 
> ; -- print midi data to the terminal with formatting --
> 
> printks "status:%d%tchannel:%d%tdata1:%d%tdata2:%d%n"\
> 
> ,0,kstatus,kchan,kdata1,kdata2
> 
> endif
> 
> endin
> 
> 
> 
> 
> 
> i 1 0 3600 ; instr 1 plays for 1 hour
> 
> 
> 
> 
> 
> ---
> 
> if I run in terminal I get “csound command: Segmentation violation”.
> 
> If I “run” it,  I get “PortAudio: failed to obtain device info.
> 
>                                  Failed to initialise real time audio input”
> 
> If “Render” it, it appears to run, but nothing is output.
> 
> --------------------------------------------------------------------------------
> 
> I originally posted this in the csoundQT mailing list, where  Eduardo 
> Moguillansky provided a .csd to try.
> 
> “Use this .csd to check for midi in csound. In many cases, if csound 
> crashes it brings CsoundQt down with it. “
> 
> https://github.com/CsoundQt/CsoundQt/wiki/Test-MIDI
> 
> I did that and the results were as follows:
> 
> ----
> 
> C:\Program Files\Csound6_x64\examples>csound miditest.csd
> 
> 0dBFS level = 32768.0
> 
> --Csound version 6.14 (double samples) Feb  2 2020
> 
> [commit: ac9b164e308b64c9f09c945c8f956c071dddd918]
> 
> libsndfile-1.0.29pre1
> 
> WARNING: could not open library 'C:\Program 
> Files\Csound6_x64\plugins64\\py.dll' (-1)
> 
> UnifiedCSD:  miditest.csd
> 
> STARTING FILE
> 
> Creating options
> 
> Creating orchestra
> 
> closing tag
> 
> Creating score
> 
> rtaudio: PortAudio module enabled ...
> 
> using callback interface
> 
> rtmidi: PortMIDI module enabled
> 
> sorting score ...
> 
>          ... done
> 
> midi channel 1 using instr 1
> 
> midi channel 2 using instr 1
> 
> midi channel 3 using instr 1
> 
> midi channel 4 using instr 1
> 
> midi channel 5 using instr 1
> 
> midi channel 6 using instr 1
> 
> midi channel 7 using instr 1
> 
> midi channel 8 using instr 1
> 
> midi channel 9 using instr 1
> 
> midi channel 10 using instr 1
> 
> midi channel 11 using instr 1
> 
> midi channel 12 using instr 1
> 
> midi channel 13 using instr 1
> 
> midi channel 14 using instr 1
> 
> midi channel 15 using instr 1
> 
> midi channel 16 using instr 1
> 
> midi channel 17 using instr 1
> 
> midi channel 18 using instr 1
> 
> midi channel 19 using instr 1
> 
> midi channel 20 using instr 1
> 
> midi channel 21 using instr 1
> 
> midi channel 22 using instr 1
> 
> midi channel 23 using instr 1
> 
> midi channel 24 using instr 1
> 
> midi channel 25 using instr 1
> 
> midi channel 26 using instr 1
> 
> midi channel 27 using instr 1
> 
> midi channel 28 using instr 1
> 
> midi channel 29 using instr 1
> 
> midi channel 30 using instr 1
> 
> midi channel 31 using instr 1
> 
> midi channel 32 using instr 1
> 
> midi channel 33 using instr 1
> 
> midi channel 34 using instr 1
> 
> midi channel 35 using instr 1
> 
> midi channel 36 using instr 1
> 
> midi channel 37 using instr 1
> 
> midi channel 38 using instr 1
> 
> midi channel 39 using instr 1
> 
> midi channel 40 using instr 1
> 
> midi channel 41 using instr 1
> 
> midi channel 42 using instr 1
> 
> midi channel 43 using instr 1
> 
> midi channel 44 using instr 1
> 
> midi channel 45 using instr 1
> 
> midi channel 46 using instr 1
> 
> midi channel 47 using instr 1
> 
> midi channel 48 using instr 1
> 
> midi channel 49 using instr 1
> 
> midi channel 50 using instr 1
> 
> midi channel 51 using instr 1
> 
> midi channel 52 using instr 1
> 
> midi channel 53 using instr 1
> 
> midi channel 54 using instr 1
> 
> midi channel 55 using instr 1
> 
> midi channel 56 using instr 1
> 
> midi channel 57 using instr 1
> 
> midi channel 58 using instr 1
> 
> midi channel 59 using instr 1
> 
> midi channel 60 using instr 1
> 
> midi channel 61 using instr 1
> 
> midi channel 62 using instr 1
> 
> midi channel 63 using instr 1
> 
> midi channel 64 using instr 1
> 
> displays suppressed
> 
> 0dBFS level = 32768.0
> 
> 0: Impact LX25+ (portmidi)
> 
> 1: MIDIIN2 (Impact LX25+) (portmidi)
> 
> PortMIDI: Activated input device 0: 'Impact LX25+' (MMSystem)
> 
> csound command: Segmentation violation
> 
> C:\Program Files\Csound6_x64\examples>
> 
> ----
> 
> Based on this result, Tarmo Johannes suggested that I post to this 
> mailing list.
> 
> If you have any suggestions on how to resolve this, log files to look 
> at, others to ask, etc., I would appreciate it.
> 
> Thank you,
> 
> Mark Butsch
> 
> 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