Skip to content

This Arduino library translates MIDI Continuous Controller signals to DMX commands. The library includes features such as DMX attenuation and the handling of static and dynamic scenes. It can be used to control DMX fixtures such as lights, fog machines, and more.

License

Notifications You must be signed in to change notification settings

chrisneukam/MidiDmxBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIDI-DMX Bridge Arduino library

Arduino Checks Spell Check License

This library allows you to translate MIDI Continuous Controller signals received at a user-defined channel into DMX commands. The library is compatible with Arduino boards and can be used to control DMX fixtures such as lights, fog machines, and more.

Installation

  1. Download the latest version of the library from the GitHub repository.
  2. Extract the ZIP file and copy the folder to your Arduino libraries directory.
  3. Restart the Arduino IDE.

Usage

  1. Include the library in your Arduino sketch by adding the following line at the beginning of your code:
#include <MidiDmxBridge.h>
  1. Define the callback method mididmxbridge::dmx::DmxOnChangeCallback with the signature (const uint8_t, const uint8_t), which receives the DMX updates:
static void onDmxChange(const uint8_t channel, const uint8_t value) {
}
  1. Instantiate a MidiDmxBridge and mididmxbridge::ISerialReader object in you sketch:
static SerialReaderDefault reader;
static MidiDmxBridge MDXBridge(kMidiChannel, onDmxChange, reader);
  1. Initialize the library by calling the begin() function in the setup() function of your sketch:
void setup() {
  MDXBridge.begin();
}
  1. In the loop() function of your sketch, call the listen() function to listen to incoming MIDI messages and translate them into DMX commands:
void loop() {
  MDXBridge.listen();
}
  1. Use the setAttenuation() function to adjust the intensity of the dynamic and static scenes:
MDXBridge.setAttenuation(512);
  1. Use the switchToDynamicScene() function to switch to the dynamic scene:
MDXBridge.switchToDynamicScene();
  1. Use the switchToStaticScene() function to switch to the static scene:
MDXBridge.switchToStaticScene();

Example

Here's an example sketch that uses the library to control a DMX light fixture listening on MIDI channel 1 and using pins 3 and 4 for MIDI IO:

#include <MidiDmxBridge.h>

static void onDmxChange(const uint8_t channel, const uint8_t value) {}

static SerialReaderDefault reader(3, 4);
static MidiDmxBridge MDXBridge(1, onDmxChange, reader);

void setup() {
  MIDI_DMX.begin();
  MDXBridge.setStaticScene();

}

void loop() {
  MDXBridge.setAttenuation(512);
  MDXBridge.listen();
  MDXBridge.switchToStaticScene();
  delay(1000);
  MDXBridge.switchToDynamicScene();
  delay(1000);
}

License

This library is 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! 😊

About

This Arduino library translates MIDI Continuous Controller signals to DMX commands. The library includes features such as DMX attenuation and the handling of static and dynamic scenes. It can be used to control DMX fixtures such as lights, fog machines, and more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages