Shop OBEX P1 Docs P2 Docs Learn Events
A MIDI object? — Parallax Forums

A MIDI object?

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2006-04-05 00:12 in Propeller 1
I was chatting with someone about their frustration at trying to put MIDI in use on an AVR due to the hardware implimented serial ports.

Since the BasicStamp has always been the MIDI friendliest chip, it would seem like a good thing to carry on into the Propeller.

Hey Jon, Break a leg -- it is showtime!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-04-02 12:09
    George -

    Why did they say that a hardware UART was such a problem? I'd have thought it would have been an advantage rather than a disadvantage, unless it can't be set for some reason to the baud rates used by MIDI (31.5 KBPS as I remember), and I'd highly doubt that was the case.

    Just curious.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-02 14:00
    Well, the AVRs have only two h/w serial ports anyway and a suggestion was made to change the crystal, which would eliminate the RS-232.

    There may be an advanced way to manipulate the serial ports individually, but it appears that the firmware/software vendor suggested to change the crystal in lieu of another fix.

    MIDI users tend to be performing artist, not techno-geeks.

    Often, the MIDI and the RS-232 are both useful together as an adaption. I strongly suspect the Propeller's serial object inherently supports it already, but a mention is worth-while. A few tips and examples would be even better. An object might create a purchasing decision otherwise passed over.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-02 14:56
    Remember this project with the SX: http://forums.parallax.com/showthread.php?p=533525

    This would be a breeze on the Propeller using the FullDuplex UART object -- the other seven cogs could do all kinds of wonderful things: control lights, make sounds, you name it.· Yes, I will be doing a MIDI project with the Propeller sound.· Remember the wall-of-lights the scientists used to communicate with the aliens in "Close Encounters of the Third Kind"? -- I'm going to do something like that to mount about my MIDI keyboard; it should make learning to play it more entertaining.

    BTW: MIDI baud is 31_250.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WurlitzerWurlitzer Posts: 237
    edited 2006-04-04 16:46
    Jon, great news on the MIDI front. I was just about to convert my 1928 Wurlitzer pipe organ over to a few BasicX-24 micros (don't ban me) to handle MIDI but the Propeller would seem to be a no brainer for such an application.

    Only wish the Propeller could be programmed with VB. My assembly suffers from 5 years of non-use.

    Incorporating a light show with the pipe organ was to be phase II but with 8 cogs who needs phase II.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-04 16:51
    Hi Wurlitzer,
    It isn't all Assembly language.
    The Propeller has a Higher level language, called SPIN. It is object oriented.

    Lots of other things that can be done in software, including ADC [noparse][[/noparse]which the BX-24 required an outboard chip for].

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-04 17:18
    As Kramer points out, we can write most of our programs in Spin and let hardcore coders like Chip develop assembly objects for us to use.· Since all assembly objects have a Spin interface, including them into our products is pretty easy.

    I've attached a Spin object called Debug_PC (used to send values to a terminal program) that uses another Spin object called Simple_Numbers (for number to string conversion) -- the only assembly part of the program is called FullDuplex (the UART object that runs in its own cog)·and as you can see, it's interface methods are all written in high-level spin.· I've tested FullDuplex up to 460.8 kBaud, so MIDI will be no problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WurlitzerWurlitzer Posts: 237
    edited 2006-04-04 17:18
    Kramer, in reading some of the many posts, I got the impression that 19,200 was about max for communications using SPIN. I may have misinterpreted this. If this is incorrect then the news is even better.

    I am used to writing a lot of industrial control applications and always looking for high speed at the control end and ease of programming at the operator interface end (VB). Assembly does not put me off it is just VB so much easier for me as it the sharpest tool in my tool belt and I use it daily so there is no rust.

    For the many functions needed in a pipe organ application speed will be important and in fact many MIDI Pipe organ applications have failed because it was too slow due to certain functionality required in a pipe organ. I have created another method to use MIDI yet hide much of the data heavy communication creating in playing the organ. I have solved the MIDI data pipeline bottleneck with some unique software routines while still keeping within the MIDI specs. The Propeller opens up doing multiple tasks for the organ plus lighting.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-04 17:20
    With Spin yes, 19.2K is about the limit -- but the FullDuplex object is written for you, easy to incorporate (see above), and will work at speeds that far exceed the MIDI requirement. It also buffers data in and out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WurlitzerWurlitzer Posts: 237
    edited 2006-04-04 17:20
    Jon you wrote: "I've tested FullDuplex up to 460.8 kBaud, so MIDI will be no problem." well that takes care of my serial comm concerns big time. You can ignore my last post.

    Thanks,
  • pjvpjv Posts: 1,903
    edited 2006-04-05 00:04
    Hi All;

    I'm still working things out, but in assembler I expect to be able to run at about 10 Megabits per second, and 20 Megabits per second under special circumstances.

    What I'm attempting is direct Ethernet communications straight from the propeller, and I think we have a good shot at it.

    Once that is nailed (it's kinda trickey), then perhaps somone else can show us how to wrap that up so it can be accessed from Spin. I am not a high level programmer, so all my stuff is in assembler, and I expect to need help with that soon.

    Any volunteers?

    Hmmmm, perhaps this info should be posted elsewhere.....

    Cheers,

    Peter (pjv)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-05 00:12
    I should point out that the FullDuplex object does both buffered RX and TX -- if we split those two things apart (separate cogs) I'm sure the would run much faster, and I think PJV's experiments bear this out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.