Teensyduino 1.41 Beta #3

Not open for further replies.


Staff member
Here is a third beta test for Teensyduino 1.41.

Major updates were made to USB MIDI. Please let with testing MIDI if you
have MIDI software or MIDI devices (to plug into the USB host port on
Teensy 3.6).

Since Arduino's 1.9 betas are a moving target, I've included copies of
beta build #31 which this Teensyduino version expects.

Old beta download links removed. Please use the latest version:

Changes since Teensyduino 1.41-beta2

USB MIDI support for virtual cables (select from Tools > USB Type menu)
USB MIDI updated with most functions of Arduino MIDI lib 4.3.1
USB MIDI getType() now returns same as MIDI 4.3.1 -- NOT BACKWARDS COMPATIBLE
Support for compatibility with Arduino's MIDIUSB.h
Added more examples in File > Examples > Teensy > USB_MIDI
USBHost_t36 MIDI support for virtual cables
USBHost_t36 MIDI updated with most functions of Arduino MIDI lib 4.3.1
USBHost_t36 MIDI returns same as MIDI 4.3.1 -- NOT BACKWARDS COMPATIBLE
USBHost_t36 MIDI fix for devices using interrupt endpoints
USBHost_t36 MIDI workaround for devices sending improperly coded sysex message
XPT2046_Touchscreen add setRotation()
FreqMeasureMulti fixed on Teensy LC (thanks Manitou)
Downloaded and still runs... I probably won't test much of the new stuff (no MIDI stuff)...

I probably should hurry up with the USB joystick stuff I am playing with. I am trying to be able to retrieve more of the Axis data for the different joysticks like PS3, PS4 and also try get some Rumble and LED support to work. I have some of this working now on PS4. Trying to figure out XBox One, so far the documentation I have seen, the specified way is not working for me... But I have seen other conflicting things as well. PS3 is retrieving additional information but have not done rumble yet...

On the new Beta buile #31. Is it just me, but I find the Find and Replace dialogs when I do something like <ctrl f> comes up but does not grab the focus and what I try to type for search string ends up in Sketch... Irritating probably should report to Arduino...

On the new Beta buile #31. Is it just me, but I find the Find and Replace dialogs when I do something like <ctrl f> comes up but does not grab the focus and what I try to type for search string ends up in Sketch... Irritating probably should report to Arduino...

Not just you KurtE - I see it on two Win 10 machines. Hit Ctrl+F and find Dialog displays but cursor focus stays and types in the sketch not the dialog. Though I'm in 'external editor' mode just now so that stopped bugging me.

Also the IDE - but are you seeing the failure in line number association with reported compile errors as well with the updated pre-processor?
New MIDI stuff is all testing out perfectly here.
Mac is seeing 16 cables and midi transfers fine.

Windows 7 has an issue with usbMIDI.sendNoteOn(note, vel, channel,cable) from teensy to PC. After a disconnection and reconnection(USB lead) it will work for a couple of bars and then timeout for a minute or two before working again for the rest of the session. After a disconnection windows 7 is not properly closing the port so on reconnection it forces the open port closed causing the timeout. Not a problem on Mac.

USBHost_t36 now has transmit working great, as well as receive.
Controlling the lights on a MidiFighter Twister :cool:
Clocks are all good and I still need to test sysex.
I will report if I run into anything not working as expected but for now it all looks awesome.
Might be nice to be able to name the cables in future on OSX. MIDIx16 routing can be confusing in a daw.
No dice on Windows as you know.

Thanks for getting such a big job done Paul. Fantastic stuff.
Hi Paul- I have a little USB MIDI keyboard I'm using for a project. It has decoders, pads, keys, and mod/pitch sliders. Everything works great except for the Pitch slider (the modulation one works fine). I've attached the debug log, hoping this is an easy fix. This isn't a new bug, but was hoping 1.41 would fix it, should have reported earlier... Thanks for all you do Paul!
View attachment Pitch Slider Debug Log.txt
Just for the record.
I have a korg microkey usb keyboard connected to the usb host port of a T3.6 and pitch bend works as intended.
Sending pitch bend from logic pro x to the usb port of the T3.6 also works as intended.
Yeah, all this USB MIDI stuff needs better documentation. That's why I've been adding more examples. Planning to do updates on the website soon...
Arduino 1.9.0-beta adds some html parsing stuff to the serial monitor. Maybe it's consuming more memory as lots of data comes in?
I've been using the 1.9.0 builds since the first 1.41 beta supported it and not seen JAVA issues the little I used IDE SerMon - though I primarily use TyCommander for my SerMon - one reason was the older IDE builds would consume lots of memory and fault Java with long running lots of serial spew - though in later 1.8.x builds when I used it that seemed to have been fixed. As Paul notes - perhaps they regressed with new features. I'm on Win 10 now - but my earlier experiences were Win 7.
I have run a full example build with this release and found a issue with example_examples__10_StarterKit_BasicKit_p11_CrystalBall for all teensy boards.
The reason is that the library arduino-PR-beta1.9-BUILD-31\hardware\teensy\avr\libraries\LiquidCrystal lib is empty and marked as "no longer used"
Resulting in ..\p11_CrystalBall.ino:28:1: error: 'LiquidCrystal' does not name a type
Best regards
I just tried a fresh copy of Arduino 1.9.0-beta31 and Teensyduino 1.41-beta3.

It verifies without any error.


Any chance your install might have leftover stuff from prior betas or other installs?
Indeed it seems to work with teensyduino :-( As you know I use Sloeber...
Root cause is that ...\arduino-PR-beta1.9-BUILD-31\hardware\teensy\avr\libraries\LiquidCrystal contains a LiquidCrystal.h and LiquidCrystal.cpp in 2 locations.
Arduino IDE seems to prefer the files in src and sloeber the once in the root.

Deleting the dummy files in the root makes it work in Sloeber and Arduino IDE. Is that an option for you?
Hey Paul, there's a bug with usbMIDI, but before i explain the bug, there's another thing that im a bit confused with, the new version seems to be using the usb_midi under cores/teensy3/usb_midi (i'm using a 3.2 with Serial + MIDI) but i thought it was supposed to use usb_midi under cores/usb_midi/ ?

In usb_midi.c the bug is at around line 342

if (type1 == 0x02 || type1 == 0x03 || (type1 == 0x05 && type2 == 0x0F)){

it should be

if (type1 == 0x02 || type1 == 0x03 || (type1 == 0x05 && (n>>8) >= 0xF1 && (n>>8) != 0xF7)) {

sometimes the type1 can be 5 and type2 can be 0x0F even tho it containes 0xF7 to end the messsage
Awesome, thank you! i've been testing 1.41 today and so far everything is work as usual for me, my main focus being on MIDI
Paul, both USBHost_t36 and usbMIDI should have a getSysExArrayLength() and behave like the MIDI library, where the the sysex length is split into 2 uint8_t and each assigned to data1 and data2, then getSysExArrayLength would merge them into a uint16_t

Currently the size of sysex arrays is 290 but data1 is only a uint8_t so it wouldn't be able to store a length higher than 255

msg_sysex_len in USBHost_t36 would have to be a uint16_t like it is on usbMIDI
sfaik there is absolute no convention on how sysex should be architectured.
f.e. KORG packs 8 bytes into 7bits and unpacks 7bytes into 8 bits.
where f.e. DSI Tempest has a totally custom packing/unpacking system I had to reverse engineer in order to program a randomizer for it: https://forum.davesmithinstruments.com/index.php/topic,165.0.html.
what about a 32bit integer? or a double?
so how a sysex message is made depends on how you want it. then you have to make your own encoder/decoder system for it.
Not open for further replies.