Hi everybody! My name is Dan and I've been gifted a pair of Teensy LC boards from a friend. I have a big old midi controller that I use with Ableton, it feels amazing to play but has no pitch or mod wheels, so I thought I'd get the teensy to do this over USB to my DAW. I've got the mod wheel working from running the AnalogControlChange example but now I've tried to add pitchbend I'm running into trouble. I found an answer from the forums about pitchbend code so I've kinda just tried to add that to the existing analogcc one.
void setup() {
}
void loop() {
usbMIDI.sendControlChange(1, analogRead(0)>>3, 1);
delay(10);
usbMIDI.sendPitchBend(1, analogRead(1)bendVal<<7,1);
while (usbMIDI.read()) ; // read and discard any incoming MIDI messages
}
But I'm getting this come up when I try to Verify it
Arduino: 1.8.1 (Mac OS X), TD: 1.35, Board: "Teensy LC, MIDI, 48 MHz, Smallest Code, US English"
AnalogControlChange: In function 'void loop()':
AnalogControlChange:6: error: expected ')' before 'bendVal'
usbMIDI.sendPitchBend(1, analogRead(1)bendVal<<7,1);
^
AnalogControlChange:6: error: no matching function for call to 'usb_midi_class::sendPitchBend(int, int, int)'
usbMIDI.sendPitchBend(1, analogRead(1)bendVal<<7,1);
^
/Users/danknight/Downloads/AnalogControlChange/AnalogControlChange.ino:6:54: note: candidate is:
In file included from /Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:29:0,
from /Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:1,
from /var/folders/ly/hkddh0q537x3s38w6q4mg81h0000gn/T/arduino_build_215963/sketch/AnalogControlChange.ino.cpp:1:
/Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_midi.h:121:14: note: void usb_midi_class::sendPitchBend(uint32_t, uint32_t)
void sendPitchBend(uint32_t value, uint32_t channel) __attribute__((always_inline)) {
^
/Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_midi.h:121:14: note: candidate expects 2 arguments, 3 provided
expected ')' before 'bendVal'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I'd imagine this must be one of the simplest things you can do with a Teensy but I have zero experience in the code. I just want the modwheel on pin A0 and the pitchbend on pin A1. Can anyone help me here and/or direct me to some cool learning resources? I'd love to put the second Teensy board to good use!
I also have a question with regards to the voltage tolerance of the pins on the LC. Just to be sure I have my pots outer pins connected between 3V and G and the wiper going to its respective analog pin?
Thanks so much in advance!
Dan
void setup() {
}
void loop() {
usbMIDI.sendControlChange(1, analogRead(0)>>3, 1);
delay(10);
usbMIDI.sendPitchBend(1, analogRead(1)bendVal<<7,1);
while (usbMIDI.read()) ; // read and discard any incoming MIDI messages
}
But I'm getting this come up when I try to Verify it
Arduino: 1.8.1 (Mac OS X), TD: 1.35, Board: "Teensy LC, MIDI, 48 MHz, Smallest Code, US English"
AnalogControlChange: In function 'void loop()':
AnalogControlChange:6: error: expected ')' before 'bendVal'
usbMIDI.sendPitchBend(1, analogRead(1)bendVal<<7,1);
^
AnalogControlChange:6: error: no matching function for call to 'usb_midi_class::sendPitchBend(int, int, int)'
usbMIDI.sendPitchBend(1, analogRead(1)bendVal<<7,1);
^
/Users/danknight/Downloads/AnalogControlChange/AnalogControlChange.ino:6:54: note: candidate is:
In file included from /Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:29:0,
from /Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:1,
from /var/folders/ly/hkddh0q537x3s38w6q4mg81h0000gn/T/arduino_build_215963/sketch/AnalogControlChange.ino.cpp:1:
/Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_midi.h:121:14: note: void usb_midi_class::sendPitchBend(uint32_t, uint32_t)
void sendPitchBend(uint32_t value, uint32_t channel) __attribute__((always_inline)) {
^
/Users/danknight/Desktop/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_midi.h:121:14: note: candidate expects 2 arguments, 3 provided
expected ')' before 'bendVal'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I'd imagine this must be one of the simplest things you can do with a Teensy but I have zero experience in the code. I just want the modwheel on pin A0 and the pitchbend on pin A1. Can anyone help me here and/or direct me to some cool learning resources? I'd love to put the second Teensy board to good use!
I also have a question with regards to the voltage tolerance of the pins on the LC. Just to be sure I have my pots outer pins connected between 3V and G and the wiper going to its respective analog pin?
Thanks so much in advance!
Dan
Last edited: