MIDI react LED using Teensy. (but im really stuck)

Status
Not open for further replies.

ozguney

Member
This is the project I want to do:
aYd815.png


Equipments: Teensy 3.2, WS2812b Strip LED, 88 Key Piano.



Piano and Teensy connected PC. They are communication via PC.

This is my code, but its not working. I have no idea where I'm making mistakes.

Code:
#include <Adafruit_NeoPixel.h> // Add Led Library

#define PIN 6
#define NUM_LEDS 88


#define RedDensity    150
#define GreenDensity  199
#define BlueDensity   88

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);


void setup() {
  strip.begin(); // start the strip and blank it out
  strip.show();
  usbMIDI.setHandleNoteOn(myNoteOn);
  usbMIDI.setHandleNoteOff(myNoteOff);
}


void loop() {
  usbMIDI.read();
}

void myNoteOn(byte channel, byte note, byte velocity) {
    strip.setPixelColor(note-21, RedDensity, GreenDensity, BlueDensity);
    strip.show();
}


void myNoteOff(byte channel, byte note, byte velocity) {
      strip.setPixelColor(note-21, 0, 0, 0);
      strip.show();
}

This is my Tools Menu:
3z7kXA.png



When you use Teensy you dont need to use Hairless MIDI. I know it but why my Teensy not reacting my MIDI notes I have no idea. When I run "AdaFruit strandtest" its working. Data cable, 5v and Ground cables are okay. I'm stuck. Can somebody help me?
 
You could try serial print commands inside the note handler code to see that they are being triggered.

It's not clear to me how the test midi is sent to Teensy?

Is it possible you don't have the PC software configured to send midi out to the Teensy?
 
You could try serial print commands inside the note handler code to see that they are being triggered.

It's not clear to me how the test midi is sent to Teensy?

Is it possible you don't have the PC software configured to send midi out to the Teensy?

1. I will try it.
3. We called it HairlessMIDI
 
Sorry... You've said you don't need Hairless... which is correct.

But you need to be sure your DAW is sending to the usbMIDI Teensy.
 
Status
Not open for further replies.
Back
Top