MIDI Music Synthesizer with Pi Pico

@cymplecy Jo Watts (@jbw3r) and I thought that the code example that you posted to create a music synthesizer using a Pi Pico was great:

Could you share more details about how this was created? We have a Raspberry Pi Pico and would like to replicate your example.

Thanks - Glen

Hi Glen

It's from here -

@bromagosa demonstrated it at a FOSDEM session

Thanks for pointing us in the right direction. What MIDI device were you connecting the Pi Pico to? (It sounded great!)

Jo and I are interested in connecting TuneScope to the MIDI device via the microcontroller (which we could do by using the Snap!-to-MicroBlocks bridge). This assumes that the latencies in response times would not be an issue.

Alternatively, is there a way to use a Snap! serial out command to control an external MIDI device directly via USB cable. (Inquiring minds want to know.)

Thanks - Glen

I don't (any more) have any midi devices with 5 pin connectors so I used one of these

https://www.amazon.co.uk/Giyofom-Converter-Connector-Synthesizer-Keyboard/dp/B0CMGZCFW5/ref=sr_1_8?crid=3OAPY97APA8P2&keywords=usb+midi+convertor&qid=1707819759&sprefix=usb+midi+convertor%2Caps%2C257&sr=8-8

and plugged it into my Windows PC and then used the Anvil Studio program to act as a software synthesiser
(I'm trying to get hold of a real synth with 5 pin DIN connectors but even 2nd hand ones on Ebay are expensive!)

There will always be a way but I've not tried to do that :slight_smile:

@bromagosa is currently working on MIDI stuff for Snap!

He tried to show it off to me at FOSDEM but something went wrong so it's not yet ready for prime time :slight_smile:

I got MicroBlocks Boardie to send MIDI to the TuneScope's Snap! library via
TuneScope_PlayMIDI
USBConnection on a Macbook.

I have not yet been able to get a Pico-W plugged into a USB port to send MIDI to TuneScope. The IAC Driver in Audio MIDI Setup app does not recognize the Pico-W as a MIDI device.

I've used a cheap USB-MIDI adaptor like the one Simon mentioned. Here's an example:

https://www.amazon.co.uk/Digiflex-Adaptor-Musical-Keyboard-Laptop/dp/B00K4UXH5Q

However, the Raspberry Pi Pico and SAMD21 boards like the Metro M0 and MakerPort can send MIDI commands over a normal USB cable. From scspaeth's post, it looks as Snap! can receive MIDI commands via WebMIDI. scspaeth, you might need to send a MIDI command from Boardie (or from a physical board) to get the MIDI system to recognize the new MIDI source. You might also need to use your system's MIDI settings to route the MIDI source to Snap!, although It looks as though the block provides a drop-down menu of possible MIDI sources.

Also, you do not need a hardware synth to generate sound. There are a number of free sofrware synths such as Fluidsynth. There is even one that runs right the browser (midi.city). Midi.city needs to run in Chrome to accept input from external MIDI sources. So, in theory, you could have TuneScope drive on of those software synths and avoid the need for any external MIDI hardware.

@scspaeth That's fantastic that you were able to use MicroBlocks Boardie to send MIDI to the TuneScope Snap! library via a USB connection on a MacBook. We don't have a Boardie, but we will order one and try to replicate your results. Thank you!

@jmaloney Thanks for the suggestion of using a free software synth to generate the MIDI sound. We (ideally) would like to give folks the option of either a hardware approach (after the fashion of the great things that Bernat is doing) or a software solution. We're meeting with a CS student on Friday to discuss working on this as an independent study. Both approaches (hardware and software) seem worth exploring.

Hi, Glen.

You do have a Boardie! It's a virtual microcontroller that comes with the web version of MicroBlocks. Here's a blog post about it: Boardie: A Virtual Board for MicroBlocks - MicroBlocks

OTOH, don't hold your breath because I'm working on too many projects at the same time right now, and I don't know when (if ever) this will be done, but I got a basic proof of concept of the MIDI, Rhythm, and Scales&Chords libraries working on Snap!. The timing is pretty solid, although you experience tempo drops as soon as you do anything in the IDE. Music is extremely time sensitive.

Jens and I discussed a bunch of ideas to circumvent the issue, but I've had to move on to other things now (if you're curious, the Snap! 3D Beetle extension and turning Snap4Arduino into an extension), so I can't promise much.

In the meantime, here's a video showing a glimpse of what the future may look like:

I like this glimpse of the future. I also like the Boardie ... thanks so much for developing it and for bringing it to our attention. We'll begin using it immediately - there are several use cases. (Thanks!)