Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No midi output over usb Teensy #2

Closed
mattlamperouge opened this issue May 20, 2017 · 12 comments
Closed

No midi output over usb Teensy #2

mattlamperouge opened this issue May 20, 2017 · 12 comments

Comments

@mattlamperouge
Copy link

Hello, I was trying your encoder example, and everything compiled fine but i don't get midi output.
Im using a Teensy 3.1 with MIDI as the Usb type and all the needed libraries and software installed.
The Led lights up when i move the encoder so the enc.refresh(); seems to work.
I'm used to send midi using the pjrc library, like usbMIDI.sendControlChange for example.
How does your library send midi over USB?
Do i need to setup anything else?

@tttapa
Copy link
Owner

tttapa commented Jun 7, 2017

The library uses the same function to send MIDI as usbMIDI.sendControlChange. Not sure why it's not working. Have you tried using a MIDI event analyzer?
https://github.com/tttapa/MIDI_controller/blob/master/src/USBMidi.cpp#L47
https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_midi.h#L110

Pieter

@mattlamperouge
Copy link
Author

Hi I used a midi analyser but didn't get any cc msg or value..

@tttapa
Copy link
Owner

tttapa commented Jun 7, 2017

You could try uncommenting the DEBUG preprocessor directive: https://github.com/tttapa/MIDI_controller/blob/master/src/USBMidi.cpp#L4
And check what it's doing in the serial monitor.

I probably won't have time to look further into it until July, my apologies.

Pieter

@mattlamperouge
Copy link
Author

Thanks i will rey and report back

@tttapa
Copy link
Owner

tttapa commented Jun 26, 2017

Did you get it to work?
I tried it with a Teensy 3.2 today, and it worked just fine ...

Pieter

@tttapa
Copy link
Owner

tttapa commented Aug 17, 2017

Closing this issue as I've not been able to reproduce it, and no activity for well over a month.

@tttapa tttapa closed this as completed Aug 17, 2017
@deksprime
Copy link

Hello all, I have also come across the same issue with Teensy 3.2. Maybe we could reopen this issue and discuss it more thoroughly? Thanks in advance.

@deksprime
Copy link

@mattlamperouge have you been able to fix this issue? I'm having the same problem, the LED is lighting up while I rotate the potentiometer knob but there isn't any midi output to my DAW of choice, which is in this case Mixxx. I will try to analyze it with a midi analyzer today and post the results here

@tttapa
Copy link
Owner

tttapa commented Sep 14, 2017

Very strange. I do most of my testing on a Teensy 3.2, and I've never had any problems.
Please check with a MIDI analyzer. Also post your exact code and the versions of the Arduino IDE, Teensyduino and the libraries you are using.

Note that you have to close your DAW and reopen it after uploading new firmware to the Teensy/Arduino.
Unplugging the Teensy is not necessary (at least not in Linux, but your mileage may vary if you're on Windows or Mac).

Pieter

@tttapa tttapa reopened this Sep 14, 2017
@deksprime
Copy link

deksprime commented Sep 14, 2017

  • Arduino version 1.8.1 (it was included in the supported versions on Teensyduino installer)
  • Teensy Loader 1.33 (don't know if this is the same version as teensyduino)
  • Teensy 3.2
  • Teensyduino 1.38
  • I'm on Ubuntu Studio 16.04 with kernel 4.4.0-93
  • USB type is set to MIDI from the Arduino IDE
  • Teensy loader is opened (does this matter or should this be opened for only uploading?)
    Here the led is blinking while I rotate the potentiometer so that I know there's nothing wrong with the hardware setup(at least with the pot setup), but no midi over USB is sent.

the exact code is:

#include <MIDI_controller.h> // include the library

const static byte Channel_Volume = 0x7; // controller number 7 is defined as Channel Volume in the MIDI implementation.
const static size_t analogAverage = 8; // Use the average of 8 samples to get smooth transitions and prevent noise
//________________________________________________________________________________________________________________________________

Analog fader(A0, Channel_Volume, 1); // Create a new instance of the class 'Analog, called 'fader1', on pin A0, that sends MIDI messages with controller 7 (channel volume) on channel 1.

//________________________________________________________________________________________________________________________________

void setup(){
  USBMidiController.blink(LED_BUILTIN);  // flash the built-in LED (pin 13 on most boards) on every message
  USBMidiController.setDelay(15);  // wait 15 ms after each message not to flood the connection
  USBMidiController.begin();  // Initialise the USB MIDI connection
  delay(1000); // Wait a second...
  fader.average(analogAverage); // Use the average of 8 samples to get smooth transitions and prevent noise
  fader.map([](int value){return (int)((unsigned long)value*value/1023);}); // Map to a quadratic curve
}

//________________________________________________________________________________________________________________________________

void loop(){
  fader.refresh(); // refresh the fader (check whether the input has changed since last time, if so, send it over MIDI)
}

Which is the Analog_map_example from this repo. I suppose it is something not related to this specific code since I have tried many other analog potentiometer examples using the USBMidi library but no luck. Although my problem might be unrelated, the only similar problem on the web I could find was underneath this issue,so a little help or any suggestions would make a huge difference on my side and be so much appreciated! :)

@tttapa
Copy link
Owner

tttapa commented Sep 19, 2017

I just tried it in Ubuntu 16.04 and Ubuntu 14.04 Studio, without any problems.
I used the Analog_map_example on a Teensy 3.2 with Arduino 1.8.4, Teensyduino 1.39 and MIDI_Controller 2.1.0.
Here are my ALSA MIDI connections:
MIDI-connections
And here's the output from GMIDImonitor (also works in KMidimon and Midisnoop):
MIDI-monitor

Is the MIDI device detected?
Open a terminal and execute lsusb. It should show up as Van Ooijen Technische Informatica Teensyduino MIDI
Then try amidi -l. It should show IO hw:1,0,0 Teensy MIDI MIDI 1 or something similar.

@deksprime
Copy link

Tried the steps that you have recommended. This time it worked, although I don't have any previous reference whether if the lsusb and amidi -l worked becaused I have only tried them this time and this time the Teensy happened to work. Thanks for your time and the extensive reply though. I think this issue can be closed since the other guy on the thread is not responding. Thank you dude.

@tttapa tttapa closed this as completed Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants