sfplay and basic stamp serial input


    Feb 14 2006 | 4:00 pm
    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:
    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

    • Feb 14 2006 | 4:52 pm
      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
    • Feb 14 2006 | 4:53 pm
      try adding a [change] between the unpack and the [sel]
      or, if you're more ambitious, add a function like that to your stamp ;)
    • Feb 14 2006 | 5:27 pm
      scott!
      i must say, using [change] definitely did the trick!
      i'm very gracious to your curteous and helpful response!
      thanks again!!
      -p