The Dink Network

Reply to Re: midi

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
February 4th 2009, 09:42 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
I think a loop with a random function would suffice, but I don't think that there's any hard coded way to tell whether or not a midi is already playing, so you'd have to use specific wait commands equal to the approximate length of the midi. Here's some sample code, but the hard part is getting the wait commands to match up with the midi length.

void main ()
{
script_attach(1000);
int &rand;

loop:
&rand = random(3,1);

if (&rand == 1)
{
playmidi("1.mid");
wait(X);
}

if (&rand == 2)
{
playmidi("2.mid");
wait(X);
}

if (&rand == 3)
{
playmidi("3.mid");
wait(X);
}

goto loop;
}