Why Have You Stolen Our Earth

Today thousands of young people walked out their lessons to protest at political inaction over the climate change crisis engulfing us.

It is shameful to hear our politicians blame the students “bunking off” in order to raise awareness of those politicians own failure to act. Anyhow as part of the discussion someone asked us what the tune was for a song called Why Have You Stolen Our Earth because the lyrics seem particular appropriate given today’s news.

Update: This is a song that I’ve only ever heard it passed around at campfires and I wasn’t really sure where it came from. Having posted this I’ve discovered that to listen to the original track then you should track down an album called The Wild Side of Town by the Albion Band with Chris Baines.


Fifteen minutes using a Boss Micro BR

The fifteen minute figure is a slight poetic license. I did record this track during my first fifteen minutes playing about with the recorder. However after that it took me nearly twenty minutes to figure out how to master it into a format I can share with the world!

Recording is an Epiphone Dot plugged directly into a Boss Micro BR using the P01 “SuperCln” preset. The preset has been changed from the factory setting only by turning off the chorus.

To be honest the chorus effect sounds pretty terrific but, with such a naked guitar part it makes it sound like I have something to hide.



The Encore project – Introduction

Recently I allowed myself to be given a very old beat up Encore strat copy. The idea is to have something that is provably worthless to mess about with as a confidence building re-finish project.


Somebody has attempted to refinish this guitar before and failed in quite an extreme manner. The body, originally black, is still just as black but has a weird tar like coating on top of the slightly cracked original poly finish. It must have looked better before they started work, simple because I haven’t found much underneath that I wouldn’t have been happy to address with nail varnish and T-cut. In the picture below that big rectangular patch on the side is some of that charming tar. From the shape I can only assume the new paint reacted badly with the glue of some stickers.


The scratch plate is almost worse. It looks like it is coated in tipex…


This last pictures is a close up of the controls that shows the edge of the scratch plate nicely. Its actually a three ply scratch plate but you can hardly see the black middle ply in places.


Oddly the neck is actually in a pretty good state. Not only that but I was actually pretty stunned by its build quality (let’s just say I was not expected great things from this guitar). The wood of the fretboard is a bit cheap (and not stained enough) but the main wood of the neck is sufficiently pretty and the frets are really quite well finished. Its a fairly nice profile too so when I can get over my prejudices it doesn’t feel that bad to play.

The body? Not so much, they’ve put the money where is shows and put the MDF were it doesn’t! I had at least hoped for plywood (like my old Epiphone SG) so I could play about with transparent finishes. Not to be, so it goes…

Anyhow, ideas for how to refinish would be cool. I’ve more or less given up on the idea of a trans finish. I did briefly toy with doing an “industrial” finish of incompletely sanded back black poly next to very dark stained MDF under a tinted transparent finish. I might learn something doing that but I suspect what I would learn is not to put half sanded MDF under a transparent finish…


The Egmond Project – Update #2

The next part of the project turned out to be getting everything lined up. After rebuilding the guitar I left it at pitch for a week or two to see if anything moved… it didn’t. Since the last post I have also moved the bridge over a bit to improved the line up of the strings. Unfortunately with the bridge in the right place the bass string started popping out if anyone breathed too loudly so I took the bridge out to cut a much deeper saddle slot for the bass strings.

Note: This post is part of a series: [Update #1] -> [Original post]

Even with these changes it still lacked quite a bit in the playability department. After several hours trying to shave the bridge I concluded that the neck joint really did need the neck to lay back a bit more. The Egmond’s neck joint it rather different from the Fender-style neck joint you might see on electric guitars. Instead of the four big screws it relies on a single bolt to counter the tension of the strings.

The Egmond cantilever neck joint
The Egmond cantilever neck joint

Basically the neck pivots on the plywood at the top of the neck joint, whilst the single bolt goes through the heel of the neck, through the spring and into the body. Adding some shims to the pivot point allows the neck angle to be increases slightly, dropping the strings down a bit and making the guitar more playable.

Neck joint with shims inserted
Neck joint with shims inserted

The shims were made by setting a plane to a fairly brutal setting and running it up and down a piece of beech. Sadly they were not quite thick enough, even when doubled up. The folks over at The Guitar Grounds were very helpful. After they described how the 70s era Fender’s were generally shimmed using whatever was at hand (often business cards). I figured if business cards were good enough to US made Fenders then I could get away with four layers of wooden shims. Actually I have three shims on one side and four on the other so correct the angle slightly.

It’s done the job. The neck is now laid back enough that the little metal wheels on the bridge can adjust the action properly. I’ve been forced to set the action a little higher than I would like because the frets could really do with the attention of a crowning file (which I don’t have). Nevertheless it makes the world of different to its playability.

Electrification will come soon!


tintdrum – tintamp’s junior stablemate

For some time now I’ve been playing with constructing my own digital modeller.

By and large I’ve deliberately kept the scope of the project to be a make a practice tool (rather than a studio effect) in order to try an keep things achievable. The ultimate aim is to make a device that you use like an amPlug (or iRig for iPhone) to practice with. More exactly it is a battery operated “thing” that allows you practice without any wires except those joining the guitar to your ears.

I’m working in phases of very limited scope so that I can lose interest in the project whilst still having achieved something and there’s still a long way to go before I can call it a modeller. Nevertheless since Christmas I’ve been able to move from playing with software in the PC to playing with something real.

STM32F4-Discovery running an early version of tintdrum
The above is my recently acquired STM32F4-Discovery board running tintdrum, a fixed function groove machine designed to use like a metronome but with a stronger groove. The idea is that this type of drum machine is a vital component of a digital practice tool so tintamp will definitely have to have one when its finished. However it is actually useful enough to be a separate thing in its own right. Something I can put in a box and call “done”

The board above is running my own drum machine software. You can tell can’t you? Until last week all it was able to do was plug in and it started playing drums via the headphone socket at the bottom… it played a really basic 4/4, kick, snare, kick, snare beat (plus hi-hat)… at exactly 100 beats per minutes… and that’s it.

This week however I’ve been able to extend it to flash an LED on the beat (a vital feature in a practice tool) and also been able to rig up a tap tempo button. This means its starting to feel real. That said I still need to implement controls to change the groove and volume. I’d also like to extend the drum machine code to include humanization to stop is sounding quite so start.

Nevertheless the journey from PC to real hardware has begun. Bon voyage.


The Egmond Project – Update #1

The restoration/reassembly of this lovely old guitar is coming along nicely. I spent a good half hour the other day working methodically though the box of screws, pickups, electrics and hardware until I was sure I know what each screw was for. It turned out to be quite complex jigsaw, made a lot easier when I realized that the screws for the machine heads didn’t actually match (which is why I couldn’t find 16 identical little screws).

I also spent a fair bit of time with the bridge. As you can see on the photo below I needed to sand it down a bit to match the curvature of the guitar.

With the bridge feet set up to avoid damaging the top of the guitar I had all the bits ready to string it up and see what other adjustments might be needed. When I first strung it up I realized I would have to cut slots into the saddle to get the string spacing right (not quite sure how I overlooked that). So finally yesterday I was able to bring the guitar into a playable condition.

First impressions are pretty good. Its fun to play and sounds much more like a double bass than my electric basses. I understand the tapewound strings contribute to this.

At this stage I’m not quite ready to start the rewiring as there remain a few drawbacks. Some of this is just finishing what I started. The truss rode needs a little more tuning now the strings are at tension and I need to shave several mil of the bridge. I need to shave of a little more from the feet, a little from the saddle and then take the rest from the middle section.

The other issue is that the strings don’t quite run parallel to the fretboard.

Most of what you see in the picture above is actually caused by the bridge being incorrectly sited. However there is some play in the neck joint meaning I can pull the neck and bring the strings completely straight. The neck joint has odd single bolt plus one light duty woodscrew construction which I’ve not seen before and I haven’t yet decided whether or not to try and wedge it. I’m going to leave that decision until the bridge is at the right height.

Nevertheless I pleased with the progress so far. It’s bags of fun to play acoustically… looking forward to starting on the electrics.


The Egmond Project – Introduction

After my uncle’s sad, and rather too early, passing away I recently inherited a guitar project. Basically the guitar said something to me from the first photo I saw of it, perhaps because semi-acoustic basses really aren’t very common. It went from a passing whim to a potential project when my dad unearthed a cigar box full of all the guitar hardware that changed the body and neck from being firewood into being a viable project.

So now there is something potentially wonderful in my garage. It just needs a little time spent on it. Everything I’ve got is shown in the picture below, both main bits of guitar together with a cigar case containing all the missing hardware, right down to the strings.

Looking more closely at the box of bits is interesting.

In there are all the bits and bobs that need to be screwed, nailed, wedged and soldered together to bring the guitar back to life: pickups (one of which needs repairing), tail piece, machine heads, circuit components, switches. So far I’ve not thought of anything missing.

I have spent some time trying to work out why the guitar was taken to pieces. Was there something wrong with it? Certainly the bridge overs some clue that I might end up having to do something about the neck.

Those massive grooves really shouldn’t be there. It’s like they were cut to account for a neck that was practically falling off. However I’ve looked very carefully at the joint and I don’t see the problem. When properly tightened it sits at what looks like the right angle and doesn’t want to move much.  I guess I won’t find out until I buy a new bridge and try and bring the strings to tension.

For now I have concluded the guitar was in so many bits because my uncle was planning to refinish it. When someone takes so much of the hardware off it can only really be to get down to the wood! For me that’s terrific news, because it suggests it was playable and will fit back together again!

So there it is… a project. I’m looking forward to it.


A guitar preamp using biquads and a waveshaper

Let’s start this with a confession. This post is nothing more than a summary of an idea I picked up from an eight year old paper. I didn’t even go to the trouble of finding the paper myself but instead found it cited in the source code to guitarix. For that reason this should be quite a short post.

Firstly remember that at the moment tintamp is not really a modeller. It will be, but its not there yet. For now its just a fixed function digital signal processing chain that is “good enough” to allow each stage in the chain to be prototyped and developed further. On the plus side being fixed function makes things very easy to describe.

So the first revision attempt at a tintamp preamp consists of three similarly configured amplification stages based on an approximation of a class A 12AX7 amplifier. The heart of the tube stage is a waveshaper based upon the transfer function of a 12AX7. This is surrounded by three biquad filters that model the effects of the capcitors in the circuit being modelled.

All told it looks something like this (click to enlarge):

Please forgive the poor layout above. I rushing to press “Publish” just a little and I’m not very expert at graphviz just yet. Additionally if you want to see the ideas expressed more lucidly the Virtual Air Guitar folks have already done a very good job, take a look at their paper!


Cabinet simulation using biquad filters

My last post introduced tintamp and described the target hardware for the project. I’ll now fill that out a little bit with a description of one the building blocks from which I plan to construct the initial signal chain. For now the idea is to fairly simplistic DSP techniques from which I can develop and end-to-end signal chain, including an amplifier, tonestack and cabinet simulation. Once there is a complete signal chain then the hardware components needed to connect the delicate guitar signal to the target hardware can be tested. Likewise when more sophisticated software is written we have a benchmark to compare it to. There’s no point in sophistication just for the sake of it.

Ultimately I think only two blocks are needed to build a complete chain, a biquad filter and a waveshaper. On its own the biquad is sufficient to construct simple tonestacks and cabinet simulations while the waveshaper allows us to trivially model non-linear relationships between input and output voltages. A waveshaper is not insufficient to model a real valve’s behaviour for AC signals although it can be combined with a biquad filter that feeds back from its input to its output to add at least some modelling of dynamic behaviour.

So on that basis I coded up these basic building blocks (including a test suite) and set to work. I should at this point express my gratitude to Robert Bristow-Johnson for his Cookbook formulae for audio EQ biquad filter coefficients, all those filters compressed into such an easy to read document saved me an awful lot of work.

So, lets get back on topic and introduce a basic cabinet filter using only biquad filters. My starting point was a trace of the frequency response of the Condor cabsim from runoffgroove. I had no real reason to pick this cabinet response over any other but I happened to stumble across their graph first.

Based on the above graph picked out five biquad filters:

  • A -16dB partial notch filter at 400Hz to get the deep notch
  • A 6dB high boosting shelf filter at 400Hz to get the roller coaster effect
  • A single high pass filter at 60Hz
  • Two low pass filters each at 4000Hz

As of now I haven’t yet graphed the response of this cabinet simulation (although I have listened to it) and currently all the Q values are untuned and set to 0.7 . Tuning these will have a big effect on the mid range since in particular they change the shape of the curve around the notch.

Having got this far I won’t be using the runoffgroove graph as a reference any more. All further tuning will be by ear and, eventually, I’ll create other speaker models using graphs from real speakers. That said it will be while before I start improving the cabsim. At the moment one working cabsim is sufficient to get the rest of the signal chain in place so the focus has to be somewhere else for a while.


The Integer Amplifier

This post is an introduction to tintamp, the integer amplifier. The goal of the tintamp project is to build a free software guitar modeller for low resource computers such as digital music players or modern high performance microcontrollers. The focus on low resource devices defines much of the character of the project from its choice of implementation language to the relatively simplistic, and therefore CPU-friendly, DSP engine. These devices also mandate unusual features such as the no malloc() mode and the use of purely integer arithmetic operations (a.k.a. fixed point) from which the project gets its name.

To provide even more focus and to make it easier to ‘complete’ the project I have picked two platforms to be reference devices. These are the first devices I expect to port tintamp to. Both devices require a little hardware hacking as well as the tintamp software so there will be a substantial element of learning as I go.

Target 1 – Sansa Clip Zip

From a hardware perspective this is a simple mini-project to convert an off-the-shelf digital music player into a headphone practice amplifier. The digital music player in question is the Sanza Clip Zip made by Sandisk.

From the point of view of this project it has good many things going for it. In particular it has audio inputs that can be tapped into by de-soldering either the built in microphone or FM radio chip. It also has a colour display, a 250MHz ARM9 CPU and,crucially, a mature Rockbox port. The Rockbox port means I can concentrate on the signal processing code without having to work very hard getting the rest of the hardware to work. Even better, these devices are really cheap, so much so that I’m seriously contemplating buying a second one to keep and use for its original purpose.

The only problem with the device is the noise floor. The microphone is probably too noisy too use at all and even with the FM radio’s line in things are only 12dB better. Still, when finished this device will be a headphone practice amp so there’s little need for studio quality effects. It just has to be playable.

The most significant technical limitation of this platform is the absence of FPU making this device is the main motivation for (optionally) using fixed point arithmetic.

Target 2 – STM32F4-Discovery

This time around the mini project it to take a demo board based around a very powerful modern micro controller, combine it with a good quality codec chip and build a digital effects pedal.

The discovery board from STMicroelectronics[1] brings most of the pins of ST’s STM32F4 controller and brings them out to header connectors. This includes the I2S (digital audio) in/out needed to interface it to a codec chip. Alternatively the board has built-in audio output together with a USB on-the-go controller that allows a USB audio device to be connected up.

The STM32F4 is based around a 168MHz ARM Cortex M4 which, although restricted to only the Thumb2 instruction set, does have a floating point unit. Here the big restriction is that being a micro controller there is only 192k of RAM. This will have to be very carefully managed. On the other hand what memory there is should be very fast compared to the CPU so no performance will be wasted with cache misses.

In the interests of full disclosure I should probably mention that I work for STMicroelectronics. However I don’t work in the microcontroller group and I didn’t pick the Discovery board because it was made by ST. I picked it because the board is fast, cheap and has I2S pins. Likewise, however much I ask my manager, I don’t get the board for free; I have to pay for it like anyone else. While disclaiming things I should also add that nothing in this blog comes from my employer. I’m not authorized to speak on their behalf and all opinions expressed here are purely my own.