View Full Version : Teensyduino 1.41 Beta #3

01-09-2018, 10:46 PM
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 (https://forum.pjrc.com/threads/48728-Teensyduino-1-41-Beta-2)

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)

01-10-2018, 05:20 PM
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...

01-10-2018, 06:11 PM

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?

01-11-2018, 06:40 AM
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.

01-11-2018, 07:49 PM
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!

01-12-2018, 02:45 AM
Please give this program a try. Does it help?

01-12-2018, 03:39 AM
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.

01-12-2018, 03:53 AM
Thanks Paul, that works. Didn't realize that pitch had its own handler... Thanks again!

01-12-2018, 04:08 AM
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...

01-14-2018, 03:30 AM
This post is no longer important to

01-14-2018, 03:51 AM
Do the out of memory problems happen only when using the serial monitor?

01-14-2018, 03:59 AM
No longer important to this thread.

01-14-2018, 04:36 AM
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?

01-14-2018, 05:39 AM
No longer important to this thread.

01-14-2018, 05:41 AM
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.

01-14-2018, 12:52 PM
I have run a full example build with this release and found a issue with example_examples__10_StarterKit_BasicKit_p11_Cryst alBall 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

01-14-2018, 01:23 PM
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?

01-14-2018, 02:23 PM
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?

01-14-2018, 08:22 PM
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

01-14-2018, 08:39 PM
hardware/teensy/avr/cores/usb_midi is for Teensy 2.0 and Teensy++ 2.0.

01-14-2018, 08:42 PM
In usb_midi.c the bug is at around line 342

Already fixed on github, at line 340:


I'm going to roll all the recent fixes up into 1.41-beta4 soon. But first updating the Java stuff for Arduino 1.9.0-beta34 (was only beta31 a week ago).

01-14-2018, 08:43 PM
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

01-14-2018, 10:05 PM
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

04-13-2018, 08:55 AM
USBHost_t36 MIDI workaround for devices sending improperly coded sysex message

what exactly does it mean?

04-13-2018, 09:08 AM
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.