Shop OBEX P1 Docs P2 Docs Learn Events
Prop>Midi data out via USB? — Parallax Forums

Prop>Midi data out via USB?

T ChapT Chap Posts: 4,223
edited 2013-09-05 18:07 in Propeller 1
I want to experiment with a drum trigger device for fun, the idea is to connect a number of inputs to a Prop and output midi signals via USB (FT232) to a sequencer. I see a Midi In obj, is there anything here for some Spin Midi out snippets?

Comments

  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-09-04 21:00
    Sending simple MIDI messages is both-hands-tied-behind-your-back easy. Declare a serial object at 31_250 baud. A quick Internet search will help you with the byte sequences you need to transmit.
  • T ChapT Chap Posts: 4,223
    edited 2013-09-05 11:59
    Thanks Jon. With a few minutes of trial and error, I cannot get Logic Pro to recognize the FT232RL. I will try later tonight. Other USB midi keyboards and drum triggers I have just work automatically.
  • AribaAriba Posts: 2,690
    edited 2013-09-05 12:50
    For MIDI over a serial port (also USB-Serial), you will need a special driver. I use an old Roland driver that only supports COM 1..4. I think you will find newer and better ones with a Google search.

    USB MIDI Keyboards and Expanders support a special MIDI/Audio Class of the USB specification, which is recognized by Windows and other OSes automatically.

    Andy
  • T ChapT Chap Posts: 4,223
    edited 2013-09-05 12:57
    Great. thanks!
  • AntoineDoinelAntoineDoinel Posts: 312
    edited 2013-09-05 16:22
    T Chap wrote: »
    I want to experiment with a drum trigger device for fun, the idea is to connect a number of inputs to a Prop and output midi signals via USB (FT232) to a sequencer. I see a Midi In obj, is there anything here for some Spin Midi out snippets?

    You could could also this one:

    http://projectgus.github.io/hairless-midiserial/

    note that unlike the one from Roland, to use it from within your MIDI apps you'll also need to install a MIDI loopback device (like "loopMIDI", "loopbe" or "MIDI Yoke").

  • T ChapT Chap Posts: 4,223
    edited 2013-09-05 17:39
    Thanks Antoine. That is a big help. On OSX, I now can see midi data received on the Hairless Midi terminal, and have it going out to ipMidi, and ipMidi shows up as an option in Logic, yet still no data into Logic showing yet.
  • T ChapT Chap Posts: 4,223
    edited 2013-09-05 18:07
    Update. This is working with the Prop sending midi data via USB to Mac OSX 10.8.4 into the Hairless Midi to Serial, routing that to the ipMIDI. In Utilities on the Mac, you must open Audio/Midi and find ipMidi, double click it and turn on Loopback. Now I can play notes on Logic. Tomorrow I will connect some buttons and check the latency. This will be a lot of fun.

    CON
      _clkmode               = xtal1 + pll16x
      _xinfreq               = 5_000_000
    
    VAR
    
    OBJ
        ser          :"FullDuplexSerial4Port"
    
    PUB INIT
         StartSerial    'initial baud and port set up
         TestMidi
    
    PUB StartSerial        'PUB AddPort(port,rxpin,txpin,ctspin,rtspin,rtsthreshold,mode,baudrate)
         Ser.init
         Ser.AddPort(0,31, 30,-1,-1,0,0, 115200)            ' baud must match Hairless serial midi setting, default is 115200
         Ser.Start
    
    PUB TestMidi
         repeat
           ser.tx(0, %1001_0000)     '   note on_Channel
           ser.tx(0, %0_001_1111)     '   note number
           ser.tx(0, %0_111_1111)     '   velocity
           waitcnt(80_000_000 + cnt)
           ser.tx(0, %1000_0000)     '   note off_Channel
           ser.tx(0, %0_001_1111)     '   note number
           ser.tx(0, %0_111_1111)     '   velocity
           waitcnt(80_000_000 + cnt)
    
    
Sign In or Register to comment.