Skip to the content
2 layersMegamidimerge, the printed circuit board in 3D

MEGAMIDI MERGE, MEGABOY MIDI

Copper layers
2
Thickness
1.6 mm
Parts
39
Nets
40
Pads
119
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 7 (file 20221018)
Created
6 Nov 2024
Updated
15 Nov 2024

Overview

Megamidimerge is an open-source printed circuit board by rusaakkmods, from the rusaakkmods/megamidimerge repository on GitHub, published under the GPL-2.0 licence. It is a 2-layer board with 39 parts on 40 nets.

Its parts include 12 connectors, 10 resistors, 7 capacitors, 6 diodes and 2 ICs. It belongs with the audio and music boards of this library.

README

README.md

rusaaKKMODS Megamidi Merge

This project is designed to merge MIDI input from multiple sources, calculate beats per minute (BPM), and update clock resolution as needed.

Overview


1. Main Ideas and Initial Concepts

  • The core idea is to build a MIDI merge device that merges MIDI data from two inputs and outputs through multiple channels. This device also manages a clock signal, providing precise timing and synchronization to connected MIDI equipment.
  • Key features include:
    • Master Clock Selection: An SPDT switch allows for selecting the master MIDI clock source.
    • Analog Clock Output: Synchronized with the MIDI clock for external device control.
    • Adjustable Clock Pulse Resolution: Allows for user control over the clock pulse-per-quarter note (PPQN).
    • OLED Display: Displays BPM, clock rate, and other useful information.
  • The Arduino MEGA 2560 Pro is used as the primary microcontroller for its multiple I/O pins and capability to handle complex MIDI merging tasks.

2. MIDI Circuitry and Clock Management

  • MIDI Input Circuit: The design incorporates optocouplers (6N137) for proper isolation, ensuring safe handling of incoming MIDI signals without electrical interference.
  • MIDI Thru and Output Circuits: Designed to accurately route MIDI signals from the Arduino to multiple MIDI outputs while ensuring protection through the use of resistors and diodes.
  • Clock Signal Shaping: Implemented using the 74HC14 Schmitt Trigger IC to clean up the clock pulses, thereby eliminating noise and providing a stable MIDI clock output.

3. Design Considerations for Protection and Filtering

  • Surge and Reverse Polarity Protection: 1N5819 Schottky diodes were added to protect the power inputs and MIDI signal lines from voltage surges and reverse polarity.
  • Filtering Capacitors: Various capacitors were incorporated in critical areas of the circuit:
    • Clock Output Filtering: Added to stabilize the clock signal for connected MIDI devices.
    • Power Line Filtering: Used to reduce noise and maintain stability near sensitive components like optocouplers.
  • Pull-Up and Pull-Down Resistors: Selected to maintain correct voltage levels for signal detection and to stabilize the digital lines.

4. Code and Software Development

  • Clock Signal Generation: Initially, PWM was considered for generating the clock pulses; however, it was recognized that using Timer1 would provide more precise and consistent timing, addressing the inaccuracies inherent in PWM.
  • MIDI Input Handling: The code was structured to receive MIDI messages in MIDI_CHANNEL_OMNI mode, allowing the device to respond to any channel.
  • Set Handle Message Method: A method was included for handling incoming MIDI messages effectively. We also discussed the possibility of detaching or optimizing this function to improve code modularity.

5. Recent Improvements and Iterations

  • Clock Output Circuit Update: Recently, capacitors (C14, C15) were added to the clock output stage for further noise filtering, ensuring that the clock output is stable and clean.
  • Component Value Review: Detailed reviews of resistor and capacitor values were conducted, focusing on ensuring that timing and pulse characteristics meet the requirements of the MIDI specification.
  • Decoupling Capacitors: It was suggested to add decoupling capacitors near the 74HC14 IC to minimize the impact of power line noise, which could interfere with pulse stability.

6. Project Progress and Future Considerations

  • Progress Overview:
    • The hardware components, including input and output circuits, power protection, clock signal conditioning, and user interface, have been prototyped and tested.
    • Software functionality for merging MIDI inputs, controlling clock output, and handling MIDI messages is well underway, with a focus on improving timing precision.
  • Upcoming Improvements:
    • Implementing Timer1 for clock generation to replace PWM and improve clock signal accuracy.
    • Testing the RC filter networks to ensure no unintended delays or signal issues affect the precision of the MIDI clock output.
    • Modularizing the code for better readability and maintenance, potentially splitting the MIDI handling, clock generation, and display functions into separate, reusable modules.

Overall, the project has transformed from an initial concept into a sophisticated MIDI merging and clock management device. The integration of effective isolation, filtering, and protection measures—along with clean clock signal generation—has ensured reliable operation and precise MIDI timing. Moving forward, the focus will be on refining timing accuracy, enhancing modularity in the code, and finalizing the design for stability and usability in practical scenarios.

Features


  • Merges MIDI input from two sources (MIDI-1 and MIDI-2)
  • Calculates BPM from MIDI clock messages
  • Updates clock resolution based on user input
  • Displays current BPM, clock resolution, and master clock source on an OLED display

Dependencies


  • Arduino library (for millis() and digitalRead() functions)
  • MIDI library (for MIDI input and output handling)

Hardware Requirements


  • Arduino board with MEGA 2560
  • MIDI input and output interfaces
  • Toggle Switch to select Master
  • OLED display
  • Knob for changing clock resolution

Usage


  1. Upload the sketch to the Arduino board.
  2. Connect the MIDI input and output interfaces to the board.
  3. Connect the OLED display to the board.
  4. Toggle to select master MIDI.
  5. Plug Clock Out to your Clock In Synth.
  6. Rotate Knob to select Clock Rate.

Parts

39
QtyValueFootprintReferences
410nFCapacitor_THT:C_Rect_L7.2mm_W2.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2C4, C5, C6, C7
41N5819Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1, D2, D3, D4
4220RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R3, R5, R6
44.7KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2, R4, R9, R10
20.1uFCapacitor_THT:C_Rect_L7.2mm_W2.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2C1, C2
210KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7, R8
22N2222Package_TO_SOT_THT:TO-92L_Inline_WideQ1, Q2
25.1VDiode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD5, D6
26N137Package_DIP:DIP-8_W7.62mmU2, U3
110uFCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC3
1CLOCK OUT 1Connector_JST:JST_EH_B2B-EH-A_1x02_P2.50mm_VerticalJ5
1CLOCK OUT 2Connector_JST:JST_EH_B2B-EH-A_1x02_P2.50mm_VerticalJ6
1DCConnector_JST:JST_EH_B2B-EH-A_1x02_P2.50mm_VerticalJ13
1LCDConnector_JST:JST_EH_B4B-EH-A_1x04_P2.50mm_VerticalJ11
1LEFTConnector_PinHeader_2.54mm:PinHeader_1x12_P2.54mm_VerticalJ8
1MIDI IN 1Connector_JST:JST_EH_B3B-EH-A_1x03_P2.50mm_VerticalJ1
1MIDI IN 2Connector_JST:JST_EH_B3B-EH-A_1x03_P2.50mm_VerticalJ2
1MIDI OUT 1Connector_JST:JST_EH_B3B-EH-A_1x03_P2.50mm_VerticalJ3
1MIDI OUT 2Connector_JST:JST_EH_B3B-EH-A_1x03_P2.50mm_VerticalJ4
1RESOLUTIONConnector_JST:JST_EH_B2B-EH-A_1x02_P2.50mm_VerticalJ12
1RIGHTConnector_PinHeader_2.54mm:PinHeader_1x12_P2.54mm_VerticalJ9
1SWITCH MASTERConnector_JST:JST_EH_B3B-EH-A_1x03_P2.50mm_VerticalJ10

Similar boards

  • 2 layers24.4 × 24.4 mmOSO SWAT B1, the printed circuit board in 3D

    OSO SWAT B1

    joeycastillo/Sensor-Watch

    A board replacement for the classic Casio F-91W wristwatch

    39 parts2.1k
  • 2 layers33 × 26 mmVL53L1x pwm, the printed circuit board in 3D

    VL53L1x pwm

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    39 parts915
  • 2 layers43.4 × 18.8 mmUsb sniffer lite, the printed circuit board in 3D

    Usb sniffer lite

    ataradov/usb-sniffer-lite

    A simple USB sniffer based on Raspberry Pi RP2040

    39 parts706BSD-3-Clause
  • 2 layers40 × 20 mmESP8266, the printed circuit board in 3D

    ESP8266

    windowsair/wireless-esp8266-dap

    CMSIS-DAP compatible wireless debugger for ESP8266/ESP32/ESP32C3/ESP32S3. Optional 40MHz SPI acceleration, etc. 适配多种ESP芯片的无线调试器

    39 parts690MIT
  • 2 layers100 × 70.3 mmModulAdapterMagnet, the printed circuit board in 3D

    ModulAdapterMagnet

    GaudiLabs/OpenDrop

    Open Source Digital Microfluidics Bio Lab

    39 parts492GPL-3.0
  • 2 layers81.3 × 53.3 mmRGB LED 1.4, the printed circuit board in 3D

    RGB LED 1.4

    lachlanA/eagle-to-kicad

    Eagle SCH/LIB to KiCad SCH/LIB ULP conversion script

    39 parts429GPL-2.0
  • 2 layers65.7 × 44.8 mmDock, the printed circuit board in 3D

    Dock

    mackieks/Kawaii

    Tiny, beautiful metal Wii keychain

    39 parts374

Questions

What parts does the Megamidimerge use?

39 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Megamidimerge KiCad files?

From the rusaakkmods/megamidimerge repository on GitHub, at the commit this page was made from: the board is schematics/megamidimerge/megamidimerge.kicad_pcb and its schematic schematics/megamidimerge/megamidimerge.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Megamidimerge design in my own project?

Its repository publishes it under the GPL-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).