|
Post by reductionist_earth_catalog on Oct 1, 2023 20:20:38 GMT
Hello everyone! I am very excited about the Wonkystuff MB-1 MIDI interface. I have modified some GRAINS firmwares to be MIDI-controlled, but that relies on a USB connection to a raspberry pi running one instance of ttymidi per connected GRAINS module, which has never felt very elegant. I wanted to add a MIDI input patch socket to my GRAINS so I can just patch from a MIDI channel output on MB-1 right into GRAINS.
Here is a video showing what I did. It is ~8 minutes of me fumbling with crummy tools and laughing at how crude the results are, but it worked. To summarize, I soldered a single patch socket to the serial Rx pin on the ATMEGA on the GRAINS PCB (which is the third pin from the bottom right of the microcontroller). I then cut a small hole in the front-panel to accommodate the patch socket, and hot glued the socket in that hole to try to improve the mechanical stability of the hack. I changed my GRAINS firmware to work at a baud rate of 31250, and set the module to respond to any MIDI channel (since I can select a single channel just by patching from the corresponding output of MB-1). I tested it with the MIDI output pin from a Bastl Microgranny, since I don't have my MB-1 yet. I will probably try to clean up my terrible code a bit, then post a link to a GitHub repo.
(EDIT--I shouldn't recommend doing this, unless you are either ok with potentially ruining your GRAINS, or are sufficiently more technically adept than me, such that you are confident it will work. I imagine this of course voids any warranty that may exist for the module)
|
|
|
Post by duddex on Oct 2, 2023 6:39:15 GMT
Wow! Great! This is AE Modular DYI at its best. This is why I like the AE modular "form factor"
|
|
|
Post by reductionist_earth_catalog on Oct 3, 2023 16:33:33 GMT
Thanks!
Just an update: over on discord, dizzeesatchel pointed out that there is an unused input socket between the bus signals and the A input. So for my other two grains, I’m probably going to try to solder a jumper wire between that pre-existing input pin and the serial rx pin of the microcontroller.
Not totally sure how I’ll do that yet. I guess the easiest way to solder to the input socket is on the reverse side of the board, but then I’ll have to get the jumper wire to the front of the board somehow…
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Oct 3, 2023 17:27:23 GMT
Is there something already connected to the Rx pin? It might be profitable to trace and see if there’s a place on the back of the pcb where it is accessible?
|
|
|
Post by reductionist_earth_catalog on Oct 3, 2023 17:33:36 GMT
Hmm yeah, i imagine it should be connected to the ch340 (or equivalent) that handles USB-serial. When I’m home I can check to see if that trace is accessible on the back of the pcb!
|
|
|
Post by reductionist_earth_catalog on Oct 4, 2023 14:33:23 GMT
I couldn’t find an obvious way to access the trace leading to the rx pin on the back of the board. I think I might try cutting a small wedge off the top left corner of the PCB above the input sockets (outside, with a mask on so as to avoid breathing in fiberglass), and then running a wire through that wedge to connect the fifth input socket to the rx pin. It looks to me like the top left of the pcb is just the ground plane, so hopefully that doesn’t mess anything up. Will probably have to wait until next week!
|
|
|
Post by rodney on Oct 7, 2023 21:53:45 GMT
I like the idea of hijacking a corner of the ground plane by isolating it and using it as a nice big solder point! That has set some wheels in motion in my head ...
|
|
|
Post by reductionist_earth_catalog on Oct 15, 2023 16:36:56 GMT
I was just cutting off the top left corner of the pcb, I would worry that connecting the ground plane to midi input would have some unintended consequences on the module.
I actually connected the 5th input pin to the serial rx pin today using wire. It works. One thing I notice with both the one I hacked today and the one I hacked earlier with the new input socket glued to the front panel is that I get some crackle in the audio whenever a new midi note (or midi cc) is received. You could maybe see it as an additional Lofi texture, but it is definitely noticeable. It is something I don’t hear when I use the usb input. I imagine additional components could be required to limit the crackle, but I’m not sure what those would be.
|
|
|
Post by reductionist_earth_catalog on Oct 15, 2023 19:00:46 GMT
Update: I think I may have fixed the noise by not sending pitch bend from my digitakt! I wi have to play around with it more as I find time.
|
|
|
Post by feijai on Oct 15, 2023 22:58:54 GMT
One possible issue is that you are not opto-isolating your input. MIDI isn't a direct electrical connection from your Digitakt to the Atmel chip. Instead you're expected to run it through an opto-isolator to prevent the sending device (the Digitakt) from affecting the receiving device (the Atmel) with noise or other issues. The circuit diagram can be found on page 2 of the MIDI 1.0 Detailed Specification 4.2 (1995). It's pretty simple to do but you'll need a breadboard. SparkFun has an Optoisolator on a breakout board which should make it easy.
|
|
|
Post by reductionist_earth_catalog on Oct 16, 2023 0:48:55 GMT
I am running the midi connection through the wonkystuff mb-1, which I believe handles the optoisolation, unless I’m mistaken!
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Oct 16, 2023 5:27:24 GMT
I am running the midi connection through the wonkystuff mb-1, which I believe handles the optoisolation, unless I’m mistaken! Yes, that’s correct — the opto isolation is done in the mb/1. It might be that the serial input is running close to the audio line on the grains board? There may need to be some extra decoupling I suppose; looks like I’ll have to try this too
|
|
|
Post by feijai on Oct 16, 2023 12:11:13 GMT
I note that you're having issues when you send pitch bend. Unlike note on/off, which are occasional, pitch bend can send MANY messages very fast (while you're sending it). You may be seeing the problem with pitch bend because it's changing the serial line a lot, creating more noise perhaps?
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Oct 22, 2023 11:58:04 GMT
MIDI is still untested, but: 1) RX pin is connected to the header; 2) GRAINS is not dead; 3) I can still program it over USB. I did a bit of tracing (and looked at the Arduino nano schematic) and found that pin 3 is connected to the junction between D2 and R8, and there’s a handy (thin!) trace on the bottom of the board. Now I just need to work out how to make a MIDI-capable program for it! reductionist_earth_catalog do you have a suitable “ino” file? EDIT: MIDI input also verified Using the code from your github — just had to comment out the setting of serial speed. I'm also hearing noise from the pitch bend messages; so I'm going to see if there is any decoupling I can add to reduce it Attachments:
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Oct 22, 2023 13:15:47 GMT
Update: I think I may have fixed the noise by not sending pitch bend from my digitakt! I wi have to play around with it more as I find time. Ok, so (knowing that GND and Vcc are on the little 6 pin header location on the GRAINS board) I have been applying some more localised decoupling — a 47μF or 100μF capacitor does the trick: Pitch bend noise is greatly reduced (removed? I can’t hear it, but doesn’t mean it’s entirely gone!) by this addition. Obviously this is a temporary addition right now, and I’ll see about finding a better place which does not obscure the 6-pin header. EDIT: Just realised that the picture shows the capacitor in the wrong way round - GND is closest to the camera! Attachments:
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Oct 22, 2023 14:09:09 GMT
Soldered a 100μF capacitor across ’P3’ — data noise is vastly reduced; so I’m going to put it all back together now I just realised that it is possible to do these mods without actually having to remove the faceplate at all, in case that was putting people off 😉 Obvious disclaimer: I take no responsibility for breaking your GRAINS, etc. etc. but it’s going to be interesting playing around with MIDI-fying some GRAINS firmwares (added it to the list of jobs 🤣) Attachments:
|
|
|
Post by reductionist_earth_catalog on Oct 22, 2023 15:24:43 GMT
Amazing that you got the noise down! I’ve been meaning to upload my newer grains ino files to GitHub, will try to do that today to test it out! (I also welcome feedback on my terrible code haha)
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Oct 22, 2023 15:46:54 GMT
Amazing that you got the noise down! I’ve been meaning to upload my newer grains ino files to GitHub, will try to do that today to test it out! (I also welcome feedback on my terrible code haha) If you have any similarly-sized capacitors hanging around then it’s worth a try! I went for the 100μF in the end, just used the first one I found (it’s a little on the large side physically; I expect a 10v rated one would be smaller than the 25v-rated one I had)
|
|
|
Post by reductionist_earth_catalog on Oct 23, 2023 0:02:20 GMT
|
|