Given a sample clip, I would like to be able to find in another audio file a part that sounds similar to the clip. So for example, given a cymbal sample, I would like to be able to find a part of an audio file that sounds similar to a cymbal. I am not interested in beat detection, but rather just getting a single slice.

Having only a basic grasp of digital audio theory I am wondering what algorithms would be applicable for this situation. I am also new to Linux audio, so I would appreciate any pointers to libraries that provide this functionality or means to implement it myself.