Reverse the order of clock mod options. #16

Merged
awonak merged 5 commits from reverse-clock-mod-index into main 2025-07-22 00:00:49 +00:00
7 changed files with 56 additions and 146 deletions
Showing only changes of commit 837cc761e6 - Show all commits

View File

@ -50,9 +50,6 @@ class Clock {
void Init() { void Init() {
NeoSerial.begin(31250); NeoSerial.begin(31250);
// Static pin definition for pulse out.
pinMode(PULSE_OUT_PIN, OUTPUT);
// Initialize the clock library // Initialize the clock library
uClock.init(); uClock.init();
uClock.setClockMode(uClock.INTERNAL_CLOCK); uClock.setClockMode(uClock.INTERNAL_CLOCK);

View File

@ -34,28 +34,28 @@ static const byte MOD_CHOICE_SIZE = 25;
// Negative numbers are multipliers, positive are divisors. // Negative numbers are multipliers, positive are divisors.
static const int CLOCK_MOD[MOD_CHOICE_SIZE] PROGMEM = { static const int CLOCK_MOD[MOD_CHOICE_SIZE] PROGMEM = {
// Multipliers
-24, -16, -12, -8, -6, -4, -3, -2,
// Internal Clock Unity
1,
// Divisors // Divisors
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16, 24, 32, 64, 128}; 128, 64, 32, 24, 16, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
// Internal Clock Unity (quarter note)
1,
// Multipliers
-2, -3, -4, -6, -8, -12, -16, -24};
// This represents the number of clock pulses for a 96 PPQN clock source // This represents the number of clock pulses for a 96 PPQN clock source
// that match the above div/mult mods. // that match the above div/mult mods.
static const int CLOCK_MOD_PULSES[MOD_CHOICE_SIZE] PROGMEM = { static const int CLOCK_MOD_PULSES[MOD_CHOICE_SIZE] PROGMEM = {
// Multiplier Pulses (96 / X) // Divisor Pulses (96 * X)
4, 6, 8, 12, 16, 24, 32, 48, 12288, 6144, 3072, 2304, 1536, 1152, 1056, 960, 864, 768, 672, 576, 480, 384, 288, 192,
// Internal Clock Pulses // Internal Clock Pulses
96, 96,
// Divisor Pulses (96 * X) // Multiplier Pulses (96 / X)
192, 288, 384, 480, 576, 672, 768, 864, 960, 1056, 1152, 1536, 2304, 3072, 6144, 12288}; 48, 32, 24, 16, 12, 8, 6, 4};
static const byte DEFAULT_CLOCK_MOD_INDEX = 8; // x1 or 96 PPQN. static const byte DEFAULT_CLOCK_MOD_INDEX = 16; // x1 or 96 PPQN.
static const byte PULSE_PPQN_24_CLOCK_MOD_INDEX = 0; static const byte PULSE_PPQN_24_CLOCK_MOD_INDEX = MOD_CHOICE_SIZE - 1;
static const byte PULSE_PPQN_4_CLOCK_MOD_INDEX = 4; static const byte PULSE_PPQN_4_CLOCK_MOD_INDEX = MOD_CHOICE_SIZE - 6;
static const byte PULSE_PPQN_1_CLOCK_MOD_INDEX = 8; static const byte PULSE_PPQN_1_CLOCK_MOD_INDEX = MOD_CHOICE_SIZE - 9;
class Channel { class Channel {
public: public: