A train melody is a succession of musically expressive tones played when a train is arriving at or about to depart from a train station. As part of train passenger operations, a train melody includes a parade of single notes organized to follow each other rhythmically to form a , singular musical thought. In Japan, departing train melodies are arranged to invoke a relief feeling in a train passenger after sitting down and moving with the departing train. In contrast, arriving train melodies are configured to cause alertness, such as to help travelers shake off sleepiness experienced by morning commuters.
Metros in several cities, including Budapest and Stockholm, mark train arrivals and departures with short melodies or "jingles".
In 1844, French classical pianist Charles-Valentin Alkan composed Le chemin de fer ("The Railroad"), a programmatic étude for piano designed to depict the happy journey of train passengers from departing a train station to portraying the train pulling into a second station. It is frequently cited as the first musical representation of railway travel. The joyful melody of Le chemin de fer subsequently has been celebrated as a forerunner to Arthur Honegger's famous orchestral work Pacific 231, which also represents a locomotive.
In August 1971, the Japanese private railway company Keihan Electric Railway became the first railway in Japan to introduce train melodies. Most of Japan's railway network was owned by the state until 1987. The former Japanese National Railways (JNR) company was privatized at that time, and the network was split between six major companies in the Japan Railways Group and a range of smaller operators. Under JNR ownership, bells were used at stations to mark the arrival and departure of trains; but privatization gave local managers greater autonomy to customize their station environments. The idea of introducing more melodic alarms was developed, and this quickly spread after passengers reacted positively.