T

Tokyo Has 2,496 Stations and No List of Their Songs

Dark map of the Greater Tokyo rail network, colored lines radiating out, with a dense cluster of yellow dots at the center marking stations that have playable melodies.
All 2,496 stations in Greater Tokyo. The yellow ones have a melody you can play. The gray ones are stations nobody has recorded. Credit: Akash Wadhwani, sheets.works.

My wife and I went to Tokyo. It was the first trip we had taken together.

I’ve been into trains for a long time, so I already knew about the departure melodies. Seven seconds of music, played on the platform as a train pulls out. I’d known about them for years and never heard one. Then I heard one, and I was more excited than a grown man should be about a train leaving.

So we got on the wrong train, on purpose. Japan is signed well enough that getting lost takes real effort. I wanted to hear more stations, so we rode one the wrong way and then rode it back. That is how I found out what the melodies are for. The music changes by platform and by direction. My first trip with my wife, and I had us riding trains we didn’t need.

When I got home, I went looking for the dataset.

Tokyo’s rail network has good open data. The Public Transportation Open Data Center publishes stations, lines, coordinates, timetables, even live train positions. It doesn’t publish which station plays which song. Nobody needs that to run a train. Seven or so small music studios have been writing these songs since 1989, one railway line at a time. There has never been an official list of them.

The lists that do exist were made by train fans. They keep their own wikis, with tables of which melody plays where. One fan site holds the sound files. Others post long videos to YouTube, 20 minutes of melodies in a row, with a list of times underneath saying which station is which. Nobody had put any of it on a map. One reason is that the sites don’t agree on how to spell a station.

I spent about a month doing that, from northern India. It came out as a map: all 2,496 Greater Tokyo stations, and the 200 melodies you can still hear. None of the sound on it is mine.

The easy half

The list of stations took a day, because somebody else had already done it.

Mini Tokyo 3D is a live 3D map of the Tokyo network. It gives away the data behind it, as plain files anyone can download. Stations, railway lines, the companies that run them, and where each station sits on the map. The license lets me use all of it as long as I say where it came from. Every name comes in Japanese, in English, and in romaji.

Two of those files did most of the work. The station list gave me 2,522 rows. That drops to 2,496 once you take out the airline check-in desks, which aren’t railway stations at all.

The second file says which of those rows are the same building. I would have gotten that wrong on my own. Stand in Shinjuku and it is one station. In the data it is 11 rows, because JR East, Odakyu, Keio, Toei, and Tokyo Metro each keep their own record of it. Without that file you have to make up a rule about how close two stations must be before they count as one. Any rule you make up is wrong somewhere.

I’d budgeted two weeks for this part. If you’re building anything on Japanese rail, start there.

Four lists that don’t line up

The melodies were the actual work. No two sites keep them the same way.

One wiki is a list of songs. Each row is a piece of music, and next to it sits every station that plays it. There are 637 rows.

The next wiki is the other way up. Each row is a station, with its songs next to it. There are 203 rows. It is also the only one that writes down who wrote the music.

The sound site is a list of stations too, but split up by platform and by direction. That is why its 428 entries only cover 120 stations. A fourth site fills in the small private railways the others ignore.

The same facts, stored upside down from each other. So the first job was turning the song list around into a station list, then stacking all four together, one row per station. Every row keeps a note of which site it came from. That sounds like tidying up. It is the reason I could go back months later and work out which site had misled me.

Matching the names

Then the real problem. To put four lists together you have to match a row in one to a row in another. The only thing these four share is the station name. So the whole project came down to deciding when two names are the same name.

Here is all the code that does it.

def norm(s):

    s = unicodedata.normalize(“NFKC”, s)

    s = re.sub(r”駅$”, “”, s)  # 新宿駅 and 新宿 are the same station

    s = re.sub(r”[〈〔((][^〉〕))]*[〉〕))]”, “”, s)   # 〈原宿〉 is an editorial aside

    return s.strip()

Table of four Japanese station names as the fan archives write them, with the extra characters struck through in red, and the cleaned version of each name beside it.
Four spellings of the same station, and what the cleaning takes off. The last row is a rule that never fired. Credit: Akash Wadhwani, sheets.works.

Three lines are all there is to it.

The first line is the one that matters, and the one nobody notices. Japanese writes many characters twice over, a wide one and a narrow one. To your eye they are the same character. To a computer they are as different as A is from B. That line rewrites them all one way, so the machine sees what you see.

Leave it out and a lot of stations fail to match. Nothing warns you. You just get fewer results, and fewer results look exactly like a smaller archive. That is the thing to be scared of.

The second line deletes 駅, which means “station.” Some sites write 新宿駅 and some write 新宿, and both mean Shinjuku. That one never actually fired on my four sources. It costs nothing to leave in.

The third deletes anything inside brackets, and that one earned its place 28 times. One station is officially called 明治神宮前〈原宿〉, Meiji-jingumae (Harajuku), while other sites just write 明治神宮前. Elsewhere a row is tagged (接近), meaning that melody is the one for an arriving train rather than a departing one. Leave the brackets in and a station stops matching itself.

What I didn’t do is let the computer guess. You can tell it to accept names that are merely close, and I tried. Every time, it paired up stations that had nothing to do with each other, and spotting those needs better Japanese than I have. So the names either match exactly after cleaning, or they don’t match. That is a good part of why so few stations ended up with sound. I would do it again.

The YouTube detour

The sound was supposed to come from those videos.

I can’t put the sound files on my own site. Somebody wrote this music for money; a Japanese body called JASRAC collects that money for them, and the railway companies have said no to smaller requests than mine. A YouTube video is different, because YouTube holds the licenses and takes the complaints.

Better still, the good videos have chapter markers. Each marker should hand me a station and the exact second its melody starts.

I collected 44 of those videos and got usable text out of 38. Only 13 had chapter markers at all. That came to 272 markers, and they went through the same name cleaner as everything else.

143 of them matched a station. 48 didn’t, and not because of spelling.

0:00  冒頭〜銀座線          “opening, then the Ginza Line”

2:38  丸ノ内線              “Marunouchi Line”

9:46  日比谷線              “Hibiya Line”

The markers are written for a person dragging a slider, so they mark the railway line, not the station. Whoever uploaded the video assumed you would listen to it, not search it. In the end eight videos gave me every match I got, covering 89 stations between them.

There are 89 stations that do not yield enough sound for a map of 2,496. So the videos moved. 11 of them, timed by hand, now sit behind the written sections of the page instead of the map. One is a news report from 1989. One is 81 melodies that don’t play anywhere anymore.

The map’s sound came from the fan site instead. That is where the final count comes from: 200 stations, 143 of them Tokyo Metro, 55 JR East, two Toei.

Four days of work, 11 clips. When people write these things up afterwards, it all sounds planned. That bit wasn’t.

The awkward number

The network has 2,496 stations. I could find out what plays at 242 of them, and you can actually listen to 200. That’s 8%.

Horizontal bar chart comparing 2,496 stations in the Greater Tokyo rail network with the 242 that have a melody documented in a fan archive and the 200 with published audio.
8% of Greater Tokyo’s stations have a recording that anyone has published. Credit: Akash Wadhwani, sheets.works.

That was the hardest problem in the whole build, and none of it was code. 8% of the dots do something. That is either an honest picture of what volunteers have saved, or a map that looks broken. Same dots either way.

I left the rest on the map as gray dots, and wrote next to them that nobody has uploaded this one yet. That is a fact about the archive, which is the only thing I can vouch for. Saying the station has no melody, or that the platform is silent, would be a claim about Tokyo, and my data can’t carry either.

I got that wrong the first time around. An early draft of the page said 1,782 melodies were “never archived.” Good number. I had gotten it by taking my own total away from the station count, so it described my own work while pretending to describe Japan. It came out before the page went live.

The audit

Before publishing I checked every factual claim in the copy against a source and marked it verified, weak, or wrong. About 140 claims. 17 were wrong.

One: I had the composer Minoru Mukaiya’s station career starting with a 1985 commission for the Tokyu Toyoko Line. 1985 is real—it’s the year he founded his studio. His earliest verified work for that line is 2013. I had turned a company founding into a commission because it gave me a cleaner opening date, then repeated it in five places.

Another: I used a Japanese word, “otomachi,” for a city’s soundscape. It isn’t a word. The term is oto fūkei (音風景). I still don’t know where I picked it up.

The third one I felt bad about. “Spring,” the best-known Yamanote melody, was credited on my page to Yamaha and the engineer behind the original 1989 set. It’s by Itagaki Makito at Nippon Denon. My whole argument is that these composers should be named, and I named the wrong one.

There were 17 out of 140, in sources I can’t fully read. The fixes went in the next day.

Whose recordings these are

I didn’t copy the sound files onto my own site. Somebody else did the work of recording them and putting them online, and lifting them over to my site would have made their work look like mine. So the map sends you to the archives that already exist, and names them in the sources.

Nighttime view along a Tokyo station platform, a green-striped Yamanote train behind white platform-edge doors.
Platform doors at Ueno. Where these go in, the departure melody usually goes out. Credit: Nesnad, CC BY-SA 4.0, via Wikimedia Commons.

The harder question is credit. Most of this was put together by people using a nickname, or no name at all, which is normal on the Japanese web. Crediting a website is simple. Crediting a person is not, because these people chose to leave their names off their own work, and I’m not the one who should undo that.

So the sources name the sites. A person is named only if they already publish under their own name, and composers only if the public record has them. When a credit came from one site alone, I left the melody blank instead. On the map, 83 of the 517 melody entries have a composer’s name on them. Of them, 42 are Mukaiya, who is the one composer here the press has bothered with.

Two corrections arrived from strangers on Reddit the week it went up, both about single stations, both right. They’re tagged reddit-correction in the data, next to the tags naming the wikis, so a fact from a person is stored the same way as a fact from a page.

There’s a third thing I want and don’t have. When a dot is gray, I can’t tell you why. Maybe nobody ever recorded that station. Maybe my name cleaning dropped it and I never noticed. If you know Tokyo’s platforms better than I do and you want to argue with a dot, here’s my address.

Akash Wadhwani

Akash Wadhwani is a data visualization designer based in Kanpur, India. He publishes the “Data Drop,” a weekly newsletter of interactive data stories at sheets.works, and his work has appeared in theNew York Times  and the Financial Times.

CategoriesData Art