WAV trigger: track end flag?

Can I know if a track is done playing. What I want to do is loop a track with variable pitch (external control via N_pitch). When using samplerateOffset() the play duration changes. Using trackLoop() and PlaySolo() doesn’t work well.

wTrig.trackLoad(11);

wTrig.trackLoop(11, 0);

wTrig.trackPlaySolo(11);

wTrig.samplerateOffset(N_pitch); // varies between -32k and +32k

delay(400); // duration of track (normal pitch) is 1 sec.

wTrig.trackFade(11, -20, 20, 1);

How can I know track duration of a WAV file (at normal speed)?

What I mean: to know the duration before playing the track. Something like wTrig.duration(track);

Is it possible to add these functions:

  • wTrig.trackDuration(track) : returns track duration in ms

  • wTrig.trackPlaying(track) : returns TRUE while track is playing

  • wTrig.trackFile(track) : returns TRUE if the file is on the SD-CARD

  • wTrig.setBank(bank) : sets a sound bank. A bank is like a folder. Default is 0. A convenient way to subdivide and access sounds

That would be great. I’m working on this art project called The Ommegang (the procession) - Time Spirits where a new instrument is central: the macePod.

The first performance is in the centre of the city of Ghent on April 23rd.

And another: negative pitch values to play the tracks in reverse…

Read more here:

https://stad.gent/kunst-op-straat/nieuw … imesprites

Crowdfunding:

https://crowdfunding.gent/nl/projects/t … e-ommegang

The best way to let samples play in reverse would be to set a flag: wTrig.trackDirection(int); -1 for reverse, 0 for pause, +1 for forward. Could be used to set speed too.