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

Thread: midi transport messages with Teensy LC

  1. #1
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8

    midi transport messages with Teensy LC

    Hello,

    I'm new in the microcontroller world.
    I would like to build a midi foot controller to START/STOP my DAW while I'm playing guitar.
    Actually, I sennd a CC message and I use a vst to translate this message in a transport message, through a midi learn process.

    It works, but I'm not satisfied with it. I really would like to use a realtime message. I thought I could use this one... usbMIDI.sendRealTime(usbMIDI.Start);
    But apparently I do not use it properly since my DAW (actually REAPER, but I also want to use it in Cubase Elements 10) does not react.

    Any help would be welcome.

    Merry Christmas and Happy New Year !

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,250
    Is Reaper supposed to react to that message? Do you have any other gear sending the message? I mean, the problem could be something on the Teensy side... but if your DAW doesn't respond the way you want to that message, no amount of work on the Teensy side is going to change that reality!

  3. #3
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8
    Hello Paul ,
    I'm pretty sure that both Reaper and Cubase can receive that message since my master keyboard (nektar gx61) can send this message with succes. The fact is that nektar generated different files for each DAW to have a perfect integration. So, I don't know which kind of message I must send, and how.
    I've been able to use faders and buttons with teensy lc, but apparently, start/stop messages are differents... so that's why I thought that may not use the comand inthe good way.
    Anyway, thanks for your help !

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,250
    Any chance you can run something like MIDI-OX that shows the actual MIDI messages your PC is receiving?

    Maybe there's something wrong with Teensy's code for those messages? Or maybe there's something special about the messages themselves. A utility that captures the actual messages would really help shine some light on this.

    Please remember I'm not a musician or DJ, so I don't really use MIDI. If there's something wrong in the code, I can probably fix it... but I'm going to need your help on a clear test case. And if the code is fine but there's something special needed on the messages, hopefully viewing the actual data will make that difference clear.

  5. #5
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8
    Thanks for your help PAul.
    I use Midi-ox to check my messages.
    I first start to send CC messages (ex : CC 07, value 115 on channel 02) and midi-ox see it and REAPER receive it without any problem.
    When trying to send the START message, Midi-ox doesn't display anithing but I can see that REAPER receive something... but what ? That's the problem.
    here is my code :

    // include the Bounce library for 'de-bouncing' switches -- removing electrical chatter as contacts settle
    #include <Bounce.h>
    //usbMIDI.h library is added automatically when code is compiled as a MIDI device


    const int channel = 1;

    Bounce button1 = Bounce(1, 5); // 5 = 5 ms debounce time
    // which is appropriate for good
    // quality mechanical pushbuttons

    void setup() {
    pinMode(1, INPUT_PULLUP);
    }

    void loop() {
    button1.update();

    // Note On messages when button is pressed
    if (button1.fallingEdge()) {
    usbMIDI.sendRealTime(usbMIDI.Start); // Send start message to DAW
    }

    // Note Off messages when each button is released
    if (button1.risingEdge()) {
    }

    // MIDI Controllers should discard incoming MIDI messages.
    while (usbMIDI.read()) {
    }
    }

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,045
    Cubase may not default to midi realtime messages for transport control. Try their forums.

    https://www.steinberg.net/forums/viewtopic.php?t=21285

  7. #7
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8
    Ok. So apparently, I just have to send different midi messages then go through a remote control definition with a midi learn process. Why not.....
    That's not really satisfying to me but if it works, that's the most important....
    Thanks!
    Happy New Year !

  8. #8
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,045
    Quote Originally Posted by LeBeginner View Post
    Ok. So apparently, I just have to send different midi messages then go through a remote control definition with a midi learn process. Why not.....
    That's not really satisfying to me but if it works, that's the most important....
    Thanks!
    Happy New Year !
    I don't own Cubase and didn't read all of the pages on remote control.

    Not clear what you're saying in this post.... what isn't satisfying?

  9. #9
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8
    Hello Oddson,
    I've start working on a new computer, re-type my code and, I don't know why, now, MIDI-OX displays start and stop messages... Cubase does not react, but I think I have to declare my Teensy LC as a controler.

    ATTACH=CONFIG]15447[/ATTACH]

    The idea is to be able to launch a backtrack when needed while I'm playing guitar on stage.

    Happy New Year ![
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	MIDI-OX.PNG 
Views:	3 
Size:	20.5 KB 
ID:	15447  
    Last edited by LeBeginner; 12-30-2018 at 07:13 PM.

  10. #10
    Senior Member
    Join Date
    Apr 2017
    Posts
    122
    Quote Originally Posted by LeBeginner View Post
    Hello,

    I'm new in the microcontroller world.
    I would like to build a midi foot controller to START/STOP my DAW while I'm playing guitar.
    Actually, I sennd a CC message and I use a vst to translate this message in a transport message, through a midi learn process.

    It works, but I'm not satisfied with it. I really would like to use a realtime message. I thought I could use this one... usbMIDI.sendRealTime(usbMIDI.Start);
    But apparently I do not use it properly since my DAW (actually REAPER, but I also want to use it in Cubase Elements 10) does not react.

    Any help would be welcome.

    Merry Christmas and Happy New Year !
    usbMIDI.Start will not accomplish what you are looking to do, there is a standard that most DAWs as well as keyboards use for transport control called MIDI Machine Control, I know these work in Reaper and Cubase (Pro only).

    MIDI Machine Control is sent through Universal Real Time System Exclusive messages and not System Real Time Messages.

    Here's a short article about it: http://midi.teragonaudio.com/tech/mmc.htm

    Long story short:
    • This is start
      Code:
      F0 7F 7F 06 02 F7
    • This is stop
      Code:
      F0 7F 7F 06 01 F7

  11. #11
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8
    Woooowwww !!!! Thank you ! It's Christmas after Christmas ! I'm gonna try this!
    Wish you a happy new year !

  12. #12
    Junior Member
    Join Date
    Dec 2016
    Location
    France
    Posts
    8
    Hello !
    I found a solution with the help of Brent Edstrom (the author of "ARDUINO for Musicians, a complete guide to Arduino and Teensy Microcontrollers").
    The easiest way to implement the play function is to add this single peace of code like the following one:

    Code:
    void PlayButtonFunction()
    {
      byte PlayCommandArray [6] = {0xF0, 0x7F, 0x7F, 0x06, 0x02, 0xF7}; 
      usbMIDI.sendSysEx(6, PlayCommandArray, true); //Send an array of 6 bytes representing the play command
    }
    for Stop function, change the sixth byte value by 0x01. For pause, use 0x09.

Posting Permissions

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