This application allows reading and writing files from a Vinculum 
VMusic2 device attached to the MIDIBox.

More information on the vinculum device can be found at
http://www.vinculum.com/prd_vmusic1.html

This device adds the following capabilities to your MBox project:
Basic file system access (Read/Write) to USB Flash drives.
Plays MP3 files from your flash drive.
Plays Type 0 MIDI files from your flash drive.

The VMusic interface is text. It is controlled by a command
line, very much like a DOS shell. To make the setup as flexible
as possible, I wrote this driver to exchange text command lines
by System exclusive messages. The SysEx wrapper is as simple as
I could make it. To send a "dir" command to the VMusic2 device,
send the following SysEx to the MIDIBox:
0xF0 0x00 0x00 0x7E 0x4D 0x64 0x69 0x72 0xF7
The first 5 bytes are the SyxEx header for MBStor, then the three
letters 'd', 'i', 'r', and finally the 0xF7 to mark the end of
the message. The VMusic driver will respond with a series of
SysEx messages formed the same way, describing the contents of the
current directory of the connected flash drive. Of course there
are many commands you can use, see the VMusic2 documents for 
more information.

I have been using this as a MP3 player in my office for a few 
months now, and have even written a script to read the ID3 tags from
the files on the flash drive.

The passing text by sysex messages works fine, since normal text 
never uses bit seven. This interface will NOT pass binary file data
properly. the drivers that read and write from the VMusic device
will work fine though, it's only passing binary data through SysEx 
that would pose a bit of a problem.

A word about this project: I added this feature on to my MBMixer, 
and have never run it alone. if you read over the source, you may 
find some features or variables from the mixer project. No big deal.
If you decide to build a MBMixer/MBStor combo, ask me for the 
combined source.

All the system side tools that I wrote for this, like the command
line window that works through SysEx, are specific to OS4. I will
gladly provide them to anyone who wants to see them, but someone will
need to port them to OSX, Linux and Windows for others to use them
as I have.

I have posted this as a toy. It works fine, but there's a few 
reasons why it's not a full project:
1> VMusic2 is a commercial device, MIDIBox is a DIY community.
2> This code is working well, but I have not used it for every 
possible application, and I'm not going to bother. If you want to
take it somewhere new, great! It's a good starting point.

What comes next? Anyone needing a bigger bankstick could adapt 
their code to this device rather quickly. Programmers wanting to
dig deeper should probably write a CON: to SysEx program as I did.
The VMusic2 can already play MIDI files on it's internal audio
system. It should be reasonable to write a Type 0 MIDI file player
that could play to the MIDIBox MIDI Out. Once that is working
a good challenge might be a MIDI file recorder. As long as you stay
with type 0, it should be possible.

SXInput is a separate file that can recognize a given SysEx header
and manage all that stuff for you. It needs to be called from
USER_MPROC_NotifyReceivedByte with every byte.

Everything in this distribution is in ASM. So far, that's all 
I've done with my MIDIBox. If someone wants to write it again in 
C, have fun! 

/***********************************************************/
How to patch this to replace a bankstick:
I have not yet used a bankstick, but based on the documentation,
you will need to add a few lines of code to your program.

To access files on the VMusic, you must first CD to the correct
directory, then open the file for reading or writing. To keep this 
simple, we will assume you will be using a file in the root of the
flash drive (not in a directory). Aftr plugging in the drive, 
send the commands ICS and EPA to set Extended Command Set and 
ASCII Integer Values. Now on to opening the file. To open a file
for reading, send "OPR fname" where fname is the name of the 
file you want to read. You may then read with the RFD command.
When done, close the file with the CLF command. Right now, everything
that comes back from the VMusic is passed back the the user in a 
SysEx message, but you can replace the call to xreply at the end
of MBStor.inc with your own programming.
/***********************************************************/

You can read about all the commands the VMusic recognizes at 
http://www.vinculum.com/documents/fwspecs/UM_VinculumFirmware_V205.pdf

Any users that want help adapting this code to their project are 
welcome to ask me, either by a PM or by finding me in chat.

I'll also provide the source to any OS4 specific tools I have
written if anyone is interested. I even have a type 0 MIDI file
player written in plain C that should port over fairly easily. 
:-)

Have Fun,
LyleHaze