Archive for Programming

What I’m doing & reading

I thought I’d post a few updates about what I’m doing these days. My consulting business continues to be doing well, and I’m about to start a new project for a large software company, which will involve lots of heavy XSLT work. In the mean time, I’ve been learning about how to develop apps for the iPhone and iPad, using a really excellent, free online course from Stanford, Developing Apps for iOS, by Paul Hegarty. Highly recommended. I’m also gearing up to go back to school part-time to get an M.A. in Digital Arts through Goucher College’s limited-residency/distance-learning “MADarts” program. I’ll be traveling to Baltimore next month for my first residency in this brand-new program and I’m really looking forward to it.

Here are some of the computer-related books I’ve been reading lately:

JavaScript is taking over the world, so we might as well make the best of it; Crockford’s book shows that there’s a lot to be happy about as long as you take a discriminating approach. Fowler’s book has lots of nice tidbits and insights on how to be an effective software developer, especially if you’re working for someone else. And Jenkins’ book is a fascinating study of how the role of media is changing in the age we live in, utilizing concepts such as “participatory culture” and “collective intelligence.” It’s obviously the most widely accessible of these books, with chapters about Survivor, American Idol, The Matrix, Star Wars, and Harry Potter. It’s a textbook for one of my first classes in the M.A. program, and I’m likely to blog about it some more in the future.


This blog is going to get a lot worse…

…before it gets better. That’s because I am casting my perfectionist tendencies to the wind and will be trying out lots of different things. Quite reasonable questions pop up in my mind such as “Why would anyone want to read this?” and “Is this post actually going to be useful to anyone?” For the time being, I am going to put those questions on hold. My aim, dear reader, is to get myself in the habit of blogging and of having an abundance mindset about all the things that I could possibly write about (especially relating to technology). I am sorry if this comes off as navel-gazing or as airing my dirty technical laundry (such as all the things I know so shockingly little about), but I am just going to have to run that risk. For my own benefit. And for the benefit of readers—if not you who are reading right now, at least the ones reading later on once I’ve really got my act together (as if!). In the mean time, I’ll aim to fail early and fail often.

I’m self-employed and frankly lonely when it comes to geeking out, so I am going to start geeking out in public and see what happens. Maybe it will add an extra sense of accountability about safeguarding some of my still-unbacked-up data, or an extra level of motivation to learn more about the areas I feel deficient in. And maybe it will be intrinsically rewarding and fun. And maybe someday (I hope) I’ll start writing some things that will be interesting or useful to some readers—even if not regular readers, but someone who’s just Googling for the right solution to the problem they’re facing right now.

I’ve written before about my blogging confusion. But now I’ve got a little bit more focus and motivation, even if I haven’t quite articulated what it is, even to myself. For now, I can tell you it has something to do with this: celebrating technology.

Okay, that’s all. You’ve had your fair warning. :-)


Test post from OneNote

This is a test post from OneNote. Let’s see how the various things look.


Here’s an outline, including some checkbox TODOs

Indent level 1 unchecked

Indent level 2












The end.

Update: Hmm. Apart from the hideous formatting-ridden HTML markup (should I really be so surprised?), the effective formatting isn’t faithful to the original anyway. (There are extra line breaks for one thing.) This will need some work if it’s going to work at all. I suspect that using this “Send to Blog” feature will be an occasional choice at best. It was quick and easy though…I might have to look into the possibility of a hooking into the process. I should also try upgrading to Office 2010 first; maybe things have improved in this area… And I really wish Microsoft would release OneNote for the Mac, but that’s another story…


Basic, handy rpm commands

Even though I’m comfortable on the command line (and regularly use Cygwin on Windows, and Terminal on the Mac), I haven’t used Red Hat Linux (or CentOS) since probably 2003, and so I’m not very familiar with rpm (“RPM Package Manager“, or formerly, “Red Hat Package Manager”). I started by looking at the man page, which is a great way to look up a particular command-line argument but is not necessarily the best way to learn just what I need right now. For that, Google often works better, and indeed this Quick Guide fit the bill perfectly.

After installing MarkLogic Server on my new EC2 instance, I wanted to poke around some. Here are the simple commands that came in handy:

rpm -i MarkLogic-4.2-1.i686.rpm
Installs MarkLogic from the RPM package
rpm -qa
Lists all the packages installed on this machine (“query all”)
rpm -qa | grep MarkLogic
Searches for “MarkLogic” among that list (revealing its title as “MarkLogic-4.2-1″)
rpm -qi MarkLogic-4.2-1
Shows info about this package (“query info”)
rpm -ql MarkLogic-4.2-1

Shows all the files created as a result of installing this package (“query list”)

Yep, very basic and nothing to write home about. But blogging about it might help me remember. Most Unix commands have a ton of options, many of which I’ll never need. But it’s good to be able to remember some of the most common ones and only visit the man page when I need to do something unusual.


Back in the blogging saddle

I’ve got lots of ideas swirling in my head about what to blog about here. Mostly they have to do with what I’m currently learning about, particularly as it relates to technology. One idea I have is to use OneNote to track what I’m doing and then publish highlights. I heavily depend on OneNote for my day-to-day work, particularly for keeping track of my daily and weekly goals and time usage. (Maybe I’ll share my approach on that sometime.) But another way I’ve used OneNote is to help keep track of what I’m doing on an even more granular basis—to the point where I’m constantly switching back into OneNote after each little step I take. Programmers often talk about their own “stack,” meaning what they’re trying to keep in their head at any given moment, but I’ve found that OneNote works great as a persistence framework for my brain—not only for long-term storage but also as a short-term way to boost my mental RAM.

I’m not yet blogging from within OneNote, so that will be one of the next things I’ll have to look into (and updating the website design).

Until then, I’ll keep posting some random things I’m learning—in a distinctly non-comprehensive way.


Joomla as a spiritual practice

I need to make a confession. I have a very low tolerance for badly designed user interfaces and overly complicated mis-uses of technology. We are using Joomla for The Trillium School website, and all I wanted to do was add a simple page announcing our Holiday Craft Camp next week. I’m sure it’s not just Joomla’s fault; it’s also the way our designer had shoehorned everything into Joomla’s structures. But in any case, things are way harder than they need to be. I update the website just infrequently enough that I tend to forget how things work every time.

Well, this last time, I started to notice my blood pressure rising and decided to step back, cool off, and do some thinking. “I really don’t want to learn Joomla right now; I just want to get this page created.” I didn’t have much else that’s pressing today, so I decided to take this as an opportunity to cultivate patience. Patience is often thought of as “grinning and bearing it” or waiting reluctantly with clenched teeth. But I like this definition better: “Patience is the ability to dwell gladly in the present moment when we have some desire, or what would normally be a reason to desire, to depart from it.” (Robert C. Roberts in Strengths of a Christian, p. 53)

One of the sources of my resistance is that I prefer to learn things comprehensively—or at least comprehensively within some well-defined range. That’s why I tend to enjoy smaller programming languages (like XSLT 1.0) and domain-specific languages. Joomla is a full-featured Web content management system with lots of bells and whistles. I’m not planning to use it for anything other than the school website I inherited. I’m not very inspired to learn it.

So today I found myself whining, complaining, and wanting to distract myself. This feeling caught me by surprise, because lately I’ve been really loving technology. There are so many interesting programming languages to learn, so many powerful tools and frameworks to unleash one’s creativity on. In fact, technology has been really exciting for me lately, even though it seems like it’s been years since I felt this way. I think the key for me has been gratitude. Rather than trying to hoard knowledge or get overwhelmed by all the things I won’t ever possibly learn, I somehow was able to let go of all that and begin to receive everything as a gift from God. Programming languages are part of the wonderful world we live in. I don’t have to walk in the woods (although that’s nice too) to appreciate and get excited about this planet we live on.

Learning things comprehensively can be useful (and fun), but I’m finding it’s not a good general policy to live by. For one thing, most things are impossible to learn comprehensively. For another, I don’t really operate this way. There are lots of technologies I merely learn just enough to “get by”—without understanding some of the fundamentals that would be required if I had to work with these technologies everyday: Ethernet networking, email protocols, DOS batch files, etc. So I’m fooling myself even when I say that’s how I prefer to learn things. There are lots of things I’m not an expert in, and that’s okay. :-)

Joomla can be the same way; the key is to just take some notes so I can refer back to them the next time I have a task to complete. This doesn’t have to be as painful as I’m making it. There is an underlying logic, and I can learn just enough to get by, capturing the knowledge in OneNote (what a great technology!), so I can refer back to it next time and save myself a lot of headaches.


Running and hosting MarkLogic for free

Over the past year, I’ve done some consulting for MarkLogic Corporation, including some development using their flagship product, MarkLogic Server. I created the back-end content management system for their Developer Community website. It was a real joy working with the software, particularly with its new support for XSLT. (You can read more about my excitement here.)

Since then, I’ve toyed with the idea of creating an application for The Trillium School (which I’ve blogged about elsewhere) to help manage Judicial Committee (JC) meetings.

Since I had created a basic but flexible framework for browser-based XML editing (using HTML forms) in the RunDMC project, I thought it would be nice to reuse that for the JC app for Trillium School. Now, Trillium doesn’t have a big budget, and this would be a volunteer project, so cost is a big consideration. Luckily, the free Community License for MarkLogic Server seems to fit the bill, allowing the development of non-commercial/personal applications. So licensing doesn’t appear to be an issue. Hosting, on the other hand, can be costly. Taking into consideration MarkLogic’s system requirements, we were looking at $50–100 per month for hosting fees. At that point, I decided that maybe MarkLogic was overkill for what I wanted to do.

Even so, I still liked the idea and was hoping to figure out a way to do it (ideally without having to host a server on campus or in my home). Then, in the last couple of days, I learned about the Amazon Web Services free usage tier. And I came across Mike Brevoort’s immensely useful screencast about how to get MarkLogic Server running on one of the Amazon EC2 “micro-instance” servers. (Mike is the one who beat me at the DemoJam earlier this year but then amazingly and graciously offered me the iPad, which I then dutifully gave to my wife.) Although I had created an AWS account in the past, I had never used EC2, so I wasn’t sure what to expect, but Mike’s video made it really easy and I had MarkLogic up and running on CentOS within 20 minutes. Mind you, at 613MB of RAM, the micro-instance doesn’t actually meet MarkLogic’s official system requirements, so it’s unsupported. But for the small application I’m interested in creating (small data set with very few users accessing the site approximately once per day), it just might work. So far, the server seems to be running fine. The next step is to create the application.

So I’m pretty stoked about playing with this. If you’re interested in trying this out yourself, just follow the steps in Mike’s screencast: Installing MarkLogic on an EC2 Micro Instance – Free for 1 year!


How to generate GUIDs in XSLT 2.0, using Saxon.NET

I have a project where I need to generate file names that are GUIDs. I’m using Saxon.NET. With the help of Google, I figured out how to do that, but it wasn’t immediately obvious. Hopefully this post will make the solution easier to find for other people trying to solve the same problem.

This is just one example of a .NET function you can access as an extension function in XSLT 2.0, so a more general-purpose treatment of .NET extension functions might be more useful. (I defer to “Writing extension functions for .NET” for that.) But if you’re like me, you spend most of your coding time within the safe, comfy confines of pure XSLT. And you do very little .NET development. So to ensure your continued comfort, here’s how you can generate a GUID in Saxon.NET (relevant parts highlighted):

<xsl:stylesheet version="2.0"

  <xsl:output indent="yes"/>

  <xsl:template match="/">
        <xsl:value-of select="guid:NewGuid()"/>
        <xsl:value-of select="guid:NewGuid()"/>
        <xsl:value-of select="guid:NewGuid()"/>


Here’s an example result from applying this stylesheet (to any input document):


All you do is call the .NET platform’s System.Guid.NewGuid() method as an extension function. The function’s namespace URI identifies for Saxon what assembly and object class you’re interested in (System.Guid in this case).

Thanks to M. David Peterson: I found this usage buried in a code example in his lucidly-titled blog post: if ((OOP + FP + AOP) == XSLT 2.0) then ‘Composable Language’ else ‘Try Again’.

Comments (3)

Some updates

Short blog post, in bullet points:

That’s all for now. See you again in 6 months. :-)

Comments (1)

Ninja pain

This is how the PianoNinja is feeling tonight after suffering a difficult blow:

Out-of-sorts ninja

We had a little setback involving lost code. Ironically, this happened when I was trying to set up version control to guard against this very thing. I’ve posted a message to the user’s list for the IDE that failed to give me a warning before deleting all this naive user’s code, in hopes that similar mistakes by other users can be prevented. Hindsight is 20/20. I should’ve backed it up before trying to…back it up. It would also have been good to have Time Machine set up already, but I hadn’t done that either.

Thankfully, I did still have an older version of the code from before I switched over to the development environment that I’m now using, so I don’t have to start totally all over. And you can be sure that I have already secured that code into version control on a server machine so that I can continue from now on from a solid base.

How bad is it? Well, we were on Video #7. Let’s just say we’ve now reverted back to Video #3. In other words, all the code I wrote in the last two weeks is gone.

Maybe this is a blessing in disguise. Sure, I learned a lesson and I won’t make this mistake again. But the blessing might be that my continued dependency on MIDI files as the game’s underlying format is now that much less alluring. The MIDI crutch has been snatched out from under me. I don’t need to wrest myself from the MIDI code so I can move onto a better way. The code has wrested itself from me…

I was going to add bar lines tonight. Oh well, those can wait.

Before you know it, the ninja will be feeling better than ever.

Comments (2)

PianoNinja Video #7: Notation-consistent note releases

Okay, this post is just to complete the thought I’ve been exploring over the last couple of posts. I wasn’t up for much heavy thinking tonight, so I decided to just download a free MIDI editor and normalize the durations of the notes in the Chopin Waltz MIDI file so that it had no more staccato releases in the first section of the piece. Now the visual note releases reflect the actual notated durations (except that some Klavarskribo continuation dots are still missing; I haven’t implemented those yet). I wanted to see if this helped make it easier to “see” the beat:

Video #7: Notation-consistent note releases (Quicktime streaming)

I think it works pretty well for this piece of music. The sudden flash of each note release now coincides with the attack of the next note. I think it now looks smooth and rhythmic, which is what I was hoping for.


PianoNinja Video #6: Note OFF events visualized

I haven’t made any progress since yesterday’s report, but I did finally track down our camera. This video shows what I was talking about yesterday: the MIDI Note OFF events are now visible.

Video #6: Note OFF events visualized (Quicktime streaming)

The game isn’t making any sound in this video, because I’m not playing along on the MIDI keyboard. It’s easier to see the note releases when I’m not playing along and adding all the green and red colors. The piece is the same one I’ve been using for the last few demos: Chopin Waltz in E-flat, Opus 18.

The molasses effect of lingering notes is gone, so that’s good. But the note releases are accented too much, in that the suddenness of the notes’ disappearance tends to be the most visually striking movement that’s going on. It’s also dependent on the interpretation of the person who rendered the performance in the MIDI file. My theory is that if performance-dependent note releases are ignored and instead the actual note value is reflected (regardless of whether the note should be played staccato), then the accented note releases will actually help rather than hinder the feeling of the beat, since they’ll most often coincide with the attack of the next note. I’m looking forward to testing my theory out (and then moving on past this academic theorizing).


More MIDI mismatches

Today, I tried to enable what I talked about in my last post about PianoNinja. I was able to get the MIDI Note OFF events to be reflected in each note’s visible duration: how long it remains stationary on its piano key before disappearing. (I would have posted a video, but I can’t seem to find the camera right now, and I really need to be getting to bed earlier anyway.) I have a couple of observations:

  • It’s much nicer than before: crisp and clean releases, but…
  • the effective duration doesn’t necessarily correspond to the actual note value.

A MIDI file contains a rendition of a piece, not (necessarily) the authoritative musical information you’d need to reconstruct a score. Staccato durations, for example, get interpreted as short notes that obscure the actual notated value. I’m coming to terms with what I want PianoNinja to do: display a score (in Klavarskribo notation) that can be relied upon as containing the more-or-less canonical information that makes up the piece. While there might be many and varied MIDI files for the same Chopin Waltz, I don’t want PianoNinja to be subject to those variations.

So while I’m glad that I got the MIDI Note OFF events to be reflected, the associated note-vanishing is still a bit jumpy-looking, since they don’t always coincide with the attack of the following note. Before diving into using MusicXML instead, I might try to see what sorts of MIDI file quantization I could do to stretch each duration out for its full note value. I’m going for the path of least resistance here in keeping this project moving forward—without compromising the steady vision I have for what PianoNinja can be.


Feeling the beat in PianoNinja

As I play around with PianoNinja, I’ve noticed so far that it’s fairly easy to get out of sync with the notes that I’m supposed to be playing. I tend to speed up when playing slowly, for example. (You might have noticed this in the last video I posted). Part of the problem is that I don’t have any strong cues as to where the beat falls. In games like Dance Dance Revolution, there’s a very strong beat—you simply dance to the music that you hear. Ultimately, I think PianoNinja will need auditory cues as well, whether as simple as a metronome sound or as complex as a full accompaniment. (That would make it a lot more fun too.)

But before I add any auditory hints, I want to see how far purely visual cues can get me. Of course, I’ve made the decision to go with Klavarskribo, so the question as to what visual cues to use has largely already been answered for me. (Basically, use solid and dotted bar lines to indicate the primary and secondary beats, respectively.) But what Klavarskribo doesn’t answer is how to display the notes once they reach the point where they’re supposed to be played.

The simplest approach would be to just keep scrolling the manuscript right off the screen, just as if it was a roll of sheet music continuing to unwind. In other words, apart from the scrolling movement, the display would be purely static. You’d know when to play the notes only according to when they cross a given (horizontal) line, but then they’d keep on scrolling off the screen and out of sight. In that case, perhaps the most natural place for that line would be the middle of the screen rather than the top. That way, you’d be able to see the notes come and go rather than immediately scroll off the screen at the top.

I’ve decided to take a more dynamic approach, placing that line at the top of the screen and representing it with a picture of a piano keyboard, so that, for one thing, the relationship between the notation and the piano keyboard is immediately obvious (I hope). The dynamic aspect is that the visible note then freezes and remains stationary on its corresponding piano key for the duration that it’s supposed to be played, while all along the rest of the music continues to scroll upward. Early on, I was experimenting with a grayscale fade-out approach for representing the decay of the note’s sound, but I found that keeping it solid and stationary and then suddenly making it disappear worked nicely—especially when followed immediately by another note in the same hand. The combination of the new note stopping in its tracks and the old note vanishing in the same instant creates a certain visceral perception of the rhythm. At least that’s my suspicion and hope; I haven’t fully put it to the test. Right now, the durations are all hard-coded to the length of one beat, which doesn’t fit well with the Chopin Waltz I’ve been using in my demos. The notes all linger far too long, giving a molasses-like visual effect which doesn’t help you feel the beat at all. So I think I’ll focus next on taking care of those note durations.

With this approach, the most “attack-like” movement that you see is when a note ends, not when it begins. What makes it work is the fact that the disappearance of one note often coincides with the attack of the next. For that reason, it may turn out to work well for some kinds of music, but not so well for others.

But now I’m just speculating. First I’ll get it to work correctly and try several pieces of music with it. If I still find it to be lacking, then maybe I’ll add some kind of “flash” to each note’s attack. I’m hoping that won’t be necessary though. I like the idea of a visually spare interface that still packs a punch—like Klavarskribo itself, and, I hope, like the new PianoNinja logo. :-)


PianoNinja file formats: MIDI or MusicXML or…

I’m trying to figure out what file format(s) to support in PianoNinja. Synthesia has gone the route of “blind devotion to MIDI files” and its attendant pitfalls when it comes to notating music. I’ve already gotten a glimpse of these drawbacks now that I’ve tried to add the left-hand/right-hand distinction to PianoNinja. Some MIDI files separate the hands into two different tracks, and some don’t. And there doesn’t seem to be a standard way of doing this. Also, there are other visual cues built into Klavarskribo that I want to include, like bar lines, note beams, rests, continuation dots, etc. These aren’t going to be easy to derive from simplistic MIDI ON and OFF events, especially since the best MIDI files as far as performance goes would tend to be the worst as far as deriving notation goes. That’s my suspicion anyway. I get the impression that there are features of MIDI files that could allow them to provide notational hints, but those are optional and so they can’t be totally relied on.

MusicXML, on the other hand, is designed for representing musical information that can be notated. The biggest disadvantage I see of using MusicXML is that it’s not nearly as widely available as MIDI files are. Where do I go to find MusicXML files anyway? Do I have to purchase them? Do they only exist transiently on their path from Finale to Sibelius or vice versa? If I can get sufficiently past that hurdle, then it seems that I should go with MusicXML.

But there might be some other disadvantages to MusicXML also. Traditional notation requires you to make certain decisions about things like key signatures, whereas key signatures are optional in Klavarskribo (represented by a circle or diamond at the beginning of the piece on the relevant line for major or minor keys, as well as other shapes for different modes IIRC). Are they optional in MusicXML? Or does MusicXML force you to make certain distinctions that Klavarskribo doesn’t require? If MusicXML files were as abundant as MIDI files, I wouldn’t worry so much about this. I’d just take what I need and leave what I don’t need. But if I want to promote the proliferation of PianoNinja music across the Web, would MusicXML raise the bar too high? The purist in me doesn’t want to have to decide whether a note is B-flat or A-sharp in the underlying format when that distinction may not ever appear on the screen in PianoNinja.

So maybe what’s needed is a new “KlavarML” format, along with a converter from MusicXML to KlavarML (using XSLT of course). I presume there are already converters from MIDI to MusicXML (insofar as they’re able to). I don’t want to reinvent the wheel. But I also don’t want to be held back by unnecessary technological limitations. Both MIDI and MusicXML provide too much information. MIDI has lots of performance/interpretation-specific information that’s not relevant to Klavarskribo (although theoretically could be relevant to PianoNinja insofar as the scroll speed could dynamically vary, but I digress). MusicXML makes distinctions that Klavarskribo and PianoNinja do not. And MIDI doesn’t provide enough information.

Whether a “KlavarML” becomes an interchange format or an internal format specific to PianoNinja, I still like the idea. At the very least, the exercise of designing it would help clarify the whole domain of what it is I need to represent in PianoNinja. And it would also give me another opportunity to use RELAX NG. :-)

Comments (2)

PianoNinja Video #5: Stems pointing to left and right

Whereas in the last video all the note stems pointed to the right (which made it difficult to tell which hand was supposed to play which notes), now I’ve associated MIDI events in one track with the left hand, and the other track in the right hand. For those of you who aren’t familiar with Klavarskribo (which is probably 99% of the population), if a stem points to the left, then that means the note is meant to be played with the left hand. If it points to the right, use the right hand.

PianoNinja Video #5: both hands (Quicktime streaming)

My 7-year-old son was holding the camera, while I was using both hands to play. He was trying his best to hold it still. :-)


PianoNinja Video #4: Scrolling notes from MIDI file!

Tonight I got some scrolling notes to appear on the screen in response to MIDI events being played back from a MIDI file. Observe:

There are a number of deficiencies still:

  • no bar lines (that aren’t irrelevant and hard-coded still)
  • no note durations (also hard-coded)
  • no right-hand/left-hand distinction (all hard-coded to the right)
  • stems are too short in some cases, erroneously breaking the chord up
  • no beams for grouping related notes in a line

Despite these deficiencies, I’m really stoked. I’m starting to get a sense of what it will be like to use this game and to practice sight-reading with it (using Klavarskribo notation, of course). My vision is starting to be realized!


“Piano Ninja”

Earlier this month, I decided to come up with a name for the Klavarskribo video game I’m working on, so I wouldn’t have to keep calling it the “Klavarskribo game”. I was planning on making the name public when I had a first version ready to download. But last night I came up with the coolest logo for it that I just couldn’t wait to share it. (You’ll have to be the judge; perhaps I’m just sleep-deprived.)

I’m no graphic designer, so I didn’t think I’d actually come close to anything I’d be happy with. I just thought I’d sketch out some concepts. Here’s what I started with:

Sketch of logo idea for PianoNinja

I did a quick Google search for drawing programs for OS X and downloaded a trial copy of EazyDraw. Within an hour, I was liking how things were going, so I purchased a license. I added some finishing touches today, and here’s the final result:

Logo for PianoNinja

Why “Piano Ninja”? Well, for one thing, ninjas are cool. My 7-year-old has taken a particular liking to them lately, so I already have ninjas on the brain. I wanted to juxtapose the word “piano” with something indisputably cool (ninjas), since, let’s face it, “practicing piano” and “piano lessons” don’t traditionally evoke the same sense of enthrallment someone gets when absorbed in a video game (such as Guitar Hero). Also, I already mentioned that I don’t plan to knock on many piano teachers’ doors anytime soon (I’m no glutton for punishment), so I’m not terribly concerned with making the name sound “respectable” to the music education world. Finally, I like the stealth component that’s built into the name.

Now I’ve got no excuse but to get moving on this game (heh, as if not having a logo is what was holding me back). Anyway, I’ll continue to chronicle my progress as I’ve been doing so far.

Comments (2)

Lost in the MNMA forum archives

I discovered and joined the Google group for the MNMA. Now I’m reading lots of interesting discussions about alternative notations, 7-5 keyboards (traditional piano keyboard: 7 white, 5 black) vs. 6-6 keyboards (like Janko and Chromatone). One thing I really like about the general feel of these discussions is the openness with which people greet each other’s ideas. Rather than clamoring to promote their pet notation systems at the expense of others, they generally seem to embrace new ideas as contributing to progress. They seem to embody their declared purpose well:

The MNMA is an international nonprofit organization dedicated to exploring ways to make reading and playing music easier to learn and enjoy. This is our forum for open discussion of music notation improvement, alternative music notations, and related topics.

One thing I think is missing in the discussions is an explicit emphasis on use cases. Klavarskribo and some of the other ANs (which in the MNMA forum is shorthand for “alternative notation”) as well as TN (“traditional notation”) are each what I would call a general-purpose music notation system: a single system designed to support pretty much any piece of Western music, and any activity relating to that piece of music. But I wouldn’t assume that the same notation would be equally well-suited to the very different activities of sight-reading, learning a piece for the first time, and analyzing a piece, to name a few. Similarly, I wouldn’t assume that a given notation would serve equally well for all pieces of music. In one of the MNMA forum discussions, someone mentioned that:

One person on the LilyPond list wanted to see Bartók in a chromatic
staff in order to see the symmetry. With just accidentals, and no
vertical change of position, the symmetry is hidden, just as TN hides
the symmetry.

Each piece has a logic of its own. A one-size-fits-all approach to notation is guaranteed to obscure much of that logic. The extent to which the composer’s structural intentions are clearly revealed will be haphazard if the notation is designed or chosen independently of the piece being represented.

So along with “use cases” and “refactoring”, I’d like to borrow another term from software engineering: “domain-specific languages”. But let’s modify that slightly: PSLs (piece-specific languages). And PSLs would have a leg up on DSLs, because we wouldn’t necessarily have to make them dumb enough for a computer to understand.

Comments (1)

Code as means to end—what a concept

I don’t have much to update tonight about my Klavarskribo game progress. I’m currently trying to find a free Java profiler that will help me isolate whatever code inefficiencies are causing the slight delay between pressed piano keys and visible feedback on the screen. Yes, I’m using Java for this project. Java wasn’t my first choice, but since I have some experience with it and since it has built-in MIDI support and books about game development with starter code to work from, I found that it was my fastest way to get started. Before that, I was contemplating using languages that I’d rather learn more about, like Haskell and Q. But for me right now, the elegance of those languages would be distracting. My current focus is on getting the thing to work, not writing beautiful code. I’m not sure if you could call what I have “working” yet, but I have definitely written–rather, splatted–plenty of non-beautiful code onto the screen already. So I’m right on track.


« Previous entries Next Page » Next Page »