Log In  


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



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



[Please log in to post a comment]