Jazz (K)nights

Jazz is one of my favourite kinds of music, both for listening to and playing, although I don’t often get opportunities to play it these days.  Therefore, I was delighted to be offered a jazz gig (as a bass player) this coming Saturday night.  This evening I met the rest of the band (for the first time) for a practice, which went pretty well.  There won’t be any further practices before the gig.

The band – The Jazz Knights – is newly formed for this occasion and (apart from me) is made up of members of Holyhead Jazz Club.  It is currently a six-piece band, with a line up of tenor sax/clarinet (doubling), soprano sax, trombone, guitar, drums and bass.  The programme for our concert on Saturday says: “Our music ranges from Traditional [jazz], through Swing, Bossa Nova and Tin Pan Alley/Show tunes”, which seems to me to be a fair description.  The plan seems to be to keep going after this gig and maybe try to get a regular residency (perhaps once per fortnight) at a local pub.  Hopefully I’ll get to be a part of all that too.

We have a set list of 22 pieces for this particular gig.  I have probably played about 7 or 8 of them before (including a few that I’m very familiar with, like Summertime, Satin Doll and Autumn Leaves) and I was at least vaguely familiar with about half the others.  Amongst the tunes that are entirely new to me is a bossa nova piece called Wave (by Antonio Carlos Jobim), which I particularly enjoyed playing this evening.  We didn’t have time to play through the whole set at our practice, so there will be a few that I’m sightreading on the night (which is just the way I like it).

To make matters even more exciting, I am playing this gig on a borrowed bass ukulele.  This is a small instrument (roughly the size of a viola) with polyurethane strings, which plays at the same pitch (and in the same tuning) as a bass guitar or upright bass.  When amplified, it sounds remarkably like an upright bass but is significantly more portable (and easier to fit in small bungalows or on cramped stages).  The only downside is that the scale length is very short (certainly compared to most bass instruments) and therefore it takes some getting used to the different finger spacing.  It’s probably just as well that it’s a fretted instrument I’m borrowing!

The gig on Saturday is a charity gig on behalf of the Anglesey Centre of Mission.  It takes place at St Anne’s Hall, Dale Street, Menai Bridge, starting at 7:30pm (and going on until about 10pm). Tickets cost £6 and should be available on the door, although it’s a fairly small hall so space is limited.  The Jazz Knights will be playing most of the music but there will be an interlude with music from a quartet drawn from the Menai Bridge Brass Band (as it happens both Tim, our trombone player, and I also play with the Menai Bridge Band but we’re not in this quartet).

 

Raspberry Tea

I am writing this on my Raspberry Pi, which is currently hooked up to my monitor at work (it’s now my lunchbreak and I’ve, once again, successfully resisted the temptation to play with my Pi all morning).

As I mentioned the other day, my first attempt at directly hooking up the I/O hardware (rather than going in via SSH or VNC to a headless setup) failed because my HDMI cable and DVI adaptor combo was too big to fit in the space at the back of my monitor.  I suppose the proper geek solution to this problem would have been to dismantle the cable and adaptor and see if I could wire them together directly and make the whole thing short enough to fit.  Instead, I opted for the slightly-less-exciting but also considerably-more-likely-to-work-without-frying-myself-or-my-monitor approach of buying a new cable with a HDMI connector at one end and a DVI connector at the other.  This has now arrived and works fine.

My Pi is beautifully quiet compared to my desktop PC, as it has no fan to make lots of noise (the chip is sufficiently cool-running not to need one) but it’s also noticeably slower (as it has a lot less memory and probably a much slower processor), so I won’t be trying to persuade my boss to let me replace my office computer with a Raspberry Pi, nor ditching my home PC in its favour.  However, it’s certainly an excellent little bit of kit for the price.

I’m still trying to think of actual GPIO based projects that I might want to use in real life, but I’ve now come up with an idea that is at least a step up from just making LEDs flash in pretty patterns.

Several  years ago, I wrote (and then, over the space of a few years, gradually modified) a simple little tea timer script.  As I recall, it started life as a shell script but was soon reworked in Python and has remained in that language to this day.  There are plenty of tea timers in existence but none of the ones I could find did quite what I wanted (which, initially, was mostly to allow me to run it from the command line without a GUI environment to hand, although I later added a GUI option too).

My script works reasonably well and I still use it occasionally, although these days if I want a countdown timer (whether for brewing cups of tea or other purposes) I usually reach either for my mobile phone or my mechanical kitchen timer.  However, one problem I always found with it was that it’s all too easy to miss the alarm bleep and the console message or dialog box that appears when the timer is finished.

It occurred to me the other day (or perhaps it was this morning?) that a nice shiny LED to indicate when the tea is done would be a lot more eyecatching and, with the Raspberry Pi’s GPIO facilities, it wouldn’t be very difficult to set up.  In fact, I’m intending (once I get home to my electronics stuff) to rig up two separate LEDs – one (probably red) to shine while the timer is operating (to show that it’s working) and the other (probably green) to switch on when it finishes.  I may further refine it by making the first LED flash as well if you don’t switch the timer off after a minute or so.

Due to the nature of the hardware and software involved, it’s unlikely to be possible to produce a very accurate timer, but it certainly should work well enough for purposes such as brewing a cup of tea.

More (or Less) Toast

Ordinarily at this time on a Thursday evening, at least during the winter months, I’d be out at Scottish Dancing with the Caernarvonshire and Anglesey Caledonian Society (of which I am the chairman).  This week, however, we have a different activity taking place tomorrow so there is no dancing tonight.

The alternative activity in question is our Burns Night dinner, which this year is actually taking place on Burns Night as it happens to fall on a Friday (I’m not sure why we always have our dinner on a Friday, but that’s the way it is).  Unlike last year, I’m not due to be giving any of the toasts (probably just as well as I’m still recovering from having lost my voice due to a bad cold the other week), but in my role as chairman I will get the pleasure of introducing them as well as the after-dinner speaker.  I don’t yet know who is doing the toasts, or who the speaker is, so those will be nice surprises.  I am expecting that, as usual, Lyn (our dance teacher and the president of the Society) will be reciting Burns’ ode to the haggis at the start of the meal, which is always one of my highlights of the evening (as is eating the haggis, washed down with a wee dram of whisky and accompanied by neeps and tatties).

Incidentally, dancing will be restarting next Thursday night and is due to run every week until Easter (and then a few beyond).  It starts at 7:30pm and takes place at Canolfan Penrallt in Bangor.  We’re always happy to welcome new people along so if you’re in the Bangor area and fancy giving it a go you’d be very welcome.

Another slice of Pi

I mentioned the other day that I’d got myself a new Raspberry Pi computer and promised to say more about it soon, especially the fun I’ve been having with its GPIO port. This post was slightly delayed due to the pressing need to write about other Pi-related stuff at the end of last week, but here it is now.

GPIO (short for General Purpose Input / Output) is the name for pins on various integrated circuits (or chips) that are available to be programmed by the user. Essentially it’s a convenient way to interface your chip with a wide range of hardware. The Raspberry Pi FAQ defines GPIO as “a pin that can be programmed to do stuff.”

The Broadcom BCM2835 chip at the heart of the Raspberry Pi has 8 GPIO pins (as well as several other pins that are accessible by the user for various purposes that I haven’t yet figured out) and a nice, shiny 26-pin (IIRC) connector to make all of the pins accessible. Unfortunately that includes about half a dozen pins that can fry your chips if you connect stuff to them. Also, it’s not terribly convenient to connect wires directly to these pins. For these reasons, I decided to invest in a cheap, simple and potentially extremely useful accessory called a Slice of Pi (NB I have no connection to Ciseco, the company that sells this product, apart from being a satisfied customer). This is described as a “breakout board” and plugs in to the GPIO port on the PI, providing nicely labelled female connectors (i.e. sockets rather than pins) for the pins you can usefully use while hiding the ones that are liable to destroy the processor.

The Slice of Pi comes as a PCB with a bunch of loose connectors that need to be soldered into place. As well as being, presumably, slightly cheaper for the company to produce, this gives you the flexibility to only include the connectors you actually need. Fortunately it is not a particularly difficult soldering task to assemble the board, as my soldering skills are not the greatest.

Armed with my new Slice of Pi and a bunch of electronics stuff that I’ve had for years (since a previous occasion when I got interested in electronics), I have been able to wire up a few simple circuits to test out the GPIO capabilities of my Pi. So far, this has amounted to a few LEDs and a switch (plus a bunch of resistors and some wires) and all I’ve done with them is to make the LEDs flash in pretty patterns (hopping from one pattern to the next at the press of the switch) but I look forward to being able to move on to bigger and better things soon.

Pi Led #3

On the software side, the GPIO port is controlled by a library for your programming language of choice. At least, I assume there are GPIO libraries available for several languages. So far I’ve only looked at Python, which is the Raspberry Pi’s language of choice (and the reason for the “Pi” bit of the name, although they don’t tie you into using just one language) as well as one of my own favourite programming languages (and probably my strongest, to boot).

Having accomplished my first goal of getting the Pi to flash LEDs in pretty patterns, my next task is to figure out some actually useful things to do with the GPIO port.

Evil Power Daleks

As I’ve mentioned before, I’m currently reading through my Doctor Who book collection. This is focused on the classic series (i.e. from its inception in 1963 to its cancellation in 1989; so far my only contact with the new series has been via the TV episodes, mostly on DVD). Although I also have a number of more-recently-written novels (including a few audiobooks) set in this era, the mainstay of my collection is novelisations of the original TV stories. By now, I have almost all the novelisations up to the end of the 5th Doctor’s tenure, with only two outstanding (there were also a handful of stories that were never officially novelised, but there are versions of them published by the New Zealand Doctor Who Fan Club which are freely available online in PDF format – although the novelisations page seemed to be down when I last checked it). My collection for the remaining doctors has a few more gaps but I’m less worried by them since I remember watching the stories that are missing from my novel collection and some of them weren’t that great.

The two missing novels from my early Doctor Who collection are the two dalek stories from the Patrick Troughton era. Both of these were novelised (sometime in the late 1980s, I think) by John Peel (not the radio DJ) but unfortunately they are long out-of-print and copies are now quite expensive to procure. I have not yet managed to find a copy of either book for a price that I’m willing to pay. However, all is not lost as I have managed to get copies of both stories in other formats (not DVD, as both are among the missing stories from the early years of Doctor Who).

The first of the two stories is The Power of the Daleks, which is an especially significant story as it was Troughton’s first (and therefore the first story ever – not counting the two dalek movies of the early 1960s – to feature a doctor other than William Hartnell). I have got a copy of the TV script for this one (which, along with several other Doctor Who scripts, was published in the early 1990s). Reading a script is, in some ways (and perhaps unsurprisingly), rather similar to reading a play and requires somewhat more effort than reading a novel to keep track of all the characters and to imagine how the lines might be delivered.

The other story is The Evil of the Daleks, which was the first story of the next season (season 5) and marked the introduction of the character of Victoria Waterfield, who went on to travel with the Doctor and Jamie for the remainder of that season (before being replaced by Zoe, who is a strong contender for my favourite companion ever). This one I have in audiobook format. They have used the audio track from the original story (which, unlike the video, still exists in its entirety) and supplemented it with some fill-in narration from Frazer Hines (the actor who played Jamie, although he doesn’t put on a Scottish accent for the narration) to explain the bits that are not conveyed by the dialogue.

Both the script and the audiobook provide quite a different experience from reading a novelisation. On balance I prefer the novel format, which I think holds up better as an alternative to actually watching the stories. If I get a chance to get the novels of these two stories without having to mortgage any body parts to pay for them, I think I will do so. However, it is quite nice by way of change to approach these stories via alternative media and it is certainly better than having them completely absent from my collection.

As I write this, I am listening to the final chapter of The Evil of the Daleks. This illustrates one benefit of audiobooks over printed novels, in that you can listen to them while doing other stuff (although potentially at the cost of sacrificing some of your attention from the story).

The Joys (and Sorrows) of Pi

Yesterday was quite a mixed day for me and my Raspberry Pi.

As I mentioned the other day, I’ve been running my Pi headless and accessing it via ssh since I didn’t have suitable input/output hardware to connect to it directly. I also mentioned that I’d obtained a USB keyboard and ordered an HDMI cable and HDMI/DVI converter to allow me to connect up my Pi directly using my monitor at work (strictly during my lunch break, of course ;)).

Shortly after writing that post, my HDMI cable arrived (the converter had in fact got here already), so it was with some excitement yesterday that I took my Pi and related bits along to work with me. Exercising great self-discipline, I managed to resist the temptation to start playing with my Pi during the morning (despite the fact that my boss was safely away at a meeting down in Cardiff) and got on with my actual work until lunchtime. At that point I lost no time in setting up the equipment only to find that the combined length of the HDMI/DVI converter and the connector at the end of my shiny new HDMI cable was slightly greater than the available space in the recessed area at the back of the monitor where the cables are supposed to plug in. In short, there was no physical way of plugging the cable into the monitor.

Scouting around the rest of the building, I discovered that none of the other available monitors had a DVI or HDMI input that I could use. However, I did manage to find one with a composite video socket, as well as a suitable cable, so I was able to connect the Pi that way and have a bit of a direct-connect session with it. I wasn’t vastly impressed with the video quality (and the monitor in question is in a cold part of the building and not easy to move) so I think I probably won’t take the Pi to work again until the new HDMI/DVI cable I’ve now ordered arrives (this one will have a DVI connector wired in directly at one end so it should fit my monitor with no trouble).

Returning home in the evening, I was able to make some progress on the headless connection front which put an altogether more positive spin on the day’s adventures with my Pi. Up to now, I’ve been using ssh to access it via my local network. This is great for command line stuff (which is where I spend quite a lot of my time in Linux anyway) and I recently discovered how to enable the use of programs with a GUI (essentially, adding the “-X” switch to the ssh command, which lets your local X server handle the graphics on behalf of the remote programs). However, it doesn’t seem to let you run a full graphic desktop environment (it could be that I’m just missing something).

While reading around the subject, I recently came across the concept of Virtual Network Computing (VNC), which seems to allow fuller graphic support for a remote system than ssh (I don’t fully grok the technical details yet). I managed to find a couple of good tutorials on setting up and accessing a VNC server on a Raspberry Pi (I mostly used the Penguin Tutor one and filled in some extra details with the eLinux one).

I haven’t yet had much time to play with it, but so far it seems to be working quite well. I suspect that, until such time as I upgrade to a new monitor with HDMI (or at least DVI) capability at home, I’ll continue to access my headless Pi mostly by ssh and use it mostly from the command line. It will, however, be handy to have the option of using a full graphic interface for it if I want to.

10444.7 inches (or 31334.1 barleycorns)

If you’ve been following my blog for a while, you may remember that early last year I started a series of posts on the subject of units of length measurement based on the Distance Measurement Tool feature of Google Maps, using the span of the Menai Suspension Bridge as a test object for comparing the different measurements.

The last couple of units I looked at (beard-seconds and Olympic swimming pools) were decidedly esoteric, but both derived essentially from standard metric units (a beard-second is 5nm and a swimming pool is 50m so it’s not surprising that, as I’ve just noticed, an Olympic swimming pool is exactly 10,000,000,000 beard-seconds long).

This time I want to return (mostly) to somewhat more mainstream units and also diverge from the metric path as we consider inches and related measurements. These form the length part of the so-called Imperial system of measurements which, according to Wikipedia, was formally introduced to the UK by the Weights and Measures Act of 1824, although the actual units themselves are somewhat older. Since 1995, all Imperial measurements in use in the UK are defined in terms of metric units and measuring devices used in trade are legally required to display metric measurements. In practice, many people continue to use Imperial measurements for many purposes.

In principle, I’ve always been a firm supporter of the metric system as it makes a lot more logical sense to me. For instance, I find it much easier to remember that there are 1000 millimetres in a metre and 1000 metres in a kilometre than to remember that there are 12 inches in a foot and 5280 feet in a mile (I had to look that last one up on Google!). However, a couple of years ago I read an interesting book entitled About the size of it (by Warwick Cairns, published in 2008 by Pan Books), which advances the thesis that Imperial units are actually based on various measurements relating to the human body and are thus easier for people to visualise.

For instance, a foot (which is about the same as 30cm – apparently it’s actually 304.8mm) is the length of a standard British size 10 boot, which is the average shoe size for an adult male. As it happens, my feet are size 10. This is obviously fairly approximate as individual boots (for a size 10 foot) vary somewhat in length but it means that it’s quite easy to pace out a length of, say, roughly 6 feet and consequently somewhat easier (or so Mr Cairns says, and I’m inclined to agree with him) to visualise a length of 6 feet than one of 1.8m.

An inch (now officially 25.4mm) is, according to Cairns, essentially the thickness of a human thumb. Although different people have hands of different sizes there is, apparently, less variation in the thickness of thumbs than you might think and certainly they are close enough to a standard size to be quite useful for approximating distances.

I would have to do some experimenting to be sure, but I’m fairly certain that I’m more accurate when I try to estimate (suitable) distances in feet or inches than when I try to do it in metric units (despite my best efforts, in the past, to make myself work in metric). For accurate measurements or calculations, metric would still be my first choice in general, but for estimating or visualising distances (on a human scale, at least) I have always found imperial units to be somewhat more natural and now I have a better understanding why that is.

Another Imperial unit that Cairns mentions, which as far as I can tell was not included in the Weights and Measures Act, is the barleycorn. This, as the name suggests, is the length of an average grain of barley and happens to be exactly a third of an inch. Although no longer regularly used as a unit of measurement, the barleycorn is apparently the basis of the British system of measuring shoes. Here’s a condensed explanation (see Cairns’ book for more detail): A child’s size 0 shoe is based on the size of an average child’s foot when they first start needing shoes, which is 4 inches (aka. 1 hand – you can probably guess where that unit came from); thereafter, shoe sizes go up in barleycorns (e.g. a size 1 is 4 inches + 1 barleycorn, i.e. 4.33 inches, size 2 is 4 inches + 2 barleycorns, size 3 is 4 inches + 3 barleycorns, i.e. 5 inches, etc.); a child’s size 12 shoe is 8 inches (or 2 hands) long (i.e. 4 inches + 12 barleycorns (4 inches)). The next size up (8 inches + 1 barleycorn) is considered a child’s size 13 or an adult size 0 and thereafter the adult sizes continue by adding barleycorns. This means that an adult size 10 is 8 inches + 11 barleycorns or 11.66 inches (11 and two thirds, to be precise), slightly shy of a foot (i.e. 12 inches); the discrepancy is explained by the fact that shoe sizes measure the size of the insole, which is slightly smaller (by about a barleycorn, in fact) than the external size of your boot. In other words, if I want to measure distances in feet as accurately as possible, I should put on a fairly sturdy pair of boots.

The span of the Menai Suspension Bridge, as measured with the Google DMT for the purposes of this blog series, is 10444.7 inches, which is the same as 31334.1 barleycorns or 870.393 feet.