Audacity Tip: Cleaning up Scratches

.figure {
display: block;
text-align: center;
}
.caption {
font-style: italic;
}

Just something I discovered recently while using Audacity to clean up some old vinyl recordings:

The Click Removal tool does a darn good job of cleaning up most scratches, but not all. IME it’s still necessary to go back after it to fix what it missed (I find that the Repair tool works well for small scratches).

Unfortunately, a lot of scratches are hard to see with the default waveform view: a scratch can have a small amplitude (smaller than the clean waveform around it); it’s annoying because it shows up as a short burst of white noise in the middle of a tune.

The black bars mark the location of an audible but invisible click.

However, white noise shows up as a vertical bar in spectrum view. So what I did was:

  1. Duplicate the track I’m cleaning up.
  2. Mute the copy.
  3. Switch the copy to spectrum view; leave the original in waveform view.

That way, you can zoom out and easily find scratches on the spectrum view. By the time you zoom in and the spectrum becomes too smeared out to be useful, you can see the scratch in the waveform view, so you can fix it.

In spectrum view, the scratch is clearly visible as a bar that goes all the way to the top.

The downside of this technique is that Audacity has to do lots of FFTs to show the spectrum. So you may want to use a fast machine for this.

As we zoom in, the spectrum becomes too smeared out to be useful, but in waveform view, the scratch becomes obvious.

The other downside, of course, is that since you can see a lot more flaws, it takes ten times longer to fix a track.

Minimal Electoral Map

During a discussion on whether the electoral college is still a good idea, someone brought up the point that it’s possible to win the electoral vote but lose the popular vote, and pretty badly at that.

So I wrote a Perl script that used evolutionary computation to try to produce the most skewed electoral map possible. Here’s what it came up with:

Electoral Vote

(click to embiggen)

Read More

Commentary Track for Expelled

Shane Killians has
released
a subtitle track for Expelled: No Intelligence Allowed
that aims to correct a lot of the errors and lies in the movie. So if
someone bought the DVD and wants you to watch it, you can add
subtitles so your
friend/relative/smizmar
can get a real-time rebuttal to the claims presented on screen.

The link above includes instructions for getting the subtitles to
display in some popular media players. In addition, I think MPlayer
should automatically pick up the .srt file (dunno about the
.ssa one).

You’ll also need to buy/rent/rip/bittorrent/teleport a video file of the movie, but you’re on your own for
that.

Wanted: Calendar Feature

PDAs have solved or simplified a lot of the problems I used to have
before I started carrying around a backup brain. But there’s one type
of reminder that they still can’t deal with: “do X under when Y
happens”. E.g., “Return Paul’s book next time I see him” or “Look up
Janice if I’m ever in London.”

Read More

L10n 2.0

If you write a software package, and want it to be usable by as many people as possible, it’s important to translate it into other languages. But like documentation, localization (l10n) is one of those chores that programmers don’t want to do. But if it’s a web app, why not ask the users to contribute translations?

Read More

Unicode Input in Emacs

One question that had been bugging me for a while is, how does one
input a character in Emacs, given its Unicode hex code?

Answer: use the ucs input method, then use
uHHHH to input, where HHHH is the character’s
hex code.

Unfortunately, it doesn’t look as though there’s a way to input a
character by its decimal code.

Also, C- toggles an input method on and off, rather than
cycling through a list. So if you’re writing HTML (and therefore want
the default input method) with French text (for which you want the
latin-1-postfix input method), but need to insert box-drawing
characters (for which you need ucs), you’ll wind up using
M-x set-input-method a lot.

A Better Way to Toggle

(Warning: what follows may be obvious or trivial to many.)

One of the cool things about AJAX is switching parts on and off: you
can make an element visible simply by

myElement.style.display = "block";

or hide it with

myElement.style.display = "none";

But the problem with this is that it requires the JavaScript script to
know a lot about the document. The example above doesn’t look too bad,
but what if you have something like a pulldown menu that appears when
you click a button?

Let’s say that originally, the button is gray and has a “+” icon next
to the text. When you click on it, the menu becomes visible, but the
button also changes to red, and the “+” icon changes to “-“, to show
that the menu is active.

Now you have all sorts of CSS resources that you have to keep track
of. It would be nice to put them in the .css file, with the
rest of the style stuff.

Read More

Different Stylesheets for Browsers With and Without JavaScript

As hacks go, this one is pretty obvious, but I thought I’d throw it
out there anyway.

Let’s say there are three stylesheets you want to use on your web
page: one for all browsers (style.css), one for browsers with
JavaScript enabled (style-js.css), one for browsers without
JavaScript (style-nojs.css). This can be useful for things
like “display the fancy drop-down menu only if the browser supports
JavaScript; display the plain-HTML menu only if the browser doesn’t
support JavaScript”.

The common stylesheet is pretty standard:

<link rel="stylesheet" type="text/css" href="style.css"/>

The one for browsers that don’t support JavaScript is also pretty
easy: that’s what <noscript> is for:

<noscript>
  <link rel="stylesheet" type="text/css" href="style-nojs.css"/>
</noscript>

Finally, what’s the best way to have different behavior in browsers
that support JavaScript? Why, run a script, of course:


  document.write('n');

Sunday Wordplay

If you’re a touch-typist, you’ve probably typed a word without realizing that you had placed your hand in the wrong position. As it turns out, sometimes this can yield a different existing word:

Read More

A Sri Lankan Mystery

The last thing that came out of recently deceased author Arthur C. Clarke’s printer was a sheet that said:

<blockquote

lurrlsrtr lurrlsrrt lurrlrtsr lurrlrtrs lurrlrstr lurrlrsrt lurrlrrts
lurrlrrst lurltrsrr lurltrrsr lurlsrtrr lurlsrrtr lurlrtsrr lurlrtrsr
lurlrtrrs lurlrstrr lurlrsrtr lurlrsrrt lurlrrtsr lurlrrtrs lurlrrstr
lurlrrsrt lultrrsrr lulsrrtrr lulrtrsrr lulrtrrsr lulrsrtrr lulrsrrtr
lulrrtsrr lulrrtrsr lulrrtrrs lulrrstrr lulrrsrtr lulrrsrrt ltusrrlrr
ltursrrlr ltursrlrr lturrsrrl lturrsrlr lturrslrr lturrlsrr lturrlrsr
lturrlrrs lturlrsrr lturlrrsr ltulrrsrr ltsurrlrr ltsrurrlr ltsrurlrr
ltsrrurrl ltsrrurlr ltsrrulrr ltsrrlurr ltsrrlrur ltsrrlrru ltsrlrurr
ltsrlrrur ltslrrurr ltrusrrlr ltrusrlrr ltrursrrl ltrursrlr ltrurslrr
ltrurrsrl ltrurrslr ltrurrlsr ltrurrlrs ltrurlsrr ltrurlrsr ltrurlrrs
ltrulrsrr ltrulrrsr ltrsurrlr ltrsurlrr ltrsrurrl ltrsrurlr ltrsrulrr
ltrsrrurl ltrsrrulr ltrsrrlur ltrsrrlru ltrsrlurr ltrsrlrur ltrsrlrru
ltrslrurr ltrslrrur ltrrusrrl ltrrusrlr ltrruslrr ltrrursrl ltrrurslr
ltrrurrsl ltrrurrls ltrrurlsr ltrrurlrs ltrrulsrr ltrrulrsr ltrrulrrs
ltrrsurrl ltrrsurlr ltrrsulrr ltrrsrurl ltrrsrulr ltrrsrrul ltrrsrrlu
ltrrsrlur ltrrsrlru ltrrslurr ltrrslrur ltrrslrru ltrrlusrr ltrrlursr
ltrrlurrs ltrrlsurr ltrrlsrur ltrrlsrru ltrrlrusr ltrrlrurs ltrrlrsur
ltrrlrsru ltrrlrrus ltrrlrrsu ltrlursrr ltrlurrsr ltrlsrurr ltrlsrrur
ltrlrusrr ltrlrursr ltrlrurrs ltrlrsurr ltrlrsrur ltrlrsrru ltrlrrusr
ltrlrrurs ltrlrrsur ltrlrrsru ltlurrsrr ltlsrrurr ltlrursrr ltlrurrsr

At first, it was thought that this was a test pattern, but today, estate executors discovered a storage room in Clarke's home filled with similar pages. The oldest ones were written out by hand in notebooks. Later ones appear on reams of fanfold printer paper, while the most recent ones appear to have been printed on a laser printer and bound together.

No two words are the same. All use only the letters A C E H K L R S T U. It is not known why these letters were significant, nor which rules were used to generate the "words". For instance, although many "words" contain two, three, or four instances of the same letter, never does a letter appear three times in a row.

With ten columns of eighty "words", each double-sided sheet holds 1600 "words". Investigators estimate that the entire collection comprises about nine billion such words.