I was very fortunate enough to be made one of the prototype versions of Helen Leigh Steers amazing Mini.mu gloves, it uses micro:bit to create a gestural controller and is aimed at getting younger people into the more fun/physical things that coding and tech can do. I’ve been pushing what this little, cheap product can do and have already had great success in connecting it up to physical instruments and puredata.
I struggled getting the micro:bits connecting via radio/serial and into puredata, I definitely couldn’t have managed it using the micro:bits blocks editor which is the easiest/user friendliest way to start coding. So, I found a work around which I thought would be useful for anyone else wanting to connect micro:bits to puredata.
This works with 2 micro:bits, communicating over radio, sending MIDI data into Puredata. This obviously limits you to the range of MIDI values, but is more than enough to get some really great results.
The first thing you need to do is install the MIDI extension for your Blocks Editor. Search for MIDI and you’ll get the option for either bluetooth-midi or midi. I used midi, feel free to explore the other option.
So next we load up our .hex files with the following codes for sending/receiving.
One important thing to note, is that the “rollx” blocks have to be white, and not red variables. For some reason it just didn’t work if I tried to load a variable named rollx.
Now, before you open up puredata, you’ll need two more small programmes to make this work. All the documentation for the MIDI library is in here, and it mentions the need for a bridge between serial and our midi devices, so Hairless MIDI is the first thing you need. This converts incoming Serial data into MIDI packages. The second thing you’ll need is loopMIDI, which is a brilliant programme that acts as a virtual connection for MIDI devices. I use this one to make PureData and Reaper talk to each other too.
So, your two other programmes will look like this:
So, now you have all this set up, you can open up puredata, select loopMIDI as a MIDI input device and use [notein 1] as your method of recieving data.
This is the patch I used in the video above to simply turn the incoming stream into a sinewave.
Obviously, you can do whatever you want with the incoming data, and I’ll be posting a few more complex patches soon (once I’ve made them) showing the potential of mini.mu and puredata.
There may be some other issues with connecting things together if you’re on not Windows 10 or on Macs, but thanks to Neill Bogie, there may be work arounds:
Instructions for mac users (LoopMIDI is windows-only, so mac users must enable their IAC Driver):
Windows versions prior to windows 10, users will first need to install the mbed windows serial port driver before Hairless MIDI Bridge will see the microbit as a COM port, following these instructions: https://os.mbed.com/docs/latest/tutorials/windows-serial-driver.html … (Making sure to have the microbit connected during install). Source: microbit support https://support.microbit.org/support/solutions/articles/19000022103-how-do-i-use-the-serial-port-with-a-micro-bit-on-windows