Loading files…
The MIDI-DMX Bridge is an Arduino-based hardware and software solution that converts MIDI Continuous Controller signals to DMX commands. The project consists of a hardware schematic and PCB designed using KiCad, an Arduino sketch, and an Arduino library. It can be used to control DMX fixtures such as lights, fog machines, and more.
The MIDI-DMX Bridge Arduino project is designed to seamlessly integrate with the lighting fixtures Stairville CLB4 RGB Compact LED Bar 4 and two Stairville LED Flood Panel 150. Here's how the bridge supports these fixtures:
Stairville CLB4 RGB Compact LED Bar 4:
Stairville LED Flood Panel 150:
Remember to consult the user manuals for both fixtures to configure the MIDI-DMX Bridge effectively. Enjoy your creative lighting setups! 🌟
The hardware schematic for this project was designed using KiCad. The schematic includes the following components:
The DMX circuit is based on the DMX shield from Matthias Hertel, see DMX Shield for Arduino with isolation.
The hardware design focuses on efficiency and space-saving. The compact printed circuit board (PCB) houses all essential components, including the Arduino ProMini microcontroller, MIDI interface, and DMX driver.
The PCB has the following features:
The PCB layout and the circuit diagram as a 3D simulation, before and after final assembly, are shown below:
The PCB can be ordered from any PCB manufacturer that supports the KiCad format. Alternatively, the Interactive BOM tool can help with the assembly of the PCB.
The PCB shown was manufactured by JLCPCB, the production data can be found in kicad\production as a reference.
The Arduino sketch for this project is responsible for processing the incoming MIDI signals and generating DMX commands. The sketch uses its own implementation to receive MIDI signals and the DMXSerial Library to send DMX commands.
#include <DMXSerial.h>
#include <MidiDmxBridge.h>
static void onDmxChange(const uint8_t channel, const uint8_t value) {
DMXSerial.write(channel, value);
}
static SerialReaderDefault reader;
static MidiDmxBridge MDXBridge(kMidiChannel, onDmxChange, reader);
void setup() {
DMXSerial.init(DMXController);
MDXBridge.begin();
}
void loop() {
MDXBridge.setAttenuation(analogRead(kSensorPin));
MDXBridge.listen();
}
For the complete Arduino sketch, please refer to arduino-MidiDmxBridge.ino.
The Arduino library for this project is a custom library that provides additional functionality for processing MIDI signals and generating DMX commands. It is also available as MidiDmxBridge via the Arduino Library manager. The library includes the following functions:
void begin(): This function processes initializes the library.void setStaticScene(const DmxRgbChannels& channels, const DmxRgb& rgb): This function defines the DMX static scenevoid setAttenuation(const uint16_t attenuation): This function switches to the MIDI controlled dynamic scene.void switchToDynamicScene(): This function sets the attenuation of the generated DMX signal.void switchToStaticScene(): This function switches to the predefined static scene.void listen(): This function listens on the serial interface for the next MIDI CC value and updates the DMX state.class MidiDmxBridge {
public:
MidiDmxBridge(const uint8_t channel, DmxOnChangeCallback callback, ISerialReader& serial);
void begin();
void setStaticScene(const DmxRgbChannels& channels, const DmxRgb& rgb);
void setAttenuation(const uint16_t attenuation);
void switchToDynamicScene();
void switchToStaticScene();
void listen();
};
For the complete API, please refer to MidiDmxBridge.h.
The Arduino library is developed in C++ and uses CMake for configuration. The library is tested using gtest and documented using Doxygen.
cmake -S ./src/arduino-library/ -B ./build
cmake --build ./build
ctest --test-dir ./build/
On Linux OS code coverage using lcov and gcov is available:
cmake -DENABLE_COVERAGE=ON -S ./src/arduino-library/ -B ./build
cmake --build ./build
ctest --test-dir ./build/
cmake --build ./build --target coverage
The software documentation can then be accessed at ./build/html/index.html, the code coverage results at ./build/coverage/index.html.
To run codespell, you need to have Python 3 installed on your system. You can install Python 3 from the official website: https://www.python.org/downloads/.
Once you have Python 3 installed, you can install codespell using pip, the Python package manager. Open a terminal or command prompt and type the following command:
pip install codespell
This will install codespell and all its dependencies.
To run codespell, navigate to the root directory of your project in the terminal or command prompt and type the following command:
codespell
This will run codespell on all the files in the current directory and its subdirectories. codespell will check for common misspellings and suggest corrections. You can use the -w option to write the changes directly to the files.
codespell -w
For more information on how to use codespell, including a list of all the available options, please refer to the official documentation: https://github.com/codespell-project/codespell#usage.
CPack is a powerful tool that allows to create binary installers and source packages. To generate a source code release package, use the following commands:
cd ./build
cpack --config CPackSourceConfig.cmake
This will create a source package in the CMake build directory.
This project provides a simple and effective solution for converting MIDI Continuous Controller signals to DMX commands. The hardware schematic, Arduino sketch, and Arduino library can be easily modified to suit your specific needs. If you have any questions or comments about this project, please feel free to contact me.
This library and the PCB design are released under the Apache V2.0 License. See LICENSE for more information.
Please let me know if you have any questions or feedback. I'm happy to help! 😊🎵
No comments yet. Be the first to ask about this board.