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

Thread: Mapping Teensy with usbMidi in Traktor/Ableton

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    1

    Mapping Teensy with usbMidi in Traktor/Ableton

    Hi all, I'm new here.

    I came over from Arduino because of it's better options for sending MIDI signals.

    I just set up a simple pushbutton on my teensy ++ to send a midi note when HIGH. This actually
    works perfectly well and in MIDI-OX I receive the notes and all, but when it
    comes to mapping my button in software (I have Traktor Pro and Ableton Live),
    I get no response whatsoever. In both programs, it seems as if the MIDI isn't
    coming through (It doesn't "learn"). Yet, at the same time, I can see the note coming in in MIDI-OX.
    I've set the teensy as my input port, and "None" as my output port.

    I've switched the button for a potentiometer - same result.
    Unfortunately, I can't change computers.

    Below is my code, could anything be interfering?
    Am I using the right MIDI command?

    Code:
    const int b = 7;
    const int led = 6;
    
    void setup() {
      pinMode(b,INPUT);
      pinMode(led,OUTPUT);
    }
    
    void loop() {
       
      if (digitalRead(b) == HIGH)
      {
        
        digitalWrite(led,HIGH);
        usbMIDI.sendNoteOn(26,100,1); //note, velocity, channel
        delay(150); //delay so that only one signal goes through
        
      } else {
        digitalWrite(led,LOW);
      }
      
    }

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,114
    Having switched the note on, you are not switching it off again!

    Code:
    else {
        usbMIDI.sendNoteOn(26,0,1); //velocity zero means off
        digitalWrite(led,LOW);
      }

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,212
    Try the example, from File > Examples > Teensy > USB_MIDI > Buttons.

    I highly recommend you use the Bounce library to read pushbuttons (as shown in that example), rather than digitalRead().

Tags for this Thread

Posting Permissions

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