Newb looking to make a MIDI controller.

siike92siike92 Posts: 2
edited 2011-10-15 - 13:01:12 in Propeller 1
So, I'm rather new to this whole microcontroller thing but I've been researching for about 2 months. I'm a musician and I'm looking to turn an old supernintendo controller into a midi controller. I was originally looking at the basicstamp, but after scouring the forums I came across a couple threads that lead me to believe that propeller may be a better option.

The goal of the project is to send MIDI data out by pressing the buttons of the Supernintendo controller. I'd like the MIDI data to be sent through usb(so I'll probably using the Propstick USB?). I also want all the boards,controllers, and other electronics to be inside the Supernintendo controller.

So here are my questions,...

1. Is my idea feasible with propeller?

2. Is the project too far out of a relative beginners range?

3. I plan on using this kit, http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/506/List/1/Default.aspx?SortField=UnitCost,ProductName. Would that be all I need?

4. What about power? Would I need some type of powering unit or can I power it using the usb cable?


Thanks in advance!

Comments

  • siike92siike92 Posts: 2
    edited 2011-01-02 - 20:51:06
    Another question I forgot to ask, can I use PBASIC or do I have to use SPIN?
  • StefanL38StefanL38 Posts: 2,287
    edited 2011-01-03 - 00:54:43
    HI siike92,

    welcome to the propeller-forum !

    Your first two postings are really good! I want to explain about that:

    - you give an overview about your project

    - you give somehow detailed informaion about your skill-level in electronics and programming

    - you are asking questions like they come into your mind

    This all is VERY good

    Now to answer your questions:
    the propeller can do that

    If it is out of the range of a beginner depends on the complexity what you want to do.

    ALL propeller-kits are connected via USB to a PC. Really ALL of them. Why this? because nowadays PCs have no more serial COM-Ports.

    All Propellerboards work through a chip that converts from USB to a serial COM-Port. Some of the kits have this chip mounted on the board
    (like the propstick USB or the PPDB) some of them have an extra adapter. All these USB-devices create a virtual-COM-Port on the PC
    So in the end you have LOGICALLY a V.24 serial connection where the data goes PHYSICALLY through an USB-port.

    As you are a real beginner I would recommend using the Propeller Education Kit - 40 pin DIP Version
    With the Propeller Education Kit - 40 pin DIP Version If you damage the prop-chip you can replace it for $8.
    On the propstick USB you have to send it to parallax trying to repair it or buy a new one for $100

    The prop-chip is pretty robust but there are limits voltage and current should stay inside to avoid damages.

    I guess you want to use the propeller to create the MIDI-signals and send them to a PC (or some other MIDI-device?)
    You can interface the propeller almost DIRECTLY to a MIDI-input.
    This is much much easier than trying to make the prop-chip acting as a USB-device himself.

    Another input-path might be to have an extra interface MIDI-2-USB but here the prop-chip still creates MIDI-signals for a standard MIDI-input

    Feel free to aks as many questions as you like.

    best regards

    Stefan
    [x] <== SLAM in nail here to hook up the new screen! :lol:
  • garylakegarylake Posts: 41
    edited 2011-01-03 - 09:11:47
    I have already done something like this so I might be able to help out some. I programmed the Propeller to send midi data (note, velocity, channel) to a synth when I pressed buttons on the breadboard. It worked great.

    My intentions are to send the data to ProTools.

    So, what is it you want to send to and what data do you want send?

    Gary
  • BotdocterBotdocter Posts: 271
    edited 2011-10-14 - 15:47:30
    Since there is no reply from the original poster:

    I am looking to convert a number from 1 to 120, to, a midi signal containing notes that compare to the number. So the higher the number the higher the note.

    In the end i just want to say: if the number is 48 play note "F#" (for example)

    I don't need a very wide range. 17 to 20 notes is fine
    I seriously hope you can help!
  • AntoineDoinelAntoineDoinel Posts: 307
    edited 2011-10-14 - 16:45:22
    Botdocter wrote: »
    Since there is no reply from the original poster:

    I am looking to convert a number from 1 to 120, to, a midi signal containing notes that compare to the number. So the higher the number the higher the note.

    In the end i just want to say: if the number is 48 play note "F#" (for example)

    I don't need a very wide range. 17 to 20 notes is fine
    I seriously hope you can help!


    Hi Botdocter

    It should be as simple as opening serial object and sending out some values.

    Try this:
    CON
      MIDI_OUT_PIN  = 0             'MIDI out pin
      MIDI_IN_PIN   = 1
    
      OPEN_DRAIN    = true          'if using the standard MIDI output circuitry TX must be open drain
      INVERT_TX     = false         'change if required
    
      BASE_OCT      = 0             'can go down to -2 or up
    
    OBJ
      ser : "FullDuplexSerial"
    
    VAR
      long onems
    
    PUB main | n, mode
      mode := 0
      if INVERT_TX
        mode |= 2
      if OPEN_DRAIN
        mode |= 4
      ser.start(MIDI_IN_PIN, MIDI_OUT_PIN, 31250, mode)
      waitcnt(cnt + clkfreq * 3)
      onems := clkfreq / 1000
      repeat
        repeat n from 0 to 60
          send_note(n, 500)
        waitcnt(cnt + clkfreq * 10)
    
    PRI send_note(pitch, duration)
      'send NoteOn message
      ser.tx($90)
      ser.tx((BASE_OCT + 2) * 12 + pitch)
      ser.tx($40)
      'wait for a while
      waitcnt(cnt + duration * onems)
      'send NoteOff message
      ser.tx($80)
      ser.tx((BASE_OCT + 2) * 12 + pitch)
      ser.tx($40)
    

    If you cannot get it to work you can try inverting the output.

    It's assumed that you're using two 220 ohm resistor following the circuit indicated in the MIDI specifications.

    Alessandro
  • BotdocterBotdocter Posts: 271
    edited 2011-10-15 - 11:38:16
    Thank you! that seems like the whole deal.

    About the wiring setup for the midicable; where can i find this info? i have looked but have not found any wiring setup for propeller.
  • AntoineDoinelAntoineDoinel Posts: 307
    edited 2011-10-15 - 13:01:12
    Botdocter wrote: »
    About the wiring setup for the midicable; where can i find this info? i have looked but have not found any wiring setup for propeller.

    Refer to the lower section of the circuit:

    MidiSchematic.gif
    midi-schem.jpg


    the inverter marked with "A" should be an open-collector (or open-drain) type.
    You can omit the first inverter, and compensate by the inversion flag in the software.
    You can omit both, as long as the MCU you're using has open-drain mode (as in our case).

    So in the end you only need two 220 ohm resistors, one from +5V to pin 4 of the DIN connector, and one between the prop tx pin and pin 5.
    Pin 2 of the connector goes to ground (only on TX side, note that is disconnected on the MIDI in side to avoid ground loops).

    If you're driving very long cables, or if you want to keep the Propeller fully safe against output shorts, you'd better use an NPN BJT (or better a 74HC07 gate) to buffer the signal.
    For BJT connection, look at the second diagram (again the inverter gate can be omitted and compensated in software).

    P.S. the schematic by Ariba that Bob linked is even simpler, and is perfectly fine with 3.3V supply only, as long as you double check the wiring.
    524 x 528 - 8K
    475 x 411 - 21K
Sign In or Register to comment.