-
Hi everybody, i've build a MIDI IN interfaz via optocoupler to connect a keyboard vía tradicional midi cable (schematica below) using GPIO15 (UART RXD). Everything works ok but only if I press one key at a time. If I play chords, just one note is played by Mididexed and if a "note Off" event occurs near another event (in the same message chain) the note continues to playing forever. It seems that MIDI messages chains with more than 3 bytes, for example when I play two notes at the same time or when pitch bender is actioned, are truncated and only the first 3 bytes are proceced and the rest of the message is lost, as I could note on screen activating Midi dumping option. I've tested on Raspberry 1B+ and 2B with the following schematics: |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 22 replies
-
I don't have much success with 6n devices, I tend to use 4n devices, this one works perfectly with a midi keybed playing chords and sequences. |
Beta Was this translation helpful? Give feedback.
-
Here is the 6n138 version that I started with, check the wiring against yours. |
Beta Was this translation helpful? Give feedback.
-
I would suggest changing your resistor values to similar values to the ones used in my 6n138 design. |
Beta Was this translation helpful? Give feedback.
-
Could be helpful as a general MIDI primer in the WIKI section but also how the MIDI hardware circuitry is implemented : |
Beta Was this translation helpful? Give feedback.
-
I just looked at circle on GitHub, it suggests Bluetooth is not even
supported yet.
…On Thu, 28 Apr 2022, 11:19 Luis Correia, ***@***.***> wrote:
I think it can be disabled by not having the relevant DTD file (but I'm
not a Circle expert)
—
Reply to this email directly, view it on GitHub
<#170 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMFJTAKDAJOB3VN5UNOV7K3VHJCYJANCNFSM5UJFVOVQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
FYI, I've added a new section in the WIKI for this |
Beta Was this translation helpful? Give feedback.
-
It makes no difference to me, either will work, I put a 5 way splitter/thru
into my Roland A110 clone using the 74HC14 so I know it works.
…On Thu, 28 Apr 2022, 11:58 Luis Correia, ***@***.***> wrote:
I will, as soon as I'll fire up my Kicad at home with a bit more time.
(but I'll probably do the 74LS14 version, if you don't mind)
as a side note, I'm also designing a midi splitter Eurorack module, from
which all my designs derive.
—
Reply to this email directly, view it on GitHub
<#170 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMFJTAM3ACVIKEVPW43UUHTVHJHMTANCNFSM5UJFVOVQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
From my experience, the 6N138 really "likes" 5V as its VCC, so that could be part of the issue? You might be ok in some cases, depending on the specific part, with 3V3 (I've had some working fine), but other circuits I've seen power the 6N138 with 5V but pull the RX connected output UP to 3V3. I talk about this a bit here: https://diyelectromusic.wordpress.com/2021/02/15/midi-in-for-3-3v-microcontrollers/ Note: I'm not really an electronics person, so treat with caution :) Generally I've had the most success with a H11L1/H11L2 when building MIDI IN circuits for use with 3V3 power levels. This is pretty much the design in the Adafruit MIDI Feather Wing and the Clumsy MIDI interface for the RPi. The Teensy MIDI IN uses a 5V powered, 3V3 RX output 6N138 though IIRC... I'm working on the assuming that pjrc, Adafruit and gmcn42 all know much more than me :) (It might also be worth adding a 100uF capacitor between VCC and GND for the optoisolator too) Could it be that you are getting corrupted/slow MIDI frame sequences that are being decoding in odd ways...? Can you see the MIDI signal in a logic analyser at all? (If you don't have access to a logic analyser to "see" the signal, I built a "pretend" one from an Arduino for similar situations. It should be ok with a 3V3 receive signal as long as the 5V is kept well away from the Pi...? https://diyelectromusic.wordpress.com/2021/06/08/arduino-midi-analyser/) Kevin |
Beta Was this translation helpful? Give feedback.
-
@LuisCorreia As diyelectromusic mentioned, the 6N138 needs 5V on its Vcc (pin 8) . The -.5- 7V are the maximum voltages that you can place from Vcc to GND without damage- not the correct operating voltage. In the spec sheet it shows typical parameters when powered by 4.5-5V. I am using the 6N138 with MiniDexed and it works fine (and I've used them many times in the past for MIDI IN ciircuits- on 5V). The 2.2k resistor is probably OK, but its better to use 1k as that results in slightly faster switching speed. The 2.2k pull up resistor does have to go to the 3.3V supply, for sure. |
Beta Was this translation helpful? Give feedback.
-
@ditelectronics. The company that made the 6N138's that I used in the past, and have on-hand (HP) no longer make them. But, take Everlight, who currently sell them. Here is a link to the datasheet |
Beta Was this translation helpful? Give feedback.
-
I do electronics, analog and digital for more then 30 years now (yes, I'm old) For this case I could be that a VCC of only 2V would be enough for the circuit to work VCC is only providing a weak positive polarization to the photo-sensitive transistor, and as soon as light hits the "base die", it will conduct and make the output transistor pull down the RX line. Think what you will, my 6N139 optocouplers were bought from tme.eu about 3 years ago, all of them are new stock |
Beta Was this translation helpful? Give feedback.
-
Hi everybody, I've insert some printf on the code of serialmididevice.cpp to monitors what it is happends. I've found an extrange (until today for me) situation, when I play two or more notes at the same time my keyboard (early nineties Roland JV80) just the first note that it send has the "status byte", but the rest of the notes pressed just send the second and the third byte. This is not a faulty. In order to minimize latency, some controllers send the status byte and then a string of pair of bytes containing all data information. Most of modern USB modern interfaces "filters" this and complete the three byte message. You can read about this on this article. @probonopd in order to handle this is necessary to evaluate the 4th byte and determinate if it's a Status Byte or a Data Byte. This is supposed that happens on Process() method of serialmididevice.cpp class. I below I've attached the code with my suggested additions (sorry I'm not a professional programmer... ). I've tested on a custom built and finally everything works ok! On the other hand, it is important to say that all of the schematics discussed here are Ok, I've tested almost all. Meybe some are better than others but I've choose the 4n35 versión of @craigyjp Here the modified Process() method of serialmididevice.cpp class:
|
Beta Was this translation helpful? Give feedback.
-
Oh, MIDI Running Status. I've seen that bite a few midi projects. |
Beta Was this translation helpful? Give feedback.
Hi everybody, I've insert some printf on the code of serialmididevice.cpp to monitors what it is happends. I've found an extrange (until today for me) situation, when I play two or more notes at the same time my keyboard (early nineties Roland JV80) just the first note that it send has the "status byte", but the rest of the notes pressed just send the second and the third byte. This is not a faulty. In order to minimize latency, some controllers send the status byte and then a string of pair of bytes containing all data information. Most of modern USB modern interfaces "filters" this and complete the three byte message. You can read about this on this article.
@probonopd in order to handl…