Jump to content

a midi-in connector for pc... with no components.


jon_oz
 Share

Recommended Posts

hi all,

this may sound stupid to experienced electronics experts, but it's something that i think would benefit many impoverished backyard tinkerers like myself if it were possible...

i'm trying to design a midi input (just an input at this stage) for my pc - without the use of any external microcontrollers, without using a soundcard midi port, just wiring directly to a usb or serial port, probably using an optocoupler.

yes, i know it sounds silly.  and yes, it is re-inventing the wheel - a wheel that costs about US$20 if you look around hard enough.  but! please humor me for a while.

i know standard PC serial ports aren't capable of running at 31250 baud.  but i know they are capable of much higher speeds - particularly USB ports.  if i'm not mistaken, you can use drivers (see the arduino site) that allow a USB port to operate more or less as if it were an oldschool serial port (is anyone able to elaborate on how this works?).

my idea is that you could run a USB as an emulated serial port at a very fast rate (i've read that 1+Mbaud is possible...?), and basically count the number of clock ticks between 'high' inputs.  midi commands always begin with a high input (correct?), so using simple division surely it's possible to figure out the shape of the midi data coming in... even if it is at a non-supported baudrate.  then it's just a matter of routing the data to virtual midi devices.

as you can probably tell, i'm very much a newcomer to serial comms (and electronics in general, really) so i'd really appreciate if someone could help out with a few design ideas and explanations of concepts.  even if it means telling me it's definitely impossible!

jon.

Link to comment
Share on other sites

hmmm... sorry, perhaps i was unclear in my waffling.  the only thing i'm trying to achieve is to get midi signals from my keyboard to my PC, without the use of a PIC or any kind of external processing.  that's it.  i know a commercial interface would probably only cost $20 or so... i'm doing this more out of curiosity, and because i'd use it so infrequently that i don't really want to outlay anything.  call me stubborn...

Link to comment
Share on other sites

It's a bit more complicated than you think.

USB is a serial BUS, not a serial port. That means that there is more going through it than just a stream of data.

The lower levels require "negotiations" between the host (usually your PC) and the device. Your device must recognize and respond to questions from the host. It must identify itself with some combination of manufacturer, name, serial number, device class, device subclass, power requirements, and whether it it taking it's power from the USB port or if it brought it's own.

If you can't get past all of the above, the OS (windows,OSX,OS4, whatever) won't even make the device available for applications like your program.

Assuming you've made it that far, information will then need to be received and organized into packets, formatted according to the USB spec. I can provide a link to that document if you're still interested. :-)

Now, I'm not the kind of guy that likes to squash other peoples dreams, but if you can handle what I've described above with nothing more than an optocoupler, friend, you can go FAR in this business.

We have discussed before on this board that you might use an FTDI USB to Serial chip, hack the baud rate settings to get 31250 (yes, it can do that), and then use the Yamaha ToHost drivers to connect MIDI devices to this "virtual" serial port. All possible, if not tested yet.. But you are still spending as much as you would on a USB MIDI adapter.

Just my two cents, but unless the challenge is the reward, your time would be better spent making music.

Whatever you do, Have Fun,

LyleHaze

"Always have a song in your heart. It's like Karaoke for the voices in your head."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...