Shop OBEX P1 Docs P2 Docs Learn Events
Play music through the stamp? — Parallax Forums

Play music through the stamp?

NerdicusMaximusNerdicusMaximus Posts: 11
edited 2007-11-09 20:29 in Learn with BlocklyProp
I want to use a stamp to control which music track I play through a speaker.

This is a Halloween thing, so it would probably generate a random number and play that track number when a certain pin goes high.

Does anyone know of a way to do this?

B

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-30 21:00
    How did you intend to actually play a music track? A Stamp can generate tones and there are some demo programs that play tunes very simply using a piezo-speaker connected to a Stamp pin (see the Stamp Manual for this), but this is probably not what you mean. There are some MP3 players that can be controlled from a Stamp (like Vinculum's VMusic2 and Rogue Robotics' uMP3). There's a sort of MP3 player from Quadravox too. All of these would have to be ordered. Theoretically, you could get a Stamp to generate IR Remote Control codes for a CD player. It depends on the brand and model. Look at the "IR Remote for the BoeBot" tutorial from Parallax's Stamps in Class webpage for ideas there.
  • NerdicusMaximusNerdicusMaximus Posts: 11
    edited 2007-10-31 00:51
    Thanks Mike, I will just break down and buy the uMP3...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-31 03:34
    I would suggest the VMusic2 over the uMP3. A year or so ago, I built an MP3 player using the uMP3 to repeatedly play a list of short tracks. It worked ok for a few hours, but would miscommunicate with the Stamp and the program would hang up. There was a subtle bug in the firmware and I don't know if it ever got fixed. I've just redesigned and rebuilt the same controller using a Propeller and the VMusic2 and I thought the VMusic2 was easier to use. Just my opinion ...
  • NerdicusMaximusNerdicusMaximus Posts: 11
    edited 2007-11-09 19:17
    I have the same issue. I have a Vmusic2 and a stamp BS2px with the development board on my desk. I am following the suggested program seen on this forum, but it won't play anything.

    ' {$STAMP BS2px}

    'RXd=pin 0

    t VAR Nib

    DEBUG "Please Wait"
    '*******************[noparse][[/noparse]INITIALISE]******************
    SEROUT 0,,[noparse][[/noparse]"ipa",CR]
    PAUSE 2000
    SEROUT 0,84,[noparse][[/noparse]"scs",CR]
    PAUSE 2000

    t=1
    DEBUG CLS,"playing ",DEC t
    SEROUT 0,84,[noparse][[/noparse]$1D,$20,DEC t,".mp3",$0D]
    PAUSE 5000
    SEROUT 0,16468,[noparse][[/noparse]$20,CR]
    PAUSE 2000
    DEBUG "end"

    my track is on a thumbdrive... called 1.mp3

    It should play, right?

    B
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-09 20:29
    First of all, the Baud constants are those for the BS2, not the BS2px. The supplement for the BS2px has all the constants needed. I couldn't find the supplement on the new website, so I've attached it. Make sure that CTS# is grounded through a resistor (like 4.7K or 10K) or the VMusic2 may not transmit back to the Stamp.
Sign In or Register to comment.