get_music_position (slot)

Pixilang programming language
Post Reply
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

get_music_position (slot)

Post by spiny »

Hi Guys,

I'm putting together a little music disk of XMs and MODs, and I would like them to play one after the other, for example, when one ends, start playing the next one.

can I use get_music_position (slot) somwehow to do this ? eg. compare the position with the known 'end position' and if they match skip to the next tune ?

thanks, Phil.

spiny / torment
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

Re: get_music_position (slot)

Post by spiny »

ah, 'get music pattern' seems to do what I want, am I right in thinking that it just increments until the module ends ? and if so, all I need to do is note how many 'patterns' each mod contains and skip track based on that ? I am aware that each mod will have a different amount of patterns.
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

Re: get_music_position (slot)

Post by spiny »

figured it out :)

track2: // 30 patterns
track2pos = get_music_position (2) // 1 -127
track2pat = get_music_pattern (2) // 1-30 for this module
sum = track2pat + track2pos // add both to get an integer to compare against
if ( sum < 156 ) // number is max pattern plus 127 - 1, so will change tune at position 126 of the very last pattern
{
print ( "TRACK 2", -200,-200, #ffffff )
print ( "POSITION $track2pos", -200,-150, #FFffff )
print ( "PATTERN $track2pat", -200,-100, #FFffff )
print ( "SUM $sum", -200,-50, #FFffff )

}
else { music3 } // jump to next track
Post Reply