We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › minim - sync timer with music playback
Page Index Toggle Pages: 1
minim - sync timer with music playback (Read 1175 times)
minim - sync timer with music playback
Mar 17th, 2010, 9:43am
 
hello

im writing a small tool .. sort of a "painting to music" app
anyway .. i cant get a timer to sync with minim music playback

my first test loads a mp3 .. and then play the music with minims AudioPlayer

i want to have a timer exacly timed with the music
now i use the millis() in processing .. but if the music lags for some
reason .. timer gets out of sync with sound ..

i cant find a timer-function-reader in minim.. have i missed it?

another question i have is: is it possible to set position in the audio playback?   like start playing the mp3 at 1:33 .. or jump to 2:11 ?

if you have an answer to these question
i would be greatful to hear them!  Smiley

/ellie

Re: minim - sync timer with music playback
Reply #1 - Mar 17th, 2010, 5:37pm
 
Have you tried the position() method of the AudioPlayer object  The documentation says that will return the current playback position.

Similarly, you can use skip(int millis) to skip to a particular playback point.

See javadoc for AudioPlayer:

http://code.compartmental.net/minim/javadoc/ddf/minim/AudioPlayer.html
Re: minim - sync timer with music playback
Reply #2 - Mar 17th, 2010, 9:04pm
 
ah perfect
thanks
Page Index Toggle Pages: 1