Log In  

How do you make music play, and wait until done?

P#46586 2017-11-22 13:45 ( Edited 2017-11-22 20:56)

Oh wow, in the process of copying/pasting from the manual, I noticed there were some more stat() numbers added recently apparently (to my knowledge)! 24, 25, and 26 were not there before :D

Anyway, I was going to say it's kind of tricky and there's not a super easy way, but it looks like it just got slightly easier at least! You have to use stat(24) to read the index of the currently playing pattern, and then keep track of that and/or the current note number to know when the pattern has finished playing. (It used to be that you had to reverse-engineer the pattern index by looking at the combination of sfx indexes being played on all the channels)

Relevant portion of manual:

stat x

    16..19  Index of currently playing SFX on channels 0..3
    20..23  Note number (0..31) on channel 0..3
    24      Currently playing pattern index
    25      Total patterns played
    26      Ticks played on current pattern
P#46592 2017-11-22 15:56 ( Edited 2017-11-22 20:58)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 12:03:50 | 0.004s | Q:9