Origami XML

As I mentioned last week, I feel inspired to dust off my origami software, the Foldinator, and try and move its development along towards a release version. I brief recap: I first conceptualized Foldinator as an application to author origami diagrams, since there is no such purpose-built software out there. As I thought about it I realized it would in fact have to be something of an origami simulation, with the steps of the diagrams working an actual animated simulation of the paper.

I started with the application design, concentrating particularly on the user interface and authoring tools. I wrote a paper on the subject with I delivered at 3OSME a few years back. I was writing it in Flash, which in those days meant ActionScript 1, which is a bit of a kludgey language without proper objects or data types. Around this time I was out of work for a while after the dotcom crash and made a good start on a prototype since I was able to give it some serious focus for a few months. The prototype could record and playback steps, and execute several operations including Rotate, Turn Over, (Valley) Fold and Fold, and Valley Fold.

When I got to the point where I had to grok a sequence of valley folds, I knew I had gotten to the heart of the problem. I had to figure out how to model this algorithmically to proceed, how to break the paper into a bunch of inter-related parts with hinged and/or joined edges. This made harder by the limitations of ActionScript as a language, which was not really designed for serious application development. I considered rewriting the whole thing in Java, but that would have meant a completely new approach and implementation of the drawing engine. A related problem was how to represent the data that comprised a sequence of steps. At the time I was using generic objects with properties, again due to AS1 limitations.

Around this time I got a new job and the amount of time and energy I was able to put into the project waned. After long days of writing software, it was hard to come home and work on a whole ‘nuther project at night, and besides, I wanted to put more of my origami time into actually designing and folding models.

Well things have changed since then and I figure it’s time to give it another shot. For a while I was trying to get some kind of R&D funding so I could work on this full time. But that does not look like it’s likely to happen, so I might as well get on with it.

One thing that that’s changed is ActionScript has grown up into a full-fledged Java-style object oriented language, and Flex into a professional grade authoring platform for web applications, built on Eclipse. Flex is a superset of Flash and includes the Flash vector drawing and animation engine. So the platform for Foldinator 2.0 is Flex.

Another thing that’s changed is I’ve figured out over the years how to be productive in small focused efforts that accumulate over time. (Having kids kind of forces you to get good at using your time wisely.) The key is to have a discreet and achievable goal every for every session that you sit down to work at something, whether it’s a few hours of even just an hour or less. Sometimes the goal can be just to think about it or come up with a plan for something, but I try and do my thinking offline, so when I sit down to work there’s a short-term goal. The first thing I did was create a new Flex project and set up the basic framework, and import my old Flash code to pick over and see what can be ported and what should be scrapped.

The other thing I did was to start to work out the data representation side. The first prototype focused on the authoring and interface side of things. This comes at it from the opposite end. Naturally, the logical choice is to use XML, so I thought coming up with an XML schema to represent an origami model would be an important step. Having googled “Origami XML” it does not appear that anyone has done any work on this. I told my idea to Brian Webb and he said “That sounds like a trip to Singapore right there,” referring to the upcoming 5OSME. I’m not sure I want to this, but I’m thinking of going to this year’s PCOC, because it’s in San Francisco and I used to live there and it’d probably be a lot of fun. Maybe there will be an opportunity to present a paper there, like the Monday sessions at the OUSA convention in New York.

In any event, the design goal of OrigamiXML is to represent a model by its folding sequence, in a way that’s application agnostic, in other words independent of Foldinator. I’d like to make OrigamiXML a standard that can be shared with the origami and software communities, so that Foldinator can share documents with other applications. I ran this idea by my brother Martin, who is thinking of developing an origami themed computer game in SilverLight.

I have started with a few examples of traditional and simple models expressed in Origami XML. They are: Picture Frame, a pureland model invented by my daughter Elizabeth a few years back (for those of you who are not folders, pureland means the model has only mountain and valley folds), the traditional Swan, the Waterbomb Base, and the Preliminary Fold. These bring up the issue of reverse folds, which it looks like I’ll have to get to sooner rather than later.

In the offing I have a few more models partially specified: The bird base and traditional crane, which will necessitate working out how to specify and execute a petal fold, the frog base, which will do the same for a squash fold, and a funny little thing I made up and call the bird-dog base, which is half a bird base on one side and half of Montroll’s dog base on the other.

If you look at the XML, there is some meta data at the top, including things like the title of the model, the author, and copyright info. Then there’s information about the paper: it’s proportions, whether it ought to be two-color and so on. Although I am mainly focused on single-sheet models, it supports specifications for multiple sheets. How to put multiple sheets together into a model is a bride to cross when we get there.

The heart of the document is the sequence of steps. Each step includes an action, which indicates the kind of step usually “fold”. It also has an annotation, which is a human readable description of the step, like those that typically appear in published diagrams.

Then there is room for any number of creases. At first I thought I would have just one crease per step, but then I realized it is necessary to have multiple crease to support reverse folds, squash folds, petal folds, and sinks. This means too that the OrigamiXML can support arbitrarily complex compound folds that collapse all at once, that are common in box-pleated models and other advanced modern styles.

A crease is specified by several parameters. First is the location, which can be either an end point and an angle or two end points. I’m not sure yet whether these coordinates are relative to the unfolded sheet as in a crease pattern, or to the current view of the folded model as in conventional diagramming. I’d prefer that latter, but have not yet worked out if this is possible, or if it will introduces too many cases of unsolvable ambiguities.

Other parameters include Swing, which specifies which way the folded paper moves (Left, Right), as well as Parity (“Mountain” or “Valley”), Type (Inside Reverse, Outside Reverse, etc., although I’m not sure if this belongs with the step of the crease), and an optional value for the number of layers to fold thru, which defaults to “all”.

Another feature is that steps can be nested, so a step can contain multiple sub-steps. The intent of this is to handle common diagramming situations such as “Repeat steps 19 -24 on the left side” or “Petal fold, repeat behind.” In the second case, this simple instruction actually breaks down into four steps. First the petal fold (which itself involves three creases). The next step is to turn the model over. Third is another petal fold, and last is to turn it over again. Having to make this into four steps in a diagram would be tedious to the diagrammer and bothersome to the folder, so I’m hoping to be able to automate this out.

That’s as far as I’ve gotten so far. I’d like to figure out a way to vet this to the origami community and get some feedback. Probably a simple post to the O-list ought to do it. Meanwhile I’ll start development on Foldinator 2.0 and by having it read in these XML files and parse them, and build the logic in the engine ones action at a time until it can execute these models. I fully expect there will be some back’n’forth between the XML and the engine to get the kinks ironed out. We’ll see how it goes. Wish me luck.

TV Strikes Back

My television spontaneously stopped working one day last week. They finally stopped broadcasting analog TV. I knew this day was coming for over ten years now, because way back in the 90’s I worked in a place doing R&D into futuristic interactive digital media, and it was on the slate way back then. Still, it had already been delayed more than once, so I never thought they’d actually go thru with it. In fact Jeannie put on Conan just so we could see the Snow Crash at midnight, but it never came. “Ha! See?” I said, but they quietly went dark the next day when no one was watching.

So now if we want to watch real time TV we need a weird little box that doesn’t properly turn off, only goes on “standby” with a sinister red light like the Eye of Sauron. For the most part this doesn’t bother me and I usually just unplug the thing, as I’m not a big fan of TV news, talks shows or watching sports on the tube. In fact, it’s been about two years since I watched much of anything on TV.

But TV has been creeping back into my life in form of internet TV. We’ve been getting into watching streaming shows from Netflix and Hulu. I thought my kids didn’t watch alot of TV until he first time I tried streaming from Netflix and saw a whole stack of Hannah Montana in the recently watched bin. It turns out TV can still be pretty entertaining and a good way to turn off your mind when you don’t have to suffer thru all those ads, and you can watch it whenever you like, which for me means late at night.

First we were getting into the classic 60’s show Star Trek, and worked our way thru about half of season one since coming back from New Mexico in April. Also we were turned on to 30 Rock after seeing it on the flight from Hell on the way back from NM. It’s a smart and wickedly funny sitcom, and always has one Star Wars (or other geek show) reference per episode. We had borrowed The Godfather from Netflix, and because it’s such a long movie, it sat on top of our DVD deck for about six months before we finally had the time to watch it. So then we got The Godfather II, and now that’s been sitting there for four months. One Saturday night not too long ago, we decided we could watch 12 or 13 episodes of 30 Rock in the time it would take to watch the Godfather II, so now we’ve basically burned our way thru 30 Rock. We also watch The Daily Show on Hulu from time to time. Usually catch up on the whole week on a Thursday night. Two minutes of ads per half hour is alot more tolerable than ten or twelve.

So you heard it hear first. This is the golden age of Internet Television, a.k.a. a reasonable value proposition for the viewer. In a few years when it becomes popular in the mainstream it’ll become as loaded up with ads and filler as cable and broadcast TV, and they’ll start charging two or three times for the same thing (like I don’t already pay for an ISP, etc.). And then I’ll have to give up watching TV again or go underground. Ah well, might as well enjoy it while it lasts.

Test

My site has been jammed for the past few days.  I had to upgrade my version of WordPress to be be able to publish posts again. This has the strange side effect of introducing strange characters in old posts.  Gotta get on the horn with tech support.  Hopefully we’ll have it cleared up soon.

Catching Up

It’s been a while since I posted so here’s a quick update. I’ve been in the middle of a bunch of things; progress on multiple fronts.

Summer’s here! Summer Fridays are in effect at my office. The kids are counting the days until the end of school. We had a good visit with our friends Seth and Cathy at their new summer house over the long weekend, kayaking and making barbecues. Great time. Thanks!

I replaced the drive gears in my garage door opener, and then had to debug all kinds of fussy settings for travel and balance and torque so the thing would go up and down smoothly without tripping the automatic safety shutoff when it wasn’t supposed to. Looks like it’s pretty much there. Also I took the Mustang out for a good long drive the other day. It sounds kinda rough under 30 MPH, especially when the engine is cold, but once it gets above 50 it’s strong as ever. Strange. I wonder what can be done about it. Once I straighten that out I’ll feel better about getting the bodywork done.

I’ve been slowly getting back into updating my web site, which is long overdue for a major overhaul. As a start a made a new index page, which combines the features of old index and home pages, replacing them both.

I got the horn section for my new song Green Glove recorded and mixed, and I need just one more session to tweak some levels before I’m ready to post the rough mix. I’m also nearly complete my origami War Elephant. I’ve been working on this steadily the last month or so. More on both of these in separate posts soon.

MTV Music

Some of the people in my new group at work came from the team that built the site mtvmusic.com.  It’s basically a video player with a library of thousands and thousands of music videos.  We had fun playing with it one night last weekend when Jeannie wanted to show our kids the original version of “Girls Just Wanna Have Fun”, the Cindy Lauper hit from the 80’s recently covered by one of those modern teenybopper acts.  Once the video was over the site presented a list of related videos.  This led to a sort of scavenger hunt.  Jeannie and I spent hours clicking on links and touring videos from the early 1980’s.  Sort of an eclectic mix, and many things not in my usual listening genres these days, but it made sense in context.  David Lee Roth, Madonna, Michael Jackson, The Cars, Duran Duran, The Clash, Tom Petty, ZZ Top, Van Halen, Stevie Nicks, Wang Chung, A-Ha, and on and on.  (No Prince, BTW.)  By the time we were thru, I remembered why watching music videos felt alot like drugs.

New Computer: Fun With Photo Booth Movies

I’ve been busy moving into my new computer, and so far it’s not too bad, although it’s dragging on, and Apple is just as bad as Microsoft in their own little ways. It’s amazing the little gaps in my software that I need to replace now. Audio, video and network utilities, not to mention syncing and organizing all my old data. In any event, the new version of PhotoBooth make movies, and Lizzy and Michelle were happy to give it a go.

Dead Computer New Computer

It’s been awhile since I last wrote.  The deep cold, long dark nights and bleak days continue without interruption.  Five weeks now with only one or two afternoons barely breaking freezing.  Snow still on the ground from December has crusted up to ice and is covered over by newer layers like a fossil record.  I’ve been trying to keep busy by working on music and origami lest the season work its way thru my bones and into my soul.  Making progress on that stuff, albeit slowly.  A new version of my origami Lizard is basically finished.  But all work and no play makes Jack a dull boy.

I have been reading Martin’s blog about his new music recoding efforts.  I have some stuff to say, partially in response, about song writing and recoding from my own POV, particularly in regards to the guitar and the bass.  But it’s been hard pulling all that together and I realize it’s probably more than one topic, so hopefully I can get to that some time soon.

I’ve also been really busy at work getting up to speed with the Platform Group.  A bunch of new people have joined, so the lot of have been going thru three weeks of twice daily meetings to learn about the whole platform architecture, application stack from soup to nuts.  As well current state and future plans of the project.  It’s valuable stuff but alot to absorb in a short amount of time.  Basically like school.  And on top of this I’ve been getting into the code base and working on fixing bugs and adding new features from day one.

Tuesday into Wednesday a storm of snow and freezing rain descended on us.  I worked from home on Wednesday because the kids’ school was cancelled.  That morning my old laptop finally gave up the ghost for good.  It went to sleep and wouldn’t wake up.  My best guess is the power manager is fried and thinks the battery is dead and can’t tell that it’s plugged in.  At least I successfully migrated my music production off that machine, and I have a recent full backup, and most of my most recent work is on a thumb drive, so the timing of it was not too bad.  Unable to face the prospect of another week or more of downtime trying, probably in vain, to fix the machine yet again, I went out and got a new computer.

Fortunately there’s an Apple Store right near my office, so I swung by the next morning and picked up a new MacBook Pro.  So that’s the end of Microsoft OS for me for the foreseeable future (BootCamp and Parallels notwithstanding), and good riddance.  Now instead of trying to recover and old dead machine, I have the slightly less dreary task of installing all the software and my data on the new machine.  I feel like I’ve done this so many times that I’ve stacked up the carcasses of old computers like so many cloned conjurors a la The Prestige.  Ah well, hopefully this one will last me a few years and it’ll be a good long while before I have to go thru this again.

OK Computer

You might recall I bought a new computer, an iMac, about a year ago. The plan was to use is as the centerpiece of my recording studio. But ProTools didn’t run on 10.5 so that led to a big OS reinstall. I finally got ProTools, my Box and my MOTU MIDI interface all working together on the Mac under 10.4, only find out that SampleTank, which is my main onboard sampler, wasn’t compatible with Intel Macs and I’d have to get a whole new (as opposed to an upgrade) version of SampleTank. So that kind of bottomed out here. I did manage to install Boot Camp and Windows XP, but by the time I was done with all that I just wanted to get on with making music, so I went back to using my laptop again.

Well that laptop has been acting funny, and I don’t know why, and I went thru all kinds of pain to replace the hard drive last month. So over xmas vacation I finally got around to installing ProTools, SampleTank and all my samples, and the MIDI software on the XP partition of my Mac, and doing all the authorization rigaramole.

All was looking good, until I went to work on some actual music. Then to my dismay I discovered that after a few seconds the thing came to screeching halt. I tried again and it was the same thing. It was completely unusable. So I googled “protools xp bootcamp” and found lots of other people experiencing similar problems. Well misery loves company I guess. I learned that I probably needed something called the “microsoft dual core hotfix” so I googled that and it led me to this link:

http://support.microsoft.com/kb/896256

Shawnuff I installed the patch and now everything is working splendidly and completely copasetic. The one caveat is I have to turn off wifi on the mac, which is something I never had to do on my laptop. The good news is that mac is a way more powerful machine. Mixes that would max out my old machine are only using about 40 percent of the CPU. Also, with the big monitor, I can display a full 24 tracks worth of faders without having to scroll! So a longstanding goal has been realized and I’m back in business in the recording front.

And it’s a good thing too. I’m in the middle of a new song called “Earthbound”. Or maybe it will be called “Perihelion”. After a month of downtime I can finally get back to it.

The next problem is that if the machine sleeps while XP it kinda crashes when it wakes up, and then reboots in the MacOS. I think Microsoft has a fix for that too.

Worse Computer

So my computer repair project took a turn to the strange. When we last checked in with the little adventure, I had recovered and backed up all my data and bought a replacement 160 BG hard drive. Well, then I formatted the drive using an external drive bay, on my Mac running Windows. I made 2 partitions, one at 40GB for the system and another at 120 for my data. I opened my laptop, which is a big pain, and pulled the old drive and put in the new one. I ran Ghost to recover the system partition, but I failed with a mysterious “disk geometry error”.  We tried a few things, but ultimately we reformatted the drive in the laptop using an XP install CD. From there were able to restore the C drive from Ghost and the data on the D drive from the recovered files. The weird thing was, the size of the D partition somehow changed from 120 GB to 90 GB and the total size of the drive to 128 GB. Some part of the drive had become orphaned.

Throughout all this, Jeannie was helping me figure out how to proceed, with extraordinary patience. It was slow going, so we’ve been working our way thru HBO’s “Rome” while the computer was doing its thing. So, knowing at least we could recover the system, we wiped the drive clean and started over, but the same problem persisted. We figured there was a problem with the replacement drive, so I bought yet another replacement drive, this time a 250 GB one. We followed the same path. Formatted it from the Mac via a sled with a 40 and (this time) 210 GB partition, took apart the laptop to swap the drives, restored the C drive from Ghost, and watched it fail with that geometry error. We reformatted the drive in the laptop and again the size of the drive dropped down to 128 GB. Yeesh!

So we have determined that the problem is not with the drive but probably with the machine itself, maybe something to do with the drive controller. I’ve never encountered anything like this before and I don’t really know. So I’m giving up. I sunk a huge amount of time into it and at this point I have a working, if old and creaky, computer so that’s will have to do. Come the new year I will probably look to getting a new laptop. It is mostly likely to be a Mac, so this means I will be leaving Window behind, hopefully for a long time.

Bad Computer

Astute readers of this blog may have noticed a longer than usual interval since my last update, and concerned readers may be wondering why. Well I’ll tell you. The last few weeks have been pretty tumultuous. I’ve finished work of a bunch of projects, including home improvement, an update to my web site and a music flash app fro my friend Erik. (More on that later.) In completely other events, my company is undergoing a major restructuring, having laid off a whole bunch of people a week ago Thursday and moved a bunch of others, including yours truly, into new and different groups, which makes for fun and exciting time at the office these days. (More on that too later as the situation unfolds.) And lastly, as a concession to it being dark and cold out all the time, we’ve been playing Super Mario Galaxy and watching HBO’s “Rome” on DVD.

Last weekend was the first in months that we’ve had basically free with no major commitments or work to do. It was very nice and relaxing. Caught up on my rest, hung out with the kids and played legos, that sort of thing. I finally got back to my origami book and made good progress on diagramming my elephant. I updated my todo list with random tasks for the holiday break. One of them was to backup my computer, since I haven’t done that since the start of the semester.

And then, Sunday night I was settling down to work on music (I have a new song I’m working on called Earthbound – more on that later too.) and I rebooted my computer, and guess what, it wouldn’t boot. Turns out my hard drive chose that moment to turn bad.

So it’s taken me three days of downtime to recover all my work and order a replacement hard drive. Tonight I’ll be formatting the drive, putting it in my computer and restoring all my data. Fun fun fun. So that’s why it’s been almost two weeks!