Yamaha Tenori-On

After the glorious triumph that was my emf presentation I met up with a bunch of the audience in the bar. We were talking about different music devices and one chap mentioned the Yamaha Tenori-ON. I’d just got paid for some work and so……

It’s a very interesting device. The top surface is made up of 256 illuminated buttons in a 16x16 grid. On the back there is a duplicate of the front, except that these are just lights that mirror the playing grid. The idea is that you can stand in front of an audience and play it and they can watch what you are doing.

You play notes by tapping a button or holding the button for slightly longer to create a note in a sequence which will be played repeatedly as the play position (indicated by three vertical lights) sweeps over the grid. There are sixteen different grids and you can flip between sixteen different versions of each grid. You can vary the length of the sequence on a grid and change its speed. It is quite fun to come up with interesting sounding stuff by combining panels of different lengths. You can record a complete performance onto an SD card and then play it back. The note playback is animated, making a performance look like a tiny firework display.

There are 256 different voices built in and you can load samples off an SD card if you want to make songs out of your own sounds. It can be battery powered (6 aa batteries) or mains via a 12v adapter. It also has a MIDI connection and a pair of weedy speakers built in.

The device dates from 2007 so there are no fancy Bluetooth or usb connections available but it does have a headphone output for personal playback or connection to an amplifier. The LCD panel is a tad hard to read (mostly because it is behind an artistically curved window in the case) but it works well enough.

I’m choosing to regard it as an investment (pause for laughter) but I’m also having a lot of fun playing with it too.

The Estates is a great game

We’ve started having in-person game nights again. With real people. At the last one we played The Estates. This is a fantastic game. The gameplay has you playing as a construction company vying with others to put buildings on tracts of land. If you manage to fill your tract, you get points for the bits of the buildings you made in it. If the tract is not filled, all of those in it get negative points.

It is great. Highly strategic, with with plenty of bluff, counter bluff and whatnot. One wonderful thing about the game is that every turn involves an auction, which means that even when it is not your turn you can either buy something you’d rather like or try to scupper another player by forcing the price up.

The gameplay forces a kind of cooperation. It would be impossible to fill a tract with just your own buildings. However, since there can be only one winner, it also forces chicanery and double crossing. It is the kind of game that you really appreciate playing in the same room as everyone else.

I’ve put in an order for a copy for Father’s Day……..

Camping with a dirt-cheap laptop


Now with added sticker

For the last few days, I’ve been living in a tent and doing all my work on a laptop that I bought for 80 pounds (that’s around 100 dollars). I’ve developed code, written documents, captured video, opened lots of browser tabs and given the odd presentation. The machine I’ve been using is a GeoBook 140. It is not what you would call highly specified. It has an Intel Celeron N3350 processor, 4Gb of RAM and 64Gb of mass storage. It chugs a bit. And yet it gets there in the end. It has run everything I want faultlessly.

It has a couple of USB A sockets and a single USB C. It also has HDMI and audio outputs along with a micro-SD slot. The keyboard is clunky and not back lit, but I can type quickly on it and it is a good size with all the keys I need. The screen is low resolution (but very bright) and the track pad is not great (although I much prefer an external Bluetooth mouse anyway). It runs Windows 10 very well indeed though (although it may never run Windows 11).

I can even run KiCad

I can open Visual Studio Code, Word, PowerPoint, OBS, Thonny, GitHub desktop, PureData and all the other bits and bobs I need to get things done. The paltry storage space doesn’t bother me because I use OneDrive to give me the illusion of all my files at my fingertips. I’m getting at least five hours of battery life. I don’t know how long the battery really lasts because I’ve not managed to run it flat yet. I wouldn’t be thrilled if someone said that it was now my primary device, but I’d still be able to do stuff.

I’ve got a MacBook Air which I think is lovely. And I use it every now and then. But I’d never take it away to use in a tent. I’d be scared that it might get dropped, scratched, or wet. And it wouldn’t be as useful to me as the GeoBook. I’m afraid that MacBook to me is a bit like a Ferrari. I take it out for a spin every now and then to do fancy things. The GeoBook is more of a Ford Focus. I use it to get things done. I like it a lot, especially in the Minecraft Blue colour. I’d be a bit upset if it got broken. But I’d also only be 80 quid out of pocket. For the price of my MacBook I could buy more than ten “blue wonders”.

The amount of productivity you get for your money is amazing. If you’ve not got a laptop it represents amazing value. You can pick one up from xsonly. They have a bunch of different ones. I recommend the N3350 based ones as they have four core processors. Well worth a look.

Heading home

Today it was time to go home. Rather sad. It has been an awesome festival. We’ve gone to loads of session, met a bunch of people and seen some amazing tech. Thanks so much to the organisers and the huge team of volunteers who made everything work. Apparently it isn’t possible to organise and manage an event like this with such a small number of people. Except that it is. Wonderful stuff. Counting down now to EMF 2024.

Self promotion at emf

Shameless self promotion in the lounge

We’ve had a couple of interesting nights here at emf. It’s quite fun to watch the tent around you swirl and dance as the wind howls and the rain pours down. Really. The best bit is the moiré fringe effects that you get when the inner and the outer layers of the tent touch each other. Quite mind blowing.

Anyoo, the good news is that just as we woke up the rain stopped and it wasn’t ever a hinderance right through the day. Oh, and here I present my tips for emf shower success. I meant to write these down last time, but I forgot and had to rediscover them all again.

  • wear shorts for the shower. There’s nothing quite as nasty as pulling on jeans over barely dry legs in a steamy, enclosed space.

  • don’t wear socks for the shower. If you think jeans are hard to pull over damp legs, you haven’t tried pulling socks over damp feet.

  • a carrier bag is your friend. When you set out it holds your clean clothes, towel and soap etc. You can hang it on the hook in the shower, and then move things in and out as you go through the shower process. A true ninja takes two bags, one for clean stuff and one for dirty.

  • put your toothpaste on the toothbrush before you leave the shower cubicle. The tap and basin are outside the shower. It’s a real faff to put toothpaste on a brush while standing in a queue. Much better to just have it all “tap ready” when you leave your shower. The first time I saw someone heading towards me holding a toothbrush in front of them I thought I was being challenged to some kind of duel. But when he shot past me and made for the tap I realised what a genius he really was.

Making Geiger Counters at emf

What better way to start the day than by building a Geiger counter. The session yesterday was fully booked so today saw me standing in my wellies (the weather has changed slightly) at the head of the queue to take part. I was lucky to get in, as in the previous session things got very busy. The bad news for everyone was that, due to a shortfall in Geiger tubes, not everyone would be able to take away a fully working device. But they are readily available on ebay for a modest price, and I never could resist a bit of soldering, so off we went.

It was wonderful. We had excellent instructions, plus lots of folks wandering around offering us components and advice. At the end of the day some of us walked away with working devices. Number one son got his built and working and even managed to get a tube to take home. I’m going to get myself a tube on ebay so that I can finish mine off . Somebody told me that bananas are a good source of radiation. I’m looking forward to investigating this.

Note that just because the counter makes a noise when you hold it close to something doesn’t make that thing dangerous. I’m very grateful to the folks from Bristol and their sponsors for making the whole thing possible though, it was awesome.

When presentations go wrong...

So much for testing

If you’ve been wondering where I’ve been for the last couple of weeks, I’ve been working furiously on a device for a presentation at emfcamp. Emf is a fantastic place to talk tech and meet folks. I was at the last one and really enjoyed it. We arrived at the camp on Thursday and yesterday I got to tell everyone about my “Chocolate Synthbox Synthesizer”.

I’d spent a lot of time building the device and after some careful testing in the tent in the morning I reckoned it was good to go. Fate however had other ideas. If you’ve ever done any presentations you’ll have heard of the “Demo Gods”. If they smile on you all will be well. If they frown on you, then get ready for trouble. The worst I ever had was a while back when I did a session in Amsterdan where every demo failed - that is, the worst until today.

The presentation involved me saying nice things about two technologies, sending MIDI messages to musical instruments using the Raspberry Pi PICO and using the Puredata program to make sounds. It hinged around live demonstrations of the soundbox itself. If that didn’t work, I was toast. It didn’t work. Worse than that, it gave the impression of working every now and then just to get my hopes up, and then failed when I tried to use it to show anything off.

The audience was great. They laughed at all my emergency jokes – that is until I ran out of them. I think they were entertained too, but not in the way I was intending. Oh well. You should treat every setback as an occasion to learn something. In this I’ve learned that you should always have a fallback position. Most of the other presentations I’ve been to have used videos to show things off, so I really should have had a few of them lying around to show off.

We’ve tracked the problem down to power supply issues and a broken speaker connection. I’m hoping everything can be got working so that I can wander down to the bar with it and show it off properly.

Apparently, to this day in some parts of Holland they speak of the time that everything broke for the idiot Englishman, perhaps it is OK to be remembered for something, even it is glorious failure.

I just hope I get the chance to present at emf again, so that I can show something that properly works.

Heading for emf

We headed off to emf today first thing. Well, around 8:30, we’re not fanatics. The roads were nice and quiet and the journey was very pleasant. We didn’t actually sing at any point, but wouldn’t have been out of place if we did.

The site was just coming alive as we arrived and number one son found us a nice site on the side of the hill. Actually, here everything is on the side of the hill which takes a little bit of getting used to. If Istand up suddenly I then feel myself instantly falling over. The tent proved quite easy to put up. We’ve taken the precaution of getting an extra groundsheet to keep the inside of the tent nice and dry, but the ground seemed pretty dry.

We’ve carefully planned our itinerary for the first day, I’ve tested everything for the presentation and the WiFi reaches up to us. We’ve even got our own mains power courtesy of the tent next door. This is going to be fun.

Bringing back the Autographer

I’m thinking of taking my Autographer to emf camp. I bought it a while back when the idea of wearing an automatic camera to record my so-called life seemed quite attractive. Since then the product has been withdrawn and the company behind it has vanished along with all the software support. You can go onto GitHub and find someone hosting all the apps and documentation but the program flatly refuses to work on the Mac. On the PC the application runs OK until you try to press buttons and do stuff, at which point nothing happens. It’s all rather sad.

The good news is that the device itself does work and you can get the pictures off it after you’ve taken it somewhere interesting. The date and times on the pictures are all wrong though, which is surprising given that the Autographer is supposed to have a GPS system built in.

The thing about the Autographer is that it decides when to take the picture. It has a bunch of sensors that help it do this. You can trigger it to take a some pictures if you like, but you’ve no idea precisely when they will be taken. This not the kind of camera you can say “cheese” for. However, it does come up with the occasional gem, like this one of me coming down the stairs. I’d left the camera lying on the floor of the hall and it has captured a very interesting angle that I probably couldn’t have got any other way. The ultra-wide angle also captures a good view of what’s around.

Sending messages to Pure Data using fudi

Isn’t this exciting? I’m just on the brink of sending useful messages between my PICO powered controller (which has buttons and a display) and a Pure Data patch running on a Raspberry Pi. Last time I got the comport working now that I can send raw data bytes between the devices. Now I want to see about sending packets of useful data.

The man behind Pure Data (Miller Puckette) has thought of this. He’s invented the FUDI protocol for sending messages. It’s a very simple text based protocol which means that it will be very easy to make the PICO assemble FUDI messages for the Pure Data patch to read.

Lets take a look at the kind of message that I might want to send from the controller to a Pure Data patch:

encoder 97 5;

The controller generates messages like this when an encoder is turned. The word encoder tells the receiver that a new encoder value is coming The first number (97) is the new encoder value. The second number (5) is the number of the encoder. The encoder message is generated by Circuit Python running inside a PICO which is connected to the encoders and sends messages out over the serial port. The Python code that sends these messages is:

b1 = int(self.active_config.serial_channel)
b2 = int(self.active_config.controller_value)
message = "encoder " + str(b1) + " " + str(b2) + ";\n"
send_buffer = bytes(message,"ascii")
print("Sending to serial:", send_buffer)
self.client.serial_port.write(send_buffer)

This code takes the two values and puts them into the variables b1 and b2. Then it creates the message string. Next it makes a byte array containing the message in ASCII. Finally it uses the serial_port_write method provided by the serial port to send the entire string out to the Pure Data patch. Now lets take a look at how this serial data stream is received.

My blog post here shows how to get a Pure Data patch to receive data from a com port. At the bottom of the patch you can see a data flow coming out of the comport object and ending in a rather enigmatic way. The patch decodes the input message and routes it to the required destination. It uses a Pure Data loop to assemble the message (which is a line of text) and then uses FUDI (Fast Universal Digital Interface) to parse the text and extract a message which is then routed to the appropriate destination.

Remember that what is happening is that individual bytes are arriving, one at a time, and need to be assembled into a line of text. The text is terminated by a newline character (10) or a return (13).

The sel object at the top of the patch takes the input stream and feeds it to one of three outputs. If the input value is 10 or 13 (the characters that mark the end of the list) the list is triggered to push its contents into the fudiparse object. If the input value is anything else (this is what the right hand output from sel is for) the newly received character is added to the start of the list, building up the line of text.

The fudiparse block takes the buffer containing the incoming message (in our case “encoder 97 5” and uses it to generate a Pure Data message that contains the values “encoder”, 97 and 5. This message is then sent into a route object. This looks at the first item in the message and then sends the rest of the message (the values 97 and 5) to the output that matches that name. In the case of the patch above, this means that the two encoder value are sent to a message endpoint called “encoderReceived”. Patches in other parts of the of the application can receive these messages and act on them.

You should be able to work out that the decoder above can also respond to an incoming message called button, which tells the Pure Data application when a button was pressed.

Using the comport object in Pure Data

I’m building a Raspberry Pi 4 based device that uses a thing called Pure Data to play sounds in response to incoming MIDI messages. The device also has a controller and display which is controlled by a Raspberry Pi PICO. I’ve connected the hardware for a serial connection and discovered how to send serial messages from the Circuit Python program in the PICO. Now I need to get the messages from the PICO into my music making software. This is how to do it.

The above patch fragment (is that even a thing?) shows how it we can surface serial data in a Pure Data patch. However, before we can do this we have to add the comport object to your Pure Data installation. If you re using a Raspberry Pi it turns out that this is very easy:

sudo apt install pd-comport

This console command installs the comport object. Now we can add one to our patches. The patch above shows that we can send it messages to make it do things. The message on the left sets the device name. The second messages sets the baud rate. The third message asks the comport to display all the available comports that Pure Data has found.

When the above patch is triggered by a message on the inlet it will set up a comport and set the baud rate to 19200. Any messages that we send to the comport object will be sent out of the comport. These need to just lists of bytes. If the comport receives any bytes from these are sent out of the bottom of the comport object. In a while we’ll take a look at how we can encode and decode messages that we want to send over the serial connection.

Linking a Raspberry Pi 4 and a PICO over a serial connection

I want the Pure Data patches in my Chocolate Synthbox to be able to display lights that flash in time with the music. The lights in question are a bunch of neopixels connected to a Raspberry Pi PICO which is handing all the inputs and outputs for the device. I’ve done this to keep the design simpler and to remove any chance of issues with the sound code on the Pi interfering with the pixel animations.

However, to make it work I have to connect the Pi and the PICO together. Both devices have plenty of serial ports, so the best way is just to use one of those.

On the Raspberry Pi 4 (note that this only works for the 4) there are four serial ports which are surfaced on the “hat” connector. You have to enable them and they surface as devices you can use.

You enable them by editing the /boot/config.txt file:

sudo nano /boot/config.txt

Then, if you want to enable serial port 2 (which I do) add the following line at the end of the file:

dtoverlay=uart2

Save the file and then restart the Pi. You can now ask it which pins it uses with the command

dtoverlay -h uart2

The important part of this information is the “uart 2 on GPIOS 0-3. This means that the pins will be assigned as follows:

Pin 27 GPIO0 UART2 TX
Pin 28 GPIO1 UART2 RX

The other two pins (GPIO2 and GPIO2) can be used for hardware handshaking, but I’ve not enabled that. The device will appear as /dev/ttyAMA1, I’m going to use it in Pure Data (but that’s a different blog post. For this one, let’s discover how to connect the port to a PICO. I’ve decided to use uart1 in the PICO. This can be used on pins GP8 (TX) and GP9 (RX). So the wiring I need is:

Raspberry PI         PICO
Pin 38 GND           Pin 13 GND
Pin 27 GP0 UART TX   Pin 12 GP9 UART1 RX
Pin 28 GP1 UART RX   Pin 11 GP8 UART1 TX

Note that the TX and RX are crossed over. The PIC is running Circuit Python, this is how to connect a program to this port:

serial_port = busio.UART(board.GP8, board.GP9, baudrate=19200,receiver_buffer_size=500)

Now if the Circuit Python program in the PICO sends data to this port it can be picked up in the PI.

Auto-Start a Pure Data Patch on Raspberry Pi Bootup

Today I needed to find a way to auto start a Pure Data patch when a Raspberry Pi boots up. This is so that the Chocolate Synthbox (patent pending) can play sounds without the owner having to do anything to get it going.

Above you can see how I did it. The /etc/xdg/lxsession/LXDE-pi/autostart file contains commadns that are obeyed once the desktop has loaded. I used this command to start the editor:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

I added the line you can see at the bottom:

sudo pd /home/pi/Desktop/Synthbox/ChocSynthboxMain.pd

This works well for me because the file Synthbox on my desktop contains the file ChockSynthMain.pd If you want to use it you change this to the location of your Pure Data patch.

You can use this technique to start any other programs on power up.