March 29, 2024, 03:05:19 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.


VMUSIC Demo Program for Prop-1 -- Use This First!

Started by JonnyMac, May 28, 2009, 11:17:25 AM

Previous topic - Next topic

JonnyMac

May 28, 2009, 11:17:25 AM Last Edit: August 24, 2009, 01:42:36 PM by JonnyMac
As the VMUSIC has shown itself to be mostly... well, junk! -- I suggest that you start with this program to get it going; once the VMUSIC part is working then you can add in triggering and control features.

IMPORTANT: You must change the file names at the end of the listing to match what you have on your media!  Also, the file name must be no longer than eight characters.  You don't need to add ".mp3" in the names list as the code does that for you.

Pay very close attention to the connections: P7 (RX on the Prop-1) connects to the TX pin of the VMUSIC (think ear [RX] to mouth [TX]), and P6 (TX on the Prop-1) connects to the RX pin of the VMUSIC (think mouth [TX] to ear [RX]).  The pins of the ULN that correspond to P7 and P6 must be removed.  The P6 and P7 SETUP jumpers must be in the UP position.

I'm really sorry I ever recommended the VMUSIC because it has turned out to be a big mess for so many of our loyal customers -- okay, two customers, but that's two too many for us!

Updated and re-tested: 28 MAY 2009 (this code works if connected correctly to Prop-1)

' =========================================================================
'
'   File...... VMusic.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK (www.efx-tek.com)
'   E-mail.... jwilliams@efx-tek.com
'              Copyright (c) 2008-2009 EFX-TEK
'              Some Rights Reserved
'              see: http://creativecommons.org/licenses/by/3.0/us/
'   Started...
'   Updated... 28 MAY 2009
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Demo for VMUSIC2 player
' -- P7 and P6 SETUP jumpers need to be in the UP position
' -- clip pins 1, 2 and 3 from ULN2803, or pins 1 and 2 from the ULN2003
' -- use P5 for Sio (no ULN) to EFX-TEK accessories
' -- use P4 for (active-high) trigger -- leave ULN intact for pull-down


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  RX              = 7                     ' SETUP = UP, no ULN
SYMBOL  TX              = 6                     ' SETUP = UP, no ULN
SYMBOL  Sio             = 5                     ' no ULN
SYMBOL  Trigger         = PIN4


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  VolMax          = 0
SYMBOL  VolMin          = $FE

SYMBOL  Baud            = OT2400


' -----[ Variables ]-------------------------------------------------------

SYMBOL  theMP3          = B2                    ' MP3 file pointer
SYMBOL  eePntr          = B3                    ' EEPROM memory pointer
SYMBOL  char            = B4                    ' character value
SYMBOL  mute            = B5                    ' mute level (0 = loudest)
SYMBOL  idx             = B6                    ' loop controller


' -----[ Initialization ]--------------------------------------------------

Reset:
 PAUSE 2250                                    ' let VMUSIC power up
 GOSUB VM_Stop                                 ' stop if playing
 GOSUB VM_Wait_Prompt


' -----[ Program Code ]----------------------------------------------------

Main:
 DEBUG CLS, "Playing FIREFLY.MP3", CR
 theMP3 = 0
 GOSUB VM_Play
 GOSUB VM_Wait_Start
 DEBUG "-- file started", CR

 PAUSE 5000
 mute = 25
 GOSUB VM_Mute
 GOSUB VM_Wait_Prompt
 DEBUG "-- volume level reduced", CR

 GOSUB VM_Wait_Prompt
 DEBUG "-- ready for new song", CR

 mute = VolMax                                 ' restore full volume
 GOSUB VM_Mute
 GOSUB VM_Wait_Prompt
 DEBUG "-- volume reset to max", CR, CR

 DEBUG "Playing SERENITY.MP3", CR
 theMP3 = 1
 GOSUB VM_Play
 GOSUB VM_Wait_Start
 DEBUG "-- file started", CR, CR

 GOSUB VM_Wait_Prompt
 DEBUG "VMUSIC demo done", CR, CR

 PAUSE 5000
 GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

VM_Wait_Prompt:
 SERIN RX, Baud, (">")
 RETURN

' -------------------------------------------------------------------------

' Pass file # (index in EEPROM table) to play in "theMP3"

VM_Play:
 SEROUT TX, Baud, ("VPF ")
 GOTO Play_MP3

' -------------------------------------------------------------------------

' Pass file # (index in EEPROM table) to play in "theMP3"

VM_Repeat:
SEROUT TX, Baud, ("VRF ")

' -------------------------------------------------------------------------

Play_MP3:
 eePntr = theMP3 * 8                           ' calc address of name

Send_Name:                                      ' send file title
 FOR idx = 1 TO 8                              ' max is 8 characters
   READ eePntr, char                           ' get a character
   IF char = 0 THEN Finish_Cmd                 ' if 0, we're at end
   SEROUT TX, Baud, (char)
   eePntr = eePntr + 1
 NEXT

Finish_Cmd:
 SEROUT TX, Baud, (".MP3", 13)                 ' send extention + CR
 RETURN

' -------------------------------------------------------------------------

VM_Wait_Start :
 SERIN RX, Baud, ("T $")
 RETURN

' -------------------------------------------------------------------------

VM_Stop:
 SEROUT TX, Baud, ("VST", 13)
 RETURN

' -------------------------------------------------------------------------

' Pass mute (0 = loudest, 254 = muted) in "mute"

VM_Mute:
 mute = mute MAX VolMin                        ' limit per spec
 SEROUT TX, Baud, ("VSV ", #mute, 13)
 RETURN


' -----[ User Data ]-------------------------------------------------------

' File names are stored on 8-byte boundaries -- this is very important for
' correct program operation.  This strategy uses a little more EE space but
' is easier to update and maintain

Song_List:
 EEPROM $00, ("firefly")                       ' theMP3 = 0
 EEPROM $08, ("serenity")                      ' theMP3 = 1
 EEPROM $10, ("spalding")
 EEPROM $18, ("file3")
 EEPROM $20, ("file4")
 EEPROM $28, ("file5")
 EEPROM $30, ("file6")
 EEPROM $38, ("file7")
Jon McPhalen
EFX-TEK Hollywood Office

HauntedWolf

Jon,

I hate to break this to you, but there will be a bunch of us in Utah hooking the Prop-1 to a VM2 for the Zombie prop we are building...in fact I just got the VM2 shipment yesterday...am I going to wish we hadn't?

I'm glad you guys will be there to get it to work.   ;)

Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

JonnyMac

Let me just be blunt -- the VMUSIC player blows and their corporate tech support stinks out loud (ask me how I know).  They even had the nerve, after their horrible support, to call us up and ask if we wanted to do a bulk purchase.  Yeah... right.

I will bring my VMUSIC player with me to prove that it *can* work.
Jon McPhalen
EFX-TEK Hollywood Office

HauntedWolf

Thanks Jon!  Looking at Scary Terry's web page it looked like it would be a walk in the park.

We have another member that has successfully used the VM2.  Once you get it working have you had many issues or is it just the initial pain?
Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

JonnyMac

My problem has been moving it between 2400 and 38400 baud -- after the pain it was to get it back to 2400 (luckily, S/T sussed out the details of "reflashing" with a PC) I have just left it there.  Other than that, I have had no troubles (for basic operation, that is) myself.  I've talked to the engineers about what I think are missing features in the interface and they were wholly uninterested.
Jon McPhalen
EFX-TEK Hollywood Office

kenqu

I just have to say that JohnnyMac Rules, is the bomb, (add your personal exultation)!!!!  I very carefully followed the instructions in this post and the instructions on the firmware upgrade from Scary Terry.  In less than an hour I was hearing the sweet dulcet towns of the Eagles singing Hotel California.  If you follow what JohnnyMac tells you and you utilize his program this will work exceptionally well.  Now the fun part starts, I will be using JohnnyMac's program as a template to build a "here come da judge" prop where I utilize the VM2, relays and a pneumatic solenoid to create a drop platform where victims, I mean customers, are judged the sent to the just reward.