Here's my current theory: everything is in code. The
DNA in our bodies contains a code describing how to make a human
being. Quantum physics equations are codes describing matter and
energy. Sound can be digitally encoded, as can light. (When
scientists decipher the codes for the human mind, then
they'll really have something!)
However, the code that concerns us today is of a more mundane
variety — computer code, specifically the information that
describes how to build a Web page. Basically, this is a language
computers use to communicate with each other, so the server can
tell your machine how to display Web data. The language's creators
have arranged it to look somewhat like English, but don't let that
fool you. It's not English — it's HyperText Markup Language
(HTML).
HOW IS HTML LIKE MIDI?
A text file containing HTML is like a MIDI file in that only the
instructions for how to re-create the Web page or song are
transmitted over the Internet. For example, when a MIDI file
arrives on your machine, a sequencer interprets the data,
accurately reproducing what the composer had in mind. At least,
that's what you hope — playing the same song with different
audio cards or software synths can produce varying results.
A similar process happens with an HTML file. The code downloads
to your computer, and the browser uses that information to display
text, graphics, forms, tables, sound, animation, and other elements
of the described Web page. But the page may not look and act
exactly the same on all browsers because of user preference
controls, varying hardware, and some cross-platform idiosyncrasies.
Fortunately, this is not a problem for most bands' Web sites. If
the page looks okay on a computer running Windows Internet Explorer
with a moderate-size monitor, you're probably golden. (It would
also be useful to check it on Netscape Navigator, though most users
will probably have Internet Explorer.)
WHICH WAY DO YOU GO?
There are two ways to produce HTML code: you can either type it
into a text file or use a Web page development program like Adobe's
GoLive or Macromedia's Dreamweaver. Both
approaches have their pluses and minuses. A complex, constantly
changing, and frequently updated business Web site requires a
powerful program to create and keep track of the myriad files. Band
Web sites tend to be less intricate by design, consisting mostly of
promotional material, photographs, and contact information, along
with the occasional music or video file. For such relatively
uncomplicated sites, hand-coding is possible (and maybe even
preferable).
I maintain my own Web site by editing the HTML pages with a word
processor. The site is simple — black and white with few
graphics (see Fig. 1). My aim is to let visitors know up
front that my business is about audio, not visuals. A menu on the
left side links the user to various pages on the site. The code
gets a bit more complicated on the interactive audio pages, but in
general I try to keep the controls and the data as straightforward
and logical as possible (see Fig. 2).
There are a number of good arguments for hand-coding as opposed
to using an HTML editor program:
- When you build a site from the ground up, you get a much better
understanding of the structure of a Web page and exactly what all
that code is doing.
- It will be much easier to maintain and modify your own code
because you know exactly where everything is and what it all
does.
- Hand-coding allows you to “pretty print” — in
other words, it makes sure your code lines up, indents correctly,
and adheres to a consistent naming convention. This is an essential
part of creating easy-to-maintain Web pages. It also allows you to
include useful comments in the code, such as “/*** CURRENT
GIG SCHEDULE GOES HERE ***/”.
The problem with Web page development programs is that they
generate hard-to-decipher code. This isn't necessarily a problem if
you edit your page using only the program, but heaven help you if
you want to tweak any item by hand-coding. You'll have to wade
through line after line of computer-generated gibberish, trying to
find the right spot to edit and praying all the while that you
don't break something in the process.
And what if you need to add site material your program can't
handle? For instance, while some editors can embed such currently
popular formats as RealAudio or MP3, there's no guarantee your
program will handle any and all new formats that come down the
pike. You'll run into trouble then unless you know how to read and
write code.
CODE OR CODA?
I'm of the opinion that musicians tend to write good code. The
idea that mastering both music and math requires a related aptitude
(heck, even Einstein played the violin) is hardly new. It's a
cliché to say that music is a language — but code is a
language, too, so it should come as no surprise that so many
programmers moonlight as musicians, or that so many bands publish
their own Web sites. Also, so many electronic musicians work with
computers, synths, and sequencers these days that the line between
computer-generated music and handwritten code is becoming more
blurred all the time. Musicians who work with computers all day
tend to develop the logical, structured mind-set required for
writing code.
Even the format of an HTML page is reminiscent of a jazz chart.
Instead of the tune's intro and changes, you have the HTML
document's <HEAD> and <BODY>. Each bar in the chart
must have a specific number of beats, and within each bar certain
chord symbols are recognized. Similarly, the code of an HTML page
must take a specified form, and only keywords known as tags will be
processed correctly by the client computer. If the HTML document is
the chart, the client computer is the band playing that chart
— and each band or client has a slightly different
instrumentation and interpretation.
BROWSE AND LEARN
Whenever people ask me how they might go about learning HTML,
the first thing I suggest is that they examine the code of existing
sites. In the same way that Thelonious Monk's “Straight No
Chaser” uses the changes from Gershwin's “I Got
Rhythm,” you can easily borrow coding techniques from any Web
site on the Internet and apply them to your own pages. In fact,
just as with music, analyzing other people's code is probably the
best way to acquire the knowledge to write it yourself.
Basically, here's what you do: find a band Web site that works
the way you'd like yours to, then right-click on the page (if
you're a Mac user, click and hold), select View Source, and
voilà! There's the HTML code for that page. Some page sources
will be easier to read and understand than others — depending
on the page's complexity and how the code was generated — but
the overall structure will be useful. Like a jazz chart, in which
the chord changes and song form become a framework for playing your
own music, the code can be used as a model for your own site.
Peter Drescher is a composer and a sound designer. He
is also the owner of Twittering Machine, a project studio in San
Francisco. He maintains his own hand-coded Web site at www.twittering.com.