Csound Csound-dev Csound-tekno Search About

[Csnd] Csound for Android Question

Date2025-05-10 19:00
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] Csound for Android Question
Especially for Mike Gogins:

Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?

I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).

Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)

I've had the same result on our Samsung Chromebook Plus v2's.

abhunkin@uncg.edu
http://www.arthunkins.com

Date2025-05-10 19:06
FromMichael Gogins
SubjectRe: [Csnd] Csound for Android Question
I'm sorry, but I really don't know off the bat. I asked ChatGPT-4o this question and here is the response:

Yes, **Android apps running on Chromebooks can access external MIDI controllers**, but only under specific conditions and using the proper APIs.

### ✅ Requirements

1. **Android MIDI API** (introduced in Android 6.0):

   * Your app must use the `android.media.midi` package.
   * Works with USB MIDI and BLE MIDI (Bluetooth Low Energy), depending on hardware.

2. **Chromebook support for USB or Bluetooth MIDI:**

   * Many modern Chromebooks support USB OTG and Bluetooth LE.
   * A USB MIDI controller can be connected via a USB-A or USB-C port (with adapter if needed).

3. **Permissions and Features in the Manifest:**

   ```xml
   <uses-feature android:name="android.software.midi" />
   <uses-permission android:name="android.permission.MIDI" /> <!-- Optional on newer versions -->
   ```

4. **Detecting and Connecting to the MIDI Device:**
   Use `MidiManager` to enumerate available MIDI devices:

   ```java
   MidiManager midiManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE);
   midiManager.getDevices(); // Returns array of MidiDeviceInfo
   ```

5. **Opening the device and receiving input:**

   ```java
   midiManager.openDevice(deviceInfo, device -> {
       MidiInputPort inputPort = device.openInputPort(0);
       // Use inputPort.send() or create a receiver
   }, new Handler(Looper.getMainLooper()));
   ```

---

### 📌 Notes for Chromebooks

* Chromebooks running Android 9 or later generally support the MIDI API well.
* If your app runs in **ARC++ or ARCVM**, behavior can vary:

  * **ARC++**: Better USB access, more mature.
  * **ARCVM**: May require explicit user permissions or ChromeOS flags.

---

### 🧪 Testing

* Use the **"MIDI BLE Connect"** or **"MIDI Monitor"** app from the Play Store to verify that the Chromebook detects the MIDI device.
* Check the USB device info using `UsbManager` if needed (especially for OTG detection).

---

### 🧯 Troubleshooting

* If your MIDI device is not detected:

  * Ensure it's **class-compliant**.
  * Test on a physical Chromebook (not just Android emulator).
  * Try a powered USB hub if the controller requires more power than the port provides.

Would you like a sample Android Java or Kotlin snippet showing full MIDI input handling?

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


On Sat, May 10, 2025 at 8:00 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Especially for Mike Gogins:

Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?

I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).

Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)

I've had the same result on our Samsung Chromebook Plus v2's.

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

Date2025-05-10 19:07
FromMichael Gogins
SubjectRe: [Csnd] Csound for Android Question
BTW, I'm not sure ChatGPT is correct, but I will look at my source code in the next few days and see if it makes sense and if there is anything I could fix. I'm in France for the next few weeks without a Chromebook....

Best,
Mike

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


On Sat, May 10, 2025 at 8:06 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I'm sorry, but I really don't know off the bat. I asked ChatGPT-4o this question and here is the response:

Yes, **Android apps running on Chromebooks can access external MIDI controllers**, but only under specific conditions and using the proper APIs.

### ✅ Requirements

1. **Android MIDI API** (introduced in Android 6.0):

   * Your app must use the `android.media.midi` package.
   * Works with USB MIDI and BLE MIDI (Bluetooth Low Energy), depending on hardware.

2. **Chromebook support for USB or Bluetooth MIDI:**

   * Many modern Chromebooks support USB OTG and Bluetooth LE.
   * A USB MIDI controller can be connected via a USB-A or USB-C port (with adapter if needed).

3. **Permissions and Features in the Manifest:**

   ```xml
   <uses-feature android:name="android.software.midi" />
   <uses-permission android:name="android.permission.MIDI" /> <!-- Optional on newer versions -->
   ```

4. **Detecting and Connecting to the MIDI Device:**
   Use `MidiManager` to enumerate available MIDI devices:

   ```java
   MidiManager midiManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE);
   midiManager.getDevices(); // Returns array of MidiDeviceInfo
   ```

5. **Opening the device and receiving input:**

   ```java
   midiManager.openDevice(deviceInfo, device -> {
       MidiInputPort inputPort = device.openInputPort(0);
       // Use inputPort.send() or create a receiver
   }, new Handler(Looper.getMainLooper()));
   ```

---

### 📌 Notes for Chromebooks

* Chromebooks running Android 9 or later generally support the MIDI API well.
* If your app runs in **ARC++ or ARCVM**, behavior can vary:

  * **ARC++**: Better USB access, more mature.
  * **ARCVM**: May require explicit user permissions or ChromeOS flags.

---

### 🧪 Testing

* Use the **"MIDI BLE Connect"** or **"MIDI Monitor"** app from the Play Store to verify that the Chromebook detects the MIDI device.
* Check the USB device info using `UsbManager` if needed (especially for OTG detection).

---

### 🧯 Troubleshooting

* If your MIDI device is not detected:

  * Ensure it's **class-compliant**.
  * Test on a physical Chromebook (not just Android emulator).
  * Try a powered USB hub if the controller requires more power than the port provides.

Would you like a sample Android Java or Kotlin snippet showing full MIDI input handling?

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


On Sat, May 10, 2025 at 8:00 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Especially for Mike Gogins:

Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?

I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).

Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)

I've had the same result on our Samsung Chromebook Plus v2's.

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

Date2025-05-10 21:01
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Csound for Android Question
I did manage to install the USB MIDI Monitor app on my Samsung Chromebook Plus v2. With a MIDI device attached, I don't get any MIDI data through. So no joy yet. Also the list  of USB attached devices is blank.

abhunkin@uncg.edu
http://www.arthunkins.com

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Michael Gogins <michael.gogins@GMAIL.COM>
Sent: Saturday, May 10, 2025 2:07 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] Csound for Android Question
 
BTW, I'm not sure ChatGPT is correct, but I will look at my source code in the next few days and see if it makes sense and if there is anything I could fix. I'm in France for the next few weeks without a Chromebook....

Best,
Mike

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


On Sat, May 10, 2025 at 8:06 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I'm sorry, but I really don't know off the bat. I asked ChatGPT-4o this question and here is the response:

Yes, **Android apps running on Chromebooks can access external MIDI controllers**, but only under specific conditions and using the proper APIs.

### ✅ Requirements

1. **Android MIDI API** (introduced in Android 6.0):

   * Your app must use the `android.media.midi` package.
   * Works with USB MIDI and BLE MIDI (Bluetooth Low Energy), depending on hardware.

2. **Chromebook support for USB or Bluetooth MIDI:**

   * Many modern Chromebooks support USB OTG and Bluetooth LE.
   * A USB MIDI controller can be connected via a USB-A or USB-C port (with adapter if needed).

3. **Permissions and Features in the Manifest:**

   ```xml
   <uses-feature android:name="android.software.midi" />
   <uses-permission android:name="android.permission.MIDI" /> <!-- Optional on newer versions -->
   ```

4. **Detecting and Connecting to the MIDI Device:**
   Use `MidiManager` to enumerate available MIDI devices:

   ```java
   MidiManager midiManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE);
   midiManager.getDevices(); // Returns array of MidiDeviceInfo
   ```

5. **Opening the device and receiving input:**

   ```java
   midiManager.openDevice(deviceInfo, device -> {
       MidiInputPort inputPort = device.openInputPort(0);
       // Use inputPort.send() or create a receiver
   }, new Handler(Looper.getMainLooper()));
   ```

---

### 📌 Notes for Chromebooks

* Chromebooks running Android 9 or later generally support the MIDI API well.
* If your app runs in **ARC++ or ARCVM**, behavior can vary:

  * **ARC++**: Better USB access, more mature.
  * **ARCVM**: May require explicit user permissions or ChromeOS flags.

---

### 🧪 Testing

* Use the **"MIDI BLE Connect"** or **"MIDI Monitor"** app from the Play Store to verify that the Chromebook detects the MIDI device.
* Check the USB device info using `UsbManager` if needed (especially for OTG detection).

---

### 🧯 Troubleshooting

* If your MIDI device is not detected:

  * Ensure it's **class-compliant**.
  * Test on a physical Chromebook (not just Android emulator).
  * Try a powered USB hub if the controller requires more power than the port provides.

Would you like a sample Android Java or Kotlin snippet showing full MIDI input handling?

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


On Sat, May 10, 2025 at 8:00 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Especially for Mike Gogins:

Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?

I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).

Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)

I've had the same result on our Samsung Chromebook Plus v2's.

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

Date2025-05-11 01:02
From"Brian R."
SubjectRe: [Csnd] Csound for Android Question
Yeah csound android doesn't have midi controller support but wasm csound with chrome and webmidi does support midi controllers.

On Sat, May 10, 2025, 1:01 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
I did manage to install the USB MIDI Monitor app on my Samsung Chromebook Plus v2. With a MIDI device attached, I don't get any MIDI data through. So no joy yet. Also the list  of USB attached devices is blank.


From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Michael Gogins <michael.gogins@GMAIL.COM>
Sent: Saturday, May 10, 2025 2:07 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] Csound for Android Question
 
BTW, I'm not sure ChatGPT is correct, but I will look at my source code in the next few days and see if it makes sense and if there is anything I could fix. I'm in France for the next few weeks without a Chromebook....

Best,
Mike

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


On Sat, May 10, 2025 at 8:06 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I'm sorry, but I really don't know off the bat. I asked ChatGPT-4o this question and here is the response:

Yes, **Android apps running on Chromebooks can access external MIDI controllers**, but only under specific conditions and using the proper APIs.

### ✅ Requirements

1. **Android MIDI API** (introduced in Android 6.0):

   * Your app must use the `android.media.midi` package.
   * Works with USB MIDI and BLE MIDI (Bluetooth Low Energy), depending on hardware.

2. **Chromebook support for USB or Bluetooth MIDI:**

   * Many modern Chromebooks support USB OTG and Bluetooth LE.
   * A USB MIDI controller can be connected via a USB-A or USB-C port (with adapter if needed).

3. **Permissions and Features in the Manifest:**

   ```xml
   <uses-feature android:name="android.software.midi" />
   <uses-permission android:name="android.permission.MIDI" /> <!-- Optional on newer versions -->
   ```

4. **Detecting and Connecting to the MIDI Device:**
   Use `MidiManager` to enumerate available MIDI devices:

   ```java
   MidiManager midiManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE);
   midiManager.getDevices(); // Returns array of MidiDeviceInfo
   ```

5. **Opening the device and receiving input:**

   ```java
   midiManager.openDevice(deviceInfo, device -> {
       MidiInputPort inputPort = device.openInputPort(0);
       // Use inputPort.send() or create a receiver
   }, new Handler(Looper.getMainLooper()));
   ```

---

### 📌 Notes for Chromebooks

* Chromebooks running Android 9 or later generally support the MIDI API well.
* If your app runs in **ARC++ or ARCVM**, behavior can vary:

  * **ARC++**: Better USB access, more mature.
  * **ARCVM**: May require explicit user permissions or ChromeOS flags.

---

### 🧪 Testing

* Use the **"MIDI BLE Connect"** or **"MIDI Monitor"** app from the Play Store to verify that the Chromebook detects the MIDI device.
* Check the USB device info using `UsbManager` if needed (especially for OTG detection).

---

### 🧯 Troubleshooting

* If your MIDI device is not detected:

  * Ensure it's **class-compliant**.
  * Test on a physical Chromebook (not just Android emulator).
  * Try a powered USB hub if the controller requires more power than the port provides.

Would you like a sample Android Java or Kotlin snippet showing full MIDI input handling?

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


On Sat, May 10, 2025 at 8:00 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Especially for Mike Gogins:

Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?

I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).

Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)

I've had the same result on our Samsung Chromebook Plus v2's.

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

Date2025-05-12 08:29
From00000008a49663bc-dmarc-request@LISTSERV.HEANET.IE
SubjectRe: [Csnd] Csound for Android Question

Hello,

with version 6.10 (it's the latest version my ancient tablet can handle) I've used the web midi api to capture midi messages (html/js within CsHTML5 tags) and pass them to the csound code through channels or score events.

If you want to take a look here: matrix-processor/mat_proc_tpz.csd at master · triceratupuz/matrix-processor · GitHub around line 557

Bye

 

Il 11/05/2025 02:02 CEST Brian R. <brianwredfern@gmail.com> ha scritto:
 
 
Yeah csound android doesn't have midi controller support but wasm csound with chrome and webmidi does support midi controllers.

On Sat, May 10, 2025, 1:01 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
I did manage to install the USB MIDI Monitor app on my Samsung Chromebook Plus v2. With a MIDI device attached, I don't get any MIDI data through. So no joy yet. Also the list  of USB attached devices is blank.
 
 

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Michael Gogins <michael.gogins@GMAIL.COM>
Sent: Saturday, May 10, 2025 2:07 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] Csound for Android Question
 
BTW, I'm not sure ChatGPT is correct, but I will look at my source code in the next few days and see if it makes sense and if there is anything I could fix. I'm in France for the next few weeks without a Chromebook....
 
Best,
Mike
 
-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

On Sat, May 10, 2025 at 8:06 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I'm sorry, but I really don't know off the bat. I asked ChatGPT-4o this question and here is the response:
 
Yes, **Android apps running on Chromebooks can access external MIDI controllers**, but only under specific conditions and using the proper APIs.

### ✅ Requirements

1. **Android MIDI API** (introduced in Android 6.0):

   * Your app must use the `android.media.midi` package.
   * Works with USB MIDI and BLE MIDI (Bluetooth Low Energy), depending on hardware.

2. **Chromebook support for USB or Bluetooth MIDI:**

   * Many modern Chromebooks support USB OTG and Bluetooth LE.
   * A USB MIDI controller can be connected via a USB-A or USB-C port (with adapter if needed).

3. **Permissions and Features in the Manifest:**

   ```xml
   <uses-feature android:name="android.software.midi" />
   <uses-permission android:name="android.permission.MIDI" /> <!-- Optional on newer versions -->
   ```

4. **Detecting and Connecting to the MIDI Device:**
   Use `MidiManager` to enumerate available MIDI devices:

   ```java
   MidiManager midiManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE);
   midiManager.getDevices(); // Returns array of MidiDeviceInfo
   ```

5. **Opening the device and receiving input:**

   ```java
   midiManager.openDevice(deviceInfo, device -> {
       MidiInputPort inputPort = device.openInputPort(0);
       // Use inputPort.send() or create a receiver
   }, new Handler(Looper.getMainLooper()));
   ```

---

### 📌 Notes for Chromebooks

* Chromebooks running Android 9 or later generally support the MIDI API well.
* If your app runs in **ARC++ or ARCVM**, behavior can vary:

  * **ARC++**: Better USB access, more mature.
  * **ARCVM**: May require explicit user permissions or ChromeOS flags.

---

### 🧪 Testing

* Use the **"MIDI BLE Connect"** or **"MIDI Monitor"** app from the Play Store to verify that the Chromebook detects the MIDI device.
* Check the USB device info using `UsbManager` if needed (especially for OTG detection).

---

### 🧯 Troubleshooting

* If your MIDI device is not detected:

  * Ensure it's **class-compliant**.
  * Test on a physical Chromebook (not just Android emulator).
  * Try a powered USB hub if the controller requires more power than the port provides.

Would you like a sample Android Java or Kotlin snippet showing full MIDI input handling?
 
-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

On Sat, May 10, 2025 at 8:00 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Especially for Mike Gogins:
 
Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?
 
I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).
 
Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)
 
I've had the same result on our Samsung Chromebook Plus v2's.
 
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

Date2025-05-12 16:19
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Csound for Android Question
Thanks Brian and Mike for the valuable information.

Mike, if you see any possible "fix" for the lack of direct Chromebook MIDI support for Android Csound, do let me know. From the reports, I am not optimistic or holding my breath.

Again thanks.

Art H.

abhunkin@uncg.edu
http://www.arthunkins.com

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Brian R. <brianwredfern@GMAIL.COM>
Sent: Saturday, May 10, 2025 8:02 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] Csound for Android Question
 
Yeah csound android doesn't have midi controller support but wasm csound with chrome and webmidi does support midi controllers.

On Sat, May 10, 2025, 1:01 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
I did manage to install the USB MIDI Monitor app on my Samsung Chromebook Plus v2. With a MIDI device attached, I don't get any MIDI data through. So no joy yet. Also the list  of USB attached devices is blank.


From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Michael Gogins <michael.gogins@GMAIL.COM>
Sent: Saturday, May 10, 2025 2:07 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] Csound for Android Question
 
BTW, I'm not sure ChatGPT is correct, but I will look at my source code in the next few days and see if it makes sense and if there is anything I could fix. I'm in France for the next few weeks without a Chromebook....

Best,
Mike

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


On Sat, May 10, 2025 at 8:06 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I'm sorry, but I really don't know off the bat. I asked ChatGPT-4o this question and here is the response:

Yes, **Android apps running on Chromebooks can access external MIDI controllers**, but only under specific conditions and using the proper APIs.

### ✅ Requirements

1. **Android MIDI API** (introduced in Android 6.0):

   * Your app must use the `android.media.midi` package.
   * Works with USB MIDI and BLE MIDI (Bluetooth Low Energy), depending on hardware.

2. **Chromebook support for USB or Bluetooth MIDI:**

   * Many modern Chromebooks support USB OTG and Bluetooth LE.
   * A USB MIDI controller can be connected via a USB-A or USB-C port (with adapter if needed).

3. **Permissions and Features in the Manifest:**

   ```xml
   <uses-feature android:name="android.software.midi" />
   <uses-permission android:name="android.permission.MIDI" /> <!-- Optional on newer versions -->
   ```

4. **Detecting and Connecting to the MIDI Device:**
   Use `MidiManager` to enumerate available MIDI devices:

   ```java
   MidiManager midiManager = (MidiManager) context.getSystemService(Context.MIDI_SERVICE);
   midiManager.getDevices(); // Returns array of MidiDeviceInfo
   ```

5. **Opening the device and receiving input:**

   ```java
   midiManager.openDevice(deviceInfo, device -> {
       MidiInputPort inputPort = device.openInputPort(0);
       // Use inputPort.send() or create a receiver
   }, new Handler(Looper.getMainLooper()));
   ```

---

### 📌 Notes for Chromebooks

* Chromebooks running Android 9 or later generally support the MIDI API well.
* If your app runs in **ARC++ or ARCVM**, behavior can vary:

  * **ARC++**: Better USB access, more mature.
  * **ARCVM**: May require explicit user permissions or ChromeOS flags.

---

### 🧪 Testing

* Use the **"MIDI BLE Connect"** or **"MIDI Monitor"** app from the Play Store to verify that the Chromebook detects the MIDI device.
* Check the USB device info using `UsbManager` if needed (especially for OTG detection).

---

### 🧯 Troubleshooting

* If your MIDI device is not detected:

  * Ensure it's **class-compliant**.
  * Test on a physical Chromebook (not just Android emulator).
  * Try a powered USB hub if the controller requires more power than the port provides.

Would you like a sample Android Java or Kotlin snippet showing full MIDI input handling?

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


On Sat, May 10, 2025 at 8:00 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Especially for Mike Gogins:

Is it true that Chromebooks cannot handle the Csound for Android app using external MIDI controllers?

I can't seem to get any of my Chromebooks to recognize my various controllers, but it may well be that MIDI control is not built into Csound for Android (including the latest).

Running a standard .csd with CsOption -M0, and MIDI plugged in, gives a MIDI device (-1) not found error. (Is some other MIDI device indication required?)

I've had the same result on our Samsung Chromebook Plus v2's.

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