Often, its form projects they were working on while alive, yes.
generally, artists work on a lot more music than what gets released to the public. Some songs are just not quite good enough, others are colabs that fell through, etc, etc. After their death, other artists often use these “rejects” as inspiration or sample them, and credit the dead artist as both a form of tribute and a marketing ploy (as an artists music tends to gain a popularity boost when they die, which can be exploited).
Latest Answers