Loop music specified amount of times then change

goonergooner Lancaster, PAMember Posts: 135

Hello,

I am using an attribute musicTrack, based on it's value I choose a different file to play.

I was wondering if anyone has played a music track, say 2 times, then change the track. I'm good changing the track, I guess my question is more specifically is there a way to determine when the song is over (which would be time to select a new track).

Thanks!

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Play Song
    While X < number of plays
    --Timer - Every length of song
    ----Play song
    ----Change X to X+1

  • goonergooner Lancaster, PAMember Posts: 135

    @Socks said:
    Play Song
    While X < number of plays
    --Timer - Every length of song
    ----Play song
    ----Change X to X+1

    I had been trying timer using (length of song * number of plays) and it was always a fraction of a second off. I will try this combination.

    PS - would you specify the length of song or is there a property I can find (like screen.width, or self.time, etc.)

    Thanks! Much appreciated.

  • SocksSocks London, UK.Member Posts: 12,822

    @ellison said:
    PS - would you specify the length of song or is there a property I can find (like screen.width, or self.time, etc.)

    You need to specify it, in an ideal world you'd edit your song length to the nearest 1/30th/sec value (the Timer behaviour can only resolve to the nearest 1/30th/sec), you could, if needed, throw together your own timer to get that down to 1/60th/sec.

  • goonergooner Lancaster, PAMember Posts: 135

    @Socks said:

    @ellison said:
    PS - would you specify the length of song or is there a property I can find (like screen.width, or self.time, etc.)

    You need to specify it, in an ideal world you'd edit your song length to the nearest 1/30th/sec value (the Timer behaviour can only resolve to the nearest 1/30th/sec), you could, if needed, throw together your own timer to get that down to 1/60th/sec.

    Understood ... that was probably my original problem. I was only using the nearest whole second, which I see now is not nearly accurate enough.

    Thanks again!

  • SocksSocks London, UK.Member Posts: 12,822

    @ellison said:
    Understood ... that was probably my original problem. I was only using the nearest whole second, which I see now is not nearly accurate enough.

    Yeah, 1 second is half a bar at 120bpm !

Sign In or Register to comment.