Friday, March 10, 2006

TickCount! I Said TickCount!

Today’s entry contains revelations which you will either find charming or that will explain everything.

My wife has started taping Monk from afternoon TV. This detective show (replacing the dire Murder She wrote and the occasionally charming Diagnosis Murder) focuses on a detective with Obsessive Compulsive behaviour which of course makes him an excellent detective. Unfortunately for me, I can detect the reason for most of his hang-ups long before they are made obvious which makes we worry about me. Yesterday’s episode involved Monk’s Boss, the obligatory gruff sergeant (who in days gone by would always have given his star underling 24 hours to get a result) having to stay in the regimentally arranged flat that was the result of many hours of late-night cleaning. At one point, the sergeant was prompted by guilt over Monk being up until 3am cleaning, to vacuum the floor. After completion, Monk had to vacuum again because the lines of the vacuum wheels were not parallel with the walls. This was obvious to me.

There is a reason why this is obvious. This office has just been rewired which involved all the floor panels being lifted (a job I used to have to do many years ago – there is something relaxing about having your head down a hole in the floor surrounded by wires and various beeping and flashing boxes). The carpet tiles have not been replaced in their original positions and means that all the permanent grooves left by years of trolleys have been moved and do not line up. I am afraid that this really bugs me. I mean REALLY BUGS ME. In bad moments I have contemplated coming in very early to put them all straight.

Another of Monk’s kinks was revealed when his boss set the alarm for 7:53. Monk suggested that 8:00 was ‘a nice round number’. When asked how much it bugged him on a scale of 1 to 10, he replied ‘about an 8 – an eight-oh-oh’. The compromise was to set the alarm for 8:00 but to set the clock ahead seven minutes. THIS IS JUST WRONG - had to read a very boring book to get to sleep.

And then something so charming as to bring tears to the eyes; the one piece of furniture not at right-angles in this homage to ninety degrees was a coffee table which was closer to one end of the couch than the other. Attempts to straighten it were forcibly resisted without explanation. The final scene revealed a flashback – Monk and his wife (whose death apparently triggered his breakdown) were shown on the couch. She was reading and he was tired so she moved the table closer so she could rest her legs on it and Monk could put his head in her lap. I am filling up just thinking about it.

I don’t want you to think that I am that obsessive. I know that real obsessive-compulsive behaviour results in completely irrational thoughts along the lines of various inconsistencies in the world resulting in death if not rectified. My hang-ups are I hope, rooted in reality – things like locking doors and turning gas and water off. I don’t think that the lines in the carpet will cause anyone harm. They just don’t fit with an ordered view. Having children means that any real arrangement of things is just not possible. I always wonder how people with kids manage to keep their houses as pristine as they sometimes are but there may just be a frenzy of tidying up before visits. Or maybe they have a chaos cupboard like Monica in Friends.

Back to time! I once wrote a scheduler for batch jobs which used the Visual Basic Timer control. I have also used it to trigger sounds in my Steve Reich Simulator but the resolution is too low to be very accurate and tends to “swing” much more than is acceptable as human-feel. So I started using the GetTickCount function which has a much higher resolution. This week I decided to try and program in Piano Phase. This requires that the same pattern is repeated by two instruments but one is played increasingly out of phase with the other until various new melodies shine out of the Contrapuntal Web (may not be using the technical terms entirely accurately there but – hey – it sounds good). Unfortunately even the tick count is not of high enough frequency to resolve this so I have had to resort to peeking at the very depths of the processor clock cycle. I now have something which takes the 12 notes of the phrase and slowly moves them until it reaches synch again. I may post the actual executable though I want to do it in c# and without using the midi control currently in the VB program. API calls are required. Sapphire and Steel have been assigned!

No comments: