What is Typomatic?
Typomatic is a typographic automatic computer.
Huh?
Okay, bear with me here...
A quick intro to computation
What does it mean to compute something? Roughly speaking, it means to manipulate information by following a routine. That’s a pretty vague definition, but there are lots of ways to make it more concrete. One of the simplest ones was invented in the 1950s by a Russian mathematician named Andrey Markov Jr.
In Markov’s model, "information" means a string of symbols, like this:
oo<<
A "routine" is described by a table like this:
from | to |
---|---|
+< | <+ |
o< | <+o |
< | |
o |
Each line in the table describes a rule for manipulating the string. To apply a rule, you look through the string from left to right until you find a piece that matches the thing in the from column. Then, you replace that piece with the thing in the to column. Here’s how you’d apply the second rule in the table above to the string I mentioned earlier:
From this... | to this! |
---|---|
oo<< | o<+o< |
Sometimes, of course, the thing in the from column doesn’t match any piece of the string. In that case, the rule can’t be applied.
To follow the routine described by a table of rules, you look through the table from top to bottom until you find a rule you can apply. Then you apply that rule, go back to the top of the table, and start again. Eventually, if you’re lucky, you’ll get to a point where none of the rules can be applied. Then you’re done!
Here’s what happens when you use the rule table above to manipulate the string I mentioned earlier. The first step should look familiar:
Step | From this... | to this! | Rule |
---|---|---|---|
1 | oo<< | o<+o< | 2 |
2 | o<+o< | <+o+o< | 2 |
3 | <+o+o< | <+o+<+o | 2 |
4 | <+o+<+o | <+o<++o | 1 |
5 | <+o<++o | <+<+o++o | 2 |
6 | <+<+o++o | <<++o++o | 1 |
7 | <<++o++o | <++o++o | 3 |
8 | <++o++o | ++o++o | 3 |
9 | ++o++o | ++++o | 4 |
10 | ++++o | ++++ | 4 |
At this point, none of the rules can be applied, so you’re done! As you bask in the warm glow of accomplishment, however, you may begin to wonder what it is that you’ve accomplished. Literally speaking, all you’ve done is turn the string "oo<<" into the string "++++" by shuffling symbols around. When you look at it in a certain way, though, the game you just played takes on a deep significance.
I could tell you what that significance is, but it’s more fun if you figure it out for yourself. A good way to start is to see what happens when you use the rules above to manipulate the following nine strings:
o< | o<< | o<<< |
oo< | oo<< | oo<<< |
ooo< | ooo<< | ooo<<< |
Unfortunately, all that symbol pushing is going to get tedious pretty quickly. It would be nice if you had a machine that would apply the rules for you, so you could concentrate on understanding what’s going on. That’s where Typomatic comes in.
Computing with Typomatic
Let’s use Typomatic to carry out the string manipulation we did by hand in the previous section.
First, we need to put our table of rules into a format Typomatic can understand. Make a text file containing the following four lines:
+< | <+ | |
o< | <+o | |
< | ||
o |
from | to | stop? |
---|---|---|
~x | x~ | |
~o | o~ | |
~ | ] | % |
[~ |
To mark a rule as a stopping rule in a Typomatic source file, just add a % character in a third column, separated from the to column by a single tab or space character. When Typomatic applies a stopping rule, it automatically stops running. You can start it again by pressing the down arrow or the right arrow. If you’re using the right arrow to apply one rule at a time, stopping rules won’t have any noticeable effect, because Typomatic would have stopped after one rule anyway.
Sounds and colors
Stopping is the most computationally important thing you can make Typomatic do when it applies a rule, but it isn’t the most entertaining. You can make Typomatic play a sound when it applies a rule by adding a fourth column with one of the six sound symbols:
. + / $ # *
You may have noticed that when Typomatic applies a rule, the piece of the string being replaced flashes white for a moment. You can make the flash a different color by adding a fifth column with one of the six color symbols:
p o y g b v
As usual, columns are separated by a single tab or space character. If you put two separators in a row, Typomatic reads a blank column in between.
Tempo control
Typomatic applies rules on a steady beat, at a default speed of 240 beats per minute. You can make it go faster or slower by pressing the arrows next to the Tempo box in the top right corner of the window. The tempo changes in increments of 60 bpm, up to a maximum of 480 bpm. If you change the tempo while Typomatic is running, Typomatic will stick to the tempo that was showing when you pressed the down arrow. You can make Typomatic switch to the new tempo by hitting the down arrow twice to stop it and start it again.
Fast mode
Someday, you’ll want to do a computation so long that even the maximum tempo feels glacial. When that day comes, it’s time for fast mode.
See that button to the right of the Tempo control? If you haven’t clicked it yet, it says >, which means you’re in slow mode. Load a fresh input string and click the slow mode indicator. The > will change to >>>, and the string display will be replaced by the number zero. You’re in fast mode.
The right arrow is now inoperative: you don’t go into fast mode to apply one rule at a time. Hit the down arrow instead. The number in the middle of the window will start scrolling upward: Typomatic is applying rules as fast as your CPU can manage, and counting how many rules it’s applied. As usual, Typomatic will stop automatically if it gets to a point where none of the rules can be applied, and you can stop it yourself by pressing the down arrow again.
Unless you’re doing a very long computation, however, you’ll never get a chance to stop Typomatic yourself: on typical hardware, Typomatic will often finish a hundred-step computation faster than your photoreceptors can even start reporting a flash of light. You’ll just see the counter jump to some number and stop there. To see what you’ve accomplished, click the >>> to switch back into slow mode. The string display will appear again, showing the result of your computation. While Typomatic is stopped, you can toggle between fast mode and slow mode as many times as you want; when you hit the down arrow again, Typomatic will pick up where it left off, using whatever mode it’s in. You can’t switch modes while a computation is running.
You can do anything
With Typomatic on your side, you can do any computation that can ever be done, and make silly noises while you’re at it. All you need is patience, practice, and a little ingenuity. Go crunch some strings!