#samd21 — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #samd21, aggregated by home.social.
-
Getting the Most out of ISM Transceivers Using Math https://hackaday.com/2025/09/17/getting-the-most-out-of-ism-transceivers-using-math/ #wirelessnetworking #wirelessnetwork #homenetworking #RadioHacks #rfm12b #SAMD21
-
Getting the Most out of ISM Transceivers Using Math - WiFi is an excellent protocol, but it certainly has its weaknesses. Its range in e... - https://hackaday.com/2025/09/17/getting-the-most-out-of-ism-transceivers-using-math/ #wirelessnetworking #wirelessnetwork #homenetworking #radiohacks #rfm12b #samd21
-
XIAO ESP32-C3 MIDI Synthesizer – Part 6
Expanding on my previous posts, I thought it might be interesting to see how I might be able to add some additional IO to the MIDI Synth. This is an exploration of some options there.
- Part 1 – Getting started and getting code running.
- Part 2 – Swapping the ESP32-C3 for a SAMD21 to get USB MIDI.
- Part 3 – Taking a deeper look at the SAM2695 itself.
- Part 4 – A USB MIDI Synth Module using the SAMD21 again as a USB MIDI Host.
- Part 5 – A Serial MIDI Synth Module using the original ESP32-C3.
- Part 6 – Pairs the Synth with a XIAO Expansion board to add display and potentiometers.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- Getting Started with the XIAO MIDI Synthesizer
- XIAO SAMD21, Arduino and MIDI
- XIAO SAMD21, Arduino and MIDI – Part 6
If you are new to microcontrollers, see the Getting Started pages.
The Synth Grove Connector
One option to immediately explore for me was the Grove connector on the Synth – highlighted by the blue rectangle in the photo below. I’m thinking at this stage of the XIAO Expander Module (more here) and how that might give some options for easily hooking up to the Synth.
There one obvious issue with this, and one not so obvious issue.
First, of course, there is no access to this connector through the case. My initial thought was to simply remove the PCB from the case and use it as a stand-alone board. On initial inspection it seemed that there were two screws holding it down. Not so, a more thorough inspection (after remove the two screws and still not being able to remove it), revealed a third screw underneath the “light pipe” for the LEDs.
Unfortunately that light pipe is pretty well wedged into the case making removal particularly tricky. But without removing the light pipe, it isn’t possible to get to the screw at all.
I did wonder about making a hole in the 3D printed case. A better option might be to get hold of the published 3D print files and add a hole and make my own (they are available via the product page).
But both options would probably end up changing the original case somehow – even if printing my own, I still need to get the original PCB out somehow and that brings me back to the light pipe issue.
The second issue isn’t quite so obvious. In that photo we can see that the pins for the Grove connector are labelled as follows (top to bottom):
- NC
- TX
- 5V
- GND
The UART on the XIAO expander board, which I’d like to use, is labelled:
- RX7
- TX6
- 3V3
- GND
Checking in with the Synth schematic, the connector is wired as follows:
SYS_MIDI connects to the MIDI_IN pin of the SAM2695, so actually connecting “TX to TX” in this instance should be ok.
5V might be an issue though, as it really does look like (to me) that it really means 5V – it is the input to the TPL740F33 that generates the 3V3 power signal, as well as feeding the amplifier directly. The datasheet of the TPL740F33 does seem to imply that if receiving 3V3 it can still generate 3V3 so it might be ok? The amplifier obviously won’t be as powerful though running off 3V3.
Anyway, for now, instead I’ve just opted to use the GPIO again, wired into the expansion sockets with the XIAO removed.
At the XIAO expander end, I’ve used the additional pins rather than the Grove connector, as they support a 5V output.
The downsides to this approach:
- I’m not using the Grove connectors, which would have been really neat.
- I have no access to the four buttons on the XIAO MIDI Synth.
But I do now have access to two I2C Grove connectors, a GPIO Grove, and the RX part of the UART Grove too as well as the on-board display.
If a XIAO SAMD21 is used, then the previous code for USB to the Synth can be used directly – see XIAO ESP32-C3 MIDI Synthesizer – Part 2.
If the XIAO ESP32-C3 is used, then an additional serial MIDI connection is required. This can be connected to the Grove UART connector (using the RX pin, and leaving TX unconnected) or the RX pin of the additional 8-way pin header on the expansion board. Then the code from this will work directly: XIAO ESP32-C3 MIDI Synthesizer – Part 5.
Adding a Display and Program Control
I already have some code that has done this for a XIAO on an expansion board here XIAO SAMD21, Arduino and MIDI – Part 6.
But for this to work usefully with the Synth module, I need to adjust the routing so that MIDI goes from USB to serial, but the program change messages are also sent via serial to the synth module. That has already been address in previous parts, to I just need to merge the code with that from XIAO ESP32-C3 MIDI Synthesizer – Part 4.
This is the result.
There is a bit of jitter on the analog pot, but that is only because I’m using the original fairly simplified algorithm to detect changes. If I was fussed about it, I’d reuse the averaging class from Arduino MIDI Atari Paddles. And to be honest, a capacitor on the pot would probably go quite a long way too…
As a test, I also powered the device from the Grove UART port connecting it as follows:
- Expander GND – GND Synth
- Expander 3V3 – 5V IN Synth
- Expander TX – RX/D6 Synth
- Expander RX – N/C
And this all worked fine. So I think a Grove to Grove lead would work fine if I had access to the Synth’s Grove port.
This does mean that the exact same code can work with the M5 Synth module using a Grove to Grove lead. The downside of this, even though it is a lot simpler in connectivity terms, is that there is now external audio out like there is on the XIAO Synth.
For completeness the same code can be used with the XIAO ESP32-C3 and serial MIDI, see the photo at the start of this blog.
To turn off all USB handling in the code, the following must be commented out:
//#define HAS_USB
//#define SER_TO_USB
//#define MIDI_USB_PCCCFor other parts of the code, the Arduino abstraction for A0 maps over to the ESP32-C3 fine. The only thing to watch out for is the increased analog resolution from 10 to 12 bits, but a call to analogReadResolution(10) drops that back to the expected 10 bits.
Oh and the Serial port to use is different:
- XIAO SAMD21: Serial1
- XIAO ESP32-C3: Serial0
Closing Thoughts
If I can be bothered, it would be nice to actually display the General MIDI voice name on the display. The SAM2695 also has its MT-32 mode, so having some means of selecting that might be interesting too.
And so far I’ve largely only messed about with driving it on a single MIDI channel, so there is a lot more that could be done there.
Kevin
#controlChange #esp32c3 #midi #programChange #SAM2695 #samd21 #usbMidi #xiao
-
XIAO ESP32-C3 MIDI Synthesizer – Part 6
Expanding on my previous posts, I thought it might be interesting to see how I might be able to add some additional IO to the MIDI Synth. This is an exploration of some options there.
- Part 1 – Getting started and getting code running.
- Part 2 – Swapping the ESP32-C3 for a SAMD21 to get USB MIDI.
- Part 3 – Taking a deeper look at the SAM2695 itself.
- Part 4 – A USB MIDI Synth Module using the SAMD21 again as a USB MIDI Host.
- Part 5 – A Serial MIDI Synth Module using the original ESP32-C3.
- Part 6 – Pairs the Synth with a XIAO Expansion board to add display and potentiometers.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- Getting Started with the XIAO MIDI Synthesizer
- XIAO SAMD21, Arduino and MIDI
- XIAO SAMD21, Arduino and MIDI – Part 6
If you are new to microcontrollers, see the Getting Started pages.
The Synth Grove Connector
One option to immediately explore for me was the Grove connector on the Synth – highlighted by the blue rectangle in the photo below. I’m thinking at this stage of the XIAO Expander Module (more here) and how that might give some options for easily hooking up to the Synth.
There one obvious issue with this, and one not so obvious issue.
First, of course, there is no access to this connector through the case. My initial thought was to simply remove the PCB from the case and use it as a stand-alone board. On initial inspection it seemed that there were two screws holding it down. Not so, a more thorough inspection (after remove the two screws and still not being able to remove it), revealed a third screw underneath the “light pipe” for the LEDs.
Unfortunately that light pipe is pretty well wedged into the case making removal particularly tricky. But without removing the light pipe, it isn’t possible to get to the screw at all.
I did wonder about making a hole in the 3D printed case. A better option might be to get hold of the published 3D print files and add a hole and make my own (they are available via the product page).
But both options would probably end up changing the original case somehow – even if printing my own, I still need to get the original PCB out somehow and that brings me back to the light pipe issue.
The second issue isn’t quite so obvious. In that photo we can see that the pins for the Grove connector are labelled as follows (top to bottom):
- NC
- TX
- 5V
- GND
The UART on the XIAO expander board, which I’d like to use, is labelled:
- RX7
- TX6
- 3V3
- GND
Checking in with the Synth schematic, the connector is wired as follows:
SYS_MIDI connects to the MIDI_IN pin of the SAM2695, so actually connecting “TX to TX” in this instance should be ok.
5V might be an issue though, as it really does look like (to me) that it really means 5V – it is the input to the TPL740F33 that generates the 3V3 power signal, as well as feeding the amplifier directly. The datasheet of the TPL740F33 does seem to imply that if receiving 3V3 it can still generate 3V3 so it might be ok? The amplifier obviously won’t be as powerful though running off 3V3.
Anyway, for now, instead I’ve just opted to use the GPIO again, wired into the expansion sockets with the XIAO removed.
At the XIAO expander end, I’ve used the additional pins rather than the Grove connector, as they support a 5V output.
The downsides to this approach:
- I’m not using the Grove connectors, which would have been really neat.
- I have no access to the four buttons on the XIAO MIDI Synth.
But I do now have access to two I2C Grove connectors, a GPIO Grove, and the RX part of the UART Grove too as well as the on-board display.
If a XIAO SAMD21 is used, then the previous code for USB to the Synth can be used directly – see XIAO ESP32-C3 MIDI Synthesizer – Part 2.
If the XIAO ESP32-C3 is used, then an additional serial MIDI connection is required. This can be connected to the Grove UART connector (using the RX pin, and leaving TX unconnected) or the RX pin of the additional 8-way pin header on the expansion board. Then the code from this will work directly: XIAO ESP32-C3 MIDI Synthesizer – Part 5.
Adding a Display and Program Control
I already have some code that has done this for a XIAO on an expansion board here XIAO SAMD21, Arduino and MIDI – Part 6.
But for this to work usefully with the Synth module, I need to adjust the routing so that MIDI goes from USB to serial, but the program change messages are also sent via serial to the synth module. That has already been address in previous parts, to I just need to merge the code with that from XIAO ESP32-C3 MIDI Synthesizer – Part 4.
This is the result.
There is a bit of jitter on the analog pot, but that is only because I’m using the original fairly simplified algorithm to detect changes. If I was fussed about it, I’d reuse the averaging class from Arduino MIDI Atari Paddles. And to be honest, a capacitor on the pot would probably go quite a long way too…
As a test, I also powered the device from the Grove UART port connecting it as follows:
- Expander GND – GND Synth
- Expander 3V3 – 5V IN Synth
- Expander TX – RX/D6 Synth
- Expander RX – N/C
And this all worked fine. So I think a Grove to Grove lead would work fine if I had access to the Synth’s Grove port.
This does mean that the exact same code can work with the M5 Synth module using a Grove to Grove lead. The downside of this, even though it is a lot simpler in connectivity terms, is that there is now external audio out like there is on the XIAO Synth.
For completeness the same code can be used with the XIAO ESP32-C3 and serial MIDI, see the photo at the start of this blog.
To turn off all USB handling in the code, the following must be commented out:
//#define HAS_USB
//#define SER_TO_USB
//#define MIDI_USB_PCCCFor other parts of the code, the Arduino abstraction for A0 maps over to the ESP32-C3 fine. The only thing to watch out for is the increased analog resolution from 10 to 12 bits, but a call to analogReadResolution(10) drops that back to the expected 10 bits.
Oh and the Serial port to use is different:
- XIAO SAMD21: Serial1
- XIAO ESP32-C3: Serial0
Closing Thoughts
If I can be bothered, it would be nice to actually display the General MIDI voice name on the display. The SAM2695 also has its MT-32 mode, so having some means of selecting that might be interesting too.
And so far I’ve largely only messed about with driving it on a single MIDI channel, so there is a lot more that could be done there.
Kevin
#controlChange #esp32c3 #midi #programChange #SAM2695 #samd21 #usbMidi #xiao
-
XIAO ESP32-C3 MIDI Synthesizer – Part 6
Expanding on my previous posts, I thought it might be interesting to see how I might be able to add some additional IO to the MIDI Synth. This is an exploration of some options there.
- Part 1 – Getting started and getting code running.
- Part 2 – Swapping the ESP32-C3 for a SAMD21 to get USB MIDI.
- Part 3 – Taking a deeper look at the SAM2695 itself.
- Part 4 – A USB MIDI Synth Module using the SAMD21 again as a USB MIDI Host.
- Part 5 – A Serial MIDI Synth Module using the original ESP32-C3.
- Part 6 – Pairs the Synth with a XIAO Expansion board to add display and potentiometers.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- Getting Started with the XIAO MIDI Synthesizer
- XIAO SAMD21, Arduino and MIDI
- XIAO SAMD21, Arduino and MIDI – Part 6
If you are new to microcontrollers, see the Getting Started pages.
The Synth Grove Connector
One option to immediately explore for me was the Grove connector on the Synth – highlighted by the blue rectangle in the photo below. I’m thinking at this stage of the XIAO Expander Module (more here) and how that might give some options for easily hooking up to the Synth.
There one obvious issue with this, and one not so obvious issue.
First, of course, there is no access to this connector through the case. My initial thought was to simply remove the PCB from the case and use it as a stand-alone board. On initial inspection it seemed that there were two screws holding it down. Not so, a more thorough inspection (after remove the two screws and still not being able to remove it), revealed a third screw underneath the “light pipe” for the LEDs.
Unfortunately that light pipe is pretty well wedged into the case making removal particularly tricky. But without removing the light pipe, it isn’t possible to get to the screw at all.
I did wonder about making a hole in the 3D printed case. A better option might be to get hold of the published 3D print files and add a hole and make my own (they are available via the product page).
But both options would probably end up changing the original case somehow – even if printing my own, I still need to get the original PCB out somehow and that brings me back to the light pipe issue.
The second issue isn’t quite so obvious. In that photo we can see that the pins for the Grove connector are labelled as follows (top to bottom):
- NC
- TX
- 5V
- GND
The UART on the XIAO expander board, which I’d like to use, is labelled:
- RX7
- TX6
- 3V3
- GND
Checking in with the Synth schematic, the connector is wired as follows:
SYS_MIDI connects to the MIDI_IN pin of the SAM2695, so actually connecting “TX to TX” in this instance should be ok.
5V might be an issue though, as it really does look like (to me) that it really means 5V – it is the input to the TPL740F33 that generates the 3V3 power signal, as well as feeding the amplifier directly. The datasheet of the TPL740F33 does seem to imply that if receiving 3V3 it can still generate 3V3 so it might be ok? The amplifier obviously won’t be as powerful though running off 3V3.
Anyway, for now, instead I’ve just opted to use the GPIO again, wired into the expansion sockets with the XIAO removed.
At the XIAO expander end, I’ve used the additional pins rather than the Grove connector, as they support a 5V output.
The downsides to this approach:
- I’m not using the Grove connectors, which would have been really neat.
- I have no access to the four buttons on the XIAO MIDI Synth.
But I do now have access to two I2C Grove connectors, a GPIO Grove, and the RX part of the UART Grove too as well as the on-board display.
If a XIAO SAMD21 is used, then the previous code for USB to the Synth can be used directly – see XIAO ESP32-C3 MIDI Synthesizer – Part 2.
If the XIAO ESP32-C3 is used, then an additional serial MIDI connection is required. This can be connected to the Grove UART connector (using the RX pin, and leaving TX unconnected) or the RX pin of the additional 8-way pin header on the expansion board. Then the code from this will work directly: XIAO ESP32-C3 MIDI Synthesizer – Part 5.
Adding a Display and Program Control
I already have some code that has done this for a XIAO on an expansion board here XIAO SAMD21, Arduino and MIDI – Part 6.
But for this to work usefully with the Synth module, I need to adjust the routing so that MIDI goes from USB to serial, but the program change messages are also sent via serial to the synth module. That has already been address in previous parts, to I just need to merge the code with that from XIAO ESP32-C3 MIDI Synthesizer – Part 4.
This is the result.
There is a bit of jitter on the analog pot, but that is only because I’m using the original fairly simplified algorithm to detect changes. If I was fussed about it, I’d reuse the averaging class from Arduino MIDI Atari Paddles. And to be honest, a capacitor on the pot would probably go quite a long way too…
As a test, I also powered the device from the Grove UART port connecting it as follows:
- Expander GND – GND Synth
- Expander 3V3 – 5V IN Synth
- Expander TX – RX/D6 Synth
- Expander RX – N/C
And this all worked fine. So I think a Grove to Grove lead would work fine if I had access to the Synth’s Grove port.
This does mean that the exact same code can work with the M5 Synth module using a Grove to Grove lead. The downside of this, even though it is a lot simpler in connectivity terms, is that there is now external audio out like there is on the XIAO Synth.
For completeness the same code can be used with the XIAO ESP32-C3 and serial MIDI, see the photo at the start of this blog.
To turn off all USB handling in the code, the following must be commented out:
//#define HAS_USB
//#define SER_TO_USB
//#define MIDI_USB_PCCCFor other parts of the code, the Arduino abstraction for A0 maps over to the ESP32-C3 fine. The only thing to watch out for is the increased analog resolution from 10 to 12 bits, but a call to analogReadResolution(10) drops that back to the expected 10 bits.
Oh and the Serial port to use is different:
- XIAO SAMD21: Serial1
- XIAO ESP32-C3: Serial0
Closing Thoughts
If I can be bothered, it would be nice to actually display the General MIDI voice name on the display. The SAM2695 also has its MT-32 mode, so having some means of selecting that might be interesting too.
And so far I’ve largely only messed about with driving it on a single MIDI channel, so there is a lot more that could be done there.
Kevin
#controlChange #esp32c3 #midi #programChange #SAM2695 #samd21 #usbMidi #xiao
-
XIAO ESP32-C3 MIDI Synthesizer – Part 6
Expanding on my previous posts, I thought it might be interesting to see how I might be able to add some additional IO to the MIDI Synth. This is an exploration of some options there.
- Part 1 – Getting started and getting code running.
- Part 2 – Swapping the ESP32-C3 for a SAMD21 to get USB MIDI.
- Part 3 – Taking a deeper look at the SAM2695 itself.
- Part 4 – A USB MIDI Synth Module using the SAMD21 again as a USB MIDI Host.
- Part 5 – A Serial MIDI Synth Module using the original ESP32-C3.
- Part 6 – Pairs the Synth with a XIAO Expansion board to add display and potentiometers.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- Getting Started with the XIAO MIDI Synthesizer
- XIAO SAMD21, Arduino and MIDI
- XIAO SAMD21, Arduino and MIDI – Part 6
If you are new to microcontrollers, see the Getting Started pages.
The Synth Grove Connector
One option to immediately explore for me was the Grove connector on the Synth – highlighted by the blue rectangle in the photo below. I’m thinking at this stage of the XIAO Expander Module (more here) and how that might give some options for easily hooking up to the Synth.
There one obvious issue with this, and one not so obvious issue.
First, of course, there is no access to this connector through the case. My initial thought was to simply remove the PCB from the case and use it as a stand-alone board. On initial inspection it seemed that there were two screws holding it down. Not so, a more thorough inspection (after remove the two screws and still not being able to remove it), revealed a third screw underneath the “light pipe” for the LEDs.
Unfortunately that light pipe is pretty well wedged into the case making removal particularly tricky. But without removing the light pipe, it isn’t possible to get to the screw at all.
I did wonder about making a hole in the 3D printed case. A better option might be to get hold of the published 3D print files and add a hole and make my own (they are available via the product page).
But both options would probably end up changing the original case somehow – even if printing my own, I still need to get the original PCB out somehow and that brings me back to the light pipe issue.
The second issue isn’t quite so obvious. In that photo we can see that the pins for the Grove connector are labelled as follows (top to bottom):
- NC
- TX
- 5V
- GND
The UART on the XIAO expander board, which I’d like to use, is labelled:
- RX7
- TX6
- 3V3
- GND
Checking in with the Synth schematic, the connector is wired as follows:
SYS_MIDI connects to the MIDI_IN pin of the SAM2695, so actually connecting “TX to TX” in this instance should be ok.
5V might be an issue though, as it really does look like (to me) that it really means 5V – it is the input to the TPL740F33 that generates the 3V3 power signal, as well as feeding the amplifier directly. The datasheet of the TPL740F33 does seem to imply that if receiving 3V3 it can still generate 3V3 so it might be ok? The amplifier obviously won’t be as powerful though running off 3V3.
Anyway, for now, instead I’ve just opted to use the GPIO again, wired into the expansion sockets with the XIAO removed.
At the XIAO expander end, I’ve used the additional pins rather than the Grove connector, as they support a 5V output.
The downsides to this approach:
- I’m not using the Grove connectors, which would have been really neat.
- I have no access to the four buttons on the XIAO MIDI Synth.
But I do now have access to two I2C Grove connectors, a GPIO Grove, and the RX part of the UART Grove too as well as the on-board display.
If a XIAO SAMD21 is used, then the previous code for USB to the Synth can be used directly – see XIAO ESP32-C3 MIDI Synthesizer – Part 2.
If the XIAO ESP32-C3 is used, then an additional serial MIDI connection is required. This can be connected to the Grove UART connector (using the RX pin, and leaving TX unconnected) or the RX pin of the additional 8-way pin header on the expansion board. Then the code from this will work directly: XIAO ESP32-C3 MIDI Synthesizer – Part 5.
Adding a Display and Program Control
I already have some code that has done this for a XIAO on an expansion board here XIAO SAMD21, Arduino and MIDI – Part 6.
But for this to work usefully with the Synth module, I need to adjust the routing so that MIDI goes from USB to serial, but the program change messages are also sent via serial to the synth module. That has already been address in previous parts, to I just need to merge the code with that from XIAO ESP32-C3 MIDI Synthesizer – Part 4.
This is the result.
There is a bit of jitter on the analog pot, but that is only because I’m using the original fairly simplified algorithm to detect changes. If I was fussed about it, I’d reuse the averaging class from Arduino MIDI Atari Paddles. And to be honest, a capacitor on the pot would probably go quite a long way too…
As a test, I also powered the device from the Grove UART port connecting it as follows:
- Expander GND – GND Synth
- Expander 3V3 – 5V IN Synth
- Expander TX – RX/D6 Synth
- Expander RX – N/C
And this all worked fine. So I think a Grove to Grove lead would work fine if I had access to the Synth’s Grove port.
This does mean that the exact same code can work with the M5 Synth module using a Grove to Grove lead. The downside of this, even though it is a lot simpler in connectivity terms, is that there is now external audio out like there is on the XIAO Synth.
For completeness the same code can be used with the XIAO ESP32-C3 and serial MIDI, see the photo at the start of this blog.
To turn off all USB handling in the code, the following must be commented out:
//#define HAS_USB
//#define SER_TO_USB
//#define MIDI_USB_PCCCFor other parts of the code, the Arduino abstraction for A0 maps over to the ESP32-C3 fine. The only thing to watch out for is the increased analog resolution from 10 to 12 bits, but a call to analogReadResolution(10) drops that back to the expected 10 bits.
Oh and the Serial port to use is different:
- XIAO SAMD21: Serial1
- XIAO ESP32-C3: Serial0
Closing Thoughts
If I can be bothered, it would be nice to actually display the General MIDI voice name on the display. The SAM2695 also has its MT-32 mode, so having some means of selecting that might be interesting too.
And so far I’ve largely only messed about with driving it on a single MIDI channel, so there is a lot more that could be done there.
Kevin
#controlChange #esp32c3 #midi #programChange #SAM2695 #samd21 #usbMidi #xiao
-
XIAO ESP32-C3 MIDI Synthesizer – Part 6
Expanding on my previous posts, I thought it might be interesting to see how I might be able to add some additional IO to the MIDI Synth. This is an exploration of some options there.
- Part 1 – Getting started and getting code running.
- Part 2 – Swapping the ESP32-C3 for a SAMD21 to get USB MIDI.
- Part 3 – Taking a deeper look at the SAM2695 itself.
- Part 4 – A USB MIDI Synth Module using the SAMD21 again as a USB MIDI Host.
- Part 5 – A Serial MIDI Synth Module using the original ESP32-C3.
- Part 6 – Pairs the Synth with a XIAO Expansion board to add display and potentiometers.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- Getting Started with the XIAO MIDI Synthesizer
- XIAO SAMD21, Arduino and MIDI
- XIAO SAMD21, Arduino and MIDI – Part 6
If you are new to microcontrollers, see the Getting Started pages.
The Synth Grove Connector
One option to immediately explore for me was the Grove connector on the Synth – highlighted by the blue rectangle in the photo below. I’m thinking at this stage of the XIAO Expander Module (more here) and how that might give some options for easily hooking up to the Synth.
There one obvious issue with this, and one not so obvious issue.
First, of course, there is no access to this connector through the case. My initial thought was to simply remove the PCB from the case and use it as a stand-alone board. On initial inspection it seemed that there were two screws holding it down. Not so, a more thorough inspection (after remove the two screws and still not being able to remove it), revealed a third screw underneath the “light pipe” for the LEDs.
Unfortunately that light pipe is pretty well wedged into the case making removal particularly tricky. But without removing the light pipe, it isn’t possible to get to the screw at all.
I did wonder about making a hole in the 3D printed case. A better option might be to get hold of the published 3D print files and add a hole and make my own (they are available via the product page).
But both options would probably end up changing the original case somehow – even if printing my own, I still need to get the original PCB out somehow and that brings me back to the light pipe issue.
The second issue isn’t quite so obvious. In that photo we can see that the pins for the Grove connector are labelled as follows (top to bottom):
- NC
- TX
- 5V
- GND
The UART on the XIAO expander board, which I’d like to use, is labelled:
- RX7
- TX6
- 3V3
- GND
Checking in with the Synth schematic, the connector is wired as follows:
SYS_MIDI connects to the MIDI_IN pin of the SAM2695, so actually connecting “TX to TX” in this instance should be ok.
5V might be an issue though, as it really does look like (to me) that it really means 5V – it is the input to the TPL740F33 that generates the 3V3 power signal, as well as feeding the amplifier directly. The datasheet of the TPL740F33 does seem to imply that if receiving 3V3 it can still generate 3V3 so it might be ok? The amplifier obviously won’t be as powerful though running off 3V3.
Anyway, for now, instead I’ve just opted to use the GPIO again, wired into the expansion sockets with the XIAO removed.
At the XIAO expander end, I’ve used the additional pins rather than the Grove connector, as they support a 5V output.
The downsides to this approach:
- I’m not using the Grove connectors, which would have been really neat.
- I have no access to the four buttons on the XIAO MIDI Synth.
But I do now have access to two I2C Grove connectors, a GPIO Grove, and the RX part of the UART Grove too as well as the on-board display.
If a XIAO SAMD21 is used, then the previous code for USB to the Synth can be used directly – see XIAO ESP32-C3 MIDI Synthesizer – Part 2.
If the XIAO ESP32-C3 is used, then an additional serial MIDI connection is required. This can be connected to the Grove UART connector (using the RX pin, and leaving TX unconnected) or the RX pin of the additional 8-way pin header on the expansion board. Then the code from this will work directly: XIAO ESP32-C3 MIDI Synthesizer – Part 5.
Adding a Display and Program Control
I already have some code that has done this for a XIAO on an expansion board here XIAO SAMD21, Arduino and MIDI – Part 6.
But for this to work usefully with the Synth module, I need to adjust the routing so that MIDI goes from USB to serial, but the program change messages are also sent via serial to the synth module. That has already been address in previous parts, to I just need to merge the code with that from XIAO ESP32-C3 MIDI Synthesizer – Part 4.
This is the result.
There is a bit of jitter on the analog pot, but that is only because I’m using the original fairly simplified algorithm to detect changes. If I was fussed about it, I’d reuse the averaging class from Arduino MIDI Atari Paddles. And to be honest, a capacitor on the pot would probably go quite a long way too…
As a test, I also powered the device from the Grove UART port connecting it as follows:
- Expander GND – GND Synth
- Expander 3V3 – 5V IN Synth
- Expander TX – RX/D6 Synth
- Expander RX – N/C
And this all worked fine. So I think a Grove to Grove lead would work fine if I had access to the Synth’s Grove port.
This does mean that the exact same code can work with the M5 Synth module using a Grove to Grove lead. The downside of this, even though it is a lot simpler in connectivity terms, is that there is now external audio out like there is on the XIAO Synth.
For completeness the same code can be used with the XIAO ESP32-C3 and serial MIDI, see the photo at the start of this blog.
To turn off all USB handling in the code, the following must be commented out:
//#define HAS_USB
//#define SER_TO_USB
//#define MIDI_USB_PCCCFor other parts of the code, the Arduino abstraction for A0 maps over to the ESP32-C3 fine. The only thing to watch out for is the increased analog resolution from 10 to 12 bits, but a call to analogReadResolution(10) drops that back to the expected 10 bits.
Oh and the Serial port to use is different:
- XIAO SAMD21: Serial1
- XIAO ESP32-C3: Serial0
Closing Thoughts
If I can be bothered, it would be nice to actually display the General MIDI voice name on the display. The SAM2695 also has its MT-32 mode, so having some means of selecting that might be interesting too.
And so far I’ve largely only messed about with driving it on a single MIDI channel, so there is a lot more that could be done there.
Kevin
#controlChange #esp32c3 #midi #programChange #SAM2695 #samd21 #usbMidi #xiao
-
XIAO USB Device to Serial MIDI Converter
Having recently revisited the CircuitPython USB to Serial MIDI Router as part of XIAO ESP32-C3 MIDI Synthesizer – Part 2 it reminded me I didn’t really have a simple Arduino USB device to serial MIDI for the XIAO. So this is filling that gap.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key Arduino tutorials for the main concepts used in this project:
If you are new to Arduino, see the Getting Started pages.
Parts list
- XIAO SAMD21
- Serial MIDI module
- Breadboard and jumper wires
The Circuit
A 3V3 serial module can be hooked up to the TX/RX pins of the XIAO as shown above.
The Code
This is largely a simplification of the code used for XIAO SAMD21, Arduino and MIDI – Part 4 to use just the standard serial port and USB device MIDI.
There is one option at the top to determine how the serial port ought to be routed. There are two options:
- Serial to USB. This allows a full bi-directional serial <-> USB.
- Serial to Serial. This allows both USB and Serial RX to route to Serial TX.
In the other direction, USB always gets routed to the Serial port.
Closing Thoughts
Often I find I’ve missed out a simpler use-case in pursuit of a more complex one. This was one of those times so hopefully that is now fixed.
In the above photo I’m using it as a USB to serial router for my M5 Stack Synth module based on the SAM2695 that I’ve been playing with. The Synth is powered from the XIAO’s 5V and GND and connected to the TX/D6 pin. This allows me to use USB MIDI which gets routed to the M5 Synth hanging off the XIAO TX pin.
There is more on that particular synth chip here: XIAO ESP32-C3 MIDI Synthesizer – Part 3.
Kevin
-
XIAO USB Device to Serial MIDI Converter
Having recently revisited the CircuitPython USB to Serial MIDI Router as part of XIAO ESP32-C3 MIDI Synthesizer – Part 2 it reminded me I didn’t really have a simple Arduino USB device to serial MIDI for the XIAO. So this is filling that gap.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key Arduino tutorials for the main concepts used in this project:
If you are new to Arduino, see the Getting Started pages.
Parts list
- XIAO SAMD21
- Serial MIDI module
- Breadboard and jumper wires
The Circuit
A 3V3 serial module can be hooked up to the TX/RX pins of the XIAO as shown above.
The Code
This is largely a simplification of the code used for XIAO SAMD21, Arduino and MIDI – Part 4 to use just the standard serial port and USB device MIDI.
There is one option at the top to determine how the serial port ought to be routed. There are two options:
- Serial to USB. This allows a full bi-directional serial <-> USB.
- Serial to Serial. This allows both USB and Serial RX to route to Serial TX.
In the other direction, USB always gets routed to the Serial port.
Closing Thoughts
Often I find I’ve missed out a simpler use-case in pursuit of a more complex one. This was one of those times so hopefully that is now fixed.
In the above photo I’m using it as a USB to serial router for my M5 Stack Synth module based on the SAM2695 that I’ve been playing with. The Synth is powered from the XIAO’s 5V and GND and connected to the TX/D6 pin. This allows me to use USB MIDI which gets routed to the M5 Synth hanging off the XIAO TX pin.
There is more on that particular synth chip here: XIAO ESP32-C3 MIDI Synthesizer – Part 3.
Kevin
-
EclairM0, the pocket notepad - Roughly the size of a Tic Tac container, this project packs a punch in a compact p... - https://hackaday.com/2025/04/28/eclairm0-the-pocket-notepad/ #handheldshacks #oledssd1306 #samd21 #tinygo #t9
-
EclairM0, the pocket notepad - Roughly the size of a Tic Tac container, this project packs a punch in a compact p... - https://hackaday.com/2025/04/28/eclairm0-the-pocket-notepad/ #handheldshacks #oledssd1306 #samd21 #tinygo #t9
-
EclairM0, the pocket notepad - Roughly the size of a Tic Tac container, this project packs a punch in a compact p... - https://hackaday.com/2025/04/28/eclairm0-the-pocket-notepad/ #handheldshacks #oledssd1306 #samd21 #tinygo #t9
-
EclairM0, the pocket notepad - Roughly the size of a Tic Tac container, this project packs a punch in a compact p... - https://hackaday.com/2025/04/28/eclairm0-the-pocket-notepad/ #handheldshacks #oledssd1306 #samd21 #tinygo #t9
-
EclairM0, the pocket notepad - Roughly the size of a Tic Tac container, this project packs a punch in a compact p... - https://hackaday.com/2025/04/28/eclairm0-the-pocket-notepad/ #handheldshacks #oledssd1306 #samd21 #tinygo #t9
-
Michael Bauer, maker of the DIY REMI electronic wind instrument, has just published all the design and build notes from a pretty neat Samd21 based synth, designed for an Adafruit Itsy-Bitsy M0.
There is a very comprehensive build guide and all code is for the Arduino environment and up on GitHub.
Read more here: https://www.mjbauer.biz/Sigma6_M0_synth_weblog.htm
I always learn a lot from his writeups :)
-
@scruss It's my own left-handed version of a #MicroWriter programmed using @microblocks on an #SAMD21 board. Been in the planning stage for 30 years :)
-
Just to help anyone else using one of these #AliExpress #SAMD21 #M0 boards, pin marked D2 is actually pin4 and pin marked D4 is pin2
https://vi.aliexpress.com/item/4000169610268.html?spm=a2g0o.order_list.order_list_main.10.75281802K6zj5w&gatewayAdapt=glo2vnm -
Just to help anyone else using one of these #AliExpress #SAMD21 #M0 boards, pin marked D2 is actually pin4 and pin marked D4 is pin2
https://vi.aliexpress.com/item/4000169610268.html?spm=a2g0o.order_list.order_list_main.10.75281802K6zj5w&gatewayAdapt=glo2vnm -
Just to help anyone else using one of these #AliExpress #SAMD21 #M0 boards, pin marked D2 is actually pin4 and pin marked D4 is pin2
https://vi.aliexpress.com/item/4000169610268.html?spm=a2g0o.order_list.order_list_main.10.75281802K6zj5w&gatewayAdapt=glo2vnm -
Just to help anyone else using one of these #AliExpress #SAMD21 #M0 boards, pin marked D2 is actually pin4 and pin marked D4 is pin2
https://vi.aliexpress.com/item/4000169610268.html?spm=a2g0o.order_list.order_list_main.10.75281802K6zj5w&gatewayAdapt=glo2vnm -
Just to help anyone else using one of these #AliExpress #SAMD21 #M0 boards, pin marked D2 is actually pin4 and pin marked D4 is pin2
https://vi.aliexpress.com/item/4000169610268.html?spm=a2g0o.order_list.order_list_main.10.75281802K6zj5w&gatewayAdapt=glo2vnm -
Keebin’ with Kristina: the One with the DIY Homing Keys https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #PeripheralsHacks #HackadayColumns #supercapacitor #CherryMXblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #SAMD21 #FandJ
-
Keebin’ with Kristina: the One with the DIY Homing Keys https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #PeripheralsHacks #HackadayColumns #supercapacitor #CherryMXblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #SAMD21 #FandJ
-
Keebin’ with Kristina: the One with the DIY Homing Keys https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #PeripheralsHacks #HackadayColumns #supercapacitor #CherryMXblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #SAMD21 #FandJ
-
Keebin’ with Kristina: the One with the DIY Homing Keys https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #PeripheralsHacks #HackadayColumns #supercapacitor #CherryMXblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #SAMD21 #FandJ
-
Keebin’ with Kristina: the One with the DIY Homing Keys - r/keebgirlies Is Totally a Thing Now
When [coral-bells] posted her first build to ... - https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #peripheralshacks #hackadaycolumns #supercapacitor #cherrymxblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #samd21 #fandj -
Keebin’ with Kristina: the One with the DIY Homing Keys - r/keebgirlies Is Totally a Thing Now
When [coral-bells] posted her first build to ... - https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #peripheralshacks #hackadaycolumns #supercapacitor #cherrymxblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #samd21 #fandj -
Keebin’ with Kristina: the One with the DIY Homing Keys - r/keebgirlies Is Totally a Thing Now
When [coral-bells] posted her first build to ... - https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #peripheralshacks #hackadaycolumns #supercapacitor #cherrymxblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #samd21 #fandj -
Keebin’ with Kristina: the One with the DIY Homing Keys - r/keebgirlies Is Totally a Thing Now
When [coral-bells] posted her first build to ... - https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #peripheralshacks #hackadaycolumns #supercapacitor #cherrymxblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #samd21 #fandj -
Keebin’ with Kristina: the One with the DIY Homing Keys - r/keebgirlies Is Totally a Thing Now
When [coral-bells] posted her first build to ... - https://hackaday.com/2025/01/28/keebin-with-kristina-the-one-with-the-diy-homing-keys/ #peripheralshacks #hackadaycolumns #supercapacitor #cherrymxblues #ballbearings #photovoltaic #keebgirlies #homingkeys #arduino #samd21 #fandj -
2024 Tiny Games Contest: Micro One-Armed Bandit Hits the Cuteness Jackpot https://hackaday.com/2024/09/11/2024-tiny-games-contest-micro-one-armed-bandit-hits-the-cuteness-jackpot/ #2024TinyGamesChallenge #contests #SAMD21 #Games #QTPy
-
2024 Tiny Games Contest: Micro One-Armed Bandit Hits the Cuteness Jackpot - They don’t call slot machines one-armed bandits for nothing. And although it’s get... - https://hackaday.com/2024/09/11/2024-tiny-games-contest-micro-one-armed-bandit-hits-the-cuteness-jackpot/ #2024tinygameschallenge #contests #samd21 #games #qtpy
-
2024 Business Card Challenge: Tiny MIDI Keyboard - The progress for electronics over the past seven decades or so has always trended ... - https://hackaday.com/2024/06/06/2024-business-card-challenge-tiny-midi-keyboard/ #2024businesscardchallenge #musicalhacks #seeedstudio #instrument #keyboard #arduino #finale #samd21 #music #midi
-
2024 Business Card Challenge: Tiny MIDI Keyboard https://hackaday.com/2024/06/06/2024-business-card-challenge-tiny-midi-keyboard/ #2024BusinessCardChallenge #MusicalHacks #seeedstudio #instrument #keyboard #arduino #finale #SAMD21 #music #midi
-
I was browsing some of the newer ATtiny chips the other day and started to make a note of some of their properties and it made me realise I actually have quite a few different microcontrollers at my disposal and many more I could be having a look at.
But having committed to not attempting to get hold of every variant of every device to put a MIDI interface on it, I thought it would still be worth a post summarising some of the features to make selecting them in the future a little easier.
There are many comparison charts and tables online, but this is my own summary of the things that are important to me right now in terms of using them for musical purposes.
Note: I think the data is correct at the time of writing. Feel free to let me know of any mistakes. Also feel free to let me know what microcontrollers you use for music, and why, in the comments.
8-bit Microcontrollers
MCUFreqPWRGPIOADCPWMDACCommsRAMFlashATmega328P16MHz2.7-5.5V236/860UART, I2C, SPI2K32KATmega32U416MHz2.7-5.5V261280UART, I2C, SPI, USB2.5K32KATtiny858/20MHz2.7-5.5V6460USI5128KATtiny8812MHz2.7-5.5V28620I2C, SPI5128KATtiny21(2|4)
ATtiny41(2|4|6)20MHz1.8-5.5V6|12
6|12|186|10
6|10|1261UART, I2C, SPI128
2562K
4K32-bit Microcontrollers
MCUFreqPWRFPUGPIOADCPWMDACCommsRAMFlashSAMD21 (M0+)48MHz1.6-3.6VN30/381430?1SERCOM, I2S, USB4-32K32-256KSAMD51 (M4)120MHz1.6-3.6VY513237?1SERCOM, I2S, USB128-256256-1024KRP2040 (2xM0+)133MHz3.3VN304110UART, I2C, SPI, USB, PIO264KexternalESP32 (LX6)160MHz3.0-3.6VY3418162UART, I2C, SPI, I2S, Wi-Fi, BT0-2M0-4MESP32-S2 (LX7)240MHz2.8-3.6VN?432080UART, I2C, SPI, I2S, Wi-Fi0-2M0-2-4MESP32-S3 (2xLX7)240MHz3.0-3.6VY452080UART, I2C, SPI, I2S, Wi-Fi, BT0-2-8-16M0-4-8MESP32-A1S (2xLX6)240MHx3.0-3.6VY?14??2UART, I2C, SPI, I2S520K+4M0?Points of Note
- The ATmega and ATtiny devices are all 8-bit AVR architecture and might be either 3V3 or 5V operation depending on the device. Whereas the others are all 32-bit, 3V3 operation, and either ARM or Tensilica Xtensa architectures.
- The SAMD51, ESP32 and ESP32-S3 are all interesting as they include a floating point unit, which might be useful if I get into requiring mathematical synthesis.
- ATtiny2xx, ATtiny4xx, SAMD21, SAMD51, ESP32 all include a DAC which would be really useful for generating control voltages.
- ATmega32U4, SAMD21, SAMD51, RP2040 all support USB directly.
- The last one is an interesting device. The ESP32-A1S is a single module that includes an ESP32 and a CODEC module. More recent versions use the ES8388 and support two audio in/out channels. There is an Espressif Audio Development Framework for use with all ESP32-based devices.
Other MCUs of possible interest might include some of the newer RISC-V devices (e.g. ESP32-C3), the STM32 device range (the higher performing devices include floating point support, for example), the Teensy boards (which have a strong following for audio applications), and even running with the broadcom devices used on the various Raspberry Pis in “bare metal” mode.
A key tradeoff already would be choosing between a more powerful, probably 32-bit, 3V3 logic devices or a less capable 5V device.
Development Boards
I’m unlikely to be working with a microcontroller directly though, given my own level of knowledge, so I’m probably going to be looking at some kind of development board.
The following could all be possibilities if I’m happy running at 3V3.
Note, many of the form-factors, e.g. Adafruit’s QT Py or Feather, support most of the architectures – but not all are listed – just those I have or might consider. I’ve also added in some other boards that I know are often used (or shout about being used) for audio applications.
Prices are approximate at time of writing (Feb 2024).
BoardMCUArchSpeedRAM/FlashFPUGPIOADCPWMI2SDACCostRPi PicoRP20402xM0+133MHz264K/2MN27316PIO0£4XIAOSAMD21M0+48MHz32K/256KN14111111£6XIAORP20402xM0+133MHz264K/2MN11411PIO0£6XIAOESP32-S32xLX7240MHz8M/8MY1191110£8XIAOESP32-C3RISC-V160MHz4K/4M?114110£6QT PySAMD21M0+48MHz32K/256KN119911£9QT PyRP20402xM0+125MHz264K/8MN13413PIO0£10QT PyESP32-S32xLX7240MHz512K+2M/4MY13101310£15TrinketSAMD21M0+48MHz32K/256KN55211£9ItsyBitsySAMD21M0+48MHz32K/256KN23111311£12ItsyBitsySAMD51M4120MHz192K/512K+2MN2371812£15FeatherSAMD21M0+48MHz32K/256KN2062011£19FeatherSAMD51M4120MHz192K/512K+2MY2161612£23FeatherRP20402xM0+125MHz264K/8MN21416PIO0£12FeatherESP32-S32xLX7240MHz2M/4MY2162110£17BananaPicoWESP32-S32xLX7240MHz512K/2M+8MY2718810£4WROOM32ESP322xLX6<240MHz500K/448K+4MY34152512£3Teensy 3.6MK66FX1M4F180MHz256K/1MY64252212N/ATeensy 4.0IMXRT1062M7600MHz1M/2MY40143120£26Teensy 4.1IMXRT1062M7600MHz1M/8MY55183520£30Arduino MKR ZeroSAMD21M0+48MHz32K/256KN2271311£30Arduino Giga R1STM32H747XM7
M4480MHz
240MHz1M/2M?761413?2£70It is interesting to note which boards support a DAC and which support I2S, both very useful for audio applications and the number of ADCs is relevant too.
Boards specifically designed for audio processing, which I’ve no direct experience of, include:
- Pico ADK – A RP2040 based “audio development kit” with 8 ADCs and SPI DAC.
- Daisy Seed – an ARM Cortex-M7 with audio IO designed for DSP and audio applications (£35)
- Bela and Bela Mini – designed for use with Beaglebone for real-time, low-latency audio processing (~£130-£160).
And it is worth noting that the Teensy has many features well suited to audio processing, including a dedicated software audio toolkit (see below).
Software Audio Frameworks
There are a number of software frameworks for use with some of the above for audio processing:
- Phil Schatzmann’s Arduino Audio Tools.
- Espressif’s Audio Development Framework.
- The Arduino Sound Library.
- Marcel-Licence’s ML Synth Tools for ESP32.
- Teensy Audio Library.
- Arduino Giga R1 Advanced ADCDAC Applications.
- Adafruit’s CircuitPython synthio.
There is a bit of discussion about these here: Arduino Audio and MIDI Frameworks.
Closing Thoughts
I expect this page will evolve with new information, but it will be good to have a single post to refer back to.
Kevin
https://diyelectromusic.wordpress.com/2024/05/07/selecting-microcontrollers-for-music/
#adafruit #arduino #attiny #esp32 #raspberryPi #raspberryPiPico #samd21 #samd51 #teensy
-
So, the tool chain works, but how to get the startup code a little sturdier? So I guess that means - how to write the interrupt vector table? How to zero the bss?
How to do it all with the thumb instruction set in assembly... okay! Sleeves up.
https://www.whynotestflight.com/excuses/how-can-i-get-this-samd21e18-startup-code-a-little-sturdier/
And finally a repo
https://github.com/carlynorama/StrippedDownChipRosetta
#arm-gcc, #arm, #assembly, #trinketm0, #samd21, ,#doireallyhavetocallthis, #baremetal
-
Now it's ARM's turn, Specifically the Core M0 SAMD21E18
There isn't quite the same perfect playlist (although plenty of great resources!) for what I wanted so this will be multi part to get to a "good" place. This post is mostly about the tool chain (arm-gcc/OpenOCD/gdb)
Hardware is the the Adafruit PyRuler which is a fancy Trinket M0
https://www.whynotestflight.com/excuses/how-can-i-make-programming-an-arm-chip-as-hard-as-possible/
Shout out to:
https://vivonomicon.com/2018/04/02/bare-metal-stm32-programming-part-1-hello-arm/#arm, #SAMD21, #assembly, #gdb, #openocd, #jlink, #embedded, #TrinketM0
-
One of my most proud of plot. Geeky, chuck-full of data, and _nice_ .
https://forums.adafruit.com/viewtopic.php?p=903215#p903215
The two small vertical lines at the base correspond to the clock jitter width I measured with a Feather M0 which uses XOSC32K since there's a crystal on the board (the jitter is then as small as ± 0.02 ms).
#matplotlib #SAMD21 #microcontrollers #electronic #atomicsynchronator -
I'm looking to upgrade my USB-C Plug Tester from #SAMD21 to #RP2040. The #USBC Plug #connector hasn't been that reliable so I'm looking at alternatives / asking for suggestions (preferably with a footprint I can create within JLCPCB capabilities). #Electronics
-
Arduino Audio and MIDI Frameworks
I’ve been collecting bookmarks for interesting Arduino audio projects for a while now, and having now played with the XIAO SAMD21 I started looking back over my list for other things to try. One thing that occurred to me is that there are a now a number of more powerful audio frameworks available for a range of microcontrollers, so in this post I’m doing an introductory “look see” at some of them, largely as “notes to self” to come back to them for some more detailed projects in the future.
Note: Many of these require a 32-bit processor, which is one of the reasons I’ve not looked at them so far.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Mozzi
I’ve spent quite a bit of time with Mozzi of course, the synthesis library for Arduino that supports a large range of microcontrollers, including the “original” 8-bit Arduino ATmega328P, so I won’t go over that again here.
For a starting point with Mozzi, see: Arduino PWM MIDI Synthesis with Mozzi. For using Mozzi on a 32-bit SAMD processor, there is more here and here.
But Mozzi isn’t the only game in town, especially if we’re expanding out to 32-bit microcontrollers.
The Arduino Sound Library
https://www.arduino.cc/reference/en/libraries/arduinosound/
This is an official Arduino library that supports SAMD21 based microcontrollers using an I2S digital to analog converter. It is designed for the MKR series of official Arduino boards.
Interestingly it appears to only support I2S audio devices for sound input and output. That seems like a little bit of a missed opportunity to me in that the SAMD21 has a built-in DAC, but I guess analogWrite() deals with access to the DAC relatively easily.
It is designed for official Arduino SAMD architecture boards – so those in the MKR series. It might work on other SAMD architecture boards, I haven’t looked into it in detail.
Phil Schatzmann’s Arduino Audio Tools
https://github.com/pschatzmann/arduino-audio-tools
This is a suite of open source code for audio stream processing, providing a range of audio sources (e.g. microphones, Internet streams, files, sensors, and so on) and sinks (e.g. DACs, PWM audio, MP3, codecs, audio modules, etc).
It can be used to build audio players, processors, effects, file processors, audio visualisers, networked audio tools, and so on.
I believe it supports the following microcontroller architectures:
- ESP32 (S and C variants)
- ESP8266
- RP2040 (MBED and non-MBED)
- AVR
- STM32
- SAMD
It supports several audio output boards too, including: ESP32-A1S based boards (ES8388 or AC101 codecs); VS1053 modules; and WM8960 modules.
I believe this is a library for audio processing, not necessarily audio synthesis.
Marcel Licence’s ML Synth Tools
https://github.com/marcel-licence/ML_SynthTools
This is a comprehensive synth library for producing synthesizers, organs and effects. Most of the code is open source, but there are certain key elements that are provided only in pre-built library form.
It provides libraries for the following microcontrollers:
- ESP32
- ESP8266
- XIAO SAMD21
- Teensy 4.1
- Daisy Seed
- Raspberry Pi Pico RP2040
- STM32F407
As well as the synthesizer core oscillators there are modules for arpeggiators, effects, meters, scopes, and MIDI file playing. Here are some example builds using the library:
- ML Organ (all platforms): https://github.com/marcel-licence/ml_synth_organ_example
- SAMD21 Synth: https://github.com/marcel-licence/samd21_mini_synth
- ML Synth (all platforms): https://github.com/marcel-licence/ml_synth_basic_example
- ESP32 FM synth: https://github.com/marcel-licence/esp32_fm_synth
- ESP32/RP2040 e-piano: https://github.com/marcel-licence/ml_epiano_example
Although it isn’t fully open source, this non-the-less looks like it would be worth taking a more detailed look. The provided videos of Marcel playing are particularly excellent.
MIDI Controller Libraries
There are a number of Arduino libraries for building MIDI controllers. Here are a selection of some that I’ve found so far.
OpenDesk MIDI Platform – https://github.com/shanteacontrols/OpenDeck
This is a set of firmware and two official PCB designs for MIDI controllers. In addition to the official boards, it also supports many microcontrollers, including:
- Arduino Mega 2560
- Arduino Nano 33 BLE
- Raspberry Pi Pico
- XIAO RP2040
- Teensy++ 2.0
And many others. It includes a web-based configuration utility for defining the MIDI commands for the controls. Official boards are available on Tindie and you can read more about them here: https://shanteacontrols.com/.
It supports a range of buttons, encoders, potentiometers, force sensitive resistors, certain touchscreens and can provided feedback using LEDs and displays.
Control Surface – https://github.com/tttapa/Control-Surface
This is a general purpose library for building MIDI input and output control devices. It supports a wide range of microcontrollers, including:
- AVR (Uno, Mega, Leonardo).
- Arduino Nano Every and 33.
- Teensy.
- ESP8266
- ESP32
- Raspberry Pi Pico
It supports a range of MIDI transports, including serial, USB, “direct serial” (using Hairless MIDI) and MIDI BLE. It also supports a range of buttons, potentiometers, rotary encoders, switches, keyboard matrices, and so on and can provide visual feedback using a range of LEDS and displays. It has built-in support for multiplexers, shift registers and LED drivers.
It includes a huge number of example projects to browse.
MIDIPal – https://github.com/pichenettes/midipal
This is a “MIDI Swiss Army Knife” that, with the additional of a display and rotary encoder, can provide a wide range of MIDI processing functions. It includes an editor application for programming MIDI filters.
This is a “native” AVR application, not for the Arduino environment.
Notes and Volts MIDI Controller – https://www.notesandvolts.com/2016/04/arduino-midi-controller-buttons.html
This is provided for completeness as it is a fairly common codebase for people to find and use with an Arduino. It supports a range of potentiometers and buttons and makes the task of configuring them as a MIDI control device relatively straight forward.
Closing Thoughts
As I say, this post is really almost a bit of a “to-do list” of things that look interesting and that I might try to take a more detailed look at, at some point.
If you have experience of any of these frameworks or libraries; or have suggestions of others that might be worth a look, do let me know in the comments!
Kevin
#ArduinoAudioTools #ControlSurface #dac #esp32 #fmSynthesis #i2s #midi #midiController #MIDIPal #MLSynthTools #mozzi #OpenDesk #pwm #rp2040 #samd21 #synthesis #xiao -
Arduino Audio and MIDI Frameworks
I’ve been collecting bookmarks for interesting Arduino audio projects for a while now, and having now played with the XIAO SAMD21 I started looking back over my list for other things to try. One thing that occurred to me is that there are a now a number of more powerful audio frameworks available for a range of microcontrollers, so in this post I’m doing an introductory “look see” at some of them, largely as “notes to self” to come back to them for some more detailed projects in the future.
Note: Many of these require a 32-bit processor, which is one of the reasons I’ve not looked at them so far.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Mozzi
I’ve spent quite a bit of time with Mozzi of course, the synthesis library for Arduino that supports a large range of microcontrollers, including the “original” 8-bit Arduino ATmega328P, so I won’t go over that again here.
For a starting point with Mozzi, see: Arduino PWM MIDI Synthesis with Mozzi. For using Mozzi on a 32-bit SAMD processor, there is more here and here.
But Mozzi isn’t the only game in town, especially if we’re expanding out to 32-bit microcontrollers.
The Arduino Sound Library
https://www.arduino.cc/reference/en/libraries/arduinosound/
This is an official Arduino library that supports SAMD21 based microcontrollers using an I2S digital to analog converter. It is designed for the MKR series of official Arduino boards.
Interestingly it appears to only support I2S audio devices for sound input and output. That seems like a little bit of a missed opportunity to me in that the SAMD21 has a built-in DAC, but I guess analogWrite() deals with access to the DAC relatively easily.
It is designed for official Arduino SAMD architecture boards – so those in the MKR series. It might work on other SAMD architecture boards, I haven’t looked into it in detail.
Phil Schatzmann’s Arduino Audio Tools
https://github.com/pschatzmann/arduino-audio-tools
This is a suite of open source code for audio stream processing, providing a range of audio sources (e.g. microphones, Internet streams, files, sensors, and so on) and sinks (e.g. DACs, PWM audio, MP3, codecs, audio modules, etc).
It can be used to build audio players, processors, effects, file processors, audio visualisers, networked audio tools, and so on.
I believe it supports the following microcontroller architectures:
- ESP32 (S and C variants)
- ESP8266
- RP2040 (MBED and non-MBED)
- AVR
- STM32
- SAMD
It supports several audio output boards too, including: ESP32-A1S based boards (ES8388 or AC101 codecs); VS1053 modules; and WM8960 modules.
I believe this is a library for audio processing, not necessarily audio synthesis.
Marcel Licence’s ML Synth Tools
https://github.com/marcel-licence/ML_SynthTools
This is a comprehensive synth library for producing synthesizers, organs and effects. Most of the code is open source, but there are certain key elements that are provided only in pre-built library form.
It provides libraries for the following microcontrollers:
- ESP32
- ESP8266
- XIAO SAMD21
- Teensy 4.1
- Daisy Seed
- Raspberry Pi Pico RP2040
- STM32F407
As well as the synthesizer core oscillators there are modules for arpeggiators, effects, meters, scopes, and MIDI file playing. Here are some example builds using the library:
- ML Organ (all platforms): https://github.com/marcel-licence/ml_synth_organ_example
- SAMD21 Synth: https://github.com/marcel-licence/samd21_mini_synth
- ML Synth (all platforms): https://github.com/marcel-licence/ml_synth_basic_example
- ESP32 FM synth: https://github.com/marcel-licence/esp32_fm_synth
- ESP32/RP2040 e-piano: https://github.com/marcel-licence/ml_epiano_example
Although it isn’t fully open source, this non-the-less looks like it would be worth taking a more detailed look. The provided videos of Marcel playing are particularly excellent.
MIDI Controller Libraries
There are a number of Arduino libraries for building MIDI controllers. Here are a selection of some that I’ve found so far.
OpenDesk MIDI Platform – https://github.com/shanteacontrols/OpenDeck
This is a set of firmware and two official PCB designs for MIDI controllers. In addition to the official boards, it also supports many microcontrollers, including:
- Arduino Mega 2560
- Arduino Nano 33 BLE
- Raspberry Pi Pico
- XIAO RP2040
- Teensy++ 2.0
And many others. It includes a web-based configuration utility for defining the MIDI commands for the controls. Official boards are available on Tindie and you can read more about them here: https://shanteacontrols.com/.
It supports a range of buttons, encoders, potentiometers, force sensitive resistors, certain touchscreens and can provided feedback using LEDs and displays.
Control Surface – https://github.com/tttapa/Control-Surface
This is a general purpose library for building MIDI input and output control devices. It supports a wide range of microcontrollers, including:
- AVR (Uno, Mega, Leonardo).
- Arduino Nano Every and 33.
- Teensy.
- ESP8266
- ESP32
- Raspberry Pi Pico
It supports a range of MIDI transports, including serial, USB, “direct serial” (using Hairless MIDI) and MIDI BLE. It also supports a range of buttons, potentiometers, rotary encoders, switches, keyboard matrices, and so on and can provide visual feedback using a range of LEDS and displays. It has built-in support for multiplexers, shift registers and LED drivers.
It includes a huge number of example projects to browse.
MIDIPal – https://github.com/pichenettes/midipal
This is a “MIDI Swiss Army Knife” that, with the additional of a display and rotary encoder, can provide a wide range of MIDI processing functions. It includes an editor application for programming MIDI filters.
This is a “native” AVR application, not for the Arduino environment.
Notes and Volts MIDI Controller – https://www.notesandvolts.com/2016/04/arduino-midi-controller-buttons.html
This is provided for completeness as it is a fairly common codebase for people to find and use with an Arduino. It supports a range of potentiometers and buttons and makes the task of configuring them as a MIDI control device relatively straight forward.
Closing Thoughts
As I say, this post is really almost a bit of a “to-do list” of things that look interesting and that I might try to take a more detailed look at, at some point.
If you have experience of any of these frameworks or libraries; or have suggestions of others that might be worth a look, do let me know in the comments!
Kevin
#ArduinoAudioTools #ControlSurface #dac #esp32 #fmSynthesis #i2s #midi #midiController #MIDIPal #MLSynthTools #mozzi #OpenDesk #pwm #rp2040 #samd21 #synthesis #xiao -
Arduino Audio and MIDI Frameworks
I’ve been collecting bookmarks for interesting Arduino audio projects for a while now, and having now played with the XIAO SAMD21 I started looking back over my list for other things to try. One thing that occurred to me is that there are a now a number of more powerful audio frameworks available for a range of microcontrollers, so in this post I’m doing an introductory “look see” at some of them, largely as “notes to self” to come back to them for some more detailed projects in the future.
Note: Many of these require a 32-bit processor, which is one of the reasons I’ve not looked at them so far.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Mozzi
I’ve spent quite a bit of time with Mozzi of course, the synthesis library for Arduino that supports a large range of microcontrollers, including the “original” 8-bit Arduino ATmega328P, so I won’t go over that again here.
For a starting point with Mozzi, see: Arduino PWM MIDI Synthesis with Mozzi. For using Mozzi on a 32-bit SAMD processor, there is more here and here.
But Mozzi isn’t the only game in town, especially if we’re expanding out to 32-bit microcontrollers.
The Arduino Sound Library
https://www.arduino.cc/reference/en/libraries/arduinosound/
This is an official Arduino library that supports SAMD21 based microcontrollers using an I2S digital to analog converter. It is designed for the MKR series of official Arduino boards.
Interestingly it appears to only support I2S audio devices for sound input and output. That seems like a little bit of a missed opportunity to me in that the SAMD21 has a built-in DAC, but I guess analogWrite() deals with access to the DAC relatively easily.
It is designed for official Arduino SAMD architecture boards – so those in the MKR series. It might work on other SAMD architecture boards, I haven’t looked into it in detail.
Phil Schatzmann’s Arduino Audio Tools
https://github.com/pschatzmann/arduino-audio-tools
This is a suite of open source code for audio stream processing, providing a range of audio sources (e.g. microphones, Internet streams, files, sensors, and so on) and sinks (e.g. DACs, PWM audio, MP3, codecs, audio modules, etc).
It can be used to build audio players, processors, effects, file processors, audio visualisers, networked audio tools, and so on.
I believe it supports the following microcontroller architectures:
- ESP32 (S and C variants)
- ESP8266
- RP2040 (MBED and non-MBED)
- AVR
- STM32
- SAMD
It supports several audio output boards too, including: ESP32-A1S based boards (ES8388 or AC101 codecs); VS1053 modules; and WM8960 modules.
I believe this is a library for audio processing, not necessarily audio synthesis.
Marcel Licence’s ML Synth Tools
https://github.com/marcel-licence/ML_SynthTools
This is a comprehensive synth library for producing synthesizers, organs and effects. Most of the code is open source, but there are certain key elements that are provided only in pre-built library form.
It provides libraries for the following microcontrollers:
- ESP32
- ESP8266
- XIAO SAMD21
- Teensy 4.1
- Daisy Seed
- Raspberry Pi Pico RP2040
- STM32F407
As well as the synthesizer core oscillators there are modules for arpeggiators, effects, meters, scopes, and MIDI file playing. Here are some example builds using the library:
- ML Organ (all platforms): https://github.com/marcel-licence/ml_synth_organ_example
- SAMD21 Synth: https://github.com/marcel-licence/samd21_mini_synth
- ML Synth (all platforms): https://github.com/marcel-licence/ml_synth_basic_example
- ESP32 FM synth: https://github.com/marcel-licence/esp32_fm_synth
- ESP32/RP2040 e-piano: https://github.com/marcel-licence/ml_epiano_example
Although it isn’t fully open source, this non-the-less looks like it would be worth taking a more detailed look. The provided videos of Marcel playing are particularly excellent.
MIDI Controller Libraries
There are a number of Arduino libraries for building MIDI controllers. Here are a selection of some that I’ve found so far.
OpenDesk MIDI Platform – https://github.com/shanteacontrols/OpenDeck
This is a set of firmware and two official PCB designs for MIDI controllers. In addition to the official boards, it also supports many microcontrollers, including:
- Arduino Mega 2560
- Arduino Nano 33 BLE
- Raspberry Pi Pico
- XIAO RP2040
- Teensy++ 2.0
And many others. It includes a web-based configuration utility for defining the MIDI commands for the controls. Official boards are available on Tindie and you can read more about them here: https://shanteacontrols.com/.
It supports a range of buttons, encoders, potentiometers, force sensitive resistors, certain touchscreens and can provided feedback using LEDs and displays.
Control Surface – https://github.com/tttapa/Control-Surface
This is a general purpose library for building MIDI input and output control devices. It supports a wide range of microcontrollers, including:
- AVR (Uno, Mega, Leonardo).
- Arduino Nano Every and 33.
- Teensy.
- ESP8266
- ESP32
- Raspberry Pi Pico
It supports a range of MIDI transports, including serial, USB, “direct serial” (using Hairless MIDI) and MIDI BLE. It also supports a range of buttons, potentiometers, rotary encoders, switches, keyboard matrices, and so on and can provide visual feedback using a range of LEDS and displays. It has built-in support for multiplexers, shift registers and LED drivers.
It includes a huge number of example projects to browse.
MIDIPal – https://github.com/pichenettes/midipal
This is a “MIDI Swiss Army Knife” that, with the additional of a display and rotary encoder, can provide a wide range of MIDI processing functions. It includes an editor application for programming MIDI filters.
This is a “native” AVR application, not for the Arduino environment.
Notes and Volts MIDI Controller – https://www.notesandvolts.com/2016/04/arduino-midi-controller-buttons.html
This is provided for completeness as it is a fairly common codebase for people to find and use with an Arduino. It supports a range of potentiometers and buttons and makes the task of configuring them as a MIDI control device relatively straight forward.
Closing Thoughts
As I say, this post is really almost a bit of a “to-do list” of things that look interesting and that I might try to take a more detailed look at, at some point.
If you have experience of any of these frameworks or libraries; or have suggestions of others that might be worth a look, do let me know in the comments!
Kevin
#ArduinoAudioTools #ControlSurface #dac #esp32 #fmSynthesis #i2s #midi #midiController #MIDIPal #MLSynthTools #mozzi #OpenDesk #pwm #rp2040 #samd21 #synthesis #xiao -
Arduino Audio and MIDI Frameworks
I’ve been collecting bookmarks for interesting Arduino audio projects for a while now, and having now played with the XIAO SAMD21 I started looking back over my list for other things to try. One thing that occurred to me is that there are a now a number of more powerful audio frameworks available for a range of microcontrollers, so in this post I’m doing an introductory “look see” at some of them, largely as “notes to self” to come back to them for some more detailed projects in the future.
Note: Many of these require a 32-bit processor, which is one of the reasons I’ve not looked at them so far.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Mozzi
I’ve spent quite a bit of time with Mozzi of course, the synthesis library for Arduino that supports a large range of microcontrollers, including the “original” 8-bit Arduino ATmega328P, so I won’t go over that again here.
For a starting point with Mozzi, see: Arduino PWM MIDI Synthesis with Mozzi. For using Mozzi on a 32-bit SAMD processor, there is more here and here.
But Mozzi isn’t the only game in town, especially if we’re expanding out to 32-bit microcontrollers.
The Arduino Sound Library
https://www.arduino.cc/reference/en/libraries/arduinosound/
This is an official Arduino library that supports SAMD21 based microcontrollers using an I2S digital to analog converter. It is designed for the MKR series of official Arduino boards.
Interestingly it appears to only support I2S audio devices for sound input and output. That seems like a little bit of a missed opportunity to me in that the SAMD21 has a built-in DAC, but I guess analogWrite() deals with access to the DAC relatively easily.
It is designed for official Arduino SAMD architecture boards – so those in the MKR series. It might work on other SAMD architecture boards, I haven’t looked into it in detail.
Phil Schatzmann’s Arduino Audio Tools
https://github.com/pschatzmann/arduino-audio-tools
This is a suite of open source code for audio stream processing, providing a range of audio sources (e.g. microphones, Internet streams, files, sensors, and so on) and sinks (e.g. DACs, PWM audio, MP3, codecs, audio modules, etc).
It can be used to build audio players, processors, effects, file processors, audio visualisers, networked audio tools, and so on.
I believe it supports the following microcontroller architectures:
- ESP32 (S and C variants)
- ESP8266
- RP2040 (MBED and non-MBED)
- AVR
- STM32
- SAMD
It supports several audio output boards too, including: ESP32-A1S based boards (ES8388 or AC101 codecs); VS1053 modules; and WM8960 modules.
I believe this is a library for audio processing, not necessarily audio synthesis.
Marcel Licence’s ML Synth Tools
https://github.com/marcel-licence/ML_SynthTools
This is a comprehensive synth library for producing synthesizers, organs and effects. Most of the code is open source, but there are certain key elements that are provided only in pre-built library form.
It provides libraries for the following microcontrollers:
- ESP32
- ESP8266
- XIAO SAMD21
- Teensy 4.1
- Daisy Seed
- Raspberry Pi Pico RP2040
- STM32F407
As well as the synthesizer core oscillators there are modules for arpeggiators, effects, meters, scopes, and MIDI file playing. Here are some example builds using the library:
- ML Organ (all platforms): https://github.com/marcel-licence/ml_synth_organ_example
- SAMD21 Synth: https://github.com/marcel-licence/samd21_mini_synth
- ML Synth (all platforms): https://github.com/marcel-licence/ml_synth_basic_example
- ESP32 FM synth: https://github.com/marcel-licence/esp32_fm_synth
- ESP32/RP2040 e-piano: https://github.com/marcel-licence/ml_epiano_example
Although it isn’t fully open source, this non-the-less looks like it would be worth taking a more detailed look. The provided videos of Marcel playing are particularly excellent.
MIDI Controller Libraries
There are a number of Arduino libraries for building MIDI controllers. Here are a selection of some that I’ve found so far.
OpenDesk MIDI Platform – https://github.com/shanteacontrols/OpenDeck
This is a set of firmware and two official PCB designs for MIDI controllers. In addition to the official boards, it also supports many microcontrollers, including:
- Arduino Mega 2560
- Arduino Nano 33 BLE
- Raspberry Pi Pico
- XIAO RP2040
- Teensy++ 2.0
And many others. It includes a web-based configuration utility for defining the MIDI commands for the controls. Official boards are available on Tindie and you can read more about them here: https://shanteacontrols.com/.
It supports a range of buttons, encoders, potentiometers, force sensitive resistors, certain touchscreens and can provided feedback using LEDs and displays.
Control Surface – https://github.com/tttapa/Control-Surface
This is a general purpose library for building MIDI input and output control devices. It supports a wide range of microcontrollers, including:
- AVR (Uno, Mega, Leonardo).
- Arduino Nano Every and 33.
- Teensy.
- ESP8266
- ESP32
- Raspberry Pi Pico
It supports a range of MIDI transports, including serial, USB, “direct serial” (using Hairless MIDI) and MIDI BLE. It also supports a range of buttons, potentiometers, rotary encoders, switches, keyboard matrices, and so on and can provide visual feedback using a range of LEDS and displays. It has built-in support for multiplexers, shift registers and LED drivers.
It includes a huge number of example projects to browse.
MIDIPal – https://github.com/pichenettes/midipal
This is a “MIDI Swiss Army Knife” that, with the additional of a display and rotary encoder, can provide a wide range of MIDI processing functions. It includes an editor application for programming MIDI filters.
This is a “native” AVR application, not for the Arduino environment.
Notes and Volts MIDI Controller – https://www.notesandvolts.com/2016/04/arduino-midi-controller-buttons.html
This is provided for completeness as it is a fairly common codebase for people to find and use with an Arduino. It supports a range of potentiometers and buttons and makes the task of configuring them as a MIDI control device relatively straight forward.
Closing Thoughts
As I say, this post is really almost a bit of a “to-do list” of things that look interesting and that I might try to take a more detailed look at, at some point.
If you have experience of any of these frameworks or libraries; or have suggestions of others that might be worth a look, do let me know in the comments!
Kevin
#ArduinoAudioTools #ControlSurface #dac #esp32 #fmSynthesis #i2s #midi #midiController #MIDIPal #MLSynthTools #mozzi #OpenDesk #pwm #rp2040 #samd21 #synthesis #xiao -
Arduino Audio and MIDI Frameworks
I’ve been collecting bookmarks for interesting Arduino audio projects for a while now, and having now played with the XIAO SAMD21 I started looking back over my list for other things to try. One thing that occurred to me is that there are a now a number of more powerful audio frameworks available for a range of microcontrollers, so in this post I’m doing an introductory “look see” at some of them, largely as “notes to self” to come back to them for some more detailed projects in the future.
Note: Many of these require a 32-bit processor, which is one of the reasons I’ve not looked at them so far.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Mozzi
I’ve spent quite a bit of time with Mozzi of course, the synthesis library for Arduino that supports a large range of microcontrollers, including the “original” 8-bit Arduino ATmega328P, so I won’t go over that again here.
For a starting point with Mozzi, see: Arduino PWM MIDI Synthesis with Mozzi. For using Mozzi on a 32-bit SAMD processor, there is more here and here.
But Mozzi isn’t the only game in town, especially if we’re expanding out to 32-bit microcontrollers.
The Arduino Sound Library
https://www.arduino.cc/reference/en/libraries/arduinosound/
This is an official Arduino library that supports SAMD21 based microcontrollers using an I2S digital to analog converter. It is designed for the MKR series of official Arduino boards.
Interestingly it appears to only support I2S audio devices for sound input and output. That seems like a little bit of a missed opportunity to me in that the SAMD21 has a built-in DAC, but I guess analogWrite() deals with access to the DAC relatively easily.
It is designed for official Arduino SAMD architecture boards – so those in the MKR series. It might work on other SAMD architecture boards, I haven’t looked into it in detail.
Phil Schatzmann’s Arduino Audio Tools
https://github.com/pschatzmann/arduino-audio-tools
This is a suite of open source code for audio stream processing, providing a range of audio sources (e.g. microphones, Internet streams, files, sensors, and so on) and sinks (e.g. DACs, PWM audio, MP3, codecs, audio modules, etc).
It can be used to build audio players, processors, effects, file processors, audio visualisers, networked audio tools, and so on.
I believe it supports the following microcontroller architectures:
- ESP32 (S and C variants)
- ESP8266
- RP2040 (MBED and non-MBED)
- AVR
- STM32
- SAMD
It supports several audio output boards too, including: ESP32-A1S based boards (ES8388 or AC101 codecs); VS1053 modules; and WM8960 modules.
I believe this is a library for audio processing, not necessarily audio synthesis.
Marcel Licence’s ML Synth Tools
https://github.com/marcel-licence/ML_SynthTools
This is a comprehensive synth library for producing synthesizers, organs and effects. Most of the code is open source, but there are certain key elements that are provided only in pre-built library form.
It provides libraries for the following microcontrollers:
- ESP32
- ESP8266
- XIAO SAMD21
- Teensy 4.1
- Daisy Seed
- Raspberry Pi Pico RP2040
- STM32F407
As well as the synthesizer core oscillators there are modules for arpeggiators, effects, meters, scopes, and MIDI file playing. Here are some example builds using the library:
- ML Organ (all platforms): https://github.com/marcel-licence/ml_synth_organ_example
- SAMD21 Synth: https://github.com/marcel-licence/samd21_mini_synth
- ML Synth (all platforms): https://github.com/marcel-licence/ml_synth_basic_example
- ESP32 FM synth: https://github.com/marcel-licence/esp32_fm_synth
- ESP32/RP2040 e-piano: https://github.com/marcel-licence/ml_epiano_example
Although it isn’t fully open source, this non-the-less looks like it would be worth taking a more detailed look. The provided videos of Marcel playing are particularly excellent.
MIDI Controller Libraries
There are a number of Arduino libraries for building MIDI controllers. Here are a selection of some that I’ve found so far.
OpenDesk MIDI Platform – https://github.com/shanteacontrols/OpenDeck
This is a set of firmware and two official PCB designs for MIDI controllers. In addition to the official boards, it also supports many microcontrollers, including:
- Arduino Mega 2560
- Arduino Nano 33 BLE
- Raspberry Pi Pico
- XIAO RP2040
- Teensy++ 2.0
And many others. It includes a web-based configuration utility for defining the MIDI commands for the controls. Official boards are available on Tindie and you can read more about them here: https://shanteacontrols.com/.
It supports a range of buttons, encoders, potentiometers, force sensitive resistors, certain touchscreens and can provided feedback using LEDs and displays.
Control Surface – https://github.com/tttapa/Control-Surface
This is a general purpose library for building MIDI input and output control devices. It supports a wide range of microcontrollers, including:
- AVR (Uno, Mega, Leonardo).
- Arduino Nano Every and 33.
- Teensy.
- ESP8266
- ESP32
- Raspberry Pi Pico
It supports a range of MIDI transports, including serial, USB, “direct serial” (using Hairless MIDI) and MIDI BLE. It also supports a range of buttons, potentiometers, rotary encoders, switches, keyboard matrices, and so on and can provide visual feedback using a range of LEDS and displays. It has built-in support for multiplexers, shift registers and LED drivers.
It includes a huge number of example projects to browse.
MIDIPal – https://github.com/pichenettes/midipal
This is a “MIDI Swiss Army Knife” that, with the additional of a display and rotary encoder, can provide a wide range of MIDI processing functions. It includes an editor application for programming MIDI filters.
This is a “native” AVR application, not for the Arduino environment.
Notes and Volts MIDI Controller – https://www.notesandvolts.com/2016/04/arduino-midi-controller-buttons.html
This is provided for completeness as it is a fairly common codebase for people to find and use with an Arduino. It supports a range of potentiometers and buttons and makes the task of configuring them as a MIDI control device relatively straight forward.
Closing Thoughts
As I say, this post is really almost a bit of a “to-do list” of things that look interesting and that I might try to take a more detailed look at, at some point.
If you have experience of any of these frameworks or libraries; or have suggestions of others that might be worth a look, do let me know in the comments!
Kevin
#ArduinoAudioTools #ControlSurface #dac #esp32 #fmSynthesis #i2s #midi #midiController #MIDIPal #MLSynthTools #mozzi #OpenDesk #pwm #rp2040 #samd21 #synthesis #xiao -
@SaguaroLynx Yep, regular Arduino UNO. The Talkie library supports SAMD21 ("M0") boards, some Teensy's, and ESP32. I've not tried it yet, but from looking at the source, I think #SAMD21 with its built-in DAC could give best quality audio. No clue about non-English languages, but there are Python tools to generate LPC bitstreams that I think could be used with Talkie.
https://github.com/ArminJo/Talkie -
Run UNIX On Microcontrollers With PDP-11 Emulator - C and C++ are powerful tools, but not everyone has the patience (or enough semicol... - https://hackaday.com/2021/11/19/run-unix-on-microcontrollers-with-pdp-11-emulator/ #microcontrollers #microcontroller #arduino #pdp-11 #samd21 #samd51 #teensy #mega #unix