Seven of Hearts: mp<3 (Half-Assed Rapper Version)


IFRemember that poem I wrote about heart-drive based music players, which I said I imagined as a rap? Well, here’s a recording of me ‘rapping’ it (now with new cover art.)  I wore my MC Frontalot glasses while recording it in case they would imbue me with talent. It’s probably still terrible, but I don’t care if you laugh at me or with me, as long as you laugh.

According to The Burning Hell, apart from all the rabbit, chicken, worm or artificial hearts, inside every one of us there also beats the hearts of a mother, a father, a trapper, a cult leader, a comedian, and an amateur rapper. The hearts of a mother and father in me went into cardiac arrest when they saw what parenthood was like (to quote the same song again, where would I find the time to build my compound, my comedy career, my empire of rhyme?) but maybe the hearts of a trapper, cult leader, comedian and amateur rapper still beat in me. In fact, they’re probably quite easy to beat.

It’s pretty light on instrumental stuff, because every time I tried to add something I realised that I’m not very good at making things line up with beats properly, and I was probably making things worse. This is a clear sign that I am a half-assed rapper and should stick to normal poetry, but I’m not going to cudgel my brains about it. Edit, one day later: You know what? I bet you could do better than I could. Here, have a remix kit consisting of all of the parts not already linked from this post or easy to find on the internet, plus a different version of ‘Copy Protected!’. Most of the backing tracks I did use are there more for pun value than anything else: some heart beats, the omnichord track (cheesy panning added by me) and artificial heartbeat sampler track from Jonathan Coulton’s Artificial Heart, the start of Worm Quartet’s I Want To Be Taken Seriously As An Artist (when I start talking about worms) and of course, Devo Spice’s Earworm at the end. My robot choir sung the ‘copy protected!’ part in the Trinoids voice. I would apologise to the artists whose sounds I used in this monstrosity, but when you release music under a Creative Commons license, you have to be prepared to face the consequences. This is also my second song-like-thing in a row containing a Wilhelm scream. Perhaps I should include one in every song; my terrible music screams, so you don’t have to! If Possible Oscar can include Wilhelm screams in songs, so can I.

Fill their briefcase with cut out hearts bloody 400Am I being too self-deprecating? The ad at the beginning just happened to come out at 30 seconds, which I think is a standard length for an ad, so that was nice. Also, I quite like the ending; the intro of that song happens to loop quite nicely at the right length for my words. I hope you get it stuck in your head.

I set the artist name to Angelastic, because rappers never seem to go by their real names, and the song is quite gelastic. I’ll probably submit it to The FuMP sideshow, because I’ve always wanted to submit something to that, but it was difficult because I don’t normally sing when people can hear me, and most of what my robot choir has sung so far isn’t really suitable.

One thing I discovered while recording this was that I have great difficulty pronouncing the word ‘earthworm’ quickly without making some kind of weird flap or trill sound between the r and the th. That’ll teach me for pitying the unpronounced r’s enough as a kid to adopt a rhotic accent.

, , , , , , , , , , ,

Leave a Comment

Synaesthete’s Blues, Immersive Edition


On Thursday I was thinking about interesting things I could do if I made a book of some of my writing and typeset it myself, and one of the things I thought of was running Synaesthete’s Blues (a poem about discovering my ‘S’ fridge magnet was blue, when according to my grapheme → colour synaesthesia it should be orange) through Synaesthetist (an app I wrote to display text in a given synaesthetist’s colours) so that it would be displayed in my colours. This would annoy other grapheme → colour synaesthetes in exactly the manner described in the poem (since their colours are almost certainly different from mine) and would probably be jarring for non-synaesthetes too.

If I did make such a book, it would probably be very expensive and time-consuming to produce, so for now, I will just put a coloured version of Synaesthete’s Blues here. The letters are coloured with the colours I associate with them, and outlined with the colour of the first letter of the word they’re in, because the first letter of a word tends to dominate, and the outline makes it clearer what’s going on and easier to read than simply mixing the colours would — see the post about Synaesthetist for more about that. It’s in bold text, which means the outline is thinner than usual relative to the letters, and makes its effect less true to how I see the words, but it makes the text easier to read, and should make it easier for you to see the colours of the individual letters without them being so dominated by the first letters. The title, URL and my name at the bottom are all done by blending the first letter’s colour in with the others in a fraction that looks just right to me.

Synaesthete's Blues

Coincidentally, Friday’s xkcd comic was about grapheme → colour synaesthesia. Neat as a tree. In case you’re wondering, I couldn’t see either big number (though they are there.) I have to look at a few graphemes at a time to get colours from them; I can’t see a colour picture just by glancing at it.

A couple of dictionaries tell me that ‘immersive’ applies to electronics which engage several senses apart from sound and vision, whereas ‘immersion’ does have the meaning I’m after but isn’t an adjective. I’m going to stick with calling this immersive until I think of a better idea. You’re immersed (but not embedded) in synaesthesia and the frustration of seeing graphemes in the wrong colours.

, , ,

Leave a Comment

Unintentional Haiku in the Princeton Companion to Mathematics


I’ve had a copy of the Princeton Companion to Mathematics for a while, and intended to start a series called ‘forms and formulae’, where I’d write about some of the articles using poetic forms from the Princeton Encyclopaedia of Poetry and Poetics. However, both books are huge and difficult to read on the bus, and the articles are long, so so far all I’ve managed to do in that vein is write a poem about platonic solids in a duel, and procrastinate my way out of writing about the entries whose names were alphabetically closest to Emmental. So I was excited to discover this morning that there is a pdf of the Princeton Companion to Mathematics available for free, apparently legally. Finally I can carry it around with me on my iPad and write poems about it whereever I want. But I don’t even need to do that, now; thanks to Haiku Detector, I can easily find the poems that are already in it. And boy are there some nice ones. Some were missed because Haiku Detector doesn’t know how to pronounce Greek letters and a lot of other mathematical notation, and the book sometimes hyphenates at the ends of lines so it looks like they’re good places for line breaks when they’re not. But these are the best ones I found. First off, some which don’t even sound like they’re about mathematics:

Watch your hand as it
reaches out gracefully to
pick up an object.

The difference between
the two definitions of
a secret is huge.

These ideas will
occupy us for the rest
of the article.

This opens you up
to new influences and
opportunities.

In our case, there are
two natural properties
that one should ask for.

Suppose that households
are able to observe one
another’s outputs.

Everything is now
a martingale and there can
be no arbitrage.

The magician can
at once identify which
digit has been changed.

This definition
has the advantage of great
flexibility.

Let us briefly sketch
the argument, since it is
an instructive one.

Moreover, it was
a thought that took many years
to be clarified.

The blocks are the sets
of seed varieties used
on the seven farms.

If you didn’t know where it came from, this could be about anything, but it also sums up the appeal of mathematics:

But then again, who
can deny the power of
a glimpse at the truth?

And a more transparent statement about the nature of mathematics:

“All roads lead to Rome,”
and the mathematical
world is “connected.”

But I really love it when you can’t tell it’s about mathematics until the last line:

The answer turns out
to be that we should weaken
our hypotheses.

It is important
to have a broad awareness
of mathematics.

We will focus on
the most important special
case: vector bundles.

Sometimes relations
are defined with reference to
two sets A and B.

This remains as an
outstanding open problem
of mathematics.

Church’s thesis is
therefore often known as the
Church–Turing thesis.

How, though, can we be
sure that this process really
does converge to x?

It turns out that both
choices are possible: one
automorphism

We shall now describe
the most important of these
extra assumptions.

Several themes balance
in Hilbert’s career as a
mathematician.

Indeed, the study
of such designs predates their
use in statistics.

This turns out to be
a general fact, valid
for all manifolds.

However, it is
a well-understood kind of
singularity.

In particular,
we can define the notion
of winding numbers.

This is exactly
the task undertaken in
proof complexity.

Questions mathematicians ask themselves:

How much better would
you do if you could compound
this interest monthly?

Why are spherical
harmonics natural, and
why are they useful?

What consequence should
this have for the dimension
of the Cantor set?

Can we reduce this
computational problem
to a smaller one?

How about checking
small numbers a, in order,
until one is found?

For what values of
the edge-probability
p is this likely?

Is every even
number greater than 4 the
sum of two odd primes?

Can one make sense of
the notion of a random
continuous path?

Perhaps this is the answer:

In mathematical
research now, there’s a very
clear path of that kind.

This one sounds like some kind of ‘how many roads must a man walk down’ question:

How many walks of
length 2n are there that start
and end at 0?

And while this isn’t actually a haiku, I can imagine it being sung in response to that song, with ‘the number of such walks’ to the tune of ‘the answer my friend’:

The number of such
walks is clearly the same as
W (k − 1).

Mathematicians don’t always answer questions in ways that other people find useful:

If instead we were
to ask each person “How big
is your family?”

In particular,
the average family size
becomes infinite

It follows that at
some intermediate r
the answer changes.

Things only a mathematician would feel the need to state explicitly:

This is a sum of
exponentials — hence the phrase
“exponential sums.”

What makes them boring
is that they do not surprise
us in any way.

Proof is left as an exercise for the reader; it probably takes several pages, but:

If you do know it,
then the problem becomes a
simple exercise.

Once this relative
primality is noticed,
the proof is easy.

All we have to do
is use one more term in the
Taylor expansion.

Doing things this way
seems ungainly to us, but
it worked very well.

It is not hard to
see that the two approaches
are equivalent.

(Of course, one needs to
check that those two expressions
really are equal!)

But this subtlety
is not too important in
most applications.

Some interesting statements:

For every person
P there exists a drink D
such that P likes D.

That is exactly
what a sphere is: two disks (or
cups) glued together!

Thus, recursion is
a bit like iteration
but thought of “backwards.”

Nevertheless, it
turns out that there are games that
are not determined.

(It can be shown that
there is exactly one map
with this property.)

The remainders get
smaller each time but cannot
go below zero.

There are other ways
to establish that numbers
are transcendental.

(The term “Cartesian
plane” for R2 is therefore
anachronistic.)

As usual, we
identify R2 with
the complex plane C.

Note that a block of
size 1 simply consists of
an eigenvector.

The upshot is that
we should always use a prime
number as our base.

Among the other
important number fields are
the cyclotomic fields.

Thus we obtain a
number that is less than the
quantity we seek.

So we might define
the “points” of a ring R to
be its prime ideals.

(For both halves, the pinched
equator is playing the
part of the point s.)

Thus, we have deduced
that length-minimizing curves
are geodesics.

For example, the
geodesics on the sphere
are the great circles.

The generators
correspond to loops around each
of the two circles.

The image of this
map will be a closed loop C
(which may cross itself).

We consider what
happens to C if we add
a small ball to it.

It is not hard to
show that the orbits form a
partition of X.

There are many ways
of combining groups that I
have not mentioned here.

I have thrown classes
of groups at you thick and fast
in this last section.

To apply Newton’s
method, one iterates this
rational function.

A quick overview
of physics will be useful
for the discussion.

can get away with
not understanding quantum
mechanics at all.

The quantum version
of Hamilton’s principle
is due to Feynman.

These encapsulate
the idea of a proof
by contradiction.

(A graph is simple
if it has neither loops nor
multiple edges.)

It is really an
algorithm that inputs
n and outputs an.

(An involution
is a permutation that
equals its inverse.)

If the tree has 2
vertices, then its code is
the empty sequence.

But the number of
possible orders of A,
B, and C is 6.

Number theory is
one of the oldest branches
of mathematics.

The percolation
and Ising models appear
to be quite different.

First, Albert shouts out
a large integer n and
an integer u.

This one is interesting if you imagine it’s about lines of poetry:

Another affine
concept is that of two lines
being parallel.

A mathematical protest slogan:

equality if
and only if x and y
are proportional.

A title of the mathematician’s equivalent of a song about unrequited love:

5.1.5
Why Is It so Difficult
to Prove Lower Bounds?

A series of short films:

10 Differences in
Economic Life among
Similar People

And something said in a soothing tone after a litany during a maths/mass:

Now let us return
to polynomials with
n variables.

The probability of finding a good haiku in the end matter is low, but I think this one’s pretty neat, even if it only has the right syllable counts if you say the ‘and’ in 906 but not 753:

law of large numbers,
753,
906

, , , , , , , ,

1 Comment

VI of Hearts: The Cantor Ternary Set Cantor Ternary Set


It’s self-referential! It’s self-similar! It would give Jonathan Coulton nightmares! It’s the Cantor Ternary Set Cantor Ternary Set: a representation of six steps in the construction of the Cantor ternary set using sped-up and slowed-down samples of Jonathan Coulton singing ‘Cantor ternary set’ in his song Mandelbrot Set, in which he professes to fear said set. I suppose you could say Jonathan Coulton is the cantor, but would it make him turn a reset?

Six of Hearts on a Jonathan Coulton Mandelbrot Floyd shirtI added a Wilhelm scream to the end, because that seemed appropriate. Here’s the audio-only version.

The Cantor ternary set is what you get if you take a line (technically a line segment, but we’ll call it a line), cut out the middle third, then cut out the middle third of the lines that remain, then cut out the middle thirds of those, and so on. If you continue doing this forever, you end up with just as many points as you started with (isn’t infinity grand?) but they’re nowhere near each other. I made the ‘lines’ at each stage out of clips of Jonathan singing ‘Cantor ternary set’ at different speeds; first at one 27th normal speed, then at one ninth, then one third, then normal speed, then three, nine, and 27 times normal speed. Then I put all the lines (i.e. audio clips) from the different steps on top of each other, positioned according to where each line came from in the original line, to make the full canticle (cantorcle?) You can see how it works in the video. To make it easier to differentiate the different layers, I put the second and fifth layers (counting from the slowest one at the bottom) toward the left ear and the third and sixth toward the right, leaving the other three (1/27-speed, original-speed, and 27-times speed) in the centre.

This didn’t take very long to make, in the end, but there were a lot of false starts. A long time ago I decided to make some kind of song about mathemusician Vi Hart using snippets of the various source tracks I have of Jonathan Coulton songs — a Hart-shaped box, on the table, and far too late you see the one inside the box is Vi Hart, who’s not a real heart but is a real bad-ass mathematician… that kind of thing. I realised some time ago that it would have to be the six of hearts, because in Roman numerals that’s the vi of Hearts. But that didn’t stop me from putting off starting it till about a week after the last minute. It’s a good thing I set my own deadlines.

A couple of days ago I finally started to actually work on this. I cut some sounds together (‘my heart’ and a ‘v’ sound from When You Go) to make Jonathan sing Vi Hart’s name, and collected relevant phrases from other songs. But I needed some kind of musical background track to tie it all together (like the Mr. Fancy Pants choir I used in my ‘Code Monkey Like…’ thingy.) I had considered using Vi’s piano music that she played on JoCo Cruise Crazy 2, but in the moment I didn’t feel like looking for it, and also didn’t feel like I could do it justice; I’ve just recently started listening to a basic and hilariously over-dramatic audio course on music theory, but most of what little I know about music, I learnt from Douglas HofstadterLeonhard Euler, Leon Harkleroad, and Vi Hart herself. While I’m okay with the mathematical side of things, I don’t think I remember enough to make a fitting musical tribute. So I asked myself, as I often do, what would Vi Hart do? Probably something symmetrical, mathematical, brilliant. So I hit on the idea of making a Cantor ternary set of Jonathan Coulton singing Vi Hart’s name, and using that as a backing track for the song.

Well, that was interesting, but it sounded terrible. The gap in the middle (the middle middle, not all the other gaps in middles which make the Cantor set what it is) sounded like a lawnmower, most of the rest sounded like a bad choir being massacred by a possessed lawnmower, and the 3x-speed ‘Vi Harts’ were more prominent and understandable than the ones at the original speed. I fiddled with levels for a while, and tried to make the lawnmower sound better by adding more words from other songs, but no dice. The fact was, using a Cantor ternary set of Vi Hart’s name (sung in that particular way) as a backing track was a terrible idea. And now that I think of it, I seem to recall that Hofstadter mentioned experimenting with fractal music and finding it didn’t work very well. That’s fine, though; I’m no musician, so I figured I could make it work to my low standards eventually. But just to take a break, on a whim I decided to try making a Cantor ternary set out of Jonathan singing ‘Cantor ternary set’.

Five minutes later, I discovered that the greater variety in syllables and pitches makes this sound quite interesting even without added lyrics, and you can fairly easily hear the words at several different speeds, so you can tell what’s happening well enough for it to be a demonstration of the Cantor ternary set in itself rather than just a backing track. Plus it’s a Cantor ternary set made up of the words ‘Cantor ternary set’. Why on Earth did I not think of that in the first place? Sorry Vi Hart; you’ll get your tribute song some day, and hopefully from someone better at music than I am.

On the subject of Vi Hart, last weekend I was at my physicist friend Aidan‘s place and noticed he had made some pretty neat things with Geomag, so I asked him to explain it all on video. He did mention Vi at one point. Here’s the video, in which we talk about RF cavities, conservation of angular momentum, triangles, and various kinds of pole, among other things:

Aidan also makes a lot of videos explaining particle physics; you should check them out.

Also on the subject of physics, and cool people I’ve met on JoCo Cruise Crazy (Vi Hart being one of them) here’s an LHC-related comic that Randall Munroe from xkcd drew for me on JoCo Cruise Crazy 3.

, , , , , , , ,

1 Comment

May the Fourth be with you (even if you haven’t seen Star Wars)


I’ve mentioned this before, but it’s Star Wars day, so it seems like a good time to repost. Remember last Star Wars Day, when I snubbed the CERN CinéClub’s showing of the original three Star Wars movies in order to write a poem about Star Wars, from my perspective as someone who has only seen The Phantom Menace, several hours of The Star Wars Holiday Special (with Rifftrax), the start of the original trilogy, under duress, while tired, from 2a.m. until I fell asleep, and a lot of Star-Wars-related songs and Internet memes? Well, I still haven’t seen the movies, and it doesn’t look like the CERN CinéClub is showing them today. But I did recite the poem in front of a crowd of nerds and geeks at the open mic night on JoCo Cruise Crazy 3, and they didn’t lynch me as an infidel, or throw me in the hot tub and force me to drink mudslides and watch Star Wars on the on-deck movie screen. Some of them even said they liked the poem! Even several people who I know write great things themselves! Here is my video of it. Having a decent microphone and no need to use up all my breath to speak loudly eliminated most causes and symptoms of nervousness, but oh boy, is my high-rising terminal showing at the beginning.

If you’re wondering, my first comment referred to Mike Phirman saying earlier that when you go on stage your body shuts down its vital functions and ‘you can really, really, really have to pee before you go on, and then you walk on stage and your body goes into like war mode, where it’s like, ‘There’s no time for that! We are at war!” I don’t think anyone laughed at the reference to the story Wil Wheaton read on the first cruise, so there goes my best chance at any audience noticing that. I missed out the following lines, at the start of the second stanza:

There were Chewie, and Yoda (the OSV talker)

Han Solo, and Leia, of course, Luke Skywalker.

I excused that in advance by saying I’d spent more time memorising Chicken Monkey Duck than this poem. That was not a joke, although I also made one mistake in Chicken Monkey Duck, so I guess I’m just imperfect. That means I’m not a replicant; hooray! (For what it’s worth, I saw all of Blade Runner for the first time this year, while outside in the rain, no less, so I finally know what that means. And I’m still using it wrong, because it seems like replicants aren’t perfect either. But passing the Voight-Kampff test just seems like it would give a higher-level qualification than passing the Turing test.)

To anyone else out there who still hasn’t seen Star Wars and feels like they should have: remember it’s entertainment. It should not be on your to-do list. Put it on your ‘things that might be fun to do when I need a break from the to-do list’ list if it seems interesting to you. Or, like me, use it to quickly dispatch anyone’s insistence that you see, read or listen to every other piece of culture that they deem important. Once you tell them you haven’t even seen Star Wars yet, they dismiss you as a lost cause and stop trying to add things to your to-do list. And if you’re a geek and they tell you this makes you a fake one, just tell them that, as Marian Call says, you have been a nerd since your first five syllable word, and no TV series or movie changes that:

In other news, I’ve signed up to read something at the Leman Poetry Workshop open mic night (warning: gratuitously-Flash-only website; don’t bother clicking if you have special needs that this won’t cater for) on May 31. I haven’t decided what to read yet, but it’s on my birthday, so probably something about birth, or death, or cake.

Also, I’m working on several different things at the moment, including the long-planned but little-implemented six of hearts, so hopefully I’ll finish those and post them here soon.

, , ,

Leave a Comment

Haiku Detector Update


On Monday I posted a quick-and-dirty Haiku Detector Mac application I’d written which finds haiku (in terms of syllable counts and line breaks, not aesthetics) in any given text. Since then I’ve made it less dirty and maybe more quick. It now shows progress when it’s busy looking for haiku in a long text, and gives you a count of the sentences it looked at and the haiku it found. You can also copy all the haiku (Copy All Haiku in the Edit menu) or save them to a file (Save in the File menu.) Here’s where you can download the new version, which should still work on Mac OS X 10.6 and later. And here are a few more haiku I’ve found with it.

There’s only one (not counting a by-line) in the feature articles of the April 27 edition of New Scientist:

Inside a cosy
new gut the eggs hatch and the
cycle continues.

From Flatland: a romance of many dimensions, by Edwin Abbott Abbott:

On the reply to
this question I am ready
to stake everything.

“I come,” said he, “to
proclaim that there is a land
of Three Dimensions.”

Man, woman, child, thing—
each as a Point to the eye
of a Linelander.

This was the Climax,
the Paradise, of my strange
eventful History.

Here are a few more from Flatland which I’m editing this post to add, since I liked them more on the second reading:

Let us begin by
casting back a glance at the
region whence you came.

Therefore, pray have done
with this trifling, and let us
return to business.

Even if I were
a baby, I could not be
so absurd as that.

From Last Chance to See, by Douglas Adams and Mark Carwardine, which I somehow ended up with a text file of many years ago and eventually got a book of:

I’ve been here for five
days and I’m still waiting for
something to go right.

We each went off to
our respective rooms and sat
in our separate heaps.

They’re nocturnal birds
and therefore very hard to
find during the day.

It looked like a great
horn-plated tin opener
welded to its face.

We keep searching for
more females, but we doubt if
there are any more.

The very laws of
physics are telling you how
far you are from home.

Foreigners are not
allowed to drive in China,
and you can see why.

`Just the one left,’ she
said, putting it down on the
ground in front of her.

Yet it was hunted
to extinction in little
more than fifty years.

And conservation
is very much in tune with
our own survival.

And here’s my own haiku about a particularly amusing passage in that book:

Here Douglas Adams
trudged through his anagram:
Sago mud salad.

Charles Darwin’s most popular work, The Formation of Vegetable Mould Through the Action of Worms with Observations on their Habits, only contained 12 mostly-lacklustre haiku, but I like to think this one is a metaphor:

Worms do not always
eject their castings on the
surface of the ground.

Something about lack of worm castings being only skin-deep.

But most of these don’t mention nature or seasons, as haiku should. So here are some from Sylva, or A Discourse of Forest Trees:

Dieu, and thence rode to
Blois and on to Tours, where he
stayed till the autumn.

How graphic, and how
refreshing, is the pithy
point thus neatly scored—

Meteorology, or Weather Explained, by J.G. M’Pherson contains some very poetic-sounding unintentional haiku:

“It’ll pe aither
ferry wat, or mohr rain”—a
poor consolation!

“Beware of rain” when
the sheep are restive, rubbing
themselves on tree stumps.

The brilliant flame, as
well as the smoky flame, is
a fog-producer.

Till ten o’clock the
sun was not seen, and there was
no blue in the sky.

But, strange to say, there
is a healing virtue in
breathing different air.

There is much pleasure
in verifying such an
interesting problem.

Unfortunately, there are no haiku in Dijkstra’s ‘Go To Statement Considered Harmful‘.

The app still uses a lot of memory if you process a novel or two, and may have trouble saving files in that case; It looks like it’s a bug in the speech synthesis library (or my use of it) or simply a caching strategy that doesn’t work well when the library is used in this rather unusual and intensive way. Anyway, if you ever try to save a file and the Save dialog doesn’t appear, try copying instead, and relaunch the program.

Next I think I’ll experiment with finding the best haiku based on the parts of speech at the ends of lines. But first, I’d better start working on the thing I’ve plan to do for the six of hearts.

If you’ve found any nice unintentional haiku, or if you can’t run Haiku Detector yourself but have ideas for freely-available texts it could be run on, let me know in the comments.

, , , , , , , , ,

Leave a Comment

Five of Hearts: Haiku Detector


A few weeks ago, a friend linked to Times Haiku, a website listing unintentional haiku found in The New York Times, saying ‘I’d actually pay for a script that could check for Haiku in my writings. That would make prose-production a lot more exciting! Who’s up to the script-writing-challenge?’

I knew I could do it, having written syllable-counting code for my robot choir (which I really need to create an explanation page about.) I told her I’d make it that weekend. That was last weekend, when I decided at the last moment to write an article about neutron stars and ISOLTRAP, and then chickened out of that and wrote a poem about it. So I put off the haiku program until yesterday. It was fairly quick to write, so here it is: Haiku Detector. It should work on Mac OS X 10.6 and above. Just paste or type text into the top part of the window, and any detected haiku will appear in the bottom part.

Haiku Detector looks for sentences with seventeen syllables, and then goes through the individual words and checks whether the sentence can be split after the fifth and twelfth syllables without breaking a word in half. Then it double-checks the last line still has five syllables, because sometimes the punctuation between words is pronounced. The Times Haiku-finding program has a database of syllable counts per word, but I didn’t need that since I can use the Mac OS X speech synthesis API to count the syllables. Haiku Detector makes no attempt to check for kigo (season words.)

The first place I looked for haiku was the Wikipedia page for Haiku in English. Due to the punctuation, it didn’t actually find any of the example haiku on the page, but it did find this:

Robert Spiess (Red Moon
Anthology, Red Moon Press,
1996)

How profound. Next, having declared myself contributing troubadour for New Scientist magazine, I fed this week’s feature articles through it, and found:

A pill that lowers
arousal doesn’t teach shy
people what to do

Meanwhile, there are signs
that the tide is turning in
favour of shyness.

So by 4000
years ago, the stage was set
for the next big step.

This heat makes the air
spin faster, so pulling the
storm towards the city.

Some will be cooler
and less humid — suitable
for outdoor sports, say.

The last ones seem almost seasonal.

I needed to stress-test the app with a large body of text, so I grabbed the first novel of which I had the full text handy: John Scalzi‘s Old Man’s War, which I had on my iPad on my lap to read while my code was compiling. This book has at least one intentional haiku in it, which Haiku Detector detected. Apart from that, some of my favourites are:

I hate that her last
words were “Where the hell did I
put the vanilla.”

As I said, this is
the place where she’s never been
anything but dead.

“I barely know him,
but I know enough to know
he’s an idiot.”

She’d find me again
and drag me to the altar
like she had before.

A gaper was not
long in coming; one swallow
and Susan was in.

They were nowhere to
be found, an absence subtle
and yet substantial.

And it stares at me
like it knows something truly
strange has just happened.

I haven’t got up to that fifth one in the novel yet, but it mentions a swallow, which I understand is (when accompanied by more swallows) a harbinger of Spring or Summer depending on which language you get your idioms from, so there’s the kigo.

Next I figured I should try some scientific papers — the kinds of things with words that the Times haiku finder would not have in its syllable database. You probably can’t check this unless your workplace also provides access to Physics Letters B, but I can assure you that the full text of the ISOLTRAP paper about neutron stars does not contain any detectable haiku. However, the CMS paper announcing the discovery of the boson consistent with the Higgs does:

In the endcaps, each
muon station consists of
six detection planes.

As is usual for CMS papers, the author and institute lists are about as long as the paper itself, and that’s where most of the haiku were too. Here are a few:

[102]
LHC Higgs Cross Section
Working Group, in: S.

University
of California, Davis,
Davis, USA

That’s ‘one hundred and two’ in case anyone who doesn’t say it that way was wondering.

And here are some from my own blog. I used the text from a pdf I made of it before the last JoCo Cruise Crazy, so the last few months aren’t represented:

Beds of ground cover
spread so far in front of him
they made him tired.

Apologies to
those who only understand
half of this poem.

I don’t remember
what colour he said it was,
but it was not green.

His eyes do not see
the gruesome manuscript scrawled
over the white wall.

• Lines 1 to 3 have
four syllables each, with stress
on the first and last.

(That’s not how you write a haiku!)

I don’t wear armour
and spikes to threaten you, but
to protect myself.

A single female
to perpetuate the genes
of a thousand men.

Kerblayvit is a
made-up placeholder name, and
a kerblatent cheat.

He wasn’t the first,
but he stepped on the moon soon
after Neil Armstrong.

He just imagined
that in front of him there was
a giant dunnock.

(there are plenty more where that one came from, at the bottom of the page)

She was frustrated
just trying to remember
what the thing was called.

Please don’t consider
this a failing; it is part
of your programming.

While writing this program, I discovered that that the speech API now has an easier way to count syllables, which wasn’t available when I wrote the robot choir. The methods I used to separate the text into sentences and the view I used to display the haiku are also new. Even packaging the app for distribution was different. I don’t get to write Mac software often enough these days.

Yet again, I didn’t even bother to deal out the cards because I already had something to inspire me. In my halfhearted attempt to find a matching card, I came across one about electronics in the service of ALICE, so I ran the latest instalment of Probably Never, by Alice, into it, and got this:

Or well, I have to
put up with getting called a
fake girl all the time.

The jackhole who called
me a “he/she” recognized
that he crossed the line.

If that sounds interesting, subscribe to Probably Never, and I could probably forward you the rest of that episode if you want.

And finally, two unintentional haiku from this very post:

Haiku Detector
makes no attempt to check for
kigo (season words.)

(there are plenty more
where that one came from, at the
bottom of the page)

Wait; make that three!

And finally, two
unintentional haiku
from this very post:

Have fun playing with Haiku Detector, and post any interesting haiku you find in the comments. Also, let me know of any bugs or other foibles it has; I wrote it pretty quickly, so it’s bound to have some.

I know what I’m doing for the six of hearts; I’ve planned it for a long time but still haven’t actually started it. It’s musical, so it will probably be terrible; brace yourselves. By the way, I keep forgetting to mention, but They Might Not Be Giants will be published in Offshoots 12. Yay!

, , , , , , , , , , ,

4 Comments

Follow

Get every new post delivered to your Inbox.

Join 980 other followers

%d bloggers like this: