Shop OBEX P1 Docs P2 Docs Learn Events
Midi in -- relay, solenoid out? — Parallax Forums

Midi in -- relay, solenoid out?

bayoubillbayoubill Posts: 3
edited 2004-10-29 21:39 in BASIC Stamp
Does someone know of a source of Basic Stamp code that is designed to listen to an input stream of Midi commands and then control up to 24 relays, solenoids or other devices?

Many thanks in advance.

Bill
On a bayou in Mississippi

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-28 18:07
    That could be done, but you'd have to be careful how fast the MIDI packets are arriving. You could take in one three-byte packet, process it, then go back for more.

    Jon
    On the plains of North Texas

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • bayoubillbayoubill Posts: 3
    edited 2004-10-28 21:45
    Thanks, Jon.

    I might be able to write something myself but I sure would like to find someone who "had shot this bear" before! ;-)· The baud rate is 30k+ (a little; 31.2K?) so should be within the range of a Stamp module.

    Writing the code to decode the midi string (See: http://improv.sapp.org/doc/misc/MidiFileFormat.html) will be the hardest part and I was hoping to tie into someone that might have already done this.

    Hear is hoping!

    Take care

    Bill (on a bayou in Mississippi)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-28 22:07
    I've done MIDI transmission, but haven't dealt with receiving MID codes because I didn't have a need (though your app is interesting).· The baud rate is no problem at all; take a look at these N&V articles for some ideas to get you started.

    http://www.parallax.com/dl/docs/cols/nv/vol4/col/nv94.pdf
    http://www.parallax.com/dl/docs/cols/nv/vol4/col/nv95.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • bayoubillbayoubill Posts: 3
    edited 2004-10-29 00:32
    Thanks for the links!·

    Here is the reason that I see this as an interesting project.· If you can accept a Midi stream and convert that to relay or solenoid activation then you can control chimes (my application), gongs or pluck strings.· All in sync with another sound maker or instrument.· The possibilities are quite far reaching.·

    Take care
    Bill
    On a Bayou in Mississippi
    ·
  • Harry StonerHarry Stoner Posts: 54
    edited 2004-10-29 18:33
    Jon said: "The baud rate is no problem at all"

    Jon, although I've seen this discussed in various threads before, I still don't have a good feel for the max. baud rate a BS2 can work at. In my case I am interested in the max baud rate from BS2 to BS2, using the flow control pins? I haven't pushed the envelope myself, only trying up to 9600. Can I expect 19.2K or 38.4K to work reliably (over short distances, e.g. 1 foot or less)?

    bayoubill's project is like an updated version of an early 20th century music machine (Mills Violano for example).

    Thanks.

    Harry
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-29 20:18
    Our specs (manual, help file) say that the BS2 will work reliably with flow control up to 19.2 kBaud. I don't use flow control much, but have a few times and do remember going that high.

    Without flow control or formatters, the BS2 can handle nearly 50 kBaud, and dealing with 31.25 kBaud MIDI is no trouble (transmitting that is, decoding MIDI on the fly is really difficult).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Harry StonerHarry Stoner Posts: 54
    edited 2004-10-29 21:39
    Thanks Jon. I will keep this in mind for the future.

    Harry
Sign In or Register to comment.