November 23, 2024, 08:01:37 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Random help

Started by J Pettis, October 27, 2011, 11:39:58 AM

Previous topic - Next topic

J Pettis

I am attempting to use the "P?" command to randomly play two files SFX00 and SFX01 and Ambient. I am able to play them individually using the "PS" command and the Ambient file works as well. Not sure what I am doing wrong.

Start_Audio:
  SEROUT Sio, OT2400, ("!AP16", %00, "P?", 2, 1)

Thanks,
J

JonnyMac

That really won't work for you because the random function in the AP-16+ does not allow the last file to be played again, hence you will always ping-pong between the two files.  You could duplicate the files so that you're commanding SFX00, SFX01, SFX02, and SFX03 to play.  This will allow the internal randomizer logic to behave as it wants.

You will have to copy the AMBIENT.WAV file to an SFXnn.WAV file if you want to through it in, too, but it seems odd to do that you if you're using looping between files.
Jon McPhalen
EFX-TEK Hollywood Office