Skip to content

Commit

Permalink
Revert "SequenceX: rework Randomize; unipolar vs. bipolar"
Browse files Browse the repository at this point in the history
  • Loading branch information
djphazer committed Dec 18, 2024
1 parent a5491c8 commit 974e315
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions software/src/applets/SequenceX.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,25 @@ class SequenceX : public HemisphereApplet {
const uint8_t* applet_icon() { return PhzIcons::sequenceX; }

void Start() {
Randomize(true);
Randomize();
}

void Reset() {
step = 0;
reset = true;
}

void Randomize(bool unipolar = false) {
const int minval = unipolar? 0 : -SEQX_MIN_VALUE;
for (int s = 0; s < SEQX_STEPS; s++) {
note[s] = int8_t(Entropy.random(SEQX_MAX_VALUE + minval)) - minval;
}
void Randomize() {
for (int s = 0; s < SEQX_STEPS; s++) note[s] = random(SEQX_MIN_VALUE, SEQX_MAX_VALUE);
}

void Controller() {
if (abs(In(1)) > (24 << 7) ) // 24 semitones == 2V
if (In(1) > (24 << 7) ) // 24 semitones == 2V
{
// new random sequence if CV2 goes high
if (!cv2_gate) {
cv2_gate = 1;
Randomize(In(1) > 0);
Randomize();
}
}
else cv2_gate = 0;
Expand Down

0 comments on commit 974e315

Please sign in to comment.