ByteNoise

Transposing sampled chords

If you've ever examined old Amiga modules, you may have noticed that they sometimes contain samples of chords in order to play a whole chord in a single channel. As they have only four channels to work with, this is necessary in order to play a chord at the same time as drums, bass and a melody without having to resort to a distinctive arpeggio. Amazingly, only one of each type of chord — such as major, minor, fifth, and so on — needs to be sampled in order to play every chord there is. The reason this is possible is that the modules all use equal temperament.

Equal temperament simply means that each note the instrument can play is the last note multiplied by a certain number that never changes. For twelve tone equal temperament in particular, this number is roughly 1.059463. This may sound like an arbitrary number, but if you multiply 1 by this number, then multiply that by the same number, and keep going twelve times, you'll end up with 2. In other words, there are twelve notes in each octave, and they're spaced equally far apart in terms of multiplying. In mathematical terms, you might say that 1.05946312 = 2, and that the way we perceive pitch is logarithmic.

For example, middle C has a frequency of 261.626Hz, meaning the instrument (or sample in this case) creates a sound that repeats 261.626 times every second. The next note is C♯4. If you multiply 261.626 by 1.059463, you can work out that the frequency of C♯4 is 277.183. Multiplying this by 1.059463 again gives you the frequency of the next note, D4, which is 293.665Hz. You can use this simple formula to work out the frequency of every note the instrument can play.

Now let's look at a major chord. It contains a root note, essentially meaning the lowest note in the chord, plus a major third, which is four notes or semitones above it, and a perfect fifth, which is seven semitones above the root note. So for C major, the frequencies are 261.626, and 261.626 multiplied by 1.059463 four times, and 261.626 multiplied by 1.059463 seven times. These are the frequencies of C4, E4 and G4, the notes in C major.

If you take a sample of an instrument playing this chord, and play it at the speed for E♭ — multiplying its speed by 1.059463 three times — then all of the three notes in the sample are sped up by exactly three semitones. C4 becomes E♭4, while E4 becomes G4 and G4 becomes B♭4, the three notes of E♭ major.

Because all the notes of a chord are sped up and slowed down by the exact same multiple of 1.059463, and their speeds are all the root note multiplied by multiples of 1.059463, you can play any sampled chord at the speed of any other note, and the semitone distances of all the other notes in the chord will all be preserved.

So even though equal temperament wasn't designed with samples in mind, it still makes the composition of sample based music much easier by enabling you to sample any chord, and play it back at any other pitch.