Changing the pitch of an audio source each time it loops

Hi all,

I have a looping audio source, a heartbeart, and I want to introduce slight variation each time that it loops. I know I could do this by not setting the source to loop, but instead re-triggering it, each time changing the pitch, but setting it to loop and changing the pitch each time would help me a bunch with the timing.

Thanks!

Inspect AudioSource API

Inside of that page, 3 things are of our interest:

AudioSource.time

AudioSource.pitch

AudioSOurce.clip