This is very basic code to take some sound clips and play them in a repeating sequence. The reason for doing this is to play background music for a game using less memory. In my case each SoundEffect is a 16beat measure and the tempo is VERY high.
This is not for a sequencer program but it that is sort of what this code does.
It really is not that hard. Plus I kind of find it annoying when a game calls the play song method because it stops my music.
Code:
SoundEffect Void0, Void1, Void2, Void3, Voidsynth0, Voidsynth1, Voidsynth2;
SoundEffectInstance V0, V1;
Code:
if (playcounter < 24)
{
playcounter++;
}
else
{
if (beat == 0) { V0 = Void0.Play(Volume); V1 = Voidsynth0.Play(Volume); }
if (beat == 1) { V0 = Void0.Play(Volume); }
if (beat == 2) { V0 = Void0.Play(Volume); }
if (beat == 3) { V0 = Void0.Play(Volume); }
if (beat == 4) { V0 = Void1.Play(Volume); V1 = Voidsynth1.Play(Volume); }
if (beat == 5) { V0 = Void1.Play(Volume); }
if (beat == 6) { V0 = Void1.Play(Volume); }
if (beat == 7) { V0 = Void1.Play(Volume); }
if (beat == 8) { V0 = Void2.Play(Volume); V1 = Voidsynth0.Play(Volume); }
if (beat == 9) { V0 = Void3.Play(Volume); }
if (beat == 10) { V0 = Void3.Play(Volume); }
if (beat == 11) { V0 = Void3.Play(Volume); }
if (beat == 12) { V0 = Void0.Play(Volume); V1 = Voidsynth2.Play(Volume); }
if (beat == 13) { V0 = Void0.Play(Volume); }
if (beat == 14) { V0 = Void0.Play(Volume); }
if (beat == 15) { V0 = Void0.Play(Volume); beat = -1; }
beat++;
playcounter = 0;
}