Modular Midi-Controller

Status
Not open for further replies.

Jorgen

Member
Hi Paul,
thanks for your reply by mail.

I will add my question also here to discuss it better by the community:

I’m working on an open-source midi device for controlling, lights, music and also software (like Adobe Lightroom)
It is modular - one main controller and different I2C slave boards (like button matrix, motorized sliders, touch sliders, encoders, …)

Currently I’m using the AtXmega for the slaves and the ESP32 as main MCU for the main controller.
But I’m running in many issues, because the rtos and arduino port stuff is not stable yet :/

I’m a big fan of Teensy from the first days and also got the 3.5 and 3.6 from your kickstarter
and wonder if it is not a better choice to use teensy 3.6 based controller for my main-controller?...

PAUL: Yes, probably. You get USB device support with Teensy. On 3.6, there's even USB host support for MIDI now....

If I choose Teensy, I’ll get USB midi interface out of the box and many other arduino libs and the awesome sound lib too.

I was choosing ESP32 as initial to support also the ESP community and mainly to have WiFi/BLE connectivity.

Is there a way to use ESP8266 or ESP32 hooked to teensy to get WiFi too?

Paul: Yes, many people have done this using Serial1 or Serial2. It's been discussed on the forum many times.

And how hard is it to bring the Teensy firmware onto my custom pcb board?
I will use the QFN-144 to easier reflow the pcbs.
But what else I will need to bring the board to life?

Paul: You need this chip:

https://www.pjrc.com/store/ic_mkl02.html

Also check out the reference board using the big TQFP chip.

Do you have any hints for me?

I will create the pcb by KiCad as 2 layer board.

Stuff I will need on my main controller:
  • USB (for USB-midi interface)
  • WiFi (and/or Ethernet and nice to have BLE)
  • I2C for the slave board communication
  • SPI or I2C for OLED or TFT display
  • 1 PWM pin for SK6812 (FastLED lib) or 2 pins for APA102 (FastLED lib)
  • 1 GPIO for enable pin
  • 1 GPIO for enable loop pin
  • 1 GPIO as interrupt pin
  • 3 GPIOs for main menu rotary encoder
  • 2 to 4 GPIOs for additional buttons


Thanks for your time and wish you a good day.
cheers Jorgen
 
Last edited:
https://forum.pjrc.com/threads/2817...VIEW-AVAILABLE?p=135276&viewfull=1#post135276

This is the only post I can find that suggests MIDI hosting is becoming feasible... (alpha release? is it compatible with usbMIDI?)

I look forward to hearing more on this from those in the know...

MIDI for BLE may be a problem... I think some data structure differences between MIDI and usbMIDI might mean ports for Arduino code are not trivial - but I'm not really competent to say for sure

The rest of what you want should be feasible but combined might need use alternate pin assignments for multiple Tx/Rx or whatever... there's lots of posts and lots of experts on the forum that should be able to help with the communications protocol and display stuff.

Definitely not a beginner project but I guess you're no beginner. :)

The pin count on your proposed project sounds very low so any Teensy will have enough pins and enough speed for MIDI needs; I think only hosting USB might point to the 3.6 (as your Paul quote implies it's required).
For non-host modules the low-cost (LC) model would be more than adequate for most purposes.

The consensus on the forum has been the number of boards you need to manufacture to make integrating the Teensy pay off is quite high. Especially if you value your time at a $non-zero rate.

That break even point will particularly high since your low pin-count means you don't need to access the pads so simple header connections are all that's required.

Hopefully someone that knows more about USB hosted MIDI and BLE MIDI on Teensy will comment.
 
Hi oddson,
thx for your post and ideas.
The MIDI stuff should only work over USB and maybe Ethernet/WiFi (by OSC)
BLE is just an idea to configure the WiFi and board and extend it on WiFi side with virtual buttons from within a tablet/smartphone (also OSC).

I just have a small prototype for the button module by RGB buttons (currently I'm using mechanical MX style buttons with 3D printed caps) everything is PWM multiplexed and working really stable.

Next is the slider module with motorized sliders (I need them to drive to correct position, if I want to edit later some pictures in Lightroom).


The Main controller should be fast enough to handle all the protocol and data flying around.
This was the reason I choosed at begin the ESP32, because it has 2 MCU cores with 160 to 240 MHz. 4MB Flash and 500+ RAM.
But as you can read above it is not stable yet and I'm running from one issue to next. Had to debug I2C and fix it and I lost my focus on the project, because I had to do workarounds for the HAL of the ESP32.

So I looked around my boxes and found the Teensy - which is one of the most stable MCU on market.
And the 3.5/3.6 is fast enough to handle all the stuff, I think.

And I do not wan to hook on the original Teeny on the main PCB, because it is too high and oversized.
I only need some pins and will build a DIY custom Teensy based MCU on my main board.

Hope this is possible... I do have good knowledge about SW and stuff, but I'm beginner in designing PCBs :/
So this would be the hardest part for me to master...

As far as I build up and test (breadboard) with teensy and the button module - and see that it will communicate right, I will share all the sources I have yet around on gitHub.
Maybe someone can review or help to bugfix stuff.

This project has no fixed dead line and is no commercial project.
I want to build it mainly for me and a colleague. I want it to edit my pictures with more feedback and real buttons. And use it to speed up my music production.
My colleague want it to mix his lights and do live performance.

The main idea is that you can clip as many devices in chain as you have space ^^
I build up a really simple and stable daisy chain initialisation for all the I2C devices. So the master has all the power and reassign all the addresses.

Current State:
- code of main base classes finished
- I2C daisy chain initialisation working
- global interrupt done
- button device code finish and working
- display is working (UI not yet done - just simple text yet)
- MIDI, WiFi, OSC, ... not yet started
- PCBs also not yet started
 
Hopefully someone that knows more about USB hosted MIDI and BLE MIDI on Teensy will comment.

I don't know about BLE MIDI, but I can tell you the new USBHost_t36 library does MIDI receive. It's still missing code in its driver to transmit, but that will be coming soon. As you might guess from the name, this only works on Teensy 3.6 because it uses the 2nd USB port.

There may be ways to use the normal USB Host Shield library, either with an actual host shield, or with a lot of fiddling to reuse the main USB port (which makes loading code quite challenging, since that's how you'd normally upload your program).
 
Finally I have now an running test scenario with Teensy 3.1 board as my main MCU. Working as Serial and MIDI over USB.
It initialize the "button module" via I2C and daisychain technique. And after button click/release interrupt it fetches the button states and will generate and send midi note on/off signals by button index as midi note index.
As soon as I press any button it sends the notes and I can hear them in my garageband or see it in MIDI monitor.
Otherwise also the MIDI input is working fine. As soon as note or control changes come in, I show them on SPI connected OLED display.

- Now I have to beautify the code a little and push it online
- than start designing the PCB for the button module
- after that I have to start to design the PCB for the main board (teensy based)

@Paul: do you have a schematic of the Teensy dev board?
I decided to use a teensy 3.1/3.2 based chip for my setup. It is not that expensive and fast enough for my project.
For my first prototype PCB I think I will hook an original Teensy on sockets.
But for the final one, I will integrate MCU and bootloaded chip on my main pcb board.

Hope you can help me here?

PS: I try to route it by kicad.
 
Is there a way to use the mk20dx256 chip for custom pcb without the extra bootloader chip?
I found this project for an open source keyboard: https://github.com/kiibohd/controller
And they are using the same chip or an teensy. In case of none teensy, they have a builtin bootloader.
I need the same for my project.
 
Last edited:
Status
Not open for further replies.
Back
Top