There are four different endings for King's Quest IV. The Worst Ending occurs when you return to Daventry without the magic fruit and without the hen that lays golden eggs. King Graham dies, and the kingdom is poor. The song was composed by William Goldstein.
King's Quest IV: The Perils of Rosella (DOS)
Five different types of output were designed for the DOS release, each output corresponds to a different group of devices, the Roland, Yamaha, OPL2, 3 Voice, and PC Speaker.
The file is sound.203 in the resource files.
It is unknown if the Amiga, Apple II, Apple II GS, or Atari ST ports have this song.