How can I communicate between Teensy and DAW?

Status
Not open for further replies.

ozguney

Member
I need to send DAW's MIDI signal to Teensy but I cant send. If I use usbMIDI codes, does Teensy can see DAW's MIDI signal?

Thanks...
 
If you compile with usb type set to MIDI your Teensy should appear as a class compliant MIDI device.

You send it MIDI from the DAW just as you would any sound module.
 
If you compile with usb type set to MIDI your Teensy should appear as a class compliant MIDI device.

You send it MIDI from the DAW just as you would any sound module.

Code:
void OnNoteOn(byte channel, byte note, byte velocity) {
  digitalWrite(LED_BUILTIN, HIGH); // Any Note-On turns on LED
}

void OnNoteOff(byte channel, byte note, byte velocity) {
  digitalWrite(LED_BUILTIN, LOW);  // Any Note-Off turns off LED
}

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  usbMIDI.setHandleNoteOff(OnNoteOff);
  usbMIDI.setHandleNoteOn(OnNoteOn) ;
  digitalWrite(LED_BUILTIN, HIGH);
  delay(400);                 // Blink LED once at startup
  digitalWrite(LED_BUILTIN, LOW);
}

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

Where is my mistake? I cant even understand it. I selected USB Type MIDI.
 
Note off or note on

Code:
void OnNoteOn(byte channel, byte note, byte velocity) {
  digitalWrite(LED_BUILTIN, HIGH); // Any Note-On turns on LED
}

void OnNoteOff(byte channel, byte note, byte velocity) {
  digitalWrite(LED_BUILTIN, LOW);  // Any Note-Off turns off LED
}

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  usbMIDI.setHandleNoteOff(OnNoteOff);
  usbMIDI.setHandleNoteOn(OnNoteOn) ;
  digitalWrite(LED_BUILTIN, HIGH);
  delay(400);                 // Blink LED once at startup
  digitalWrite(LED_BUILTIN, LOW);
}

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

Where is my mistake? I cant even understand it. I selected USB Type MIDI.

Hello there - this compiles and works fine, but I do have a couple of suggestions.

For your first post, with getting usb plugged/unplugged sounds, if you then get teensy not responding, then shut down the IDE, unplug the teensy, plug the teensy back in and then start the IDE again. Gets stuck occasionally, windows thing :)

Also, if you send output from your daw to teensy, this code should work fine - I tested it using midiox, but I think that your issue might be that your code is responding to note off - a lot of MIDI kit doesn't actually send note off, but sends a note on with velocity zero, instead. Have fun.

Paul.
 
Hello there - this compiles and works fine, but I do have a couple of suggestions.

For your first post, with getting usb plugged/unplugged sounds, if you then get teensy not responding, then shut down the IDE, unplug the teensy, plug the teensy back in and then start the IDE again. Gets stuck occasionally, windows thing :)

Also, if you send output from your daw to teensy, this code should work fine - I tested it using midiox, but I think that your issue might be that your code is responding to note off - a lot of MIDI kit doesn't actually send note off, but sends a note on with velocity zero, instead. Have fun.

Paul.

Thanks for answering :) When I test my code, Builtin Led blinking once(void setup) and not blinking when I press notes on my keyboard. Do you know about HairlessMIDI and Serial Port things?
 
Hairless is an Arduino kludge to push midi thru usb serial. Teensy does not require it as it sends class compliant usb midi.

What DAW are you using?
 
Hairless is an Arduino kludge to push midi thru usb serial. Teensy does not require it as it sends class compliant usb midi.

What DAW are you using?

Studio One 4, FL Studio not DAW but also Im using Synthesia. The main thing is communication between Teensy, PC, my MIDI Keyboard. I cant even send MIDI signal from MIDI Keyboard over PC to Teensy.
 
Yes, as above, hairless not necessary, teensyMIDI should just show up in control manager. So, MIDI out from keyboard, as MIDI in to whatever software you're using, then MIDI out to teensy - fairly logical, it could just be you've not set up a MIDI routing for that to happen in whatever software you're using. If you're wanting to do anything with MIDI, I heartily recommend midiox, which is an excellent MIDI utility - to test your code earlier I just set up the MIDI in/out ports to teensy and my ES7 keyboard, set the MIDI port routing so that MIDI out from ES7 went to teensy, then used both the PC keyboard and piano keyboard to send note on/off signals. LED blinks with every keypress. If you can do that, then your connection and code is working, and the problem lies elsewhere - start at the beginning of a signal chain and work back :). Sorry I can't help specifically, as I use cubase and am unfamiliar with the software you use, but MIDI setup and routing is a component of every DAW, and isn't always obvious in details of use.

Paul.
 
Status
Not open for further replies.
Back
Top