razrotenberg / Midier

Arduino library for playing, recording, looping and programming MIDI notes, arpeggios and sequences

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run on Teensy 3.1/3.2

zensutherland opened this issue · comments

Love the idea for this, but i could not get it to compile on my Teensy 3.1 - This may very well be due to my ignorance, so please forgive me if this is a 'user issue' and nothing to do with the software.

The compile was attempted on the provided examples (Scales, Notes, etc) with the library. Below is the error message.

In file included from /Users/zensutherland/Documents/Arduino/libraries/Midier/src/Midier.h:12:0,
from /Users/zensutherland/Documents/Arduino/Midi/midier/midier.ino:14:
/Users/zensutherland/Documents/Arduino/libraries/Midier/src/sequencer/sequencer.h:20:17: error: enumerator value -1 is outside the range of underlying type 'char'
None = -1,

Hi @zensutherland and thanks for reaching out!

I don't have any experience with Teensy boards. Can you please explain a bit how you compile the project?
Do you control the compilation command line that is executed?
If so, is the flag -pedantic passed to the compiler?

Did you install Midier using a library manager just like the one for Arduino, or did you clone this repository manually?

Thanks!

Same as zensutherland, would like to get this library working on Teensy 3.0 and later.

Using Win10, Arduino IDE 1.8.15 and Teensyduino 1.54, arpeggino compiles for AVR boards eg, UNO, Leonardo, Mega, Teensy 2.0 and Teensy++ 2.0 but not for Teensy 3.0 or later.

Results were the same for installing Midier using library manager or manual install.
Compiler errors are same as zensutherland's post

Have just completed step one of the tutorial using an Arduino Leonardo and am seeing note messages being output from TX1 however would like to get it working on a Teensy 3.0 or better and think it would be great to use this lib with Teensyduino's native Fortyseven Effects Midi library.

commented

Greetings ! I came across this issue . This is an incredible library and wanted to give it a spin on my Teensy 3.6 . Its quite simple with its own usbMIDI() implementations .
I have forked the repo with that tiny initial change . I will test the most I can out of the library and report back .
Thanks a lot for making this effort on Midier !

the fork that works out of the box on teensy (tested 3.6) for now , till an option is added to the official repo .
-https://github.com/CarloCattano/Midier

Its just a tiny change in src/midi.cpp , comenting this lines and adding the usbMIDI way of writing it
https://github.com/levosos/Midier/blob/a1f8ee5ad51951a1b7365e609f5bf7e5b1f902b2/src/midi/midi.cpp#L20-L22

should be like this instead for usb midi via teensy.
https://github.com/CarloCattano/Midier/blob/82c4ccd24e35e01847efa06db8efd50a74bc84a5/src/midi/midi.cpp#L19-L23

You can edit it yourself find in the files that complain in the arduino console when the errors popup , you should be able to see where Midier/src/Midi.cpp is installed

commented

Another thing that is just a quick hack is the addition of " signed char " . Teensy assumes char to be unsigned .
Compiler complains about the conversion from unsigned int to int .
-https://github.com/CarloCattano/Midier/commit/ad4f9020540ec129f264dd74fd1faed30903e0ef

Thank you CarloCattano, will change hardware to suit T3.6, play with those links and report back.

commented

@MatrixRat I dont think you need to change hardware. T 3.1/3.2/3.6 should behave equally, if I'm not forgetting something obvious

@CarloCattano Just to elaborate, soldered buttons etc to a Mega protoboard and need to be mindful of T3.6 V+ for Din Midi I/O. Have a T3.6 on a Talldog DUE breakout and plan to build so will work on a Mega as well thinking that with the extra I/O pins will not need to use 4067s earmarked for another project.
Am adding the Din Midi I/O as would like to be able to plug in say a Novation SL-25. Am not a real programmer and this library has got me interested and looks like excellent material to dig into C++ and learn some new tricks like there are code hieroglyphics here that I need to be able to understand and use in another Midi project, ~6K lines of working code..

The issue is that Teensy is using C++11 and has different variable types defined. I made a pull request that fixes all issues for Teensy 4.1

Here is the PR with the changes required for Teensy 4.1: #14