formatting
This commit is contained in:
2
clock.h
2
clock.h
@ -13,9 +13,9 @@
|
|||||||
#define CLOCK_H
|
#define CLOCK_H
|
||||||
|
|
||||||
#include <NeoHWSerial.h>
|
#include <NeoHWSerial.h>
|
||||||
#include "uClock.h"
|
|
||||||
|
|
||||||
#include "peripherials.h"
|
#include "peripherials.h"
|
||||||
|
#include "uClock.h"
|
||||||
|
|
||||||
// MIDI clock, start, stop, and continue byte definitions - based on MIDI 1.0 Standards.
|
// MIDI clock, start, stop, and continue byte definitions - based on MIDI 1.0 Standards.
|
||||||
#define MIDI_CLOCK 0xF8
|
#define MIDI_CLOCK 0xF8
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <gravity.h>
|
#include <gravity.h>
|
||||||
|
|
||||||
#include "euclidean.h"
|
#include "euclidean.h"
|
||||||
|
|
||||||
// Enums for CV configuration
|
// Enums for CV configuration
|
||||||
@ -66,7 +67,7 @@ class Channel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setProbability(int prob) {
|
void setProbability(int prob) {
|
||||||
base_probability = constrain(prob, 0, 100);
|
base_probability = constrain(prob, 0, 100);
|
||||||
if (!isCvModActive()) {
|
if (!isCvModActive()) {
|
||||||
cvmod_probability = base_probability;
|
cvmod_probability = base_probability;
|
||||||
@ -74,20 +75,20 @@ class Channel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setDutyCycle(int duty) {
|
void setDutyCycle(int duty) {
|
||||||
base_duty_cycle = constrain(duty, 1, 99);
|
base_duty_cycle = constrain(duty, 1, 99);
|
||||||
if (!isCvModActive()) {
|
if (!isCvModActive()) {
|
||||||
cvmod_duty_cycle = base_duty_cycle;
|
cvmod_duty_cycle = base_duty_cycle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOffset(int off) {
|
void setOffset(int off) {
|
||||||
base_offset = constrain(off, 0, 99);
|
base_offset = constrain(off, 0, 99);
|
||||||
if (!isCvModActive()) {
|
if (!isCvModActive()) {
|
||||||
cvmod_offset = base_offset;
|
cvmod_offset = base_offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void setSwing(int val) {
|
void setSwing(int val) {
|
||||||
base_swing = constrain(val, 50, 95);
|
base_swing = constrain(val, 50, 95);
|
||||||
if (!isCvModActive()) {
|
if (!isCvModActive()) {
|
||||||
cvmod_swing = base_swing;
|
cvmod_swing = base_swing;
|
||||||
}
|
}
|
||||||
@ -141,12 +142,12 @@ class Channel {
|
|||||||
bool hit = cvmod_probability >= random(0, 100);
|
bool hit = cvmod_probability >= random(0, 100);
|
||||||
// Euclidean rhythm check
|
// Euclidean rhythm check
|
||||||
switch (pattern.NextStep()) {
|
switch (pattern.NextStep()) {
|
||||||
case Pattern::REST: // Rest when active or fall back to probability
|
case Pattern::REST: // Rest when active or fall back to probability
|
||||||
hit = false;
|
hit = false;
|
||||||
break;
|
break;
|
||||||
case Pattern::HIT: // Hit if probability is true
|
case Pattern::HIT: // Hit if probability is true
|
||||||
hit &= true;
|
hit &= true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (hit) {
|
if (hit) {
|
||||||
output.High();
|
output.High();
|
||||||
@ -192,11 +193,11 @@ class Channel {
|
|||||||
(cv_destination == CV_DEST_SWING)
|
(cv_destination == CV_DEST_SWING)
|
||||||
? constrain(base_swing + map(value, -512, 512, -25, 25), 50, 95)
|
? constrain(base_swing + map(value, -512, 512, -25, 25), 50, 95)
|
||||||
: base_swing;
|
: base_swing;
|
||||||
|
|
||||||
if (cv_destination == CV_DEST_EUC_STEPS) {
|
if (cv_destination == CV_DEST_EUC_STEPS) {
|
||||||
pattern.SetSteps(map(value, -512, 512, 0, MAX_PATTERN_LEN));
|
pattern.SetSteps(map(value, -512, 512, 0, MAX_PATTERN_LEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cv_destination == CV_DEST_EUC_HITS) {
|
if (cv_destination == CV_DEST_EUC_HITS) {
|
||||||
pattern.SetHits(map(value, -512, 512, 0, pattern.GetSteps()));
|
pattern.SetHits(map(value, -512, 512, 0, pattern.GetSteps()));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -346,7 +346,7 @@ void DisplayChannelPage() {
|
|||||||
|
|
||||||
// Draw Channel Page menu items
|
// Draw Channel Page menu items
|
||||||
String menu_items[PARAM_CH_LAST] = {
|
String menu_items[PARAM_CH_LAST] = {
|
||||||
F("MOD"), F("PROBABILITY"), F("DUTY"), F("OFFSET"), F("SWING"), F("EUCLID STEPS"),
|
F("MOD"), F("PROBABILITY"), F("DUTY"), F("OFFSET"), F("SWING"), F("EUCLID STEPS"),
|
||||||
F("EUCLID HITS"), F("CV SOURCE"), F("CV DEST")};
|
F("EUCLID HITS"), F("CV SOURCE"), F("CV DEST")};
|
||||||
drawMenuItems(menu_items, PARAM_CH_LAST);
|
drawMenuItems(menu_items, PARAM_CH_LAST);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void StateManager::reset(AppState& app) {
|
|||||||
|
|
||||||
noInterrupts();
|
noInterrupts();
|
||||||
_saveMetadata(); // Write the new metadata
|
_saveMetadata(); // Write the new metadata
|
||||||
_saveState(app); // Write the new (default) app state
|
_saveState(app); // Write the new (default) app state
|
||||||
interrupts();
|
interrupts();
|
||||||
|
|
||||||
_isDirty = false;
|
_isDirty = false;
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
#include "gravity.h"
|
#include "gravity.h"
|
||||||
|
|
||||||
// Initialize the static pointer for the EncoderDir class to null. We want to
|
// Initialize the static pointer for the EncoderDir class to null. We want to
|
||||||
// have a static pointer to decouple the ISR from the global gravity object.
|
// have a static pointer to decouple the ISR from the global gravity object.
|
||||||
Encoder* Encoder::_instance = nullptr;
|
Encoder* Encoder::_instance = nullptr;
|
||||||
|
|
||||||
void Gravity::Init() {
|
void Gravity::Init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user