the clock Breaks the Chain

Hello again. We’ve decided to park the spaceship and author a little update for you. You see, last time, a couple days ago, we told you all about Sequencer Chains. In order for us to perform a more perfect set, and work around a number of hardware limitations, we devised a fantastic scheme for us to connect secondary sequencers to our Squarp Pyramid. If you haven’t read that blog post, you totally should or this one won’t make as much sense. Just click here to learn about sequencer chains.

We took all the ideas there, prototyped them, hooked the things up, programmed the buttons, and experimenting for a while. The spaceship is almost ready to play the perfect interstellar techno hour+ long set… almost.

Almost, but not quite – and it turns out that “not quite” is interesting. Well, if you’re a huge nerd.

Unsurprisingly, it all falls back to the clock.

One clock to rule them all

Did you read the last article? We don’t know if we made it obvious enough, but the clock is really really important. Like really, really, really important (that’s 3 reallys, think about that).

The short version recap is: There’s a clock, that’s a heart beat, that allows all the synths and sequencers to work together. When there are issues with the clock, devices that rely upon the clock have issues. And, in the case of sequencer chains these clock problems mess up your whole set.

Remember the key to our smooth-as-butter musical sets? Yes. The clock

While we can now turn our secondary sequencers on and off in time any time we want to, we are presently unable to make them continue to work while a song loads on the primary sequencer. Why? Well, unsurprisingly by this point in the article: the clock.

About Clocks in music

In most systems that synchronize to a centralized pulse, the timing of that pulse is extremely important. That timing between pulses is how we know the frequency of the pulses, or if we want to think about this musically, how fast the music is going. A clock pulse can be made out of anything that can be repeatedly provided with timing accuracy. In the case of midi, it’s a teeny tiny little digital ‘clock message’. Midi messages aren’t the only way to synchronize music equipment, you can also use a voltage (CV – control voltage) and this is a very popular way to do clocking on modular synthesizers. Since our spaceship uses midi protocol, we’ll be talking about the messages but we may interchangeably use voltage diagrams as they are often easier to understand.

A really nice clock pulse looks something like this:

This is a voltage based digital clock pulse. There are two values, “on” (5V) and off (0V). One ‘cycle’ is the time elapsed from the start of one pulse to the start of the next pulse. The number of pulses over a given time length is the frequency.

There are a lot to clocks in electronics, it’s not really our aim to get into all of them though we’d like to encourage you to read about them if you like. Really, what we want to point out in the above diagram is that the clock is steady or consistent. Notice that every cycle is the same length and repeats indefinitely? This is extremely desirable, and in fact, necessary in any kind of clocking system. This concept is a huge part of what makes your computer work, or your phone. And this concept translates musically.

Midi is the protocol for digital musical communication. As (we hope) you all know, timing in music is important. Tempo, measured in beats-per-minute (bpm), is fairly common nomenclature in the day of the dj, and timing is what they’re talking about. Tempo, when it comes to devices in a midi network, is set by a midi (or cv) clock.

Though fundamentally different, a midi clock works on the same basic principle as the clock we described above – the fact that there’s an accurately timed delivery of something. In the case of the original diagram, it’s the action of rising to 5Vs. In midi, it’s a beat clock message. These are special timed messages in the midi protocol that are broadcast to all devices on a network. Much like their voltage based counter part, the key in this technology that beat clock messages are sent and arrive on time.

“Jitter”

We’ve already said this twice now – it’s really important that the series of pulses, messages, whatever, in clocking are precisely timed. Now, you’ll probably guess where we’re going, but what happens if these clock pulses aren’t precisely timed? Well, things… bad things.

Jitter is the term we use to describe when clock pulses aren’t timed correctly, but just sometimes. Due to, literally all kinds of things, it’s very possible for literally any clock source to have a pulse arrive late. Note that, if timing informs us of the frequency (or bpm), a clock pulse arriving late might indicate that we have a new frequency (or bpm). Now what if several pulses arrive out of time, what happens to the frequency/bpm then?

Ideals are never real in electonics. The top row shows the idea clock where as the middle shows a clock with really bad jitter. If you look closely, there are several timing problems in the actual signal. The first pulse is late but finishes on time, the second pulse starts late, and the third pulse starts early. We would consider this clock unstable.

Usually devices can handle a little bit of jitter as jitter is just part of reality, but when there’s a lot of jitter, things can go south. Most commonly people will experience jitter as audio distortions in their home theater, though many electronics engineers have to solve jitter related problems well before an electronic device ever reaches consumers.

What causes jitter? It depends on the clock. For example, some clocks are just really bad at keeping precise time and so they jitter inherently. You mean folks will pay good money for a good clock? You bet; some things you simply can’t do if you have a bad clock source.

When it comes to midi clocks, they’re suspect to jitter all the same. Within a series of beat clock messages, it is possible for the clock messages to arrive out of time. Much like anything else, a little bit of jitter is okay, but any more than a little bit is really bad.

Midi Jitter

What causes midi jitter, exactly? Midi timing issues can be introduced anywhere on a midi network. That is, the thing creating the clock and anything receiving the clock may introduce the timing issues.

A clock is always sent from 1 source and received by 1 or more devices. You never have two clocks on the same network. In the above diagram, the computer would generate the clock for two midi devices connected to it’s MIDI OUT.

Consider the above diagram, there’s a computer. Connected to the computers input is a midi controller (the piano thing). Then there are two synths, piano & flute, connected to the computers MIDI OUT. When two synths are connected like this, it’s called a daisy-chain, where the computer sends all data to the first synth, then the first synth re-routes that data to the second synth. The computer sends the clock, and piano and flute both receive this clock, though flute really receives a clock signal that was relayed via piano.

There are several possibilities to introduce jitter in the above diagram:

  • The source – the computer. The computers job is to send the clock signal. That’s not the computers only job (it has an operating system, it’s also sending notes). If the computer is ever doing something else when it’s supposed to send the next clock signal, the clock signal will be late.
  • The relay – remember that first synth, piano, is in a daisy chain. This requires the use of what we call ‘midi through’. Midi through means to relay midi data from an input port to an output port. Relaying midi data in this way takes time, usually, as a synth’s processor and software takes time to process the data on the midi in and place it on the midi out.
  • Flooding the bus – When it comes to midi, the clock isn’t the only thing you’re sending. You’re sending notes, control values, system exclusive messages and more. These messages all share the same set of wires and there are limitations to how much data these wires can manage at any one given time. If you flood the wires with enough data, it’s entirely possible that this data will compete with the beat clock ultimately affecting the clocks timing.
  • Literally any device consuming the clock – much like the computer, there’s nothing that promises that the downstream device is ready to process that midi data when it arrives. While we certainly would hope musical devices processes these clocks as soon as they come in, it’s entirely possible for poor synth/sequencer design to introduce latency when processing incoming midi data.

Literally anything creating midi or processing the midi in any way can introduce timing irregularities.

Honestly, the last bullet is much less likely, but the first two bullets are both common. That is, the clock source itself can introduce jitter if it’s not dedicated to sending timing pulses on time, and devices in a daisy chain can introduce jitter too. It’s worth noting, that just being in a daisy chain doesn’t mean you will experience jitter, it means you might experience jitter. There’s a lot here that depends (hard midi through vs soft midi through for example), so we won’t get into all that but there are some great resources you can read if you want:

Jitter at the Source: Clocking on the pyramid

The inspiration for this article was to tell you about a problem we were having with our sequencer chains. Jitter is making it so we can’t effectively use our secondary sequencers. Where is our jitter coming from? The clock source itself.

Our sequencer, the Squarp Pyramid, sends the clock to all of our synthesizers, sequencers, and effects. Much like it controls what notes are played and when, it also controls the synchronization of literally everything. In our previous article on sequencer chains, we mentioned that the Pyramid has the ability to send a clock signal while it’s loading a new song; this is what made it possible to leverage secondary sequencers in the first place. It is this same feature that’s introducing the jitter.

Remember, any digital device is some kind of computer and computers take time to do things. Many computers can also only ever do one thing at a time, if they only have a single cpu too, even though you think they’re doing multiple things they’re just really fast and switch tasks without you noticing. But, have you ever had to wait for a computer to do something? It happens all the time right? Well, what if the computer needed to wait to send a clock pulse because it was busy doing something else and couldn’t get back in time? That’s what’s going on here.

The Squarp Pyramid is a really simple teeny tiny computer designed for sequencing music, it’s no where close to your desktop or even your phone in terms of what it can do. No, really, it’s a super simple, limited computer that uses very little electricity. And, much like any other computer, the Pyramid tries to do multiple things at once. In our case the Pyramid is sending the clock while it’s loading the next song. Every time the Pyramid sends a clock message, it can’t do anything else. Similarly, any time the Pyramid is processing the song I’m loading, it can’t do anything else. This is our problem: the pyramid goes to load the next song, and in doing so, doesn’t come back in time to send the next clock signal. This is where our jitter is coming from.

And what’s the jitter do? Well, sometimes it stops the drum machine and it consistently makes the secondary sequencers out of time. Oops.

Down, but not out

If there’s jitter introduced by the centerpiece of the whole spaceship, that’s bad right? Yea, but it doesn’t mean the spaceship will never fly the way we want it to… we just have to be a bit creative. We just have to either fix the Pyramid’s clock, or by-pass the pyramid’s clock. By-passing the clock is going to be much more interesting to write about than fixing the pyramid, though it looks like they’re going to fix it for us (they like our spaceship).

That said, external clocks and the internal clocking of the Pyramid are a topic for another day. For today, just know that jitter exists and it’s a real pain-in-the-cosmos. It will likely be a few months before we get the spaceship enhancements complete given this reality, but we all like a good cliff hanger, don’t we?

Anyways, we hope you enjoyed some more of the nitty-gritty of musical spaceships. Until next time…