This package provides a library for creating scripts for the Modulove A-RYTH-MATIK eurorack module.
Full Doxyen generated documentation of the library can be found here: https://awonak.github.io/libModulove/.
Installation instructions
There are two ways to install. Include the library directly in your script repo as a git submodule, or download the latest release zip and extract the library into your ~/Arduino/libraries
folder.
Include the library as a git submodule to use in your scripts.
In order to include the library source code directly in your repo as a git submodule, you must follow the Arduino Sketch specifications and place the code in the location <sketch>/src/<library>
. This is documented in the src subfolder section of the Arduino Sketch Specification.
git submodule add https://github.com/awonak/libmodulove.git <sketch>/src/libmodulove
Download the latest release.
[TODO]
Example usage for A-RYTH-MATIK
#include "src/libmodulove/arythmatik.h"
using namespace modulove;
using namespace arythmatik;
Arythmatik hw;
byte counter = 0;
void setup() {
#ifdef ROTATE_PANEL
hw.config.RotatePanel = true;
#endif
#ifdef REVERSE_ENCODER
hw.config.ReverseEncoder = true;
#endif
hw.Init();
}
void loop() {
hw.ProcessInputs();
if (hw.clk.State() == DigitalInput::STATE_RISING) {
counter = ++counter % OUTPUT_COUNT;
}
if (dir == Encoder::DIRECTION_INCREMENT) {
counter = min(++counter, OUTPUT_COUNT);
} else if (dir == Encoder::DIRECTION_DECREMENT) {
counter = max(--counter, 0);
}
if (press == Encoder::PRESS_SHORT) {
counter = 0;
}
for (int i = 0; i < OUTPUT_COUNT; i++) {
(i == counter)
? hw.outputs[i].High()
: hw.outputs[i].Low();
}
hw.display.clearDisplay();
hw.display.setCursor(SCREEN_HEIGHT/2, 0);
hw.display.println("Counter: " + String(counter));
hw.display.display();
}
PressType
Enum for type of switch press.
Definition: encoder.h:33
Direction
Enum constants for encoder rotation increment/decrement state.
Definition: encoder.h:26
Example usage for SyncLFO
#include "src/libmodulove/arythmatik.h"
using namespace modulove;
using namespace synclfo;
SyncLFO hw;
byte step = 0;
void setup() {
#ifdef SYNCHRONIZER
hw.config.Synchronizer = true;
#endif
hw.Init();
}
void loop() {
hw.ProcessInputs();
hw.ProcessInputs();
bool advance = hw.trig.State() == DigitalInput::STATE_RISING;
if (hw.config.Synchronizer) {
advance |= hw.b1.Change() == Button::CHANGE_PRESSED;
}
if (advance) {
step = (step + 1) % synclfo::P_COUNT;
}
byte val = map(hw.knobs[step]->Read(), 0, MAX_INPUT, 0, MAX_OUTPUT);
hw.output.Update(val);
}
Third-party Arduino Libraries