This demultiplexer is used to work which a lot of drum modules (I have). The pulse length is 2 ms.
The demultiplexer itself contains of a 2D-matrix (octaves and notes) for each key realized by some logic ICs; each note has a pulse enlarger - the Arduino has only a short time (I choosed 100 us) to put a puls out while one MIDI byte is transfered (280 us per byte at 31.25 kbps). Details are visible in the schematic. Only Note-ON is used. In the code are the flat wire numbers and binary values for each key shown; I call it 'keybyte': lower nibble for 12 notes but no X000 and X111, upper nibble for octave, maybe bit 7 as flag.
the additional clock interface i need for clocked devices like beat boxes and 6 outs for decay envelopes.
EXPANDED TECHNICAL DETAILS
MIDI Signal Processing
The Arduino Nano acts as the high-speed gateway for the MIDI interface. Standard MIDI operates at 31,250 baud, where each message consists of 3 bytes (Status, Data1, Data2). The firmware listens for Note-ON events and ignores Note-OFF or CC messages to maximize performance.
- Timing Constraints: A single MIDI byte takes 320µs to transmit. To avoid missing incoming data, the trigger pulse output is limited to a very short duration (100µs), which is then expanded by external monostable multivibrators or pulse enlarger circuits to a usable 2ms trigger for drum modules.
2D-Matrix Demultiplexing
To handle up to 96 notes (8 octaves) from a single Arduino, the project utilizes a 2D-Matrix logic system.
- Octave Selection: Binary values sent to logic ICs select one of 8 octave planes.
- Note Selection: Logic gates decode the note within the selected octave.
- Decay Envelopes: 6 specialized outputs are dedicated to triggering analog envelope generators, allowing for the classic "decay" sound found in drum synthesizers.
Synchronization
The implementation includes a MIDI Clock interface. It listens for the 0xF8 (Timing Clock) byte to provide a stable trigger for external sequencers or hardware beat boxes, ensuring the entire analog modular rack stays in sync with the digital host.