Grains
Click on the button to play short looped section (also called a grain) using Tone.Player. When the loop becomes very small, it takes on another pitch value.

The duration of the sample is ⁓2.5 seconds. Any values for loopStart or loopEnd larger than the duration will just loop to the end of the sample. Also make sure that loopStart is smaller than loopEnd.