Thursday 30 April 2015

The joy and despair of Mahler on a micro

This is all sorts of wonderful.  Twelve Sinclair ZX Spectrum vintage home computers, networked together to play the first bit of Mahler's First Symphony. Why? Because of a throw-away line in the original Spectrum's manual from 1982.

But I am troubled.

I taught myself programming on a ZX81, then a ZX Spectrum, and through a series of unlikely events ended up at Sinclair Research in the mid-80s. My first real job there was taking the original source code for the ZX Spectrum, which lived in a handful of largely undocumented slabs of raw Z80 mnemonics, and rebuilding it into an editable form for the ZX Spectrum 128 project. I had to rely on Ian Logan and Frank O'Hara's Complete Spectrum Rom Disassembly book, as the Sinclair documentation was about three comments and a semi-descriptive filename.

(Later, I worked for Amstrad on the Spectrums +2 and +3. I also wrote advertising copy for them. As the +3 had MIDI, I wrote that it "could play a symphony" - the boss made me take that out, over my objections,  as he wasn't sure it was technically true. Thirty years on, I have been proved right. Oh yes.)

As it was for uncounted thousands of others, the Spectrum was a life-shaping slab of warm black plastic.

I am unstinting in my love.

I am also a terrible snob. While I am delighted by the Mahler project, I must question some of the decisions.

The first is the use of a Raspberry Pi as the central synchronising conductor. Some may say that the Pi is the spiritual successor to those revolutionary days of home computing, and I would not demur. Some may say that it is not only valid but essential to allow the performance and interpretation of all great works of music to adapt to their times, bridging the sensibilities of the present with the eternal genius of the creator. Of course, of course.

But what we have here is the equivalent of original instruments playing music in the original style. The Pi is hugely connected - one would say  tainted - with Sinclair's great rival, Acorn Computers and its BBC Micro. Think Herbert von Karajan vs. Wilhelm Furtwängler, or Oasis vs. Blur. Having a Pi at the centre of things is like Blur reforming (oh, they have) and touring with Noel Gallagher as musical director (oh, he isn't). The Pi is a placeholder in the eternal war of Z80 vs 6502, and that must never, ever, be forgotten, let alone capitulated.

Why was the Pi even necessary? That a central synchroniser was needed - sure. Different Spectrums can run at subtly different speeds - the later models especially - and they can't keep time so well. But surely another Spectrum could waggle the virtual baton? Conductors do not keep strict tempo  - a job for metronomes -  and that is fine, as long as the orchestra follows.

The other is the use of modern Soectranet Ethernet adaptors. Now, these are wonderful in their own right; I saw the prototype running a Twitter client on a ZX Spectrum at the Bletchley Park Vintage Computing Fair a while ago, and rejoiced at the absurd pleasure it gave. But the Ethernet standard, 802.3, was introduced in 1983, the year after the Spectrum. Not quite anachronistic, certainly inappropriate. Why not use ZX Net, the network built into the Spectrum's own Interface 1? That would also provide the famous Sinclair-designed mass storage 'solution', the Microdrive, which nicely sidesteps the rather dull business of loading tape software into the twelve computers of the symphony.

I freely admit that these complaints are niggardly, mean and pointless. It would have meant a lot more work for the volunteers behind the project, and not one in a thousand of those attending would have cared. As it is, the project succeeded admirably in celebrating the hacker ethos, keeping history alive, and promoting the human nature of technology in an age where it can seem remote, commercial and slightly alien. Many would be more than satisfied with this.

But there is no point in being a terrible snob if one is prepared to be swayed by arguments over niggardliness, meanness and pointlessness.

There is either a right way, or there is not. I condemn these evil traducers to the burning pits of Hades, with a broken WH Smith's piano-keys cassette player, a wobbly RAM pack and an overheating regulator. for all eternity.





Sunday 26 April 2015

The Wristwatch of the Long Now

One of the many criticisms of the Apple Watch is that it is priced as an expensive to very expensive watch, but has the expected lifetime of a smartphone. Expensive watches hold their value, not for the four or five years that Apple products hold theirs, but across generations - so is this, too, to be lost? Why don't we try and do better?

I have always been fascinated by building electronics for a very long life. I collect old radios, and have one that's getting on for eighty years old: it's in a sorry state but is very capable of being revived. Earlier radios yet - the renowned cat's whisker sets - have nothing that wears out and need no power. If kept properly, they'll work as well in five hundred years as they did on the day they were made. (Transmitters are another matter, but even so...), I once built an 'eternal' Radio 4 Longwave receiver which was as simple as possible, had no moving parts except the speaker and no electrolytic capacitors (electro-chemical components that degrade over time) and was powered by a pair of solar cells. There's always the problem of night - I couldn't get around the need for rechargeable batteries, which die quite quickly, but they can last a long time if you treat them gently. it worked perfectly well for the ten years or so I had it.

But how do you build electronics for the centuries? Moreover, why would you? There are aesthetic and cultural reasons - we value antiquities for what they tell us about our ancestors, and ourselves, as well as their intrinsic beauty. They are messages from the past, time-travellers whose value constantly renews as we discover new ways to look at them. But there are practical aspects, too; what we can learn by reassessing lhe data locked inside their fabric informs our understanding today and predicting the future. There is no reason why electronics, our premier technology, shouldn't be consciously designed for that future, to carry on that work. It would be something that didn't deny consumerism but gives it more ambiguity, new ways to consider what it is, exactly, that we're doing - even who we are.

One of the most striking projects is the Clock of the Long Now, a multi-million dollar effort to build a timepiece that will not only survive ten millennia but keep good time throughout. It's mechanical, but the problems it faces - power, maintainability, reliability, clarity of operation, independence from external resources - are the same that any Methuselah electronics has to deal with. And there are no reasons to think that any of these problems would be unanswerable - when we do decide to design for the long-term, we can do quite well. The Voyager space probes are still alive after nearly forty years in space, after all, which is a lot harsher place to live than your front room. There's just no commercial imperative.

Which is where the concept of beauty comes in. We are predisposed to find well-engineered things worth having in themselves, far more so objects that also display consummate artistry.  Apple makes aesthetics one of its primary selling points, and that's worked out quite well, so it's safe to assume that there'll be a market for things that are not only beautiful and functional, but intend to hang around for hundreds of years.

What might these things be? A long-standing idea is that of the life catcher, a gizmo that records a wide variety of pictures and daily events over years, but none of the prototypes and experimental devices have been commercialised. These are probably too complex to be a good starting point for the new tradition of devices that outlive their owners I'm proposing

Any data stored over deep time is interesting. If you could look over even just your average daily ambient temperature over your lifetime, you'd find much to intrigue you. Or the loudest five minutes of audio every Christmas Day, or tiny snapshots of time spent with relatives, or how busy your WiFi is or... well, there is so much evanescent information in our lives. What would you most want to relive about your grandparents' time - or that of their grandparents?

Every aspect of design is challenging. Electronic components - simple and complex - do not have century-designed lifetimes, and some, such as flash memory, have very limited specifications. But that's because they haven't been built that way. Power sources wear out, mechanical systems wear out, solar cells degrade, and energy harvesting harvests very little. But you can design for intermittent power, and you can make things repairable and replaceable without disrupting the integrity of the data collected. And you can set your own rules: we're conditioned to think about continuous or periodic data collection, but what if there was, say, a diamond that quietly stored energy from light and only sampled and stored data when enough had been accumulated? Interesting things are only going to happen when there's light about, after all - so if you can crack a very low energy clock that maintains a timestamp, then you've got a worthwhile system.

That very wide range of challenges makes it somewhat unimportant exactly what the first finished device will do, because there's so much to sort out.  There are so many avenues to explore and we have so many marvellous new techniques in our toolbox of materials engineering. Each functional module can be developed in parallel, alongside research into form and purpose, and there will be commercial spin-offs along the way. Artists and craftspeople should find plenty of inspiration to play around with, too.

It'll be a long project and will take some dedication and support, but it's audacious enough to be worth it. The Clock Of The Long Now is funded by Jeff Bezos; Apple might like to think of the Wristwatch Of The Long Now as a very fitting complement.

Legacies can be potent.

Friday 24 April 2015

Digital switch-over for FM radio could be FM's golden chance

Now that analogue TV is dead in the UK and we're all watching Antiques Roadshow on terrestrial and satellite digital TV or iPlayer, people are talking about the FM radio switch-off. The Government is keen on this to save broadcasters money and encourage the digital radio industry, but nobody else likes the idea of making the hundreds of millions of FM sets obsolete  Originally, 2015 was going to be the final year for old-fashioned stereo wireless, but as this relied on 50 percent of UK listening being on DAB and the take-up seems stalled at around 35 percent that's been pushed to 2020 or beyond. Perhaps. As many smaller broadcasters on FM won't invest in DAB until there is a solid date, and until they do the DAB listener penetration won't go up much, we are at something of an impass.

It was relatively easy to switch off analogue TV. Nobody had to throw away their old tellies, as it has been easy and cheap to plug in a set-top adaptor box for years, and TVs in cars aren't an issue. And the frequencies freed up by the transition are very useful for data and thus very valuable - not the case for the VHF FM broadcast band, which is useless for anything else. Although one country - Norway - has said it will be closing down FM in 2016, it has a population basically half London's, No comparison.

So - not much money, not much demand, politically dangerous. It's probably not going to happen.

But if it did, what would it be like? What would happen at midnight on the great day? Would the listeners be left with nothing but memories of Tony Blackburn and the Archers as they tuned through the dead reaches of static between 88 and 108 MHz? Ho, ho, ho.

Take a look at this list of radio stations caught on a scan across the London FM band last year. More than forty of them are pirates who, one supposes, will not dutifully pull the plug at zero hour. Quite the opposite - with millions of receptive listeners having nothing else to detain them, one could expect the newly fallow channels to be populated by our piratical pals in microseconds. Nor is that difficult: a quick look through eBay shows that you can pick up FM transmitters with useful ranges for forty quid upwards. And if Ofcom can't be bothered to close down the pirates when they're active on a band that's officially in use, it certainly won't bother afterwards - and nobody's going to pony up the cash to make it happen anyway.

Which raises an intriguing possibility. It would be cheap and easy for a public-minded person in a community to set up DAB-FM gateway transmitters and replace the big broadcasters' missing signals. Capital and running costs would be minimal, and it's even plausible to add extra services (such as BBC 6 Music) that aren't on FM now. In fact, there'd be no way of stopping people from doing it, without some massive legal campaign by the authorities, and the political fall-out would not be pleasant.

So, how about encouraging that? Create a framework for co-ordinating transmitters and frequencies to avoid mutual interference, publish light technical guidelines and provide planning help for transmitter footprints, antenna positioning and so on. Much of this is already available online for free, and could be largely automated. It wouldn't even need to be a government service, although some thought would be needed for how to handle disputes and problems. The very real problems of malfunctioning or mal-adjusted equipment causing interference to other services - the air band is next door -  would remain, but even here there are a number of potential, low-cost and effective solutions to identifying and correcting such problems. There is now a glorious profusion of clever radio systems you can build for pennies that can scan bands and track, locate and characterise unwanted signals. This could even work better than the current rather ponderous and expensive Ofcom man-in-a-van approach.

The resulting largely deregulated FM band could be the best thing to happen to broadcast radio this century. Communities could have their mix of national and local broadcasters maintained, while getting the freedom to create their own low-cost stations at will. The burden of massive national network infrastructure that merely repeats DAB content would be lifted

You can, if you wish, get worried by thoughts of copyright and rights payments if just anyone can plug in a transmitter and become a broadcaster. Those are, I think, small fry compared to what's happening right now online

Wednesday 1 April 2015

High Resolution Audio - floored by the noise

I know why they do it, but it's not helping.

Xmos, a UK company I know and admire, sells processor chips. They're massively multicore and deterministic, acting more like programmable hardware than classic processors but (unlike FPGAs, for example) are easy to program. As a result, they're good at stuff that needs a lot of real-time data handled with low latency, such as audio processing.

Audio is a big part of Xmos' market, and that's good. Digital audio has made huge quantities of high-quality speech and music part of everyone's lives. Those of us who grew up before CDs were invented have some idea how remarkable the past forty years have been: the younger lot, however, take near-universal access at near-zero cost to practically perfect audio as their birthright. There is a lot more pleasure out there for the taking, and the world is much the better for it.

But not everyone is happy. One big problem is that people have stopped buying hi-fis - or, rather, people never buy them in the first place. Older people still do, but they're dying out. Those below 40 are used to having their music delivered by phone, laptop and tablet: they buy powered speakers or a sound bar, and perhaps they buy expensive headphones, but an amp, tuner and deck? Get hip, daddio.

The other thing people no longer do is repurchase music. I think my personal record for one particular piece of recorded sound is nine - cassette, 7" single, 12" single, LP, live LP, live video, CD, remastered CD - but then I never bothered with 8-track or pre-recorded Minidisc, and by the time DVDs arrived I'd gone online, never to return.

Large industries relied on both these long-lost activities, and aren't giving up without a fight. To persuade us to buy more kit and all our favourite music yet again, the audio industry and the recording industry have got together to sell us High Resolution Audio! And Xmos is playing its part.

High Resolution Audio is fantastic. It has virtually no limits on the number of bits per audio sample it can support, and no particular end to how many samples a second it can disgorge. And, of course, it eschews all that nasty audio compression like MP3 which excised large chunks of the music in order to keep the files manageable in the days that memory, disk storage and bandwidth all cost serious money Now we have huge memories and super-fast broadband, say the industry coven, we can at last escape the chains of Bad Audio and bathe in the sweet, sunlit waters of the Good Stuff.

If only it were true.

It isn't. Well-compressed audio is indistinguishable from uncompressed audio, because the bits that have been thrown away are the bits we don't actually perceive. You won't hear any difference when things are sampled faster than the old CD standard, because it - like audio compression - was designed to match our abilities as humans. And CD as an audio medium is better by any technical measure (dynamic range, noise, stability) than vinyl - which, curiously, is often touted as an example of 'better' audio.  Which it isn't

We know all this not just because of numbers on a page, but because you can do any number of scientific listening tests to prove it. (You can do any number of tests to disprove it, but they ain't scientific.) The whole business is as daft as the TV industry deciding to sell us all sets that can reproduce ultraviolet and infrared for 'more realistic' pictures.

And if you're engaged in something that even the TV industry finds too shameful to contemplate... boy.

The good news is that, by and large, people aren't buying it. Neil Young's Toblerone-styled Pono player/service has met with derision. (This from a demographic that thinks Beats headphones are a good idea.) Tidal looks like a wash-out from day one. There's enough knowledge out there on the Web about Nyquist and dynamic range and noise floors and generally sound audio engineering that there's no excuse for not knowing the truth. Moreover, you can sell high-quality audio stuff to the digital generation without the flap-doodle.

Which is why I think Xmos is doing itself a disservice by publicly backing the high-resolution audio circus. It doesn't need to do this: if designers want to build high-resolution audio circuits, they'll find the specs of the Xmos products do the job. But the company risks being seen as willing to market nonsense over sound engineering, and I'm not sure a component company that sells to engineers and wants a public profile of competence and trustworthiness needs that.

There is a lot wrong with digital audio, but little or none of it is down to the format. There are tons of very bad products out there - headphones, speakers - and even more atrociously recorded/mixed/produced/compressed content. Xmos could cheerfully campaign against that, even producing reference designs for systems that highlight such sins and, if at all possible, militate against them. And there's no sin in pointing out that its components can go as wide and as fast as you like.

Just don't promote the woo. It sounds awful.






Fast Radio Bursts - ET or BT?

 More fun than aliens

Want to save a few minutes of your life for something useful? Don't read any article headlined "Is this evidence of alien life?". It, more than any other, will follow the rule that any headline that's a question has the  answer "No!". 


There are always small batches of such headlines floating around, as there are always odd things going on that could conceivably be aliens, if only reality wasn't going to barge in rudely and say "My ball, I think". Most recently, such headlines have clustered around the strange bright spot on Ceres (here Alienated by The Register, which at least has the good grace to answer "No" as the first word in the subhead - having your SEO and mocking it being a hallmark of the doughty Vultures), Another batch was triggered by Putin's temporary disappearance. I won't dignify that with a link, but yes, really.

In general, the more scientific the journal the less likely little green men are to appear in a headline. So, what on earth (or off it) is New Scientist doing with "Is this ET?" - published the day before April 1st, to boot? Is it really ET?

I refer m'learned reader to my first paragraph.

There is some excuse for New Scientist. It's reporting on a fascinating phenomenon called Fast Radio Bursts, which have been puzzling radio astronomers for a while. These are - you've guessed it - transient bursts of radio energy that appear to come from outside the Galaxy but cannot be explained by any known cosmic mechanism. As this is the sort of thing that SETI watchers explicitly listen for and anything that can't immediately be explained could perhaps be the result of Vulcan broadcasters, then the question isn't actually illegal.

But it's still not a good question to ask in a headline if there's a more plausible answer. In this case, a little digging not only provides one but - and here one must frown a little sadly at the grown-ups - also comes up with a reason to have some fun with creatures even more extraordinary than aliens. There really are bizarre beasts at work, and New Scientist passed them over in favour of boring old bug-eyed monsters.

Ladies and gentlemen - no, FRBs are not aliens. Instead, I give you (probably) perytons - mythical beasts that are a cross between a stag and a bird.

The New Scientist article actually gets just about a far as you can in admitting this without being quite able to give up its fond hope for real aliens. The shame is that the piece is based on an Arxiv paper that doesn't pull that punch, leaving the reader in no doubt that perytons are afoot (the researchers, Hippke and Domainko, know how to leave the cake of conclusion on the plate for the reader while simultaneously scoffing it down).

Let's not bury the lede any deeoer. Perytons were created by the sainted Borges, who not-really-claimed to have fished them out of a non-existent medieval bestiary. Since then, they've been adopted by various fans of the fantastic, such as video game writers and Dungeons and Dragonistas. Most recently, this chmeric creation has found a roost in radio astronomy, where it is now shorthand for radio signals that  appear to have non-human causes but are really the byproduct of Homo sapiens' own radio activity.

FRBs look cosmic because they're rare - we've only spotted around a dozen - and have a key characteristic of very distant signals; they look like a very intense pulse of energy that's been smeared by a massive trip through intergalactic space. Pulses of radio energy squirt out lots of radio frequencies all at once, high and low, but the low frequency signals get delayed by free electrons hanging around between the stars. Thus, if a signal comes in from far enough away, by the time it gets to us the high frequencies arrive first and the lower stuff lags behind.

Called dispersion, this smearing mechanism is a good way of estimating distance to far-away radio sources such as pulsars, and it can also be used to map the density of the interstellar medium. (This is truly fascinating and eerily beautiful, and I'll get back to this in the future.)

FRBs do indeed show lots of dispersion. So much so, they have to come from outside the Galaxy. But if they're that distant, they must also be unbelievably powerful, far more so than pulsars - which, being staggeringly puissant spinning neutron stars, are already in the top league of ferociously energetic cosmic beasts. It beggars belief that such things could be natural.

So, ET? No! I've told you already! Perytons! There are three main reasons for believing this: iirst, of the eleven FRBs detected to date, ten have been from one site (the Parkes radio telescope). Second, while the dispersion measures are extreme, they're all very closely mathematically related - they have gaps between them that are integer multiples of exactly half the FRB smallest dispersion measure detected. Remember that the dispersion measure is a proxy for the distance of the event from the Earth - for this to be true in this case, the sources of the FRBs must be precisely arranged in space at exact distances from us.

And, finally, the FRBs have arrived in the telescopes apparently well-synchronised to Earthly seconds, the universal timing system that we use to make  our computers, satellites and mobile phone transmitters march in step.

If this is ET, the only reason it'll have pointed ears is because it's a troll.

The trouble with using dispersion to conclude distance is that it assumes the nature of the original pulse. With pulsars - also semi-facetiously labelled Little Green Men when first discovered by Joceyln Bell - we have enormous numbers of observations and a good model of what's going on. FRBs have none of this - if the original transmission just happens to sweep out high frequencies first and low frequencies later, then it'll look far away but could be on our own sofa. Called chirping, this is a very common technique in radar and other related areas. (Very common; i'm listening to a Chinese transmitter doing it on 14 MHz right now.)

A despressingly large amount of time and effort goes into identifying and squashing perytons. Entire frequency bands are marked off-limits. Governments create huge quiet-sky reserves in remote countryside for radio astronomers, where all transmitters are verboten. But still, hundreds and thousands of satellites are up there, full of radio systems and digital computers, all of which radiate some interference as they drift past the sensitive dishes of the deep-space listeners, and all manner of passive but reflective clutter in the sky can bounce back terrestrial interference over thousands of miles.

The herds of perytons sweep majestically across the sky, jabbering like antlered jackdaws: to date, not one has proved to be anything from a race more exotic than our own.

Which is slightly sad, but still a good story in its own right. More so,, I think, than could-it-be-aliens-no-not-really.

(Peryton image: "Perytonmontage" by (Copulating)_Red-shouldered_Hawks.jpg: leppyoneRedDeerCaithness.jpg:derivative work: Tsaag Valren. Licensed under CC BY-SA 3.0 via Wikimedia Commons - https://commons.wikimedia.org/wiki/File:Perytonmontage.jpg#/media/File:Perytonmontage.jpg)