-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Steps are ocassionally lost but I can tackle that in another issue
- Loading branch information
1 parent
e37bff8
commit 01575e7
Showing
8 changed files
with
77 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
i, sync rising, time, last_sync, delta | ||
1, 1, 0, 0, 0 | ||
2, 0, 10, 0, 0 | ||
3, 0, 20, 10, 10 | ||
4, 0, 30, 20, 10 | ||
5, 1, 40, 30, 10 | ||
6, 0, 50, 40, 10 | ||
7, 0, 60, 50, 10 | ||
8, 0, 70, 60, 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
#ifndef CLOCK_H | ||
#define CLOCK_H | ||
#pragma once | ||
|
||
#include "preferences.h" | ||
#include "peaks_pattern_predictor.h" | ||
#include "DebouncedBoolean.h" | ||
|
||
class Clock { | ||
private: | ||
uint32_t prev_time; | ||
|
||
DebouncedBoolean sync_debounce; | ||
|
||
PatternPredictor<32, 8> predictor; | ||
uint16_t period_prediction; | ||
uint16_t period_accumulation; | ||
uint8_t slot_duration; | ||
|
||
uint8_t pulse_counter = 0; | ||
uint32_t time_of_last_sync; | ||
uint32_t period_prediction; | ||
uint16_t prev_pulse_number; | ||
|
||
public: | ||
Clock() { | ||
predictor.Init(); | ||
} | ||
bool isHigh(uint16_t sync_voltage, uint16_t division_knob, uint32_t time); | ||
void reset(); | ||
void reset(uint32_t time); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#define PPQN 24 // pulses per quarter note | ||
#define RESOLUTION (PPQN * 16) // 16 quarter notes | ||
#define NOISE_FLOOR 128 // out of 1024 | ||
#define LOGIC_HIGH 900 // out of 1024 |