mirror of
https://github.com/erik-toth/audio-synth.git
synced 2025-12-06 17:20:01 +00:00
Firmware MCU: Sequencer, erfassen und widergabe im Sequencerblock von beiden Channel, playback im single und loop modus, test OK
This commit is contained in:
@@ -26,9 +26,10 @@ struct Key
|
||||
int col;
|
||||
};
|
||||
|
||||
struct voltageDurationPair
|
||||
struct DualVoltageDurationPair
|
||||
{
|
||||
uint16_t voltage;
|
||||
uint16_t voltage_ch1;
|
||||
uint16_t voltage_ch2;
|
||||
uint16_t duration;
|
||||
};
|
||||
|
||||
@@ -93,12 +94,12 @@ class CV
|
||||
class SequencerBlock
|
||||
{
|
||||
public:
|
||||
SequencerBlock(uint16_t maxDurationMS, uint16_t timeoutMS);
|
||||
SequencerBlock(uint16_t maxDurationMS, uint16_t minStepDurationMS);
|
||||
|
||||
// Aufnahme-Funktionen
|
||||
void startRecord();
|
||||
void stopRecord();
|
||||
void addStep(uint16_t voltage);
|
||||
void addStep(uint16_t voltage_ch1, uint16_t voltage_ch2);
|
||||
bool isRecording();
|
||||
|
||||
// Wiedergabe-Funktionen
|
||||
@@ -114,18 +115,19 @@ class SequencerBlock
|
||||
// Status-Abfragen
|
||||
bool timeLimitReached();
|
||||
uint8_t getStepCount();
|
||||
uint16_t getCurrentVoltage();
|
||||
uint16_t getCurrentVoltageCh1();
|
||||
uint16_t getCurrentVoltageCh2();
|
||||
uint16_t getTotalDuration();
|
||||
|
||||
private:
|
||||
// Sequenz-Speicher
|
||||
voltageDurationPair _sequence[N_MAX_SEQUENCE_STEPS];
|
||||
DualVoltageDurationPair _sequence[N_MAX_SEQUENCE_STEPS];
|
||||
uint8_t _stepCount;
|
||||
uint8_t _currentStep;
|
||||
|
||||
// Zeitverwaltung
|
||||
uint16_t _maxDurationMS;
|
||||
uint16_t _timeoutMS;
|
||||
uint16_t _minStepDurationMS;
|
||||
unsigned long _recordStartTime;
|
||||
unsigned long _lastStepTime;
|
||||
unsigned long _playStartTime;
|
||||
@@ -136,8 +138,9 @@ class SequencerBlock
|
||||
bool _isPlaying;
|
||||
bool _loop;
|
||||
|
||||
// Letzte aufgenommene Spannung
|
||||
uint16_t _lastVoltage;
|
||||
// Letzte aufgenommene Spannungen
|
||||
uint16_t _lastVoltageCh1;
|
||||
uint16_t _lastVoltageCh2;
|
||||
|
||||
// Hilfsfunktionen
|
||||
void _finishCurrentStep();
|
||||
|
||||
@@ -25,15 +25,15 @@
|
||||
#define PIN_K_R1 8
|
||||
#define PIN_K_R2 9
|
||||
#define PIN_K_R3 10
|
||||
#define PIN_K_R4 // NOT IN USE
|
||||
#define PIN_K_R4 // 11 NOT IN USE
|
||||
#define PIN_K_C0 1
|
||||
#define PIN_K_C1 2
|
||||
#define PIN_K_C2 4
|
||||
#define PIN_K_C3 // NOT IN USE
|
||||
#define PIN_K_C4 // NOT IN USE
|
||||
#define PIN_K_C3 // 5 NOT IN USE
|
||||
#define PIN_K_C4 // 6 NOT IN USE
|
||||
// SEQUENCER BUTTON PINS
|
||||
#define PIN_SB_1_REC 0
|
||||
#define PIN_SB_1_PLAY 0
|
||||
#define PIN_SB_2_REC 0
|
||||
#define PIN_SB_2_PLAY 0
|
||||
#define PIN_SB_1_REC 37 // 33 not available on dev board
|
||||
#define PIN_SB_1_PLAY 38 // 34 not available on dev board
|
||||
#define PIN_SB_2_REC 35
|
||||
#define PIN_SB_2_PLAY 36
|
||||
#endif
|
||||
Reference in New Issue
Block a user