sfplay and basic stamp serial input

Feb 14, 2006 at 4:00pm

sfplay and basic stamp serial input

hi guy/gals

wanted to say hello first, i’m new to the board.

i’m tokenizing the following code into my stamp:

sw0 PIN 0
setup:
SEROUT 16,240,[10,10,0] ‘ turn media off
LOW 15

main:
IF sw0 = 0 THEN GOTO setup
SEROUT 16,240,[10,10,1] ‘ turn media on
HIGH 15
GOTO main

and listening for the ‘on’ state with this patch:

http://www.visualthesis.com/pushbuttonsnd.gif

http://www.visualthesis.com/pushButtonSnd.mxb

the problem i’m having is that whenever ’1′ or ‘on’ is triggered, sfplay will repeatedly play the first couple of milliseconds of the sound and only when ’0′ or ‘off’ is triggered will the rest of the sound finish.

i would like it so that the sound only plays and finishes when 1/on is triggered’ and turned off if 0/off is triggered.

thanks in advance for any help!

-p

#24420
Feb 14, 2006 at 4:52pm

On Feb 14, 2006, at 8:00 AM, Peter wrote:

>
> i would like it so that the sound only plays and finishes when 1/on
> is triggered’ and turned off if 0/off is triggered.

Two recommended solutions, both of which should be mentioned a few
times in the archives:

1. increase sfplay~ disk buffer size

2. set your HD options to not go to sleep

-Joshua

#70564
Feb 14, 2006 at 4:53pm

try adding a [change] between the unpack and the [sel]

or, if you’re more ambitious, add a function like that to your stamp ;)

#70565
Feb 14, 2006 at 5:27pm

scott!

i must say, using [change] definitely did the trick!

i’m very gracious to your curteous and helpful response!

thanks again!!

-p

#70566

You must be logged in to reply to this topic.