There is no built-in command to directly say ‘play note X with sample Y’. However, there are ways to change the pitch or the rate that a sample plays at. (Using opts for the
sample command such as
It’s definitely possible to write a function that takes into account your sample and a desired note to play at, which then calculates how much to adjust the pitch of the sample to match the desired note; but this would also depend on knowing beforehand (or being able to figure out, even if only approximately) the basic ‘note’ of the un-modified sample.
There is a short discussion at the topic Tune samples with a note input which may be of interest, with a function that @robin.newman once demonstrated for playing specific notes with a sample. Does any of it make any sense? - there’s comments in the code, and I’m sure we can explain the details as well