Thursday, November 26, 2009

MIDI for C# / .NET

I've just released an open source library for MIDI support in C# / .NET. The Google Code page is here:

http://code.google.com/p/midi-dot-net/

This is my first foray into C#, .NET, and Windows programming in general. That's right, I've been programming for twenty years, professionally for twelve, and I've never written any software for Windows until now.

I wanted to do some MIDI programming and assumed that Windows would be the best OS for it. Then I figured I might as well learn one of Microsoft's more recent offerings, so I looked into C#. Then I found out that there is no direct support for MIDI in .NET, and so I proceeded to wrap the Win32 bindings. It turned out to be cleaner and better documented than the alternatives I saw, so I figured I should share it with the world.

Not exactly the most efficient way to get some MIDI programming done, but it's been fun.

Wednesday, September 16, 2009

A Physical Asymptote


This is the coolest art piece I've seen since the Wooden Mirror...



From the description:

This machine was inspired by dreaming about gear ratios and considering the unexpected implications of exponential powers.

Each worm/worm gear pair reduces the speed of the motor by 1/50th. Since there are 12 pairs of gears, the final speed reduction is calculated by (1/50)12. The implications are quite large. With the motor turning around 200 revolutions per minute, it will take well over two trillion years before the final gear makes but one turn. Given the truth of this situation, it is possible to do anything at all with the final gear, even embed it in concrete.

Tuesday, April 14, 2009

Little Haiti

Little Haiti

Look around--it's paradise!
Exotic spices ride the breeze
through tropic sun and sidewalk
vendors haggling in foreignese.

I'm visiting a far-off land
today. It cost a dollar eighty
on the bus through Chinatown,
past Wal-Mart here to Little Haiti.

A portly tattoo-covered lady
fortune teller draws my eyes
with signs: "I Do Do Voodoo" and
"Large Medium, Small Price."

She scatters shells, a chicken foot,
some roots and seeds, then draws a breath--
"Your future holds adventure! Travel!
Acid reflux! Love, and death!"

Amazed, I ask for more. She looks
around, alert, and draws me in.
"The key to growing wealth is--
do you have a lucky bank card PIN?"

"I hope so--is mine lucky? I
use Fifty-Seven-Eighty-Two."
She frowns. "It's not too bad, but you
should have me charm your bank card too."

She's been away a while--it must
be a complicated spell.
But when she brings it back,
my luck is changing, baby. I can tell.

-- Tom Lokovic

Wednesday, April 1, 2009

From 1999: Foreshadows of the Economic Crisis

From Flutterby, a 1999 New York Times article about the passage of the Gramm-Leach-Bliley Act. This act removed some of the safeguards put in place after the Great Depression. (Some claim that this was a significant contributor to the current crisis. Others disagree.)

Sen Phil Gramm (R-TX) arguing for the repeal:
We have a new century coming, and we have an opportunity to dominate that century the same way we dominated this century. Glass-Steagall, in the midst of the Great Depression, came at a time when the thinking was that the government was the answer. In this era of economic prosperity, we have decided that freedom is the answer.
Rep Jim Leach (R-IA), in favor of the repeal:
This is a historic day. The landscape for delivery of financial services will now surely shift.
Sen Bob Kerrey (D-NE), in favor:
'The concerns that we will have a meltdown like 1929 are dramatically overblown.
Now for the dissent:

Sen Dorgan (D-ND), arguing that it removes safeguards that could lead to a financial crisis:
I think we will look back in 10 years' time and say we should not have done this but we did because we forgot the lessons of the past, and that that which is true in the 1930's is true in 2010.
Sen Paul Wellstone (D-MN), against:
[Congress] seemed determined to unlearn the lessons from our past mistakes.
Wow.

Monday, March 23, 2009

Flower

Last night I discovered an unbelievable game for PS3. It's called Flower. It falls into the category of exploratory, atmospheric non-violent games, which isn't a genre that tends to impress me. This one, though, affected me deeply.

The developers (thatgamecompany.com) call it "a video game version of a poem", but I think it's more accurate to describe it as a meditation. With meditation, you don't get anything out of it unless you're in the right frame of mind, and willingly release yourself to the experience. So it is with Flower. If you play it in a task-oriented state of mind--an achiever's mind--you will quickly barrel through the game and completely miss out on its beauty.

Flower is "easy" in the same sense that watching a sunset is "easy": to talk about its difficulty, to treat it as something to be overcome, is to miss the point entirely.

The premise of Flower sounds ridiculous if you say it out loud: you control a cloud of flower petals, driven by the breeze through a series of lush, immersive outdoor scenes, touching other flowers and bringing life to the environment. Here's a clip:



This clip doesn't do justice to the experience. The environment is incredibly reactive. The lighting, the sound, and the music integrate beautifully. The weather, and particularly the sky, change as you progress through the game, creating very distinct emotional settings. You make your way through the environments by tilting SixAxis controller, which starts out feeling strange but quickly comes to feel as whimsical and buoyant as the petals themselves.

Flower is available for PS3 in the Playstation Store.

Thursday, March 12, 2009

Terrible Towel Instructions

(Click for full-sized image.)

To the Legion

  To the Legion

The sacrifice we make today
will live in song for future kings,
but first our story was beheld
by Janus in the dawn of things.

Before the ancient cities rose,
before the primal morning light,
the destiny of worlds was writ
for Janus of eternal sight.

The Owl of Minerva knows
the path a mortal man should take,
but where the path will lead is known
to Janus in the Temple Gates.

To Mars I dedicate my sword.
For Rome I go to fight and die.
I end today as I began:
in Janus's immortal eye.

--Tom Lokovic

Friday, February 13, 2009

One of Many

  One of Many


Through thick and smoky air inside a busy bar in Memphis
I settled down to drink beside a tired-looking Elvis.
Absently I asked if I addressed the honest deal;
He snorted, took a swig, and he said "Tell me: what is real?"


"For screaming mobs I sang and rocked my pelvis for a fee;
Their desperate eyes, in tears, perceived a God that wasn't me
And so I came to know that only death would set me free."


"One day I got away--I went to Elba more or less.
I spent my time in unfamiliar quiet happiness.
The music called me back, but now I move about unseen:
I have an army of my counterfeiters as a screen."


"In me the people found a fragile King they couldn't save.
Now they just believe in copies, not the archetype they crave.
And they're right--I'm not the light--I'm just a shadow in a cave."

--Tom Lokovic

Thursday, February 5, 2009

Lukemoist

A while ago I coined the unpleasant term "lukemoist". Here is an example usage of the term:

A: "It rained yesterday. Is the lawn wet?"
B: "Not really."
A: "Is it moist?"
B: "Maybe a little."
A: "Would you say that it is lukemoist?"
B: "Gross. I would not say that."

There are no hits for this word on Google, so I declare this to be the first usage of the term on the web.

I am so proud.

Thursday, January 8, 2009

Grid Cat

Ever since I was a kid, I've had this strange affliction.

Whenever I see a uniform grid, particularly one tilted at a 45 degree angle, I see a cat. A big cat, like a tiger.


Don't see it? Let's color it in a little.




That's pretty much the level of detail that jumps out at me, though I can add some characteristic features to make it more obvious.




See it? Now look back at the top grid, and try to see it there.

I see this everywhere. Chain link fences. Tiled floors. Rubik's Cubes. Graph paper. Anything with at least 3x3 squares. And it's been this way pretty much my whole life.

It wasn't until recently, though, that I ever mentioned it to anybody else, or tried to convey visually what I see.

If he were fancier, he'd look like this:





Thursday, January 1, 2009