[Help] Detect when song has finished playing.

I'm trying to put Shin Megami Tensei 3: Nocturne's Normal Battle theme into my RPG Maker game.

The song has 7 choruses, chosen to play randomly when the previous "chunk" of the song's finished playing. After getting some help, I'm using this plugin to run an event during the battle that plays the intro, then randomly cycles through the choruses/chunks. However, the way I'm currently checking when to start playing the new song is to use a timer. This isn't perfect because I'm not able to wait for a fraction of a frame, leaving the transitions with weird pauses.

If I could instead detect when each "chunk" has finished, it'd probably sound better. Thank you!

I'm not able to wait for a fraction of a frame
songs are measured in samples.
look into sampling rate and OGG metadata, you'll find tags being used to position markers within the audio file.
instead of the editor call to begin a playback, use a script call, which allows passing of the starting position for playback (in samples)

it's the same instruction, except the editor call doesn't let you specify a starting position.
Sorry to be dense, but I can't figure out what you mean?

Could you write out a genetic version of that the BGM script call, as well as the waiting command would look like? Thank you for the reply.

Original thread: https://forums.rpgmakerweb.com/threads/help-detect-when-song-has-finished-playing.106869/