It is currently Thu Mar 28, 2024 5:33 pm


Controller board to Hauptwerk PC using USB bridge

Building organ consoles for use with Hauptwerk, adding MIDI to existing consoles, obtaining parts, ...
  • Author
  • Message
Offline

Quint

Member

  • Posts: 5
  • Joined: Tue Dec 01, 2015 8:54 am

Controller board to Hauptwerk PC using USB bridge

PostThu Jun 29, 2017 2:34 pm

Hi all,

I'm considering writing a new interface for Novation Launchpads, using a mini controller as driver. As most controller boards support USB in master mode only, I wonder if I can use a USB Bridge cable as in between to connect the controller to Hauptwerk as a standard USB device. Then the Hauptwerk PC would see the controller as 'normal' USB device, whereas the controller board could still access the Launchpads in the normal way.

Before I start buying hardware for this, are there any builders around that have experience using this setup?
Offline

adrianw

Member

  • Posts: 160
  • Joined: Sun Dec 18, 2011 5:10 am
  • Location: Lincolnshire, UK

Re: Controller board to Hauptwerk PC using USB bridge

PostThu Jun 29, 2017 4:40 pm

Probably not.

Maybe I have misunderstood your plan but if you are suggesting you can link two USB masters together with what you call a "bridge" cable I am afraid you will be disappointed: USB just doesn't work like that.

One could certainly write custom software to do this with a microcontroller like a Teensy 3.6 which offers two functioning USB interfaces but it would likely be a great deal (perhaps hundreds of hours) of work.
Offline
User avatar

johnh

Member

  • Posts: 699
  • Joined: Sat Mar 15, 2003 6:51 pm
  • Location: Monterey Bay Area of California

Re: Controller board to Hauptwerk PC using USB bridge

PostThu Jun 29, 2017 8:43 pm

Would USB OTG give you the functionality you are looking for?

https://en.wikipedia.org/wiki/USB_On-The-Go

---john.
Offline

Quint

Member

  • Posts: 5
  • Joined: Tue Dec 01, 2015 8:54 am

Re: Controller board to Hauptwerk PC using USB bridge

PostFri Jun 30, 2017 1:45 am

@adrianw
The bridge cable I referred to, is also known as a USB network cable. It involves some electronics, and is reported to work in Windows without drivers as a 'cheap' network solution to connect two PC's. What I intend to do is make the controller board act as a USB MIDI device, so I suppose 'some' work is in order.

@johnb
This might be the solution I'm looking for. The Raspberry Pi Zero and the old models A and A+ support OTG B mode, including MIDI. Thanks for the pointer, I will look into this.
Offline

adrianw

Member

  • Posts: 160
  • Joined: Sun Dec 18, 2011 5:10 am
  • Location: Lincolnshire, UK

Re: Controller board to Hauptwerk PC using USB bridge

PostFri Jun 30, 2017 6:10 am

I am afraid you have misunderstood. Neither USB network cables (which normally emulate back-to-back Ethernet MACs or similar) nor OTG will really help you to do what you are trying to do.

Teensy 3.6 does offer USB Midi and has an independent USB interface which you could use to talk to other devices and would be my suggestion. If you want one device to act as a USB controller and also appear as a USB-Midi device you need it to have two independent USB interfaces. Sorry if this isn't what you want to hear.
Offline

jkinkennon

Member

  • Posts: 1208
  • Joined: Thu May 07, 2009 9:43 am
  • Location: Vancouver, WA

Re: Controller board to Hauptwerk PC using USB bridge

PostFri Jun 30, 2017 1:50 pm

You need something like an Arduino controller that would provide the USB MIDI device connection to the PC. Then search for an Arduino USB Host shield that can operate as a MIDI host (most don't). The Launchpad would connect to the host port.

I've seen some shields and some Arduino MIDI USB Host library projects, but the engineering task is to do the homework to figure out which products would work together correctly. No one wants to do USB programming from scratch -- think of that as a career.

There are plenty of other controller platforms with more than one USB port where it's simple to have one device port and one host port. The trick is to find libraries for both USB devices and hosts that register correctly as Audio/MIDI without additional drivers.

If a Teensy 3.6 can provide a USB MIDI host port (instead of a device) then use a pair back to back connected via SPI or I2C. Your application could run on either Teensy.
Offline

adrianw

Member

  • Posts: 160
  • Joined: Sun Dec 18, 2011 5:10 am
  • Location: Lincolnshire, UK

Re: Controller board to Hauptwerk PC using USB bridge

PostSat Jul 01, 2017 4:28 am

The Teensy 3.6 supports the Arduino IDE and has working USB and Midi libraries. You don't need 2 back-to-back since it has two independent USB ports. That is why I suggested it - very few Arduino microcontrollers do, to my knowledge, nor does the Pi.
Offline

jkinkennon

Member

  • Posts: 1208
  • Joined: Thu May 07, 2009 9:43 am
  • Location: Vancouver, WA

Re: Controller board to Hauptwerk PC using USB bridge

PostSat Jul 01, 2017 11:08 am

The issue is whether the Arduino has (or can have) a USB Host port that correctly registers the Launchpad as a MIDI device. A host port is not a device port -- the two are opposite ends of a USB connection. I know that the Teensy 3.6 can provide the device port, but that does not leave a port for the Launchpad to plug into.

Launchpad (a device) -> Controller USB Host port
and then:
Controller USB Device port -> PC or Mac USB Host port

I am assuming that the controller is a between a Launchpad and a PC as that is the only configuration that makes sense to me in a Hauptwerk application.

Once one finds the controller with the USB Host port as well as the usual device port then it is still not trivial get it working correctly. USB ports, either host or device, work in a variety of modes such as HID or Audio and the MIDI libraries will be a subset of Audio.

EDIT: There are bridge cables which include a controller board as described above. To my knowledge they all work in the serial communication mode. There might be a version that does Audio/MIDI but I haven't been able to find one.
Offline

jkinkennon

Member

  • Posts: 1208
  • Joined: Thu May 07, 2009 9:43 am
  • Location: Vancouver, WA

Re: Controller board to Hauptwerk PC using USB bridge

PostSat Jul 01, 2017 12:18 pm

I don't normally post replies to myself, but I keep digging into this interesting topic...

According to a post from the Teensy guy (Paul S) in response to a user who wanted to work with the 2nd Teensy USB port Paul said something like "you're on your own". Perhaps their USB Host 3.0 software will handle MIDI, but at present they don't even show it as something they plan to do in the future if I read them correctly.

An interesting possibility with the Teensy 3.6 might be to scrap the Arduino adaptation and program the chip in C. NXP has their own fork of the LUFA libraries developed by Dean Camera and he definitely includes MIDI Host support as well as Device. The Teensy 3.6 has a potent chip on board that runs at 180 Mhz and is intended for low level programming.

I'm still looking around for something that would do this job with some "lite" programming language like Arduino. All ideas would be welcome by Quint and myself I'm sure.
Offline

adrianw

Member

  • Posts: 160
  • Joined: Sun Dec 18, 2011 5:10 am
  • Location: Lincolnshire, UK

Re: Controller board to Hauptwerk PC using USB bridge

PostSat Jul 01, 2017 4:46 pm

I had tried to explain this in my first post. I am sorry if I wasn't clear. Teensy 3.6 has the necessary hardware: the software could be a considerable amount of work. Perhaps hundreds of hours (for an experienced developer). However, the libraries exists and it is doable.

Perhaps their USB Host 3.0 software will handle MIDI, but at present they don't even show it as something they plan to do in the future if I read them correctly.


I think you must have misunderstood or chanced upon an old post. Paul S's USB Host library is at https://github.com/PaulStoffregen/USBHost_t36 Check out midi.cpp therein for the T36 MIDI host implementation. Warning: it is officially "experimental" so to that extent you would indeed be "on your own", but not starting from scratch.

I'm still looking around for something that would do this job with some "lite" programming language like Arduino


Not so "lite". Perhaps you do not realise the Arduino "programming language" is C++? I use PlatformIO with MS Visual Studio Code for my K66 (Teensy 3.6) development. Worth checking (it is all free) if you're serious about developing on this.
Offline

jkinkennon

Member

  • Posts: 1208
  • Joined: Thu May 07, 2009 9:43 am
  • Location: Vancouver, WA

Re: Controller board to Hauptwerk PC using USB bridge

PostSun Jul 02, 2017 2:00 pm

Not knocking Paul or the Teensy 3.6. It's an amazing platform and could be ready for the kind of project under discussion sometime this year. From a recent USB Host query in the Teensy forum:

"Since releasing Teensyduino 1.36, I've been focusing on other stuff. Planning to work on USB host again in June."

Perhaps worth waiting for as this could provide a simple way to do all kinds of "pass through" MIDI projects like channel translations, filtering, and the like which I suppose is the original purpose for the Novation Launchpad project. Thanks for the info, Adrian.

Right now I'm doing projects with Microchip IC's, but I remain ready to consider a move to ARM as I think of a next generation scenario. I've had a Teensy as recent as 3.2 and that direction is always a possibility. I assume it would be easy to combine Arduino and/or Teensy programming with C++ ??
Offline

Quint

Member

  • Posts: 5
  • Joined: Tue Dec 01, 2015 8:54 am

Re: Controller board to Hauptwerk PC using USB bridge

PostMon Jul 03, 2017 4:05 am

I think I understood the USB OTG limitations right away. :) A board with just one USB port switchable to OTG will need at least one additional port in standard mode for this application to work. The Raspberry Pi Zero (RPZ) I mentioned, is a very capable platform, Linux compatible (recognizes Launchpad out of the box 8) ) and quite easily expandable with additional independent USB ports. I'm not talking about the USB Hub hats here, which will not work for this. They are cheap (a RPZ plus hat is cheaper than a stock Teensy 3.6 here) and more than capable enough for what I indent to do - just registration and controls. So, thanks again for the pointers and ideas. :D I think I'll stick to the RPZ for this project. Something about familiar territory and so... :wink:
Offline

adrianw

Member

  • Posts: 160
  • Joined: Sun Dec 18, 2011 5:10 am
  • Location: Lincolnshire, UK

Re: Controller board to Hauptwerk PC using USB bridge

PostMon Jul 03, 2017 6:01 am

I think I'll stick to the RPZ for this project. Something about familiar territory and so...


Good idea! A Pi Zero host USB hat would certainly be a good route. I had mistakenly assumed they were all just hubs. Out of interest, what device are you talking about?

Alternatively, if you want to use the Pi without extra hardware consider using one of the Midi-over-ethernet protocols like RTP for the connection to the PC leaving the USB port free to talk to the Launchpad. I experimented with this last year and although I took a different route in the end it looked very promising.

Good luck whichever way you go.
Offline

jkinkennon

Member

  • Posts: 1208
  • Joined: Thu May 07, 2009 9:43 am
  • Location: Vancouver, WA

Re: Controller board to Hauptwerk PC using USB bridge

PostMon Sep 18, 2017 10:43 pm

I would enjoy hearing from anyone who is using the Teensy and/or one of the Raspberry Pi models to insert into a USB-MIDI connection such as between an encoder or other USB device and a PC. This post got me curious enough to experiment with both platforms. I've found the Teensy super easy to work with as a USB device. On the Raspberry Pi 3b I've had good results implementing USB host ports using RtMidi.

Now if it were handy to get the two talking to each other... Both the Teensy and Pi have capable SPI Master libraries but neither seem ready to run a strong SPI slave, so I'm needing to use a slower I2C connection (or serial) which is a disappointment. I could do some tricks with a shift register and some extra interrupts between boards that would allow two masters to talk really fast, but there must be a better way.

The other possibility is to run a second Pi 0 as a USB device, or a second Teensy as a USB host though I haven't seen examples of either solution so far. Ideas welcome.

I have used the Teensy to output to a 32-pin decoder shift register and to read from a 64-pin shift register though I haven't tried my own contact debouncing yet. The shift register boards are my own rough equivalent of the MidiBox DINs and DOUTs that many will be familiar with. I suspect that the Teensy 3.6 would handle several keyboards if carefully interfaced for efficiency. It's unfortunate that it has just one SPI channel with limited buffering ability or I'd try to coax it into handling an entire console.

My goal at the moment is to use a Raspberry Pi 3 with the 7" touch screen to add 12 or more stop controls to my current console. I'm also wanting to use it to switch MIDI signals from my encoders to a digital piano or other synth for external voices on at least one touch sensitive keyboard. Always plenty to do!

EDIT: QUICK update... I've ended up using a pair of back to back Raspberry Pi Zero W boards at $10 each. It's a fun fact that this approach needs more expense for a charger and cables than for the boards themselves. One board uses the OTG port as a USB device and the other runs a USB host. It's now just a choice of how to connect the two boards. WiFi works fine as well as Serial at 115000 baud. I'm especially excited to see how the WiFi works out and whether I need a preemptive linux kernal or UDP instead of TCP for the wireless network. The components are all working and it's a matter of doing the software connections between USB and WiFi for some initial throughput and latency testing. MIDI software is RtMidi with ALSA.

Return to DIY organ consoles / MIDI

Who is online

Users browsing this forum: No registered users and 3 guests