Drawing Trees with ChatGPT

ChatGPT and I are now drawing trees together. It’s quite fun. It’s all in JavaScript, which means that I can run the code in the browser, make some comments and then play with the next version when it has been written. The best bit was when I said “Now do it in 3D” and ChatGPT obliged. It’s not perfect but I’m finding out a lot about drawing 3D graphics in JavaScript and that has got to be a win.

I’m not sure how people will learn to program in the future, but I think it will be something like this.

Projects page now live

Today I did something which I really should have done a long time ago. I’ve created a projects page for the blog which makes it easy to find a few of the things I’ve been fiddling with over the last few years. Each entry has a link to the repository where you can find out even more.

I hope you find them interesting. If you decide to have a go at making one of them, or use it as the basis of something else, I’d love to hear from you.

A talent for self-sabotage

Today I spent 40 minutes looking for the latest version of some software I wrote a month ago. I eventually found the file in the scrap folder of a project I worked on in 2022. I’d opened an old file to use as the basis of my new development and then failed to save the updated version anywhere sensible. Why it has got moved into the scrap folder is a total mystery.

And all this in the age of GitHub. Shame on me.

Rabbit r1 Revisited

Now including seasonal artwork.

You might remember the fuss last year when the Rabbit R1 went to market missing lots of features. I bought one, egged on by a good review that turned out to be a tad optimistic. It still doesn’t do lots of the things that were promised, but I don’t really care. I always regarded the “Large Action Model” stuff as a bit far fetched. The idea that a device could ever infer from a web site exactly what to do struck me as very unlikely, and I thought that the idea of letting something loose with all the passwords and authentication it would need to be able to act on my behalf would be a deeply silly thing to do. But I liked the colour and the form factor. And it has neat tricks. It answers questions well and I really like the “Magic Camera” which you can use to get an interesting twist on shots that you take.

This is what it thinks the cable release device looks like inisde…

If there is a prize for software development teams (and there hardly ever is) I’d give a special award to the folks behind the Rabbit R1. They were set an impossible goal at the start but they’ve kept plugging away adding loads of features and fixed lots of things:

  • The user interface now makes a lot more sense.

  • The battery life is OK. You can get through a day as long as you don’t get carried away.

  • You can view your pictures on the device. Say “Show me my pictures” and you get to see all your recent shots.

  • The Large Action Model is still mostly a work of science fiction, and I really wouldn’t trust it with anything important, but you can have fun playing with it and sort-of-automating interactions with the web.

  • You can change how the user interface looks and the voice it uses. This is huge fun.

  • There is now multi-language support.

  • Interactions with your rabbit earn you carrots you can spend in an “r-cade” where you can pick up costumes and add-ons.

I like having the Rabbit with me and especially like taking pictures with the camera. People enjoy seeing what the Rabbit thinks they look like (unless it’s an old fisherman when you really aren’t one).

I hope that Rabblt keeps going. I’d even be happy to pay a monthly subscription to retain access to the things it does. Lots of things have AI baked into them alongside everything else, but I much prefer having a device that just does this one thing. And I still like the colour.

3D Printed Lens Cases

I fancied some 3D printed lens cases. So me and ChatGPT wrote a little Python program that runs inside FreeCAD to make them. I find ChatGPT a useful coding companion. It doesn’t usually get the code right, but it does provide enough insight into how the code is supposed to work to make it much easier to create something that does what you want.

As an additional flourish, we managed to put text on the outside of the case by rendering a TrueType font into a shape and then cutting it out of the case. You can see the results above. Next step is to get some foam and make some inserts to keep the lens nice and safe. I’m going to tidy up the code a bit and put it on GitHub.

Mamiya Press 23

They say it is ugly, but I like the quirky charm it has. This one has the extra viewfinder on top for the wide angle lens.

If you were a photographer working for a Japanese newspaper in the 1960’s you’d probably spend a big chunk of your life carrying round a Mamiya Press camera. The camera is actually a whole ecosystem of film backs, lenses and other bits and bobs. The one above is a setup with a nice wide angle lens which will make a good job of the kind of scene setting pictures the editors of the day wanted.

The camera is big and heavy but the hand grip, which also incorporates a trigger shutter release, makes it quite easy to wield. It can take enormous 6x9 cm images on 120 roll film. You get loads of detail in every shot, which must have been greatly appreciated at the time.

The viewfinder is bright and clear and has a rangefinder spot in the middle which is coupled to the lens. This makes focusing very easy and accurate, as long as your lens and camera body have both been properly calibrated. The lenses are lovely and very sharp. The Mamiya 23 above has been in the wars. Some of the screws are missing and it could do with a good clean up. But it still turns out really nice pictures.

However, it is a nightmare to use. Taking a picture involves a sequence of steps which must be followed precisely if you want to get a result. And you only find out if you’ve missed a step when you develop the film and find you have empty frames, two frames on top of each other, blurry images and whatnot.

When you get everything right though the camera really sings. The good news is that if you fancy getting into large negative photography on the cheap these are a great way in. They are much less expensive than the Pentax 67 and no less capable. They are also much easier to repair. The shutter assembly is part of the lens, making it easy to swap out a broken lens for a working one. And lenses are not expensive. The rangefinder adjustment on the camera body is a bit tricky, but not impossible. And the film backs are all interchangeable too, so if that breaks you can get another. They were built for heavy use by working photographers and that means they are pretty tough. There are a number of different versions. I rather like the simple utilitarian appearance of the earlier models.

Worth a look if you’re prepared to put in the effort and put up with the odd wasted shot.

Watch Paradise

Yesterday we watched the first episode of Paradise with the feeling of “Ho Hum, this looks like something that we’ve seen quite a few times before”. Then, five minutes before the end things took a sudden, sharp turn. We’ve just watched the second episode and I think it is fair to say that we are hooked. I just hope they can keep up the momentum. Very strongly recommended.

Pico Powered Camera Shutter Controller

Click the image to view the video. It’s only 30 seconds…

Sometimes things work in spite of what you do, rather than because of it. With this in mind I present my PICO Powered Camera Shutter Controller. It works. It has quite a few batteries inside. It makes interesting noises when it has to work hard. I’ll show you the insides if you come to my talk at DDD North in a couple of weeks.

Sonic Super Teams is a smashing little game

Played Sonic Super Tams today. It’s a race game. First team to get all their characters around the race track and over the finish line wins. There are 8 Sonic characters in the race which are represented by beautifully made little figures. At the start of the game each player gets six move cards and a team of two characters to get to the finish line as fast as they can. Move cards apply to one particular team, so you frequently find yourself having to move your opponents pieces. The trick is to send them onto the spikes to slow them down, or get them stuck in front of a loop, while you and your teammate head off towards the double speed rings. When you’ve used up all your move cards they are dealt out again. There are also chance cards to be had which add even more variation.

With four players you play as two teams of four, which adds more fun as you try to help your teammate. Games last around half an hour, which is just the right length for a game like this. A great game with some nice strategy.

Triumph over Adversity

Today I nearly finished my camera remote control. I thought it was a simple enough project. But today, not really simple enough for me. Basically I took part in a festival of doing things wrong. The stars, in no particular order were:

  • Thinking that switching the ground power supply rail rather than the positive one was a good idea because I had an innovated (i.e. dangerous) split power delivery.

  • Building a battery pack that produces 9 volts before discovering that the servo can only handle 7 volts

  • Soldering the wrong wires on the switch

  • Soldering the right wires on the switch, but without putting the switch through the fitting hole

  • Soldering the right wires on the switch, having put the switch through the fitting hole but not added the fixing nut

  • Forgetting to connect 3.3v to the i2cv signal on the display so that I then spent 15 minutes trying to work out why the I2C lines weren’t powered properly.

  • Using == in an assignment by mistake: self.state==self.DELAY_SET compiles fine in Python, but doesn’t do what I want it to.

  • Plugging the 5V power signal onto a PICO input because a red wire looks very like an orange wire sometimes

  • Plugging the servo control signal onto the wrong PICO pin

Basically I got it right by doing everything possible wrong first. But at least it works now and I should be able to demonstrate it at DDD in two weeks time.

Combining Spreadsheet Comments for Report Feedback in Excel

If you’ve ever had to mark different sections of a student report using a spreadsheet, you’ll know the pain of writing feedback in multiple columns and then trying to combine it into one coherent message. You’d think Excel would be thrilled to help, but it turns out it has a habit of making things harder than they need to be. Fortunately, with a little Excel wizardry, we can make it work.

The Problem: Merging Feedback for Different Report Sections

Let’s say you’ve got a spreadsheet where you’ve left comments on different sections of a report:

Report Section Introduction Feedback Risk Analysis Feedback Presentation Feedback
Report 1 Clear but brief Lacks detail Well-structured

What we’d like to do is take all these comments and merge them into a single, readable feedback message. But we don’t want everything mashed together in a way that makes it impossible to read. We want nice, neat line breaks between each section.

Solution: Using Excel’s TEXTJOIN Function

The TEXTJOIN function is a bit of an unsung hero in Excel. It lets you take multiple pieces of text, stitch them together, and even throw in a separator between them. In this case, we want to use a new line (which Excel calls CHAR(10)) as our separator.

Here’s the formula you need:

=TEXTJOIN(CHAR(10), TRUE, B1, B2, C1, C2, D1, D2)

This produces a sequence of headings and comments. Let’s break this down:

  • TEXTJOIN is our function of choice for merging text.
  • CHAR(10) is the special character that represents a new line in Excel (Windows users, take note! If you’re on a Mac, you might need CHAR(13)).
  • The TRUE argument tells Excel to skip any empty cells (so you don’t end up with awkward extra blank lines).
  • B2, C2, D2 are the columns containing our feedback comments.

One More Thing: Wrap That Text!

By default, Excel doesn’t believe in displaying new lines. It just smugly ignores your CHAR(10), leaving you staring at an unhelpful string of text.

To fix this:

  1. Select the column where the merged comments appear.
  2. Click Wrap Text in the toolbar (under the Home tab).
  3. Marvel at the newfound readability of your feedback.

Copying the Comments Elsewhere

If you want to paste the merged comments into a report, Word document, or email, the new lines should carry over—unless you’re pasting into a plain text field that doesn’t respect line breaks. If that happens:

  • Try pasting into Notepad first, then copying again.
  • Use Ctrl + H (Find and Replace) in Excel to swap CHAR(10) for another separator (like a semicolon or bullet point) before copying.

Final Thoughts

This method saves a ton of time when providing feedback on different sections of a report. No more manually copy-pasting comments or trying to decipher your own mess of concatenated text. And as a bonus, you get to look like a spreadsheet wizard in front of your colleagues.

So, go forth and merge feedback with confidence! And don’t forget to turn on Wrap Text, or you’ll be staring at a very long, very unreadable single line of text, wondering where it all went wrong.

Happy grading!

Thanks to ChatGPT for help writing this.

Full Fat MIDI Cheesebox is coming

The finished version will have the lid on properly…..

I’ve been working on an upgrade for the original PICO MIDI Cheesebox. This one incorporates a MIDI sound generator and extra flashing lights. It’s been fun to make.

Maybe I should make a printed circuit board….

I’m using the PCB version of the cheesebox and connecting it directly to the light display PICO from the Chocolate Synthbox. The light display changes in time with the music. The original version of my lights responded to special messages sent from the synthesizer. I’ve changed things a bit. The latest version responds to MIDI messages. Last might at the hardware meetup I was trying to get the cheesebox to send messages out of two serial ports, one for the sound generator and the other for the light display. This turned out to be tricky because some of the serial data pins I wanted to use have been allocated to other things.

So this morning I just connected the display PICO to the same cheesebox serial output as the MIDI sound device. Sending serial data from one pin to more than one device was probably not the best way to solve the problem, but it did have the advantage of working perfectly. Then, all I’ve had to do is re-write the message code in the display PICO so that it understands MIDI and changes the lights in response. The final touch will be to get all this boxed up and working. I’ll put all the designs and software on GitHub once I’ve made them all work.

Mostly Musical Hardware Meetup

Ross with his “fillet of piano”

Another musical hardware meetup tonight. Ross brought along a demo of his amazing “piano round trip machine”. Not content with making an electronic pianola he has now added infra-red distances sensors to the piano keyboard. These generate midi notes which means you can make an old out of tune piano sound like anything. Including a new in tune piano.

Keyboards old and new

It was very impressive and opens the door on all kind of interesting stuff. You could make a piano which joins in with your playing, or plays the left hand for you.

Brian had brought along his theramin-ish machine which uses distance sensors to control sound playback.

Something else I now want to buy….

Richard brought an amazing led panel. Next time I’d like to see if we can use it in some long-exposure photographs.

This is Brian’s Pi Powered AI tracking skeletons. It was amazingly quick and didn’t slow down when more people entered the frame.

I brought along my latest non-working project and used the MakerSpace oscilloscope to prove that I really don’t know how to create a software uart using Raspberry Pi PICO state machines. But I might get it working for next time….

The next meetup is in two weeks, on the 19th of February. This one will have a photographic bent. I plan on bringing along my servo-powered cable release, among other things.

If you fancy coming along it would be lovely to see you.

Bye Bye Octopus Agile

Only a little while after I updated the Agile Octopus Display we find ourselves leaving the Agile Octopus tariff. At the start it worked well and we were able to work around the expensive parts of the day and make good use of free (or sometimes even paid to use) electricity. But we did notice that when the weather was calm and cold the price of power got unpleasantly expensive all day. Above you can see the occasion a few weeks ago when we decided to quit. For reference I think the price of power should be in the twenties.

We did the sums and concluded that we would need an awful lot of free/cheap power to compensate for these high peak prices. So for now we are on a tariff which gets cheaper overnight and we’ll be working round that.

Evercade Game Machine

Yesterday found me at the Video Game Market in Leeds It was quite a bit bigger than I expected. I thought we’d go in, spend half an hour looking around and then head out for lunch. But lunch had to be put back an hour or so because there were so many stands and so much stuff. It was busy, but not terribly so. They had phased entries at different times of the day. We were in the second sitting, starting at 12:00 so there might have been some amazing bargains that were snapped up by the 10:30 folks. But, there were also lots of things worth having.

I’ve been watching the progress of Evercade for a while. They have a mission to put classic old games into the hands of players who don’t want to have to mess around with strange hardware emulators and search for unlicenced ROM images. Their first machine was a small handset with a 4 inch screen (although you can plug it into an HDMI display if you want to). One of the stands had a one of these plus a stash of cartridges at a reasonable price so I made a carefully considered purchase….

The device works well. The screen is bright and the controls are just right. Each cartridge comes with a little booklet with game details and controller info. I don’t remember “Bad Dudes” or “Karate Champ” (classics in the Data East collection that I got with the set) but I’m looking forward to giving them a spin.

Evercade are working their way through various platforms and they seem to be good at tracking down and licencing lots of classics, including ones from the Bitmap Brothers, Gremlin, Team 17 and whatnot. The cartridges are pocket money priced (if you get more than 17 pounds pocket money) and Evercade are now branching out into consoles to go under the TV and even free-standing mini-arcade machines. I’m pleased with my purchase, and I’m very tempted to try and find space for one of their little arcade machines….

Drawing Dustbin Lids with ChatGPT

I was talking to some students last week about the interview process for the marking of their project. I said that they would do fine, as long as they didn’t use the “dustbin lid defence”. I used this when I was at school. If you were being approached by the class bully (every class had one) a good trick was to point over their head and shout “dustbin lids!” as loud as you could. Then, while they were scanning the sky for lids you made good your escape. It only worked once per bully, which was a bit of a limitation, but it was on occasion very useful. It doesn’t work in assessment interviews though.

Anyhoo, I thought it might make a good blog post but it needed a picture so I asked ChatGPT to draw some dustbin lids in the sky in the style of a 1950’s UFO sighting. Turns out that ChatGPT doesn’t know what a dustbin lid is. I got lots of floating dustbins. So I uploaded a picture of a dustbin lid for reference and now ChatGPT engaged in a debate with itself as it made the pictures:

It was really interesting to watch it at work. One AI process trying to get another process to do what it wants. I’m quite happy with the final result although there is a bit of a kerfuffle with the telegraph lines in the right hand edge. It was great fun, although I do worry about just how much electricity I used up just playing with pictures.

Update: After my search for dustbin lids to get an image of a lid the internet is now convinced I need a new dustbin and keeps showing me pictures of them wherever I go. But how would I throw away the old one?

Levelled Up Servo

I really, really want to be able to control the shutter on my Polaroid camera. So I’m in the process of building an actuator which will push the plunger on the cable release. Version 1 was a bust. Almost literally. The shutter button on the camera hardly moved while the servo made some very unhappy noises.

You can see version 2 above. Considerably more beefy. This servo actually contains metal gears. I’ve done a quick test and it seems to work, which is nice. Next thing is to build a cable release holder and attach it to the actuator.

If you want to see it in action, sign up for DD North and come along to my session.