"Crackers" PICO Midi Controller takes shape

external.jpg

I’m building a partner device for the “PICO Midi CheeseBox”. This gives four rotary controllers with pixel ring feedback displays which you’ll be able to use to control MIDI playback. It’s called the “Crackers PICO Midi controller”. Why? Take a look inside..

internals.jpg

The wiring is a bit crazy, but it worked first time. I’ve got a new build technique called “making the design and writing the drivers before I build the device”. You can see the circuit diagram and the Circuit Python code creates controller instances for each of the four inputs.

The controller will be making an appearance in a future HackSpace magazine, when I’m going to be using it to control a Pure Data synthesizer.

PICO and Feather: What are the differences?

PIC and Feather.jpg

The Adafruit Feather and the Raspberry Pi PICO are boards based on the RP2040 processor from the Raspberry Pi people. They are obviously different (for a start one is black and the other green) but what other differences are worth knowing about?

Programming

Both of them are programmed in exactly the same way. The biggest difference is that you use a usb-c cable to connect to the Feather and a micro-usb cable for the PICO. You can write C++ or Python. Both have connections for hardware debugging. On the Feather you can solder a socket on to connect the debugger, on the PICO you add some pins.

Program Size

Both of the devices use the same chip, the RP2040, which has 264K of internal memory for code and data storage. If you install Circuit Python or MicroPython you end up with around 200K of free memory as reported by my tiny memory size reporting program:

import gc
print("Memory free:",gc.mem_free())

Loading a 500 line Python program left me with a reported 130K or so free so there is scope for these devices to run quite chunky amounts of code.

Data Size

EEPROMSizes.png

Both devices use an EEPROM (or ‘flash’) memory chip to store program code and data. If you use Circuit Python they appear as external usb storage devices where you can drop the files. Above you an see what Windows thinks of a PICO (called CheesBox - oops) and a FEATHER. Note that the Feather has much more storage space. This is because the Feather device has an 8Mb flash chip, while the PICO only has 2M.

This doesn’t affect the largest program size you can run - that’s down to the program memory size, but if you want your application to use graphics and sound samples or other data resources then the Feather is the way to go.

Connections

Both devices have lots of pins for connecting things. Things to know:

  • The Feather has four analogue inputs, the PICO only has three.

  • The Feather has a STEMMA QT connector that you can use with lots of I2C devices sold by AdaFruit and others. It also has an on-board Neopixel and an on-board led.

  • The Feather can be used with a rechargeable lithium ion battery. It has a connecter and circuit to control charging.

  • The Feather has both a BOOTSEL and a RESET button. The PICO only has a BOOTSEL button. You use the BOOTSEL button to boot a device into firmware loading mode after a reset. You don’t need to use this very often, you only do it when you want to load new firmware into the device. In other words, if you are using Python you use this once to install the Python firmware. However, having a RESET button makes this easier. For the PICO you have to hold the button down when you apply power, there is no other form of reset. For the Feather you can just hold down BOOTSEL and press RESET.

What you get in the box

With the PICO you get the PICO, nothing else. If you want to add pins or sockets you'll have to add them. With the Feather you get solder pins for the device, whether you need them or not.

Infrastructure

Both these devices are very well supported. The AdaFruit Feather system has loads of devices you can stack on top (or underneath) a Feather board. The PICO hasn't been around as long, but there are now a huge range of additions for that too.

Price

This is where the PICO comes in ahead of the Feather. It costs around £3.50 ($4.00) per device, against £12:00 ($12:00) for the Feather. Having said that, both are stupidly cheap for what you get.

Conclusion

These are amazing devices. For me I see the PICO as a Ford Focus and the Feather as a BMW. Both do the same job, but the Feather has extra features that make it easier to use (a reset button, an on-board neopixel and QT). If you really need lots of local storage, four analogue inputs or on-board charging, the Feather is the way to go. Otherwise, I'd pick the PICO on price.

"Nailed it" is awesome

nailed it.png

Nailed it is a reality TV show where people are given stupidly short times to recreate confections that must have taken a trained chef ages to make. It’s hilarious. I’m not usually a fan of programs that set people up to fail and then film them doing it, but it works fine if the people are in on the joke. And the prize money is enormous for the winner (although I reckon that all the contestants should get a share).

The host and the expert chef are excellent and they do seem to have a knack of finding appropriately crazy guests to join in the fun. This is not highbrow telly. But it is great stuff.

Unexpected art

broken design.jpg

Sometimes your failures are more interesting than your successes. I’ve been doing some work to design a new music controller based on the cheesebox, but adding rounded corners. There are lots of ways to make rounded corners, FreeCAD even has a command called “Fillet” that will do this for you. But I thought I’d do it the hard way, which involves cutting off each corner and replacing it with a cylinder. You can see the results of my first attempt above. I think it is quite artistic. And hey, one corner correct out of four isn’t a bad score..

workingdesign.jpg

This is the final version. There are four controller rings with lights, and a button grid and controller on the bottom. The only problem with this design is that it won’t fit on the printer bed………

final design.png

This is the final, printer friendly, design.

20210927_083238347_iOS (2).jpg

..and this is after it has been produced by two friendly printers…..

Simply Piano has made me into a Disney Princess

performing princess.jpg

Much to my surprise, I’m still doing my piano practice every day. I’m using the Simply Piano app which works very well for me. Up until recently I was able to coast a bit, what with being made to play the piano when I was much younger. But now I’m learning stuff that is properly new to me and making a tiny bit of progress every day.

Anyhoo, Simply Piano has got hold of the rights to a bunch of Disney tunes for me to practice which has been great fun. The way they arrange the exercises it sounds like you’re part of a performance with singers and full accompaniment (although I’m always a bit sorry for the person who has to sing along with my playing). Good playing gets you stars for each piece. Eighteen stars and you’re a performing princess. Twenty four stars (a perfect performance in everything) and you get to be a prince. Not sure if I’m going to make it, but I’m enjoying trying.

Pure Data in HackSpace Magazine

hacksspace47.jpg

The October issue of HackSpace magazine is out. You can find it here, or in “all good newsagents” as they say. It’s a good read in spite/because of an article that I wrote. I’ve been playing with Pure Data music programming for a while (ever since I got an Organelle last year to play with during lockdown) and so I thought I’d write an article about it. Pure Data is a really good way to create applications that work with streams of audio data. Well worth a look.

Waveshare WM8960 Audio Hi-Fi Sound Card HAT

soundcard.jpg

I’ve been looking for a soundcard that will let me let me create a PureData powered musical instrument based on a Raspberry Pi device. This one looked like it might fit the bill. It even has two tiny microphones and comes with a pair of speakers.

The hardware isn’t directly supported by the Raspberry Pi operating system, so you have to do a mildly complicated install which involves downloading GitHub repository and then running an init script. My pro tip: rather than using Git clone from the command line (which will insist on you giving a GitHub username and password that you’d really rather not) use the browser to download the zip archive and then unzip the files onto your desktop.

I couldn’t get it to work (which is nothing new for me). I filed an online support request from the product page and was very surprised to get a prompt response offering help. Buoyed by this I had another go, starting from a brand new fresh install of Raspian. This worked a treat. Better yet, both the speakers and the microphone work perfectly with PureData (as long as I remember to start PureData in supervisor mode):

sudo puredata

If you are looking for an “all in one” audio solution for your Pi this is a very good bet. The speakers are OK for their size. The only thing it is missing is line audio in. You can only record from the onboard microphones. However, they do supply a full schematic, so if you are handy with a soldering iron and fine wire you might be able to make your own. And the support is very good. They even got back to me to ask how I was getting on after their first response.

Twisty Cube Puzzle Thing

cude puzzle.jpg

I’m very fond of hand-held electronic puzzles. This one is rather neat. It is rather like Rubik’s cube, but rather than make sides the same colour you have to make the colours on the two moveable elements line up with an arrangement shown on the four in the middle. You do this by flipping them and rotating them.

The blurb for the device goes on about the educational benefits of the toy, but I’m not particularly convinced about that. I just find it fun to play with.

Inkscape is awesome

tune settings.jpg

I’m making some documentation for my little music box. Settings for the box are managed by setting pixel colours to represent different values. Above you can see the settings for the red (tune) track. You hold down the tune button and then step through the settings on each note key. I made the diagram above using Inkscape. It is an awesome program. In a trice I’d found a way of making a circle of perfectly spaced buttons, then I was creating blocks of text filled with the appropriate colours and lining them up together.

Inkscape drawings are represented as SVG files so you can enlarge and transform them as much as you like. The program is a free download and there are versions for lots of different platforms. The learning curve is a bit steep, but the internet is full of videos describing how to do things (for example draw 12 circles in a ring as above).

Creative Coding

PICO music box.jpg

When I was doing programming lectures I used to go on about how creative programming is. I also make the point in the introduction to my latest book (subtle plug). I’ve just spent all of today proving the point. The weather has been horrible, so we were forced to stay indoors and do stuff. So I wrote some more code.

My silly little PICO music box can now store multiple rhythm tracks which can be made to run at different speeds. It has a full setting editor using coloured pixels. I rather enjoy playing with it to make little looping sound sequences.

It’s a strange and wonderful feeling when something that you are making starts to take on a life of its own. I’m sure that artists and musicians get it, programmers get it too. Big time.