Things I’ve learned, published for the public benefit
Trying To Be Helpful header image

Online Tone Generator

Capture

I made an online tone generator based on the Firefox Audio API HTML5 Web Audio API. It’s basically a large logarithmic slider that allows real-time, smooth frequency changes.

Features

  • Fine-tune the frequency in 1 Hz increments
  • Pick a music note from a list (added Sep 2014, revamped May 2016)
  • Increase/decrease the frequency by one octave (added Aug 2015)
  • Can change the frequency smoothly as you move the slider
  • Keyboard shortcuts (added Aug 2015)
  • Generate a link to a specific tone, so you can share it (added May 2016)
  • Works well on Chrome, Firefox & Safari – including mobile devices (iOS, Android) – requires a browser with support for the Web Audio API.

There are other tone generators on the Web, but they are not as cool (if I do say so myself) and/or they require Java or Flash.

What can you use a tone generator for? You can do a science experiment with resonance, tune a musical instrument, test your new audio system (how low does it go?), test the limits of your hearing (I can hear virtually nothing above 18,000 Hz, even at maximum volume), or figure out your tinnitus frequency to better target therapy.

→ 172 CommentsTags:

Plasticity – train your ears

image

Plasticity is a pitch discrimination game — that is, a game which tests and improves your ability to distinguish between similar sounds based on their frequency (pitch). You hear two sounds, which may have the same or different frequency (with 50-50 probability) and your job is to say whether they have the same frequency or different frequencies. At first, the differences are fairly obvious, but as you level up, they become smaller and smaller, which makes your job harder.

Plasticity can be a fun game to play (at least, if you believe some of my friends). In addition, it might be helpful if you want to improve your pitch discrimination skills – for example, if you’re a musician.

Plasticity is based on the Firefox Audio API and, as such, requires Firefox 4 or higher. Plasticity uses the HTML5 Web Audio API. It has been tested to work (at least) in recent versions of Chrome, Firefox and Safari – including mobile devices (in the latest release).

I wrote Plasticity to treat my tinnitus (a phantom sound in my head). The idea was to re-wire the auditory cortex in my brain through repeated training in order to change my perception of the tinnitus sound. The name “Plasticity” refers to cortical plasticity – the ability of the cortex to reorganize in response to stimuli. Did Plasticity help my tinnitus? Well, I no longer have a tinnitus problem, though I am not sure to what extent Plasticity contributed to the improvement. If you have tinnitus (especially pure-tone tinnitus), you might as well give it a try. Here are some tips on how to use Plasticity for tinnitus.

Feedback request

If you’re using Plasticity for your tinnitus, don’t forget to post a comment below. I want to know how it went!

→ 112 CommentsTags:

Is constant consumption of content keeping you from having your best ideas?

Where do you have your flashes of genius? You know, those moments when a really clever answer to something you’ve been thinking about for the past few days (months? years?) pops up in your head out of the blue.

When you ask people this question, several answers keep cropping up: “in the shower”, “in the toilet”, “in bed”, “on vacation”. Why these places? Maybe because they’re among the few places where we are (1) not actively thinking about some problem, (2) not talking to anyone, (3) not consuming content. In other words, among the few places where we are idle.

Idleness is important. In order to have creative, out-of-the-box ideas, you have to be in a relaxed state. You know that state of mind when you’ve just woken up after a refreshing sleep and there is nothing in your brain yet, and your mind just wanders from topic to topic, bringing interesting ideas and insights? You can’t tell what your next thought is going to be about, but you know it will probably be really original. That’s the state I’m talking about.

Picture of a balloon in the sky

Photo by Geoff Leeming

The opposite of idleness is focus. By the time you start focusing your mind on tasks – your morning email, the morning news, or the meeting you’re going to have at your job – the relaxed, creative frame of mind is gone. If idleness is a hot-air balloon that takes you whichever way the wind blows, focus is a high-speed train that goes straight to your destination, with no sightseeing stops or other diversions. You’ll get from point A to point B, but don’t expect any exciting adventures.

Of course, most of the time, focus is what you want. It makes you complete tasks. It makes you efficient. But it always results in some degree of tunnel vision. The more focused you are, the less likely you are to have a brilliant idea that no one else has thought about.

Tim Schafer, the man behind some of the best videogames in the world, uses a technique he calls “freewriting” in early stages of his projects. You open a notebook and write down your every thought, non-stop, for a certain amount of time. According to Schafer, the best time for freewriting is in the morning:

it has to be first thing in the morning, when the brain is empty. You’re not allowed to check email, Twitter, Facebook—nothing. Talk to as few people as possible beforehand. Every input you allow into your brain is just distracting junk that will grow and swell and muck things up. You are allowed to use the bathroom, but no reading in there. No verbal input!

Why is Tim Schafer so adamant about avoiding input? Probably because he understands that an idle, unfocused state of mind is essential for true creativity. Exposure to other people’s thoughts, whether through conversation at breakfast, reading a newspaper or checking email, focuses your mind and narrows the range of ideas you can come up with.

Unfortunately, idleness is becoming a rarity in today’s digital world. We don’t want to be idle. We want to be connected. We want to be informed. We want to be entertained. And we’ve got the technology to achieve it. So we fill every idle second of our lives with content. We watch TV shows while exercising on a treadmill. We listen to the news while driving to work. Instead of simply walking somewhere, we walk and listen to a podcast. Instead of daydreaming on our morning commute, we read on the Kindle and congratulate ourselves on putting that time to good use.

By always consuming content on our electronic devices, we are, in essence, allowing other people to put their thoughts in our heads every waking minute of our day. What about our own thoughts?

The next time you have nothing to do, consider doing exactly that – nothing. Having a bowl of cereal in the kitchen? Don’t turn on the TV, don’t update your Facebook and don’t catch up on your favorite podcasts. Don’t think about that problem you’ve been thinking about all day. Just relax, chew your cereal, clear your mind, let your thoughts wander, and give your brain a chance to come up with something great.

This post was inspired by Scott Hanselman’s talk on personal productivity, in which Scott tells you, among other things, to do less so that you can do more of it.

→ 4 CommentsTags:

I am now afraid of browser plugins

Yesterday night I got my first malware infection from the Internet. Here’s what happened, step by step:

  1. I was reading a discussion on LinkedIn, trying to get user opinions on a particular ISP in Poland.
  2. Some user had posted a link to a website which maintains a ranking of Polish ISPs. I followed it.
  3. I was transported to a pretty normal-looking website with information on ISPs, user ratings, etc. (I’m not going to post the link here, but I did report it to Google and BadwareBusters.)
  4. Soon after I started reading the page, I noticed that my browser (Firefox) started downloading some PDF file. I attempted to cancel the download, but the file was small, so I didn’t manage to do it in time.
  5. The file automatically opened in Adobe Reader 8.2, my PDF viewer of choice. (more on that later)
  6. A few seconds later, I was greeted with this:

This wasn’t just one of those annoying popups that you can simply close. My PC was completely taken over by “Live Security Platinum”, which, as I later found out, is a fake antivirus which tries to convince you that your computer is infected with a bazillion viruses and get you to pay for the “full version” of the “software”. It adds itself to the Windows Registry, sends unknown data over the network, keeps displaying annoying balloons in the notification area, and when you run Task Manager, it immediately closes it so you can’t kill it. It also reconfigures your proxy settings to keep you from running Google searches to find a solution and prevents you from running certain antivirus applications. Most annoyingly, it permanently removes several crucial Windows services like Windows Update.

Lessons learned / Advice

  1. It’s quite possible to get your PC infected just by browsing the Web – even if you never click on any suspicious links, download suspicious software, or visit shady websites. (Incidentally, I had visited tons of what would be considered shady websites before – be they porn sites, hacking sites, pirate sites – you name it, I’ve been there – and never got infected. Go figure.)
  2. Disable all the plugins that are not absolutely necessary. You may need Flash, but do you really need Quicktime, Silverlight, Java and Adobe Reader? (Remember that plugins can be temporarily re-enabled as needed.) Each plugin is one additional way for malware to gain control over your PC. All it takes is a plugin that hasn’t been updated recently and a malicious (or simply hacked) website that redirects you a cleverly written Flash animation, Java applet, video clip or PDF document.
    • Disable Adobe Reader and replace it with a built-in PDF viewer (both Chrome and Firefox have one). If you can’t do that, at least replace it with a less popular viewer like FoxIt Reader (less popular software is safer because the bad guys always focus on software with the largest user base).
  3. If you have to use a plugin, at least make sure it gets updated regularly. Don’t ignore those Flash updates!
  4. Make sure your browser doesn’t automatically open files in external applications, especially popular and rarely updated applications. With automatic opening of files, a web page can easily make your browser download a file and then immediately open it in an external application. If that external application has a security hole, it could allow the attacker to install malware on your system. Set up your browser to always ask you before opening a file. (In Firefox, you can change the behavior in Options|Applications.)

FAQ

Why the hell were you using Adobe Reader?

Well, I had been using FoxIt Reader, but I switched to Adobe because FoxIt occasionally had difficulty rendering PDF files.

Why were you using such an old version of Adobe Reader?

Because it worked faster than the newer versions. I guess I didn’t think of the fact that old Adobe Reader versions have vulnerabilities that could be exploited by a website I visit.

How did you remove Live Security Platinum from your computer?

Well, it wasn’t easy. When I typed “live security platinum remove” into Google, all I got was a ton of shady-looking keyword-stuffed sites, all of which tried to get me to purchase or at least download some malware removal software. I literally couldn’t find a single reputable-looking resource on the topic. Not a word from McAfee, Kaspersky or Avast. How was I to know that some app called MalwareRemover or TrojanKiller wasn’t going to mess up my system even more?

In the end, I followed the manual removal instructions given here (near the bottom of the page). That way, at least I could verify each step separately.

Once the malware was removed, I was in for a nasty surprise. Live Security Platinum had removed a number of crucial Windows services like Windows Firewall and Windows Update. By “removed”, I don’t mean that it simply disabled them – I mean that they did not even appear in the Services console. How do you reinstall a basic Windows component? I decided that the simplest way out was to use System Restore to bring my system back to the state it was in 4 days earlier. Thank goodness I had a restore point that I could use.

→ 6 CommentsTags:

Review of the Panasonic TX-P42-ST50-E plasma TV

I bought a new TV for my mom to replace her 21-year-old Sanyo CRT TV that my parents bought when I was a pre-teen. By the way, the Sanyo is still working, though the picture isn’t what it used to be. Initially, I was going to do it the polite way and wait for the old TV to die before I got a new one, but as the old TV has shown no signs of decline in the past two years, I lost hope of that ever happening. I guess I should have known better than to count on the death of a Japanese product from the early 90’s. (BTW, how’s your Game Boy working? Mine’s still going strong.)

image

Why plasma?

When you ask a non-techie shopper what TV they are going to buy, the answer is most likely going to be “LED”. In the minds of most consumers, LED TVs are the state of the art in TV technology. A major reason for this association is that, of all the TV types available today, LED TVs simply appeared the latest. They are also a bit thinner and much more energy-efficient than other types of TVs, which contributes to the modern impression they make on shoppers. For these reasons, an LED TV was my default choice as well. I had to be convinced to choose otherwise.

I was persuaded away from LEDs because I noticed a funny thing during my occasional visits to TV stores in Wroclaw: every time I noticed a TV with picture that impressed me, I would glance at the label and it would read “plasma”.

Plasma displays have two big advantages over LCD and LED displays. One is black level. The basic way LCDs work is by having a huge white backlight that is always on. The white light from the backlight is then blocked with an array of tiny colored filters and liquid crystals. To display black, an LCD has to block the white light with liquid crystals that turn black. (It is important to understand that “LED displays” are actually LCD displays with an LED backlight. In a “classic” LCD display, the backlight is a white CCFL; in an LED display, the backlight is composed of a large number of LEDs that give off a white light.) Since the backlight is very bright, light from the backlight tends to “leak” through the liquid crystals. This means that it is very hard for an LCD to display true black. In most cases, the best it can do is very dark grey. (LCD/LED TVs in stores are always set to show bright, colorful images, so you won’t notice this deficiency.)

On the other hand, a plasma display has no backlight. It is more like a matrix of tiny neon lights – small cells filled with a mixture of gases that turn into glowing plasma when you apply voltage to them. Turn off the voltage and the light is gone. Because of this, it is relatively easy for a plasma display to reproduce true black.

Another advantage of plasma displays is uniformity. LCD and LED displays commonly suffer from “backlight bleed” – light from the backlight “bleeds” around the edges of the panel, which means that when looking at a dark scene in a movie (e.g. a night sky or a dark interrogation room), you can notice patches of light instead of a uniform black area. This is not an issue with plasma displays.

The main advantage of LED displays over plasma displays is power consumption. An LED display will use up 50% less power than a plasma display of the same size. This may seem like a lot in relative terms, but for a 40” display the difference is about 60 watts. If you watch TV for 4 hours every single day, you will save 87 kilowatt-hours over a period of one year. This works out to about $15 per year. You decide whether it’s worth paying $15 per year for superior picture quality.

(More detailed comparison of display technologies from Wikipedia.)

My impressions of the Panasonic TX-P42-ST50-E

I’m not going to write a complete review of the TV. For that, I’ll refer you to the glowing reviews at HDTVtest.co.uk and AVForums. The consensus among the Internet experts is that this is a mid-range plasma TV with better picture quality than last year’s high-end models.

Below, I’ll report my general impressions and include some information that I wasn’t able to find anywhere, despite extensive research. I hope you will find it useful in making your purchasing decision.

Note: The information presented here refers to the European version of the Panasonic ST50. The North American version has different firmware and slightly different features.

  • Black level. This TV produces incredibly deep, inky blacks – much better than I’ve seen on any LCD display. If I may say something slightly controversial, I think there’s little point in improving the black level any further. It’s already better than what you get in a movie theater. (In case you haven’t noticed, movie projectors cannot reproduce 100% black, although they are very close.) Watching dark content such as concert footage or movies with night-time scenes (such as Drive, with night-time car chases and aerial shots of the L.A. skyline) is pure pleasure on this TV. I can’t wait to re-watch Star Wars on it. Space is going to look amazing on this set.
  • Color fidelity. Even without calibration, color accuracy on the Panasonic TX-P42-ST50-E (in the “True Cinema” mode) seems subjectively very good, as checked by inspecting several familiar photographs. This is a very good TV for browsing photos. (You can use the calibration settings posted by David Mackenzie of HDTVtest.co.uk to make the colors even more accurate.)
  • Motion interpolation. Like most modern TVs, the Panasonic TX-P42-ST50-E can make motion more fluid by inserting additional frames between the actual frames in the source. This is a controversial feature. Some people enjoy the extra fluidity; others feel it makes movies feel less “film-like”. I have found I am in the first camp. The standard movie frame rate is quite jerky (just try playing a game at 24 fps – it will be playable, but not fluid by any means). For me, the effect is simply tiring on a large screen, especially when sitting close to the TV. So I have set “Intelligent Frame Creation” to “Mid” and so far I’ve been quite happy.
  • [Added Jun 18 2012:] Burn-in. After about a month of watching a 24-hour news channel for 2-3 hours a day, the channel logo is now permanently visible in light grey when you display a uniform background (especially on white). To be fair, I only noticed the image when I tried the built-in “burn-in remover” feature (which shows a solid white bar moving across the screen). I don’t think this is classic burn-in because no image is visible on a black background (I checked in a very dark room). I tried running the burn-in remover for 5 hours. It has made the channel logo more faint, but it hasn’t removed it. It’s not terribly annoying because the TV is almost never used to display solid colors. The biggest concern is that it will keep getting worse.
  • Sound quality. Customers like slim, sexy TVs. Slim TVs means tiny speakers. Tiny speakers means crappy sound. Panasonic has crammed 8 teeny speakers and a miniature subwoofer into this TV. The 8 speakers sound worse than the single speaker in the old 14” Grundig TV in my kitchen. As an experiment, I plugged in an external amplifier and a very cheap set of Onkyo speakers and the difference was night and day. Don’t get me wrong – you can still watch stuff on this TV; it’s just that the sound seems to be coming from far away (maybe because the speakers are facing down and not forward?) and thus the clarity is not very good. From what I’ve seen, this is pretty much the norm with slim TVs.
  • Reflections. The display is glossy, but I was actually surprised at how well the anti-reflective coating absorbs reflections on this TV. There’s certainly no “mirror effect”, such as you can see on many laptop screens. As long as your display is not facing a window, you should be totally fine.
  • Remote control. From the point of view of someone who’s interested in user interfaces, the remote control is a disappointment. It’s an array of buttons, just like the remote that came with my mom’s 21-year-old Sanyo. Have we really learned nothing about user interfaces in 21 years? Why can’t I have a volume knob to make precise and quick adjustments to volume instead of having to press a button many times? Where’s my pointing device to quickly select options on the screen instead of using the awkward arrow keys? On the plus side, the infrared LED on the remote seems to be pretty powerful, so the remote works pretty much whichever way you point it (at least with fresh batteries). This is a welcome feature, as it can be quite annoying to lift the remote and point it at the TV every time you want to do something, especially if you’re the kind of viewer who often rewinds a movie in order to catch every line of dialogue.
  • Multimedia playback from USB devices. There have been reports that this TV has difficulty playing MKV and AVI files. I have found this to be completely false, at least on my (European) version of the TV. So far, I have tried about 20 different movies in MKV, MP4 and AVI containers, and the TV has played them all back very reliably 90% of them without any problems. I did encounter a problem with one very large (8 GB) MKV movie encoded in 1080p, which worked on my PC but not on the TV. It is possible to seek back and forward by about 10 seconds by pressing OK and then the Left or Right arrow, which is useful if you miss a line. External subtitles in SRT format are supported (the name of the subtitle file has to be the same as the name of the movie file) as well as internal MKV subtitles. Polish characters are supported (there is a menu option to set the character set). The font used to render subtitles is good-looking and very readable, so no problems there, even if your eyesight is not perfect. Subtitles can be turned on and off with the Subtitle button on the remote.
  • DLNA playback. The Panasonic TX-P42-ST50 can access media stored on your PC, eliminating the need to plug in a USB device. It’s simple enough on the TV end: I connected the TV to a router (both using Wi-Fi and an Ethernet cable) and it just worked. However, it took me two hours to get Windows 7 to share my media with the TV – the process is totally unintuitive and involves both reconfiguring your network sharing options and enabling some non-obvious settings in Windows Media Player. Even though I eventually succeeded in this, I was having constant trouble whenever I added a new folder to the shared library: it would take a long time for it to appear on the TV. Finally, I installed a free application called Serviio (by Petr Nejedly) which works perfectly. It allows you to share any folder on your PC with your TV.
  • Subtitles with DLNA playback. One drawback to DLNA playback on the Panasonic TX-P42-ST50 is that external subtitles in SRT files are not supported – only internal MKV subtitles work. (This might be a limitation of the DLNA standard, not of the TV.) To remedy this problem, you can download a free application called MKVmerge (part of MKVToolNix), which can combine a video file (MKV or MP4) and an SRT file into a single MKV file with built-in subtitles. Initially, I was reluctant to take this route, but it turned out to be pretty painless: just drag and drop two files, click “Start”, wait 30-60 seconds and you’re done. Another quirk is that with DLNA playback you cannot turn on subtitles with the Subtitles button on the remote, like you can with USB playback. Instead, you have to press the Option button and choose Subtitles.
  • Internet access. The TV can run third-party apps. Several apps are included with the TV. The selection depends on your country. (In Poland, the best one is iPlex.pl, which allows you to watch older and less popular movies free of charge in exchange for watching commercials for about 5 minutes.) One troubling thing I noticed about the third-party apps is that each one seems to have a different interface. Instead of using the pause button on the remote to pause a video, they’ll force you to press OK, then use the arrow keys to find the “pause” option on their own special menu. Of course the special menu is different in each app. Good luck explaining to a non-techie why something as simple as a pause button cannot work the same way everywhere. The situation is even worse with more “advanced” features like rewinding or finding a show to watch. A couple of words come to mind when contemplating this, the mildest being “idiocy”. As a side-effect of this “explosion of creativity”, many apps simply feel slow, probably because the TV’s CPU is unable to cope with all those custom animations. Panasonic should just enforce common interface guidelines for all apps; otherwise, we’ll have braindead developers each doing their own dance and thinking they look sexy.
  • YouTube app. There is a YouTube application (of course, with its own way of doing things), but I’m not quite sure if it will be of use to anybody. People usually find YouTube videos on various websites, blogs etc. Since no one in their right mind is going to browse the Web on this TV, there is the question of how exactly the YouTube app is supposed to be used. Perhaps it could be useful as a kind of “view later” feature, where you add videos to a playlist on your PC, and then watch them later on a big screen. However, even this limited functionality is not supported well due to the poor user interface of the app and the fact that, amazingly, it does not support the playback of HD videos. You can probably see why I tried it once and then never launched it again.
  • Recording (PVR).The Panasonic TX-P42-ST50-E has a PVR feature, which allows you to record digital TV. You can record on demand or you can tell the TV to record a later show for you (you can even choose the show to record on the TV Guide screen on digital TV, which is pretty convenient). There are, however, several important limitations to this feature:
    • It only works on USB hard drives (USB flash memory is not supported). I was able to successfully use this feature with a USB-powered WD Passport drive.
    • Before you can use it, you have to allow the TV to reformat the drive. This means you have to give up the whole drive for recorded programs.
    • Only digital broadcasts can be recorded. On the plus side, the quality of the recording is great. I was able to record digital terrestrial TV (DVB-T) broadcasts in HD and the quality is indistinguishable from the original. I think the TV simply saves the original MPEG stream.
    • The recorded videos are inaccessible on other devices, even on other units of the same TV. The drive is formatted with the UFS file system, which means it is inaccessible on Windows. The video files themselves are encoded and have not been successfully reverse-engineered so far. So there is no way to view the recorded videos on your PC.
    • You cannot watch one channel and record another at the same time. You can only watch the channel which is being recorded. To watch another channel, you have to stop the recording. This means the PVR feature will be useless if you want to record a football game while your wife watches Downton Abbey.
    • The TV has to be left on standby. If you set it to record a show and then another person turns the TV off completely, you’re out of luck.
  • Noise. First, the good news. Unlike last year’s Panasonic 42” plasmas, this model has no fans (bigger versions do have them). The bad news is that there is a buzzing sound (voltage transformers?) which ranges from inaudible to easily audible (this is when the TV is displaying bright images). At its worst, I can easily hear it in a quiet room at a distance of about 3 meters. The noise is not very high-pitched, so the annoyance factor is not high, in my opinion. If this was a computer display, the noise would of course be totally unacceptable, but, seeing as you rarely use a TV to watch things with no sound, it does not seem a big problem because in most cases whatever you’re watching will mask the sound completely. In any case, I’ve seen DVD drives that made more noise, not to mention the ambient noise you get when watching a movie in a cinema (I’m talking about you, popcorn lovers!). Since the buzzing sound has been reported by other users (usually as not very annoying), I believe it’s a property of the model and not an issue with my specific unit.
  • Heat. The back of the display gets warm in the upper left and right corners. The amount of generated heat seems modest for a display of this size. Certainly this is no heater.
  • Build quality. The set, manufactured in the Czech Republic, feels very solid and well-finished. Nothing feels cheap or flimsy. The build quality certainly inspires confidence in the reliability of the product.
  • Power consumption. Because this is a plasma display, it uses up about twice as much power than an LED display of the same size.
  • Minor annoyances. When watching with headphones on, it’s hard to control the volume because the headphone volume control is buried deep in the menu system.

Conclusions

When I bought the Panasonic TX-P42-ST50-E, I had already read Internet reviews of it, so I was not surprised to see the flawless cinematic picture quality of this TV. I was, however, pleasantly surprised at how well it handles digital content. Having read user comments about the limited video format support in previous Panasonic models, I was fully prepared to shell out $100 for an external media player such as the WD TV Live. This has turned out to be completely unnecessary, which is great because it eliminates the need for another device with yet another remote control.

If you are looking for a modern TV with top-notch picture quality and good support for digital media playback at a reasonable price, you’ll be doing yourself a disservice if you don’t at least check out the Panasonic TX-P42-ST50-E.

My only reservation concerns the buzzing noise that can occasionally be heard when displaying bright images. If you are highly sensitive to noise, it’s probably a good idea to make sure you will be able to return the TV in case you find the buzz too irritating. Personally, I don’t have a problem with it, and I’ve spent significant amounts of money and time to silence my PC, so chances are you won’t either.

(For tons of discussion and nerdy details, check out the official threads at AVSForum and HighDefJunkies.)

→ 15 CommentsTags:

How to tie your shoelaces securely

Back in my high school days, I had constant problems with my shoelaces coming undone. I was always having to stop and tie them, sometimes several times a day. Then I discovered Ian’s Secure Knot. It took me 10 minutes to learn (it’s really simple, once you get past the initial difficulty of translating diagrams into hand movements) and I’ve never looked back.

I’ve been using Ian’s Secure Knot for over ten years and (I swear I’m not exaggerating) I haven’t had my shoelaces come undone once. As far as I’m concerned, this knot provides military-grade security for your shoes. It looks great, too!

Finished Ian's Secure Shoelace Knot picture

→ 3 CommentsTags:

iTunes 10.2.1 fails to decode MP3 files properly

It is generally assumed that all major MP3 playback software produces the same output. The reason for this thinking is that the MPEG standard defines a decoder in a strict way, allowing only small deviations due to rounding.

A few years ago, I was disabused of that idea when I did an informal test to compare several well-known music players (iTunes 7, Winamp, Foobar2000, Windows Media Player). The test revealed iTunes 7 to be the outlier producing different output from the rest of the pack.

Today, I will present the results of a more rigorous test using the latest version of iTunes (10.2.1).

Test setup

  • Windows 7 Professional SP1 (32-bit) with all the latest updates
  • Auzentech X-Meridian 7.1 sound card
  • Cool Edit Pro 2.0 audio editing software

Tested players

  • Windows Media Player 12.0.7601.17514
  • Winamp 5.56
  • Foobar2000 1.1.5
  • iTunes 10.2.1

MethodolOgy

I played two 10-second MP3 clips in each player, recording the output digitally with Cool Edit Pro 2.0 using the S/PDIF loopback mechanism provided by the sound card driver.

All postprocessing options (crossfade, sound check, etc.) were turned off. Both application and system volume were at 100%.

I used the following MP3 files:

  1. a 10-second clip from Wszystko Ch. by Elektryczne Gitary encoded with LAME 3.97 at 256 kbps ABR with high encoding quality (download file)
  2. a 10-second clip from Time by Pink Floyd encoded with LAME 3.98 at 256 kbps ABR with high encoding quality (download file)

After recording in Cool Edit Pro (as a 16-bit, 44.1 kHz file which matched the source material), I saved each stream as a text file, which looked like this:

-354	-172
1	203
-447	-443
-2490	-3088
-3504	-3676
-3233	-2944
-3206	-3867
-2829	-4348
-2391	-4461
-2196	-4165...

I also opened each of the two MP3 files directly in Cool Edit Pro 2.0 and then saved it as a text file. This file was used as a reference: the output of each player was compared against it. Cool Edit Pro 2.0 uses a Fraunhofer MP3 decoder (Fraunhofer IIS is the institute where MP3 was developed).

I opened the text files in Notepad++ and synchronized them by discarding the initial silence in each file. The goal was to make sure that the first sample in each file corresponded to the start of the clip to enable direct sample-by-sample comparison.

After synchronization, each text file was opened in Cool Edit Pro 2.0 again. Each waveform was subtracted from the reference waveform to reveal the differences.

Results

Each waveform below shows the difference between the reference output stream (Cool Edit Pro 2.0 with Fraunhofer decoder) and the output stream produced by an MP3 player.

Wszystko Ch. – Windows Media Player 12

wszystko-wmp

Wszystko Ch. – Winamp 5.56

wszystko-winamp

Wszystko Ch. – Foobar2000 1.1.5

wszystko-foobar

Wszystko Ch. – iTunes 10.2.1

wszystko-itunes10

As you can see, Windows Media Player, Winamp and Foobar2000 all produced output that matched the reference stream very closely. A review of the text files showed that all three players produced virtually identical bitstreams: the differences between individual samples and the reference stream did not exceed 1, or in rare cases, 2. These differences were not large enough to register on the waveform view, even with magnification.

iTunes 10.2.1, however, added significant distortion that can be seen in the waveform above. In some cases, the samples deviated from the reference values by as much as 5 percent (e.g. 1811 instead of 1719). You can also download the above waveform as a WAV file to hear the “enhancement” added by iTunes. It basically sounds like a very high-pitched sound (> 15000 Hz) of an uneven volume. The ability to hear it will depend on your age: younger listeners will find it more prominent. (Of course, during normal music listening this sound would be very hard to hear.)

The output generated by iTunes 10.2.1 did not depend on the output setting in QuickTime (which iTunes uses to play audio). DirectSound, WaveOut and Windows Audio Sessions all produced the same output.

Time – Windows Media Player 12

time-wmp

TimeWinamp 5.56

time-winamp

Time Foobar2000 1.1.5

time-foobar

TimeiTunes 10.2.1

time-itunes10

Again, Windows Media Player, Winamp and Foobar2000 match the reference stream, while iTunes engages in creative decoding. In this sample, the distortion is smaller: personally, I cannot hear anything when I play the above waveform.

Conclusions

Cool Edit Pro 2.0, Windows Media Player 12, Winamp 5.56 and Foobar2000 1.1.5 all decoded the MP3 clips in virtually the same way. iTunes 10.2.1, on the other hand, produced a distorted output stream. While the distortion is probably inaudible in normal listening situations, it seems to mean that the latest version of iTunes fails to conform to the MP3 standard and is probably best avoided by users who care about audio fidelity.

Notes

In further tests using the same samples, I found that iTunes 9.2.1 matched the reference stream as well as WMP, Winamp and Foobar2000 – it would therefore seem that it decodes MP3 files properly. I also evaluated MediaMonkey 3 and detected very significant distortion (much larger than iTunes 10.2.1), even after disabling as many postprocessing options as I could find (volume leveling, clipping protection, crossfade, smooth stop/seek/pause, remove silence – did I miss anything?).

Check out the thread at Hydrogenaudio for an interesting discussion and independent measurements which confirm my findings.

Added November 2012: I made some quick measurements with the latest version of iTunes (10.7.0.21 for Windows) and it seems that it decodes MP3 files properly.

Added November 2014: I tested iTunes 11.4 for Windows (with DirectSound playback enabled) on one of the files and it is close enough to the reference waveform.

→ 5 CommentsTags:

Tinnitus tips

On November 23, I developed mild tinnitus. I’ve been hearing a constant sound in my head. The sound is a mid-pitched whistle or whine similar to what you hear through the wall when your neighbor is vacuuming. The principal frequency seems to be about 1.1 kHz. Here’s the closest I could get when trying to generate the sound in Cool Edit Pro.

The volume is not high – the sound is overpowered by the refrigerator in my kitchen, the sound of water flowing in the pipes in the bathroom. I can often hear it over my PC (several very quiet fans + quiet 7200 rpm hard drive) or during a conversation in a quiet room when nobody is talking.

As I’ve spent a lot of time reading and thinking about tinnitus, I want to share some tips that helped me get over the initial shock and go back to living normally. Much of the advice in this FAQ is based on what I’ve read about Tinnitus Retraining Therapy (TRT), the leading clinically proven tinnitus treatment.

What causes tinnitus?

Sometimes tinnitus has an easily identifiable cause, such as earwax buildup, certain drugs, hypertension, temporomandibular joint (TMJ) disorder, or acoustic neuroma. (The Tinnitus FAQ has a catalogue of possible causes.)

Most cases of tinnitus, however, are “unexplained”. That is, they result from changes in the brain that are still poorly understood. Dr James Kaltenbach has written a good scientific introduction (PDF) to the current theories on the causes of tinnitus.

One thing that is known about this type of tinnitus is that it is associated with hearing loss. Between 60 and 90% (depending on the source) of tinnitus patients have some degree of hearing loss. This is, however, not a true explanation of tinnitus because the majority of hearing-impaired people don’t have tinnitus, and a significant percentage of tinnitus patients have normal hearing (especially among younger people).

When will my tinnitus go away?

If your tinnitus is of the unexplained kind, the question is difficult to answer. If you were recently exposed to loud noise (for example, you went to a concert), you may just have temporary tinnitus that will go away in a few days. In many other cases, tinnitus goes away on its own within 2-3 months. In still others, it takes 2-3 years. On the other hand, there are people who have had tinnitus for over 20 years. Unfortunately, I am not aware of any reliable statistics that would show what percentage of cases resolve within a few months. The best I could find was this informal survey.

What can I do about my tinnitus?

You can go to a doctor in case your tinnitus is due to something that can be fixed or treated easily.

You can try one or more remedies recommended by tinnitus patients – vitamin B12, magnesium, ginkgo biloba, caffeine withdrawal and paracetamol – for each of these, you will find people who swear it reduces their tinnitus. And you can certainly avoid wasting your money on the countless “tinnitus cure” scams ran by unscrupulous assholes all over the Web.

Other than that, there is currently no proven method of rewiring your brain to make “unexplained” tinnitus disappear completely and permanently. There are therapies that can lessen tinnitus or even make it disappear (Xanax, notched music therapy), but their effect is temporary, i.e. they must be continued indefinitely if the effect is to be maintained.

However, you can do two very important things:

  1. You can stop the noise from bothering you.
  2. You can learn not to notice the noise.

If you achieve these two goals, tinnitus will be no more of a problem for you than the color of the walls in your apartment. It will still be noticeable, if you choose to notice it, but it will not be an issue.

Dr Stephen M. Nagler describes this beautifully in his introduction to Tinnitus Retraining Therapy (TRT):

TRT is not a cure for tinnitus.  It is a treatment approach designed with the goal of tinnitus ceasing to be an issue in the patient’s life.  It is designed with the goal of making tinnitus into a pair of pants.  Ninety percent of the time, people are unaware of their pants.  The 10% of the time they are aware, they do not “cope” with their pants, they do not “deal” with their pants, they do not “learn to live” with their pants, and they most certainly do not spend any time worrying whether the following day will be a “good pants day” or a “bad pants day.”  They simply wear their pants; and when the goal of TRT has been met, tinnitus should be just like that!

How do I stop the noise from bothering me?

The first thing you must realize is that the sound itself is not that much of a problem. Unless your tinnitus is uncommonly severe, the noise in your head probably does not interfere with your hearing in a significant way.

The real problem is that (1) you are paying attention to the noise and (2) you are reacting to it in an emotional way. In neurological terms, the auditory stimulus leads to a stress response. You find the sound disturbing, you can’t think about anything else, your heart is racing, you can’t fall asleep at night – all these problems are not due to tinnitus; they are due to your emotional reaction to tinnitus.

Does it have to be this way? No. You are probably surrounded by many sounds that are objectively louder than your tinnitus, yet you don’t give them a second thought. Every day, you sit in front of a computer that has noisy fans and hard drives, but you don’t obsess over it. While driving, you’re exposed to the sound of traffic and your own car, sometimes for hours, but that does not make you miserable. Airline pilots spend half their lives in the noise of jet engines, but they don’t make a big deal out of it. The only difference between tinnitus and those “everyday sounds” is that you interpret those other sounds as “normal background noise”.

As I sit in front of my computer writing this post, I am surrounded by potentially annoying stimuli. I hear the drone of the washing machine that’s running in the bathroom, the whirr of the hard drives in my computer, and some sounds of traffic outside the window. I am wearing eyeglasses that put constant pressure on my nose and ears; worse still, their rims impose themselves on my field of vision, putting a useless blurry border around whatever I’m looking at. To the right of my screen, there is a network router with bright LEDs blinking at irregular intervals. And whenever I move in my chair, it makes a fairly loud squeak. All of these things can be seen as irritating, yet none of them bothers me in the least bit.

There is no objective reason why I should be completely indifferent to all these stimuli, yet be disturbed by tinnitus. After all, tinnitus is just another sound I can’t do anything about.

Your emotional reaction to tinnitus is a matter of attitude. And attitudes to stimuli can change. I remember very clearly that I used to be annoyed by the ticking of the wall clock in my room, to the point that I had to take it down. Guess what? I recently hung it again and now I kind of like it. To take another example, there are people who are annoyed by the noise made by children playing in the playground. Often, the same people will find it much less annoying (or even pleasant) once they have their own children and begin to associate the sound with something pleasant.

It is helpful to realize that most of your negative attitude to tinnitus comes from the initial shock. If you had been born with tinnitus, would you worry about it? Certainly not. For you, it would be the way the world works – much like the fact that you have to blink every 20 seconds or so. Some people who have had tinnitus since childhood are indifferent to it to the point that they believe it is completely normal.

Finally, here are some positive thinking tricks to “become friends” with your tinnitus:

  • think of it as the “dial tone of the universe” (not everyone can hear it, you’re among the chosen ones!)
  • think of it as a noise that your brain makes when it’s working (it’s good to know your brain is working, isn’t it?)
  • think “my invisible force field is on and is protecting me” (this one was suggested by Thomas Tang in the comments here, I think it’s great)

What is partial masking?

Partial masking is a good technique that can help you stop reacting emotionally to tinnitus. Surround yourself with some sort of noise that blends with the sound of tinnitus without obscuring it completely. Good sources of noise include computer-generated noise, recordings with sounds of nature (rain, ocean, mountain stream, etc.), fans, radio static, air humidifiers, etc. There is a good free online noise generator over at SimplyNoise.com. Remember that if your goal is to reduce your emotional response to tinnitus, the tinnitus should still be partially audible over the masking noise. The reason is that you cannot get used to something you don’t hear. You can then gradually decrease the volume of the masking noise until your tinnitus becomes as boring and unworthy of attention as the buzz of the refrigerator in your kitchen.

Does tinnitus deprive you of silence?

Among tinnitus patients, there is a tendency to think “I will never hear silence again”, but it is worth noting that humans are incapable of hearing complete silence anyway. In a well-known study by Heller and Bergman (1953), out of 100 tinnitus-free university students placed in an anechoic chamber , 93% reported hearing a buzzing, pulsing or whistling sound. (Here’s another, more recent study of the same phenomenon.)

How do I learn not to notice the noise?

At the core of tinnitus is The Loop. The Loop is my own term for the positive feedback loop created by the following two mechanisms:

  1. The more attention you give to your tinnitus, the louder it gets. (What happens is, you are telling your brain “This sound is important/threatening, I need to hear it more clearly”.)
  2. The louder your tinnitus is, the more it attracts your attention, which in turn makes it even louder, and so on.

This is a vicious circle that can be extremely hard to break out of. In the first few days after my tinnitus appeared, I gave it so much of my attention that eventually I could hear it even while watching TV.

The loop starts when you focus your attention on the noise. Once you let yourself do that, the noise will get louder, making it much harder to get your mind off it. So Rule Number One is: don’t start The Loop. Whenever you find your attention wandering towards the noise, use your will to immediately focus on something else. Get busy. Slap yourself on the face. If you’re trying to fall asleep, try counting. Remember how miserable you felt the last time you let yourself focus on the noise. Do whatever it takes to take your mind off the tinnitus. If all else fails, mask it with music or some noise. But whatever you do, don’t start The Loop.

Learning to take your attention away from tinnitus takes training. One technique that helps with this is having a loud ticking clock in your room. The moment your attention wanders towards the tinnitus, focus on the tick-tock instead. Counting tick-tocks is also a good way to fall asleep.

Tinnitus gets louder when you are anxious about it, so anything that reduces your overall anxiety level is helpful. There’s medication like Xanax that is known to help, but exercise works great, too. If you make yourself feel so tired that you can barely move, it’s really hard to think about tinnitus – when your body is aching, all you can think of is how good it feels to lie down and rest. I would also recommend experimenting with cold showers. In general, anything that causes (safe) pain is good because once the pain is gone, you experience the opposite feeling: bliss, warmth, energy.

If you haven’t heard your tinnitus for some time, don’t listen for it. Don’t ask yourself: “Do I hear the noise now?” or “Has it really gone away or is it just temporarily masked by ambient noise?”. In the first weeks after I got tinnitus, whenever it stopped being noticeable, I would go to a quiet room and put on my isolating headphones to see if it really went away. I did this many times a day and all it did was make me notice my tinnitus again. In the end, I had to set a rule: I am allowed one “tinnitus test” per day, when I get up in the morning. For the rest of the day, no checking.

Remember: If you listen for tinnitus, you are just training your brain to hear it better. Don’t do it. Focus on other things in your surroundings and your life.

What if I’m already in The Loop?

Ah, yes. When you’re in The Loop, your tinnitus seems so loud that it’s like a tiger in your room – it seems damn near impossible not to pay attention to it. In addition, the stress you are probably experiencing does not make it any easier to exercise mental control.

Still, you have to help yourself. You have to get out of The Loop somehow. Here’s a method that worked for me: Mask the hell out of it and go to sleep. When you wake up the next morning, use every ounce of self-control you have to focus your attention on things other than the tinnitus. Keep telling yourself: if I let myself focus on it, it will just get bigger and even harder to ignore. Whenever your thoughts start wandering toward the tinnitus, slap yourself on the face or pinch the back of your forearm (this serves as negative reinforcement). The goal is to develop a mental habit to distract yourself every time you start thinking about your tinnitus. As time passes, it will get easier and easier to distract yourself when tinnitus becomes noticeable.

It can be hard to keep this up for the whole day, especially in the beginning, so use masking liberally. (Full masking is not recommended in Tinnitus Retraining Therapy because it removes the noise completely rather than letting you get comfortable with it, but my experience is that when you’re going crazy from listening to your tinnitus, masking it partially doesn’t make you any calmer. There are times when you need emergency measures.)

When you cannot help but pay attention to your tinnitus and it’s beginning to stress you out, you can try the following mental technique that I’ve found very effective. I call it the Refrigerator Trick. The trick is to imagine that the sound of tinnitus is made by an actual device in the room, perhaps a small refrigerator. It’s amazing that simply having that thought brings about instant stress relief. As soon as the sound is associated with an everyday object, it seems the brain no longer has any reason for alarm. Once the tinnitus is classified as an “everyday noise”, it is much easier to take your mind off it. To make this visualization more convincing, you can picture what the refrigerator looks like, where it’s standing, etc.

Useful resources on tinnitus

Update (Sep 2011)

I still have tinnitus, but have become indifferent to it to a degree I would never have thought possible. Basically, now it’s like the sound of the hard drive in my laptop. Sure, I notice it sometimes, but I don’t focus on it; I just go back to whatever I was doing. I’m certainly not sitting there writing an e-mail on my laptop and thinking “OMG, here’s the damn hard drive noise again, why won’t it stop?”. Needless to say, I don’t check the intensity of my tinnitus every day anymore. In fact, I’ve gone weeks without noticing it.

I used to be scared of going to sleep without masking sounds, as the silence at night brings the tinnitus out. Now it’s no big deal: I don’t pay attention to it, and on the rare occasion that I do, it doesn’t bother me; it’s just “that familiar sound” to me.

Update  – Plasticity (Aug 2012)

In April 2011, I wrote an HTML5 game (Firefox only) called Plasticity with the objective of rewiring my auditory cortex and thus reducing my tinnitus. The idea was simple:

  1. Some neurons are firing in my auditory cortex (since I hear the tinnitus).
  2. The cortex can reorganize in response to training.
  3. Conclusion: I’m going to train my auditory cortex and see how that changes the perception of tinnitus.

Did it work? It’s hard to say. I was of course hoping for a dramatic, unmistakable result – a total cure. That didn’t happen. I thought I noticed some improvement in the course of my training, but that could have easily been simple placebo effect. After a month of using Plasticity every day, I went on a short foreign trip. During that trip, I noticed that I was able to fall asleep without masking noise for the first time since I got tinnitus. When I got back home, I decided to stop using masking at home as well. I also stopped using Plasticity. In the following months, my tinnitus gradually became a non-issue for me. I would still hear it, but only if I tried to. It would no longer hijack my whole brain. Since the auditory training was effective (I did get better at recognizing sounds, as evidenced by better scores), I think it’s possible that the training somehow changed my brain’s neurological response to tinnitus. I wouldn’t bet money on it, though.

Anyway, I have now made Plasticity available to everyone on the Web, so you are free to try it if you wish. (Here’s some more information on the scientific justification and tips on how to use Plasticity.) It’s totally unproven, but, unlike the countless fake cures on the Internet, it’s also totally free (though I’d be really grateful for your donations if you can afford to spare some money).

Update – (SEP 2013)

Well, OK. The bad news is that my tinnitus got worse. The good news is that it didn’t really upset me. It only bothered me a bit for 2-3 days, then I quickly forgot about it.

How did it get worse? Well, there was a loud concert that I went to with a friend. My friend wanted to get closer to the stage, and, like an idiot, I followed her, even though the music was already uncomfortably loud where I was standing. In other words, there was a red light but I ignored it. Needless to say, I won’t be attending any loud concerts anytime soon. Which is fine with me, I’m more of a home listener anyway.

The concert left me with a threshold shift (reduced hearing) and a whistling sound in my left ear that persisted for about 3 days. My hearing came back to normal (for a while I was worried that it would stay that way), but the whistling never went away. It is much louder than the tinnitus I have in my right ear.

Now I am 90% sure that my original tinnitus was caused by noise as well (another super-loud concert). So here’s a public service announcement: If you have tinnitus, avoid loud noises, such as concerts in enclosed spaces like clubs.

How did I get over it? Same as before, only 100 times faster. (I’m getting good at this!) I used a bit of masking, Plasticity, plus exercise to relax, but mostly it was just the familiar “don’t let yourself think about it” technique. Initially, I felt pretty bad – mainly because I hated myself for making such a stupid mistake and because I was afraid my hearing would be permanently impaired. After a couple days, though, I started paying less and less attention to it, and now I don’t think about it as an issue anymore. Actually, I am quite proud of how quickly I stopped caring about it.

Good luck! Remember to post your comments here.

→ 370 CommentsTags:

The sound that should not be

Working late on the evening of November 23, I became aware of a barely audible whine that emerged, on and off, over the usual gentle hum of my computer. Right away, I had a theory on what was causing it: if it wasn’t the new hard drive that I had bought just a few days earlier, it had to be one of the fans in my machine acting up. I put my ear to my computer case, but I couldn’t hear the whine anymore.

Slightly puzzled, I opened up my case, unplugged all the fans and hard drives and started plugging them in, one by one, to isolate the culprit. No luck. Although I could hear the whine now and then, I could not place it.

It was clear that the problem lay somewhere else. I shut down my computer and all the other electronic devices in my room and started listening. The whine was there, clear as day, only now it appeared to be coming from the part of my room where the radiator was. I put my ear to the radiator, but the noise didn’t get any louder. I took a walk around my apartment – I could hear the damn thing in every room! What could it be?

I was out of ideas. My only remaining suspects were the ventilation system in the supermarket next door and the electrical transformers in the basement five floors below me. The problem was that the noise seemed about equally loud in every room, while you’d expect it to get louder as you get closer to the source.

It wasn’t until the next day that a simple experiment with a pair of earplugs and isolating headphones finally revealed the truth: there was a constant noise in my head. I had freaking tinnitus. The next few days were hell for me. Obsessed with the incessant whine I could not get away from, I became a nervous wreck unable to perform even the simplest everyday tasks.

Today, a month later, the sound in my head has not gone away, though it bothers me much less. In my next post, I will share some tips that helped me get over the initial shock and go back to living normally.

→ 8 CommentsTags:

If someone swapped out your CPU for a slower one, would you notice?

Today morning, I was checking the specs of my CPU when I noticed something weird. Intel Core 2 CPUs are supposed to slow down when they are not under load. Intel calls this feature “Enhanced SpeedStep technology” and it’s designed to conserve energy. But my CPU – a 3 GHz Core 2 Duo – was running at its full clock speed at all times.

When I launched the Task Manager, the cause of the problem became obvious. The CPU was under load: both cores were fully utilized by ORTHOS, a simple program used to stress-test CPUs and RAM. In fact, ORTHOS had been running for 58 hours. I had started it two days ago to heat up my room in the night, and forgotten to shut it down the next morning. (My Radeon HD4850 is a much better heater, but I wanted to effect a gentle increase in temperature, not turn my room into a sauna.)

Chew on this: Over the past two days, I had been using my machine almost continuously and hadn’t realized I had two computationally intensive processes sucking the life out of both CPU cores! (In the interest of full disclosure, there was a brief moment yesterday evening when I thought that skipping forward and backward in a HD video clip took a bit too long, but I put it down to normal differences between video formats.) If I hadn’t checked my CPU parameters this morning, which I did for a completely random reason, who knows how much longer it would have taken me to realize something was amiss.

Now, that wasn’t the first time that I’d had ORTHOS running in the background while using my computer. Those other times, it was a different experience altogether. Applications took a long time to launch, websites took much too long to load – the lack of responsiveness was simply unacceptable. I would have sworn to you that ORTHOS was crippling my PC.

Of course, the only difference between those other times and the last two days was in my head. Back then, I knew I had ORTHOS stressing my CPU, so I expected poor performance, which is why every single operation seemed slow to me. Without that knowledge and that expectation, my PC was, it seems, perfectly responsive.

Today’s experience will make me think long and hard before I decide to spend money on a new CPU. And every time I hear someone say how much snappier their new Intel i7 rig feels next to a Core 2, I will wonder: would they even notice if I secretly swapped out their i7 for their old Core 2?

→ 10 CommentsTags: