USBMidi Can I Do This?

Status
Not open for further replies.

stevoh

Member
Hello all from new teensy 3.1 user, and I will say in advance that these questions may seem a bit naive/reduntant/stoopid in nature, but I'm trying to wrap my head around a little project I've been considering, and it looks like the Teensy 3.1 is going to be able to accomplish the following:

I have a Korg nanokey2 USB midi controller that I would like to turn into a standalone midi workstation of sorts by hooking it up to the Sparkfun VS1053 based musical instrument shield, and routing the resultant audio to a small 2 watt amp and slimline enclosed speakers.

Enlarging the case for the needed boards/hardware is simple enough by adding a plastic ring in the center. Power is an issue but I will ask that question in a minute.

My first thoughts are that monitoring the nanokey2's output via the Teensy3.1 is a relatively simple matter via the usb midi read function detailed in Paul's examples. It also looks like including callback methods to then send the required midi data out the serial port to the musical instrument shield is doable as well, and I've already tested the audio portion of the circuit by directly streaming midi from a DIN-based controller to the shield and thru the amp/speaker combo.

It looks to me like this will all work okay, but I am not sure as to how I will:

a) Provide power to the nanokey2, as it usually is powered by the usb connection

b) Provide power to the Teensy3.1 - ideally I would like to power both boards with a high capacity lipoly pack and charge same via USB, but I'm not sure how to go about sequencing/controlling all of these different usb connections (nanokey2, teensy3.1, lipoly charger).

Suggestions and advice are actively sought and welcomed, including advice that gives me good reason for avoiding this project altogether...this is a very busy time in my life and if this is not doable, I would rather spend the time on something that is more realistic.

So a less wordy version of the above looks like this:

nanokey2 usbmidi -> teensy3.1 -> serialmidi instrumentshield -> audiochain

and the power considerations ?s

By the way, the instrument shield maxes at 3.7v, thus the lipoly choice.

Thanks for any comments, and please let me know if this should have been posted elsewhere,

Steve
 
Last edited:
This will be more difficult than you realize - there have been some advancements in this area, but I haven't used them so I can't comment on how well they work.

Essentially, the Teensy (right now and 'officially') only works as a USB Device. You need it to act as a USB Host. Furthering that, the USB Host functioning will need to be able to recognize the Nanokey (hopefully it doesn't need drivers) as a MIDI device, and then be able to interpret that USB MIDI data. Basically, Teensy is set up to function as a MIDI Device/USB Device (IE, something you would plug in to your computer). You want it to act like the computer, 'hosting' the nanokey.

https://forum.pjrc.com/threads/28173-Teensy-3-x-NATIVE-USB-HOST-PREVIEW-AVAILABLE is the furthest I've seen someone get on USB Host funcitonality. But, like I said, it likely doesn't have anything built-in for the MIDI portion of what you want to do, which means you'll need to write a bunch of low-level USB buffer code to get anything to work the way you want.
 
Thanks for your quick response, MuShoo. I wondered about the host mode on the teensy, and I had actually considered using something like an arduino pro mini and a usb host shield to do this, but wanted to take advantage of the teensy's computational power, and be able to write a great synth/sequencer program eventually.

I suppose I could hybrid the design and use and arduino and usb host shield to send the midi over to the teensy, do all my processing there and pipe it back out to the audio section, but that's another board and power supply consideration in a pretty crowded case...guy named Colin did this but I think he used an LPK25 controller which has a much larger case.

Next solution might be to just input the key matrix from the nanokey into the teensy and avoid the usbmidi altogether, but that means more midi processing code, wonder which is the better trade off?

Nothing worth doing is easy I hear, and I don't mind "difficult" if it doesn't turn into unmanageable,

Steve
 
A brief visit from Cpt Obvious begs the question as to why I couldn't just use the Teensy itself with one of the USB Host shields? This would possibly allow use of an existing library for communication, eh?

So, nanokey2 to usbhostshield to teensy to midishield to audio chain?
Comments welcomed,
Steve
 
I found this: http://makezine.com/2010/11/30/usbhacking/

So that should... work? I'm not sure. It seems a bit overly complex, to me - your whole collection of bits to get these two particular things talking to each other. I'd think it would be simpler (and probably cheaper!) to find something that already does something similar on it's own.
 
Hi again,
The Kenton usb/midi converter would do it, but is too large and costs upwards of US150, more than 3 times the price of the host shield at its highest listing (and I don't get to learn anything new that way:) The midi instrument shield and audio chain has already been proofed on a standard midi controller, but I'd really like to go smaller, and the smaller midi controllers all seem to be usb based these days.
 
Oh by the way, that site you listed was the one I saw that started this whole thought process, just didn't realize the usbhost functions would be difficult to implement on the teensy - the nanokey2 sends and receives usbmidi msgs, the teensy can send and receive usbmidi msgs, seemed doable at first glance...
 
Status
Not open for further replies.
Back
Top