The words "Antonin Dvořák” are often followed by phrases like “New World Symphony” or “folk music meets classical Romanticism.” But when the Czech composer wasn’t at his piano or conducting a symphony in Prague, he was often doing something quite different: obsessing over trains.

Born in Bohemia on September 8, 1841, Dvořák came of age alongside the railroads that changed life in Europe forever. As a child in Nelahozeves, a village between Prague and Dresden, the arrival of the railroad that connected the two cities also changed his life. Workers from all over the Austro-Hungarian Empire made their way to the village during its construction, and the young boy watched soldiers and celebrities fly by on the trains, pulled by newly constructed steam locomotives, from a house across the street from the train station.

The train may have ended his town’s sleepy way of life, but it also inspired the young musician with a love for technology and progress. Eventually he followed the train to Prague and, as a young and increasingly famous composer, crisscrossed Europe on steam trains. His home base of Prague was a rail hub and the site of not one but two impressive train stations. Dvořák, who lived within walking distance of the Franz Josef I station, spent much of his spare time there, befriending railroad workers and reportedly escaping boring concerts to watch international express trains depart and arrive. He became obsessed with the arrivals and departures of the trains, memorizing their extensive schedules and becoming a bona fide trainspotter.

Dvořák’s obsession even showed up in his personal life: At one point, he asked a student who was dating his daughter to note the number on an international express train, then jokingly told his daughter he would forbid her to marry him because he botched the task. And when he visited the United States, he continued his trainspotting [PDF], though Grand Central Station apparently disappointed him due to its lack of opportunities to watch trains pass one another. His love of trains was so great that he once declared: “I would give all my symphonies for inventing the locomotive.”

You’d think that someone so into trains might have made more train-like music, but it’s hard to find locomotive influences in Dvořák’s folk-inspired songs. That’s not to say he didn’t find inspiration near the tracks: At one point, the composer was waiting for a festival train at the Prague station when he came up with the theme for the opening movement of his Seventh Symphony. And weirdly enough, his “Humoresque” was used as the background to a popular joke song in the 20th century that transposed potty humor about train toilets over the classic melody. It’s even said that trains eventually killed him—while standing at the Prague train station during a trainspotting trip, the composer caught a chill. He died soon thereafter.

Trains fascinated Dvořák so much that he rearranged trips to see them and begged acquaintances to describe their rail journeys to him. But why? He himself told a student that he loved the ingenuity with which each train was built. “It consists of many parts created by many different components,” he said. “Everything has a purpose and role and the result is amazing.” Kind of like a symphony.