November 26, 2024, 09:39:42 AM

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.


AP8 playing more than one file

Started by livinlowe, October 16, 2007, 04:19:46 PM

Previous topic - Next topic

livinlowe

October 16, 2007, 04:19:46 PM Last Edit: October 16, 2007, 04:21:46 PM by livinlowe
Jon-
I am working on getting my AP8 up and running, and I'm using your program supplied by you in this thread:

http://www.efx-tek.com/php/smf/index.php?topic=334.0

Anyway, before, I told you I was having problems with sounds getting cut off. I figured it was my butterfingers when hitting the record button. So, today, I am rerecording my sounds. I got my sound into slot 0, and played it. Sounds good! Got my sound into slot 1, it sounds good as well. So I hook up my prop-1(after setting my switches all open), and power it up. Sound 1 plays, but it is cut off. I am SURE the sound is under 6.4 seconds (max of 5.5). So then sound 2 plays, it sounds right. So I unhooked my prop-1, cycled power on the ap8, and set the switches so the board plays slot 0. I pressed the play button and it plays slot 0(still cuttoff), AND slot 1. I am not sure what's going on. Any  ???

Thanks
Shawn

PS I have a rev D board.
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

I'm not sure what's going on, either.  I'm beginning to suspect the board.  We just got a new batch of AP-8s so we could exchange it for you.  Send an e-mail to us a the teamefx account and we'll set up an RMA.
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Thanks Jon! I've sent you guys an email.
Shawn
Scaring someone with a prop you built -- priceless!

livinlowe

Jon-
Got the new board today (you guys DON'T mess around  ;D ) and reinstalled the sounds. Everything is working PERFECTLY!!!!  8)

You guys ROCK! Thanks for your help (probably need more, cause I'm like the rest of the mortals you save daily!)

Shawn
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Glad it worked out, Shawn -- please return the duff board (with a note) ASAP.  Don't forget to tell all your friends how cool we are!  ;D
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Jon-
As I hopefully will become better at writing my own code, I have been reviewing the program you wrote for me. I cannot see how status from the ap8 and playing interact, meaning how does the prop1 know playing is checking the bit 7 of status? Could you clue me in?

Thanks   :)
Shawn
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

This is the code that does the trick:

Let_AP8_Finish:
  SEROUT Sio, Baud, ("!AP8", %00, "G")          ' get status
  SERIN  Sio, Baud, status
  IF playing = Yes THEN Let_AP8_Finish
  RETURN


The Prop-1 is "asking" the AP-8 for its status via the G (Get Status) command.  The return is a byte, and bit 7 of that byte tells us if the AP-8 is playing (Bit7 = 1) or not (Bit7 = 0).  In the program, there is a variable called status (B0), and playing is a bit-variable (BIT7).  This is the reason I tend to reserve B0 and B1 in my programs: these are the only variables that allow direct bit access.  My point is that BIT7 is part of B0, so when I put a new AP-8 status byte into B0, BIT7 holds the playing status.
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Oh, so if your were to change :

SYMBOL  status          = B0

to

SYMBOL  status          = B8

the line

SYMBOL  playing         = BIT7

only references the b0 byte so it wouldn't work. Oh, I'll read up more on variables in the help file.

Thanks again
Shawn
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

That's right.  One of the things I've been doing in my listings lately is using indentations in the variables declarations to make it more obvious when one variable is actually a component of another; like this:

SYMBOL  status          = B0
SYMBOL   playing        =  BIT7
Jon McPhalen
EFX-TEK Hollywood Office