Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDIcontroller- Seeeduino Xiao SAMD21 support #34

Open
digitalelements opened this issue Jun 18, 2024 · 5 comments
Open

MIDIcontroller- Seeeduino Xiao SAMD21 support #34

digitalelements opened this issue Jun 18, 2024 · 5 comments

Comments

@digitalelements
Copy link

Hey Josh,

I'd like to make a request for adding Seeeduino Xiao to the list of compatible MCUs for your MIDIcontroller library.
A bonus may be that the Xiao SAMD21 supports touch pins as well.

Screen Shot 2024-06-10 at 1 20 12 PM

Regards,

Chris

@joshnishikawa
Copy link
Owner

joshnishikawa commented Jun 19, 2024 via email

@digitalelements
Copy link
Author

Indeed it does get recognized as a USB MIDI device. I've taken things as far as adding some basic code to do an analog
read of a pin and send out a MIDI note on/off at a fixed velocity. it appears the basic Arduino MIDI Library as well as The Adafruit TinyUSB library are what most folks use to do USB MIDI with this series of board. I've observed the errors when trying to compile your MIDIdrum example to get clues as to what needs to be adjusted. Things like the "locked" to Teensy specific boards and features. elapsedMillis timer for instance. I'd love to attempt forking the library but may need a coach !
What's the best way to first break the Locked board warning ? .. I do see the board #define in the MIDIcontroller header file.

@digitalelements
Copy link
Author

This is the basic code that worked for me.


#include <USB-MIDI.h>

USBMIDI_CREATE_DEFAULT_INSTANCE();


void setup() {

  Serial.begin(115200);
}

void loop() {

  // read the input on analog pin 0:
  int FSRinput = analogRead(A0);
  int Threshold = 20;



  // Observe the input:
  Serial.println(FSRinput);


  if (FSRinput >= Threshold){
  Serial.println ("Hit");
  }
    if (FSRinput > Threshold){
    MIDI.sendNoteOn(36, 64, 1);
    delay(10); 
    MIDI.sendNoteOff(36, 0, 1);
    }


  
  delay(1);        // delay in between reads for stability
}

@joshnishikawa
Copy link
Owner

joshnishikawa commented Jun 21, 2024

It looks like the SAMD21 and ESP32 chips cover lots of Arduino compatible boards that feature capacitive touch. So, updating Flicker and MIDIcontroller to support them would probably be worth doing. My XIAO should arrive tomorrow and I'll get to work.

@digitalelements
Copy link
Author

That's great news. I was hoping the touch Xiao features would be a bonus for your libraries. Thank you kindly ! And, I look forward to testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants