Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Teensy 3.1 - USB-MIDI and serial at the same time ?

  1. #1
    Junior Member
    Join Date
    Jan 2015
    Posts
    12

    Teensy 3.1 - USB-MIDI and serial at the same time ?

    Great, I've got the Teensy 3.1 to work with various sensors to send MIDI messages to my DAW software. What I'd like to do is write some PC software so I can transmit non-midi messages back to the Teensy, and set various parameters ( to scale the sensors, for instance ). Is this possible over the same USB link while in USB_MIDI mode ?

    The alternative would be to press a button while the Teensy is being plugged in / powered up, and thus jump into a regular USB serial mode to set the parameters, then force the Teensy to reboot on command.

    Has anyone done this ( plan A ), or do I need to resort to plan B ?

    Thanks.

  2. #2
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    Why not use sysex message to send you configuration messages ?

  3. #3
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,928
    It is possible to have multiple USB devices running at the same time. At the moment there are definitions for the list you see in the device menu, but Paul is trying to make a universal solution

    https://forum.pjrc.com/threads/27559...-wizard-wanted

    For the moment you need to graft the code for two devices together by hand:
    https://forum.pjrc.com/threads/18740...ght=usb_desc.h
    Though having read that thread it looks like the serial code is there regardless for debug purposes so you should be able to declare serial in your code and have it work while using MIDI without any further effort on your behalf.

    GW

  4. #4
    Junior Member
    Join Date
    Jan 2015
    Posts
    12
    Quote Originally Posted by nlecaude View Post
    Why not use sysex message to send you configuration messages ?
    That's a good idea ... I'll investigate further. Thanks

  5. #5
    Junior Member
    Join Date
    Jan 2015
    Posts
    12
    Thanks GremlinWrangler ... interesting links to previous work. I could doubtless get to grips with the methods described there, given time, but this is supposed to be a relatively quick and simple project.

    The data I want to send back to the Teensy would be occasional calibration data, meaning the user wouldn't be using calibration mode very often at all. I'm thinking of something like a Midi breath controller ... you can see one example here. Halfway down the page is a software interface with a graph, allowing the user to modify a response curve. When the user 'saves' the new configuration, it presumably sends back a big chunk of data to the USB device, which is subsequently used in MIDI mode as a look-up table to convert breath pressure to a MIDI volume setting. Not precisely what I'm doing, but that product inspired me to do something similar.

    I think the quickest solution will be to use my 'plan B' and simply "... press a button while the Teensy is being plugged in / powered up ...". Thanks for your suggestions though.

  6. #6
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,111
    Quote Originally Posted by nlecaude View Post
    Why not use sysex message to send you configuration messages ?
    I can think of a couple of reasons why not. Firstly, the effort to construct a sysex message is greater than that required to type into the serial monitor. Secondly, SYSEX is limited to 60 bytes on Teensy 3.x (unless you edit the usb midi code, of course).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •