You dash through a crowded railway station, tripping over bags, spilling your coffee, only to have the doors slide shut in your face, leaving you breathless and sweating on the platform as the train pulls away.

But at least, if you’re in France, someone may be playing the piano for you.

It might be Edith Piaf’s “La Foule” or a burst of Frédéric Chopin’s “Fantaisie-Impromptu,” a rousing rendition of the “Pirates of the Caribbean” title song or the Tetris theme. But it won’t be performed by a paid musician, or even a street entertainer busking for coins.

It will just be a random passer-by, jamming for the fun of it on one of the pianos that the national railroad company, S.N.C.F., has installed in nearly 100 stations across France. They are free for anyone to sit down and play, and travelers from all walks of life have taken to doing just that.