Copyright law varies by jurisdiction. In the US, if you plan to distribute your music, samples must typically be cleared before use.
As described on nolo (note: the italicized emphasis is my own):
Sample clearance is typically required only if you plan to make copies
of your music and distribute the copies to the public. If you are just
playing for your friends in a small group, you likely do not need to
worry about copyright litigation from a large music studio.
Sample clearance is ordinarily not required if:
- You are just using the sampled music at home.
- You are using the sample in live shows. This is because you are
probably not making copies, and
the owner of the venue pays the blanket license fees to performing
rights organizations such as Broadcast Music Incorporated (BMI) or the
American Society of Composers, Authors, and Publishers (ASCAP).
- You plan to distribute copies to the public but meet one of the following:
(1) an average listener would not notice the similarities between your
end product and the sample, or (2) your use of the sample falls under
the "fair use" doctrine. For more information on these, see "Defending
a Lack of Sample Clearance," below.
...
Defending a Lack of Sample Clearance
If you decide to use samples
without clearance, you might be in the clear in certain situations.
Under U.S. copyright law, you do not have to obtain sample clearance
if your sample is so altered that it does not infringe on the
original, or your use is a fair one.
Ensuring Your Sample Use Does Not Infringe on Copyright
If you alter a
sample so that an average listener cannot hear any substantial
similarities between your work and the sample, there is no violation
of the law. Often, musicians can be inspired by a tune, but make it so
radically different from the original that the original artists (and
the public) would not see the tunes as the same.
What Is Fair Use?
Fair use is the right to copy a portion of a
copyrighted work without permission because your use is for a limited
purpose, such as for educational use in a classroom or to comment
upon, criticize, or parody the work being sampled.
Factors in determining fair use. When reviewing fair use questions,
courts primarily look for three factors:
- You did not take a substantial amount of the original work (say, ten
seconds of a song versus 60 seconds).
- You transformed the material in
some way (for instance, you added new base sounds to a melody).
- You did not cause significant financial harm to the copyright owner
(perhaps you are using a bit of classical music in your heavy metal
rock song, which appeals to a different market).
Do not believe the
widespread myth that "less than two seconds is fair use." There is no
"magic number" like this. Also, some courts apply a fair use rule only
to the musical composition copyright, not the sound recording
copyright. For example, one judge ruled that any musical sampling
violated the sound recording copyright.
You can use the above arguments to defend yourself against a lawsuit
for sampling without permission. The problem: You will not know for
sure which way the judge will rule. And, most likely you will have to
hire an attorney to represent you in court.
Finally, even if the Earthbound soundtrack was sampling they likely legally cleared their samples first and even if they didn't, their prior actions aren't legal justification for anyone else.