Category Archives: Music

Hormel can ukelele

A Canjo!Those clever BoingBoing-ers found another cool item for you “music” loves: a Hormel can ukelele. It doubles as a lunchbox. It’s a pity that they don’t include a link to how it sounds. This is just the kind of impromptu folk instrument that I’m beginning to find fascinating.

AI Bots Pick The Hits of Tomorrow

Slashdot links to a story about the music industry using AI to choose hit songs. I can’t help but shake my head in shame. I’m reminded of a scene in the movie Dead Poets Society (excerpted here):

KEATING
Gentlemen, open your text to page twenty-one of the introduction. Mr. Perry, will you read the opening paragraph of the preface, entitled “Understanding Poetry”?
NEIL
Understanding Poetry, by Dr. J. Evans Pritchard, Ph.D. To fully understand poetry, we must first be fluent with its meter, rhyme, and figures of speech. Then ask two questions: One, how artfully has the objective of the poem been rendered, and two, how important is that objective. Question one rates the poem’s perfection, question two rates its importance. And once these questions have been answered, determining a poem’s greatest becomes a relatively simple matter.

Keating gets up from his desk and prepares to draw on the chalk board.

NEIL
If the poem’s score for perfection is plotted along the horizontal of a graph, and its importance is plotted on the vertical, then calculating the total area of the poem yields the measure of its greatness.

Keating draws a corresponding graph on the board and the students dutifully copy it down.

NEIL
A sonnet by Byron may score high on the vertical, but only average on the horizontal. A Shakespearean sonnet, on the other hand, would score high both horizontally and vertically, yielding a massive total area, thereby revealing the poem to be truly great. As you proceed through the poetry in this book, practice this rating method. As your ability to evaluate poems in this matter grows, so will – so will your enjoyment and understanding of poetry.

Neil sets the book down and takes off his glasses. The student sitting across from him is discretely trying to eat. Keating turns away from the chalkboard with a smile.

KEATING
Excrement. That’s what I think of Mr. J. Evans Pritchard. We’re not laying pipe, we’re talking about poetry.

My real problem with this isn’t that it is snake-oil. I suspect that this software works very well in finding records that maximize the success of record companies in producing music which sells. I merely think it is a tragedy to limit the music we hear to those few that some computer (or even a few record executives) thinks they can make a buck in promoting. It becomes a self-perpetuating cycle of the banal, where generations of individuals grow up hearing only the most banal, market proven music imaginable and therefore don’t understand that music is more than that.

Tear that page out of your book, and stretch your own personal boundaries to find you own understanding of music.

Fast Generation of Sine Waves

Every once in a while, I want to generate some pure sine waves for audio purposes, and I have to go digging around to find this simple technique, so I thought I would write it down here. Suppose that you are trying to generate a 440Hz (middle A, if memory serves) sine wave sampled at 44.1Khz. The expensive way would look like this:

double t = 0.0 ; /* time begins at zero */
double omega = 0.0 ; /* angle is zero */
double dt = 1.0 / 44100 ; /* each sample advances time by dt */
double domega = dt * 440.0 * 2.0 * M_PI ; /* the angle advances by domega */

for (;;) {
    output(sin(omega))
    t += dt ;
    omega += domega ;
}

(Yes, yes, astute readers will note that t isn’t needed. So sue me.) This requires a single call to sin for each sample. On my little Via box, a call to sin takes about .584 microseconds, so you can generate over 1.7 million samples per second with this technique. Not bad, but we can do better. Much better.

The key is to remember this recurrence relationship:

(Formula courtesy of Don Cross)

You can compute samples of simple sine waves very fast using this technique, since it takes only a multiply and a subtract per sample. On my machine, that turns down to about 7 nanoseconds per sample. That is a speedup of over 84x.

Unnecessary? Perhaps, but it is still cool.

Why am I looking at this? Stay tuned.

Microsoft Sings a New Tune With Windows Media Player 10

Apprently Microsoft can occasionally dimly see the light ahead: witness Yahoo! News – Microsoft Sings a New Tune With Windows Media Player 10. After years of dragging their feet about including MP3 ripping in their Media Player product, they have finally caved and made an encoder freely available. Of course it doesn’t rip variable bitrate MP3s (sigh) and includes only four quality settings (double sigh), so it appears that they are being drug kicking and screaming into the future.

Hey Microsoft, what are you guys thinking? Do you really want to get to the point where everyone looks at your competition at Apple and says “You know, we’d be better off with them?” Apple and ITunes are kicking the stuffing out of you, and it is time to stop trying to appease your media slavemasters and give the consumers what they want. People want to be able to RIP mp3 cds, so they can play them on the largest variety of devices. If you don’t give them that capability, they will adopt products that will.