mirror of
https://github.com/AquaMorph/Droplets.git
synced 2025-04-30 01:35:34 +00:00
Sequencer documentation
This commit is contained in:
parent
01d7384eb3
commit
45fc7ea9a5
@ -5,7 +5,7 @@ SequencerDroplet::SequencerDroplet(DaisyPatch* m_patch,
|
|||||||
float sample_rate) :
|
float sample_rate) :
|
||||||
Droplet(m_patch,
|
Droplet(m_patch,
|
||||||
m_state) {
|
m_state) {
|
||||||
SetColumns();
|
SetDimensions();
|
||||||
SetControls();
|
SetControls();
|
||||||
AdjustSelected(-1);
|
AdjustSelected(-1);
|
||||||
}
|
}
|
||||||
@ -36,13 +36,15 @@ void SequencerDroplet::Process(AudioHandle::InputBuffer in,
|
|||||||
|
|
||||||
if (control_rate_count == CONTROL_RATE_LIMIT) {
|
if (control_rate_count == CONTROL_RATE_LIMIT) {
|
||||||
for (size_t chn = GetChannelMin(); chn < GetChannelMax(); chn++) {
|
for (size_t chn = GetChannelMin(); chn < GetChannelMax(); chn++) {
|
||||||
if (std::abs(control[chn].Process()-last_control_value[chn]) > CONTROL_DEADZONE) {
|
if (std::abs(control[chn].Process()
|
||||||
|
-last_control_value[chn]) > CONTROL_DEADZONE) {
|
||||||
if (!InMenu()) {
|
if (!InMenu()) {
|
||||||
sequence[chn+selected*num_columns] = control[chn].Process();
|
sequence[chn+selected*num_columns] = control[chn].Process();
|
||||||
} else {
|
} else {
|
||||||
if (chn == GetChannelMin()) {
|
if (chn == GetChannelMin()) {
|
||||||
sequence_length = std::max(1.0f,control[chn].Process()/4.9f*MAX_SEQUENCE_LENGTH);
|
sequence_length = std::max(1.0f,control[chn].Process() /
|
||||||
SetColumns();
|
4.9f*MAX_SEQUENCE_LENGTH);
|
||||||
|
SetDimensions();
|
||||||
selected = 0;
|
selected = 0;
|
||||||
AdjustSelected(-1);
|
AdjustSelected(-1);
|
||||||
}
|
}
|
||||||
@ -104,7 +106,7 @@ void SequencerDroplet::Draw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SequencerDroplet::UpdateStateCallback() {
|
void SequencerDroplet::UpdateStateCallback() {
|
||||||
SetColumns();
|
SetDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SequencerDroplet::SetControls() {
|
void SequencerDroplet::SetControls() {
|
||||||
@ -126,7 +128,7 @@ void SequencerDroplet::Reset() {
|
|||||||
step = 0;
|
step = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SequencerDroplet::SetColumns() {
|
void SequencerDroplet::SetDimensions() {
|
||||||
if (GetState() != DropletState::kFull) {
|
if (GetState() != DropletState::kFull) {
|
||||||
num_columns = 2;
|
num_columns = 2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -37,10 +37,23 @@ private:
|
|||||||
*/
|
*/
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetColumns();
|
/*
|
||||||
|
* Set the screeen dimensions of the sequence.
|
||||||
|
*/
|
||||||
|
void SetDimensions();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change the selected menu input.
|
||||||
|
*
|
||||||
|
* @param adj amount to adjust menu
|
||||||
|
*/
|
||||||
void AdjustSelected(int adj);
|
void AdjustSelected(int adj);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns if the sequencer menu is selected.
|
||||||
|
*
|
||||||
|
* @return menu state
|
||||||
|
*/
|
||||||
bool InMenu();
|
bool InMenu();
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user