-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for hardware midi input #2
Comments
No, you've misunderstood. MIDI.h is for normal serial (5 pin DIN) MIDI. This project uses USB MIDI, not serial MIDI. |
@PaulStoffregen No - this project was designed to use both USB and Serial MIDI on a 5 pin din. Both are on the schematic and board... I'm just finally getting around to implementing it. This issue is for 5 pin DIN. "Hardware MIDI input" |
Oh, ok. Then yup, use MIDI.h. |
@PaulStoffregen - right. Is there a way to specify a different serial port using MIDI.h or do I need to hack the library? The DIN is wired to Serial2, DMX is on Serial1 |
I believe newer versions allow any port to be specified. Teensyduino might be bundling an older version. For a while MIDI.h was broken on Teensy and the new versions added a lot of complexity, so I didn't update. Haven't looked at this for some time... |
@PaulStoffregen I'll have to give it a shot. Do you know if there is midi clock implemented in midi.h? If that's also broken it might just be time to abandon that library imo |
I really do not know. I've not actually use that lib in quite some time. When I have used it, my focus has been mostly on hardware and compatibility testing, not actually making any real MIDI project. |
@PaulStoffregen teensyduino bundles an older version of midi.h? It looks like the current versions must work with the teensy since there are issues that reference it: ex: FortySevenEffects/arduino_midi_library#63 I'm guessing the reason you bundle the older version is just that it's the one you've used and tested? |
@jmej I updated the MIDI2DMX code so hardware (5 pin DIN) MIDI now works, without impact to USB MIDI functionality. Tested via Ableton Live over USB and Elektron Octatrack over DIN MIDI with a 3 channel DMX relay. I added the code you suggested at the outset of this thread, but added this line above the setup code: MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI); With MIDI.h library 4.3, works fine. I can send you the working version to save a minute, & I'd love to see updates to Instructables and Github to save time and add confidence the hardware MIDI port will indeed work (a potential showstopper for some of us) should less experienced builders want to try the MIDI2DMX. It's an awesome device, thank you for the design. |
@sid8580 nice! Can you make a branch and pull request? Re: the hardware midi port. I haven't been able to test it myself because unfortunately the chip I designed it for (the pc900) is discontinued - and I don't have any! Hopefully I'll get around to trying it soon - but I maybe should just rev the PCB to use an in production chip at this point.. What changes do you recommend to the instructables and github? I tried to be as clear as I could figure language-wise involving that chip stuff - but I know it's really confusing. I'm just not sure how to state things more clearly... |
If you rev the PCB for a 6N138 (the best replacement), let's talk about also adding a 5 pin header + an optional USB host connector, and allowing room for Teensy 3.6 to overhang the 28 pins. I'll get you one of those MIDI test boards soon... |
Ok - sounds interesting. Though offhand I'm not sure why USB host would be helpful - do you have an application in mind? |
One request that comes up occasionally is interfacing USB-only MIDI products to stuff that can only receive serial. But there are now lots of great USB-only MIDI products, like Novation Launchpad, which are great for user interfaces to projects. Anyway, please check your email. I have some stuff here with your name on it... just need your current mailing address. |
@jmej - I figured out how to creach a branch/pull request, should be under Hardware MIDI for your review. The Instructables page is fine, all I'd suggest is updating it to reflect the hardware MIDI updates once you feel comfortable. It's technical stuff, can't be made fully idiot proof! I would agree with Paul that adding USB host capability would be very helpful for some. It's got me thinking I'd like to build something to do this (I'm guessing there are plenty of projects already out there to choose from), for my own rig. The need does come up and it could potentially add the ability to route different MIDI signals out of my devices that have both USB and DIN MIDI (reducing the need for external MIDI I/O splitters and whatnot). |
@PaulStoffregen can I use serial1 for midi/din in and DMX out? Or is it better to stick to 2 separate ports for that? |
No, because the baud rates are different. Both pins of the same port run at the same baud rate.
Yes |
Good to know - thanks @PaulStoffregen ! |
I think all this needs is this at the top of midi2dmx.ino:
#include <MIDI.h>
the following inside the setup method:
and this inside the loop:
MIDI.read();
One potential problem:
From reading this: https://www.pjrc.com/teensy/td_libs_MIDI.html
It looks like the library is hard-coded to use the serial port on pins 0 and 1. I used pin 1 for DMX output, and the DIN for MIDI is wired to pin 9 / Serial2
@PaulStoffregen do you know an easy way around that? Probably just hack MIDI.h a little bit?
The text was updated successfully, but these errors were encountered: