If you recreate a sample note for note and use it in a new production without using the original audio, this is referred to as interpolation. When interpolating music, you are still required to obtain permission from the rights holder(s) of the composition. However, you do not need permission from the master rights holder since you are not using the preexisting sound recording.
Remember…
It is important to understand that using uncleared samples in your work can lead to legal disputes, regardless of whether you expect any issues or release the music for free. Copyright infringement is illegal and can result in significant damages, especially for artists. In some countries, copyright infringement is also considered a criminal offense. Therefore, it is strongly advised not to use uncleared samples in your work to avoid potential legal consequences. This applies to both mainstream and independent artists.