Giter Site home page Giter Site logo

cow77 / clumsymidi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gmcn42/clumsymidi

0.0 1.0 0.0 14.31 MB

A THT-only Raspberry Pi expansion board containing a MIDI interface, DAC, and OLED display

License: Creative Commons Attribution Share Alike 4.0 International

clumsymidi's Introduction

clumsyMIDI

A Raspberry Pi expansion board containing a MIDI interface, DAC, and OLED display requiring only through-hole soldering skills. This is primarily intended as an all-in-one hardware solution for the mt32-pi Roland MT-32 emulator but all features are usable with Raspberry Pi OS, too.

Features

  • TI PCM5102 I2S HiFi DAC (using the ubiquitous GY-PCM5102 carrier board)
  • GPIO MIDI interface with in, out, and thru
  • 0.91" OLED display
  • large-ish 5V bypass capacitor which may help with slightly weak power supplies
  • works with mt32-pi and Raspberry Pi OS
  • no SMT soldering required, so it should be suitable for clumsy DIYers like me ;)

Schematic and BOM

Schematic and BOM are available in the pdf/ subfolder.

How to get the PCB

You can get a zip file with the Gerber files from the releases page and let your favorite board house build the PCB. Alternatively, you can also order directly from PCBWAY via this link for convenience. Full disclosure: If you use the link, PCBWAY will donate 10% of the PCB price to me. I want to make clear that the PCB design is completely free and you are in no way obligated or even encouraged to use that link.

In case you want to make changes to the PCB before ordering somewhere, you can use KiCAD and import the project.

PCB Specs

  • PCB size (height * width): 56mm * 65mm

  • Layers: 2

  • Minimum drill size: 0.6mm

  • Minimum track size: 0.25mm (=9.84mil)

  • Minimum track clearance/spacing: 0.25mm (=9.84mil)

  • Surface finish: by preference (the pictured boards are lead-free HASL but pretty much anything will do)

Assembly

As all components are through-hole, you should get by with basic soldering skills. It is usually the best idea to start with the flattest components and work your way up. The 40-Pin GPIO socket should be soldered on last, also remember that it goes on the bottom :).

As shown in the BOM, I recommend socketing U1 and U2 as they are the most likely casualties if defective MIDI devices are connected for some reason. Be mindful of the ICs' orientation. The notch of the 74HCT14 should be where the notch is on the silkscreen. Likewise, the H11L1's dot (marking for Pin 1) should also face the in the direction of the notch on the silkscreen. If inserted correctly, U1 and U2 will "face outward and away from each other".

It is possible to leave out some components, e.g. if you only need MIDI-In. Consult the schematic for details.

In standard configuration, the MIDI Thru output is available on a 5-pin header due to space constraints. If you do not need MIDI Out but want a MIDI Thru, it is possible to route the Thru signal to the MIDI-Out socket instead of the pin header. In that case, leave J4, R1, and R5 unpopulated and solder a wire between the footprint pads of J4 and R1 marked with a circle on the silkscreen, as shown in these two pictures (click for larger version):

Be sure to use some kind of standoffs or similar when connecting clumsyMIDI to the PI. Without them, the board may sit lopsided and come in contact with the HDMI port, potentially causing a short circuit. Apart from that, it's more mechanically stable and simply looks nicer :). The BOM contains the brass standoffs I am using in the pictures.

A final general note: Use caution and common sense while working with electronics, especially while soldering stuff. As stated in the license, I am offering this PCB design as-is incuding any and all defects it may have and will not be held liable for any harm that comes to you or others as a result of using/building/looking at it.

Software Config

mt32-pi

Follow the setup instructions on their site and then set the following options in mt32-pi.cfg:

usb = off
output_device = i2s
type = ssd1306_i2c

The option gpio_thru will also work with the MIDI Out port on clumsyMIDI, so use at your preference.

Raspberry Pi OS

You need to add the following to /boot/config.txt to get GPIO MIDI, I2S DAC, and I2C support

enable_uart=1
dtoverlay=pi3-miniuart-bt
dtoverlay=midi-uart0

dtparam=i2s=on
dtoverlay=hifiberry-dac

dtparam=i2c_arm=on,i2c_arm_baudrate=400000

Also you need to comment out or remove the line dtparam=audio=on

Additionally for I2C support, add the following line to /etc/modules:

i2c-dev

To get regular ALSA MIDI support you need to bridge /dev/ttyAMA0 and an ALSA MIDI port. You can do this with ttymidi. Once you have it compiled and installed, run the following in a terminal:

sudo ttymidi -s /dev/ttyAMA0 -b 38400

If you are asking yourself why it needs to be set to 38400 Baud: The line dtoverlay=midi-uart0 causes the Pi's UART base clock to be slightly lowered, so that 38400 (a common RS232 baud rate) effectively becomes 31250 Baud which is MIDI-compatible.

Now you when you run aconnect -l in another terminal, you should see a new MIDI client, something similar to

client 128: 'ttymidi' [type=user,pid=920]
    0 'MIDI out     '
    1 'MIDI in      '

Somewhat confusingly, the out/in naming is reversed because it is from the perspective of ttymidi. That means 'MIDI in' is what it receives from another application and then forwards to the UART. So if you want to play something on a synth connected to the clumsyMIDI's output, the correct command will be

aplaymidi -p 128:1 somefile.mid

The I2C display is supported by the Adafruit SSD1306 Python library, among others.

Have fun!

clumsyMIDI ©2020 by Andreas Zdziarstek.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
CC BY-SA 4.0

clumsymidi's People

Contributors

gmcn42 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.