Open csounder opened 4 years ago
I just peeked at the code in question, and it would take a bit of refactoring. I am not sure why they decided to use Bela's Midi
instead of the existing portmidi
backend. Maybe it would be worth going down that route instead, to minimise the coding effort (I'd be happy to add portmidi
to the board, if needed). I will ask on csound/csound about that.
Also, could you post some example code where several MIDI devices are used at once? Is Csound able to distinguish from which device a new MIDI message came in? Or do they all "look the same"?
Support for portmidi on the board might be good - hopefully there would not be any additional latency or CPU load issues associated with it.
If you ask Victor, Steven, Eduardo, Tarmo, Rory or other in the Csound Developer List for information on how portmidi MIDI is handled more specifically, and if individual devices can be referred to separately, they would know.
-dB
Dr. Richard Boulanger
On Sat, Jul 4, 2020 at 12:12 PM giuliomoro notifications@github.com wrote:
I just peeked at the code in question https://github.com/csound/csound/blob/develop/Bela/BelaCsound.cpp, and it would take a bit of refactoring. I am not sure why they decided to use Bela's Midi instead of the existing portmidi backend. Maybe it would be worth going down that route instead, to minimise the coding effort (I'd be happy to add portmidi to the board, if needed). I will ask on csound/csound about that.
Also, could you post some example code where several MIDI devices are used at once? Is Csound able to distinguish from which device a new MIDI message came in? Or do they all "look the same"?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BelaPlatform/Bela/issues/636#issuecomment-653784283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWYFRDFXLRHB2XSZ4CUYDRZ5IHPANCNFSM4OQISYQA .
Here is the command line I would use (in CsoundQt and in the terminal)
-+rtaudio=pa_cb -odac -+rtmidi=portmidi -Ma --env:CSNOSTOP=yes
this uses both portaudio in callback mode and portmidi in read all devices mode.
I HAVE INCLUDED two .csd files for you to try (and you might want to consider including as examples - the MIDI monitor.csd is pretty useful)
Not sure that the --env: command line argument is necessary, and you might not be using portaudio on the Bela
When running either of these, the console would report:
/usr/local/bin/csound -+rtaudio=pa_cb -odac -+rtmidi=portmidi -Ma --env:CSNOSTOP=yes /Users/rboulanger/Downloads/01fmCMI.csd (or MIDI-Monitor.csd)
0dBFS level = 32768.0 --Csound version 6.14 (double samples) Jun 27 2020 [commit: 58d6e6459e9a7330e0ff747958a15125d15ffa7f] libsndfile-1.0.28 UnifiedCSD: /Users/rboulanger/Downloads/01fmCMI.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 = 1.0 chnl 1 using instr 1
0: IAC Driver HairLessMIDI2Serial-1 (portmidi) 1: IAC Driver HairLessMIDI2Serial-2 (portmidi) 2: IAC Driver IBVA1 (portmidi) 3: Duet USB (portmidi) 4: Bela (portmidi) 5: Launchkey Mini MK3 MIDI Port (portmidi) 6: Launchkey Mini MK3 DAW Port (portmidi) 7: nanoKONTROL SLIDER/KNOB (portmidi) 8: Vienna Instruments MIDI (portmidi)
PortMIDI: Activated input device 0: 'IAC Driver HairLessMIDI2Serial-1' (CoreMIDI) PortMIDI: Activated input device 1: 'IAC Driver HairLessMIDI2Serial-2' (CoreMIDI) PortMIDI: Activated input device 2: 'IAC Driver IBVA1' (CoreMIDI) PortMIDI: Activated input device 3: 'Duet USB' (CoreMIDI) PortMIDI: Activated input device 4: 'Bela' (CoreMIDI) PortMIDI: Activated input device 5: 'Launchkey Mini MK3 MIDI Port' (CoreMIDI) PortMIDI: Activated input device 6: 'Launchkey Mini MK3 DAW Port' (CoreMIDI) PortMIDI: Activated input device 7: 'nanoKONTROL SLIDER/KNOB' (CoreMIDI) PortMIDI: Activated input device 8: 'Vienna Instruments MIDI' (CoreMIDI)
orch now loaded audio buffered in 1024 sample-frame blocks
PortAudio V19-devel (built Feb 12 2010 09:42:54) 0: dac0 (Telestream [Core Audio]) 1: dac1 (DisplayPort [Core Audio]) 2: dac2 (Duet USB [Core Audio]) 3: dac3 (MacBook Pro Speakers [Core Audio]) 4: dac4 (Soundflower (2ch) [Core Audio]) 5: dac5 (Soundflower (64ch) [Core Audio]) 6: dac6 (ZoomAudioD [Core Audio])
PortAudio: selected output device 'Duet USB' writing 2048 sample blks of 64-bit floats to dac SECTION 1:
====. HERE ARE TWO MIDI Instruments for TESTING ======
; MIDI-Monitor.csd - by schwaahed 2006
===============
; MIDI-CC1-6-FM.csd
=======
Dr. Richard Boulanger
On Sat, Jul 4, 2020 at 1:13 PM Dr. Richard Boulanger rboulanger@berklee.edu wrote:
Support for portmidi on the board might be good - hopefully there would not be any additional latency or CPU load issues associated with it.
- typically, when I run multiple MIDI devices on my Mac using CsoundQt and portmidi, I just specify the command line argument -+rtmidi=portmidi -Ma
If you ask Victor, Steven, Eduardo, Tarmo, Rory or other in the Csound Developer List for information on how portmidi MIDI is handled more specifically, and if individual devices can be referred to separately, they would know.
- the sense that I have is that portmidi -Ma MIDI is simply merged from any and all connected MIDI hardware and virtual controllers, and so if one controller is sending on MIDI channel 1 and the other controller is sending on MIDI channel 1 that instrument 1 (which defaults to receiving messages on MIDI channel 1) responds to both controllers. That is my experience and what I was trying to do on the Bela after testing it using CsoundQt on the Mac.
-dB
Dr. Richard Boulanger
On Sat, Jul 4, 2020 at 12:12 PM giuliomoro notifications@github.com wrote:
I just peeked at the code in question https://github.com/csound/csound/blob/develop/Bela/BelaCsound.cpp, and it would take a bit of refactoring. I am not sure why they decided to use Bela's Midi instead of the existing portmidi backend. Maybe it would be worth going down that route instead, to minimise the coding effort (I'd be happy to add portmidi to the board, if needed). I will ask on csound/csound about that.
Also, could you post some example code where several MIDI devices are used at once? Is Csound able to distinguish from which device a new MIDI message came in? Or do they all "look the same"?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BelaPlatform/Bela/issues/636#issuecomment-653784283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWYFRDFXLRHB2XSZ4CUYDRZ5IHPANCNFSM4OQISYQA .
In Csound, under portaudio, one can use multiple MIDI controllers at the same time. A number of my students are wanting to do that with their Csound instruments running on the Bela, but for some reason, we can only use a single MIDI device at a time. Can you please support multiple simultaneous MIDI controllers on the Bela or tell us how? Is there an alsa command line flag for this?