Cyborg spirograph

I've been thinking about something interesting in the drawing space lately. There are various different options for constructing shapes with perfect proportions, I even worked on a demo along those lines myself. However, there's something inherently mechanical and kind of inhuman about these approaches. You can make a square, sure, but all the squares look the same; there's no variation, no nuance.

The only reason you need construction techniques is because of the limitations of the limitations of our hands and our tools. We can't easily draw straight lines or circles freehand because our limbs don't naturally move in straight or circular patterns. We can't really change our hands (yet) but we can change our tools.

What if we made tools that were more assistive in nature? A ruler is perfectly rigid, but what if you had a magnetic pen and put a metallic grid underneath the paper? It wouldn't force you to draw a straight line, but it would mean you naturally move more linearly. That means your lines will still be, broadly speaking, straight lines, but still with some human variation.

A more circular version of this could perhaps be done with a complex arrangement of gears and pulleys that change the fundamental mechanics of your pencil's movement. So you can draw straight lines, but the gears naturally try to pull you into spirals. A perfectly straight line, in this world, would still be kind of circular.

There is of course, the spirograph, which is a rigid version of this, but I think it'd be worth making something with spirograph-like behaviour designed to adjust your drawing rather than control it. A cyborg spirograph.

Prototype wrapup #36

Last time I was doing some silly projects and experiments. Over the last couple weeks I kept the same creative vibe and worked on some new things for projects to post. I also added Racket to the languages I've made prototypes in, which feels pretty good.

Sunday

I've been working on an idea for neural network-driven music. Since it doesn't need to be, uh, strictly scientific I've been playing around with different ways to do it. I had an older version where you drew the graph manually, but I realised it would be more fun to just play notes and have that automatically build and train a network. To kick that off I figured I'd make a simple web piano. Took a bit of messing around to get the oscillators not to pop, but worked great in the end.

Friday

This was some supporting code for Etaoin Shrdlu. To get everything to work I needed to do some data processing. I could have just done it fairly quickly in CoffeeScript or Python or something, but I figured it'd be an interesting chance to try a new language. I'd just watched a neat video about Racket so I gave that a try. I hadn't used a Lisp before, but it was pretty painless and I got used to the parentheses quickly enough. Still not sure about all the closing parens being on the same line though, that's weird.

Finite and infinite time

Something interesting I've noticed about my early to bed, early to rise experiment is the way it changes my perception of time. I don't feel like I have more time, necessarily, but the way it's allocated is different. I think of it as a change from infinite to finite time.

Say you want to read War and Peace. Not necessarily by any particular time, it's just something you'd like to do. Well, depending on your age, you probably have decades to do it in. Even if it would take you a couple of months to get through it, what's that compared to a couple of decades? So, like so many things, you decide to do it later. I mean, when some things need your attention in the next week and others need it in the next decade, I know which I'd choose. Finite-time problems over infinite-time problems any day.

When you stay up late, your days obey the laws of infinite time. You have something to do today, but a friend wants to hang out? Well, no problem, you can finish it later. Now there's something interesting to read on the internet? No problem, you can finish it later. Video game distracting you? Finish it later! Later is magical because later is infinite, and you can pack just as many plans into it as you need to justify not doing them now.

Only later's not infinite, not really. It's just indeterminate. If we knew the exact hour it finished we'd be a lot less blasé about what we have planned between now and then. But we don't know - don't want to know. It's easier to think we can just keep on going and the night will stretch on as long as we need. When sleep finally takes us, it's by surprise. We go out fighting, knowing there was still more to do, dumbly realising that it's not going to happen now, and maybe it never could. The infinite was finite after all.

But getting up early doesn't work like that. You know all too well how finite the day is, because you chose when it was going to end. There's no pretending about later, because it's not indeterminite any more; you determined it. And against that unyielding finity you have no choice but to give in. There will still be more to do when the day's over, there's always more to do, but at least you could choose to do the things that were most important. And when sleep comes, you can go peacefully; you did what you could, and now it's time to rest.

Conventional Wisdom 1: Early to Bed, Early to Rise

Early to bed and early to rise makes a man healthy, wealthy and wise

I'm starting an experiment this year. Or, rather, I'm starting a project made up of a series of experiments.

It's easy to assume conventional wisdom is meaningless, especially if you don't put much stock in tradition. Who cares what a bunch of long-dead people have to say about living your life? What do they know? But progressiveness isn't a licence for wilful ignorance of the past; there's a reason they said the things they did, and a reason those things survived to the present day. Perhaps ancient advice deserves a bit more consideration, at least as much as we'd be willing to give the latest self-help fad.

So this is the Conventional Wisdom Project. Each month I'm going to pick a hackneyed old proverb, the hackneyeder the better, and try to live by it as best I can for that month. I'll turn it into something actionable, record how well I did and any changes I notice, and evaluate at the end of the month whether the old wisdom was actually wise or just old. I'm hoping that some of these will lead to beneficial changes in my life in particular, so I'm going to be biased towards proverbs that say the opposite of what I currently do.

In that spirit, January's conventional wisdom is "Early to Bed, Early to Rise". I've basically always been a night owl. Even as a teenager I was often late to school, or if I did get there on time I was tired because I stayed up late the night before. That pattern's never really changed. For a long time, I felt like night time was the best time, because it's kind of a time beyond time, when the whole world is asleep and it's just you and whatever obsession is keeping you awake. However, people who get up early are pretty, uh, effusive about how good getting up early is. Perhaps it's worth a try?

For January, I'm going to bed at 10pm and waking up at 6am. I'll record how well I stick to that schedule, how well I sleep, and any impact I notice on my work and life in general. I've actually been doing this since January 2 (January 1 was a lost cause), but haven't had a chance to write about it until now. Things are going well so far, but I'll write a more complete update on my observations shortly. For now, I'm just happy to announce this project is actually happening. It's going to be an interesting year!

Etaoin Shrdlu

I wrote about this pretty recently, but today I actually went and did it. To summarise the original idea, I wanted to take the conditional probabilities of adjacent letters that you type and match them with the conditional probabilities of adjacent words. This should make something like a Markov chain gibberish generator, but tuneable based on how random the letters you type are.

The biggest challenge for this was massaging the data. I needed not just the word and letter 2-grams, which I ended up grabbing from Peter Norvig's site, but specifically I needed 2-grams which also included terminal characters for the beginnings of words. Norvig's word data had this, but his letter data didn't, so I built my own from the 1-gram data by just summing the counts against all the first letters. Those sums probably don't compare exactly with the 1-gram data, but since I only needed relative counts I figured it was fine.

For my next trick, I wanted to trim down the word 2-grams substantially because, with only 26 letters, I wasn't going to be able to generate the 27th+ most likely word pairs anyway. Not only that, but I wasn't going to be able to generate any of the words that were only reachable from those words, and so on. Basically, I needed a simple exhaustive search that would go through and eliminate those unnecessary combinations. While I was at it, I added some filtering because the internet is mostly porn. The end result dropped the bigram size from 5MB to under 1MB, while also making it look less like bad erotic fan fiction.

There are a few things that I think could be improved. The main one is a better corpus. The internet is many things, but a repository for meaningful text is not one of them. The Google Books Ngram corpus is probably what I'd use if I had more time and wasn't in a first-world country with third-world internet. Another thing is that I could probably do something a bit more sophisticated with the rankings: the 26th most common word pair is still probably a lot less common than the 26th most common letter pair. What if I mapped the least common to the least common and stretched the distribution instead?

Regardless, I'm pretty happy with the result I got. If you want to play with it, a live version is on my demoserver and the code is on Github. I'll also write a bit more about generating the data (using Racket!) for my next prototype wrapup on Monday.