Tsunami.samplerateOffset doesn't seem to be working

The Tsunami.samplerateOffset method doesn’t seem to be working.

For example, here is some code that should play a track 16 on output 7 at different sample rate offsets. But I hear no differences in the sound.

tsunami.trackPlayPoly(16, 7, true);

tsunamiDelay(200);

for (int i = -30000; i < 30000; i += 500) {

Serial.println(i);

tsunami.trackStop(16);

tsunami.samplerateOffset(7, i);

tsunami.trackPlayPoly(16, 7, true);

tsunamiDelay(200);

}

tsunami.trackStop(16);

I tried it without stopping and restarting the track, and didn’t any changes in pitch either. Note that tsunamiDelay is a function that delays for a certain number of ms while calling tsunami.delay();

The documentation for tsunami.samplerateOffset isn’t very clear. Could someone provide any example of it being used to change the pitch/speed of a sound file?

Thanks,

Bill Pugh

The Tsunami Arduino library includes an example sketch that uses the sample rate offset command. Have you tried running that sketch or looking at the code?

After some testing, I determined that it works on Tsunami v1.09s, but not on the mono version, Tsunami v1.09m.

I was trying to do the pitch blending on channel 7 in the mono version, if that is significant.

I’m trying to use this board for a Burning Man art project; would be really nice I could find a way to make this work on the mono version quickly.

Bill

Found the bug. It was in the Tsunami-Arduino-Serial-Library code; for samplerateOffset, you were masking off all but the least two bits, which limited to outputs 0-3. I forked the code and will be submitting a pull request momentarily.