Shop OBEX P1 Docs P2 Docs Learn Events
Scribbler 2 (S2) sound syncing methods? — Parallax Forums

Scribbler 2 (S2) sound syncing methods?

hyperritualhyperritual Posts: 11
edited 2012-12-06 19:58 in Robotics
Greetings,

Does anyone here have examples of coordinating/synchronizing sound and movement with the S2's play_sync(), play_pause(), get_sync(), and wait_sync() methods? I have been fiddling around with them for a while but have not sussed out anything useful. I reviewed Jessica's Hokey Pokey worksheet, which uses wait_sync(0), but I need more precise movement control than what is allowed by MotorSet() (at least, without a crazy amount of calibration). More specifically, I would like to do something like this:

go_forward()
while going forward, play tone A
pause sound
turn_deg()
go_forward()
while going forward, play tone B

Alternatively, using drawing methods instead of motion methods:

begin_path
move_to()
while moving, play tone A
pause sound
move_to()
while moving, play tone B
pause sound
end_path

I suspect that some combination of the sound sync methods would make this possible, but I have not yet discovered one that does. Any assistance would be much appreciated. Thank you.

Sincerely,
Joshua

Comments

  • hyperritualhyperritual Posts: 11
    edited 2012-12-06 12:55
    Just adding a note to say I have had some success in using the wait_stop method to accomplish what I described above, e.g.:

    go_forward()
    PlayNote()
    turn_deg()
    wait_stop 'waits for turn to complete
    go_forward()
    PlayNote()

    Looks like wait_sync() is intended to do something similar but stop processing or addding to the motion queue until the sync value is encountered in the sound queue (or the last tone up to that point has finished playing, if wait_sync(0)). I would still like to see implemented examples of the audio sync methods if anyone can share them.

    Joshua
  • TtailspinTtailspin Posts: 1,326
    edited 2012-12-06 19:58
    Hey hyperritual, Welcome to the forums...

    The S2's sure are noisy little things, With all the beeping, squeaking and squawking...
    But they are also very easy to figure out too, as you may have already noticed. :smile:


    -Tommy
Sign In or Register to comment.