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
Option 1: Arduino CLI
The recommended way to install the library is to use the Arduino CLI to download the library code directly from GitHub.
$ arduino-cli config init
$ arduino-cli config set library.enable_unsafe_install true
$ arduino-cli lib install --git-url https://github.com/awonak/libModulove.git
Option 2: Clone and symlink the repo
$ git clone https://github.com/awonak/libModulove.git
$ ln -s `pwd`/libmodulove ~/Arduino/libraries
Option 3: 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
Example usage for A-RYTH-MATIK
#include "src/libmodulove/arythmatik.h"
using namespace modulove;
using namespace arythmatik;
volatile int counter;
void setup() {
#ifdef ROTATE_PANEL
hw.config.RotatePanel = true;
#endif
#ifdef ENCODER_REVERSED
hw.config.ReverseEncoder = true;
#endif
hw.
eb.setEncoderHandler(UpdateRotate);
hw.
eb.setClickHandler(UpdatePress);
hw.AttachResetHandler(HandleResetPinChange);
}
void loop() {
for (int i = 0; i < OUTPUT_COUNT; i++) {
(i == counter)
}
hw.
display.setCursor(SCREEN_HEIGHT/2, 0);
hw.
display.println(
"Counter: " + String(counter));
}
void HandleClockPinChange() {
counter = ++counter % OUTPUT_COUNT;
}
}
void HandleResetPinChange() {
counter = 0;
}
}
void UpdateRotate(EncoderButton &eb) {
int rotate_count = eb.increment();
counter = (dir == DIRECTION_INCREMENT)
? min(counter + rotate_count, OUTPUT_COUNT)
: max(counter - rotate_count, 0);
}
void UpdatePress(EncoderButton &eb) {
counter = 0;
}
Hardware abstraction wrapper for A-RYTH-MATIK module.
Definition arythmatik.h:22
void AttachClockHandler(void(*callback)(void))
Pin change handlers.
Definition arythmatik.cpp:67
DigitalInput rst
RST Digital Input object.
Definition arythmatik.h:55
DigitalOutput outputs[arythmatik::OUTPUT_COUNT]
Definition arythmatik.h:52
EncoderButton eb
EncoderButton object.
Definition arythmatik.h:51
arythmatik::Direction EncoderDirection()
Parse the configured EncoderButton increment direction.
Definition arythmatik.cpp:107
void Init()
Initializes the Arduino, and A-RYTH-MATIK hardware.
Definition arythmatik.cpp:22
DigitalInput clk
CLK Digital Input object.
Definition arythmatik.h:54
void ProcessInputs()
Read the state of the CLK and RST inputs.
Definition arythmatik.cpp:94
Adafruit_SSD1306 display
OLED display object.
Definition arythmatik.h:50
void High()
Sets the cv output HIGH to about 5v.
Definition digital_output.h:54
void Low()
Sets the cv output LOW to 0v.
Definition digital_output.h:57
Direction
Enum constants for encoder rotation increment/decrement state.
Definition encoder_dir.h:18
Example usage for SyncLFO
#include "src/libmodulove/arythmatik.h"
using namespace modulove;
using namespace synclfo;
byte step = 0;
void setup() {
#ifdef SYNCHRONIZER
hw.config.Synchronizer = true;
#endif
}
void loop() {
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);
}
void Update(int val)
Set the output pin to the given 8 bit value.
Definition analog_output.h:51
Hardware abstraction wrapper for SyncLFO module.
Definition synclfo.h:18
void ProcessInputs()
Read the state of the CLK and RST inputs.
Definition synclfo.cpp:49
void Init()
Initializes the Arduino, and SyncLFO hardware.
Definition synclfo.cpp:17
Third-party Arduino Libraries