Skip to content

Commit

Permalink
Sequence5/TDT: Fix transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
Chysn committed Aug 26, 2018
1 parent 242b487 commit d96fd5f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
10 changes: 7 additions & 3 deletions software/o_c_REV/APP_SCALEEDITOR.ino
Expand Up @@ -111,10 +111,14 @@ public:
uint8_t high = V[ix++];
OC::user_scales[current_scale].notes[i] = (uint16_t)(high << 8) | low;
}
}

current_note = 0;
undo_value = OC::user_scales[current_scale].notes[current_note];
// Reset
current_note = 0;
undo_value = OC::user_scales[current_scale].notes[current_note];
// Configure and force requantize for real-time monitoring purposes
quantizer.Configure(OC::Scales::GetScale(current_scale), 0xffff);
QuantizeCurrent();
}
}

/////////////////////////////////////////////////////////////////
Expand Down
6 changes: 1 addition & 5 deletions software/o_c_REV/APP_THEDARKESTTIMELINE.ino
Expand Up @@ -143,12 +143,8 @@ public:
cv = get_data_at(idx, tl);

// Get transpose value from CV 4 over a range of 1 octave
int transpose = 0;
int transpose_cv = DetentedIn(3);
if (transpose_cv) {
transpose = Proportion(transpose_cv, HSAPPLICATION_3V, 12);
transpose = constrain(transpose, -12, 12);
}
int transpose = transpose_cv / 128;

if (tl == 0) {
// This is a CV Timeline, so output the normal universe note
Expand Down
12 changes: 8 additions & 4 deletions software/o_c_REV/HEM_Sequence5.ino
Expand Up @@ -44,19 +44,23 @@ public:
ClockOut(1);
}

int transpose = Proportion(In(0), HEMISPHERE_MAX_CV / 2, 12);
transpose = constrain(transpose, -12, 12);
int transpose = 0;
if (DetentedIn(0)) {
transpose = In(0) / 128; // 128 ADC steps per semitone
}
int play_note = note[step] + 48 + transpose;
play_note = constrain(play_note, 0, 127);

if (Clock(0)) StartADCLag();

if (EndOfADCLag()) {
Out(0, quantizer.Lookup(note[step] + 48 + transpose));
Out(0, quantizer.Lookup(play_note));
Advance(step);
if (step == 0) ClockOut(1);
}

if (play) {
Out(0, quantizer.Lookup(note[step] + 48 + transpose));
Out(0, quantizer.Lookup(play_note));
}
}

Expand Down
2 changes: 1 addition & 1 deletion software/o_c_REV/HSApplication.h
Expand Up @@ -117,7 +117,7 @@ class HSApplication {

// Apply small center detent to input, so it reads zero before a threshold
int DetentedIn(int ch) {
return (In(ch) > 180 || In(ch) < -180) ? In(ch) : 0;
return (In(ch) > 64 || In(ch) < -64) ? In(ch) : 0;
}

bool Gate(int ch) {
Expand Down
2 changes: 1 addition & 1 deletion software/o_c_REV/HemisphereApplet.h
Expand Up @@ -307,7 +307,7 @@ class HemisphereApplet {

// Apply small center detent to input, so it reads zero before a threshold
int DetentedIn(int ch) {
return (In(ch) > 180 || In(ch) < -180) ? In(ch) : 0;
return (In(ch) > 64 || In(ch) < -64) ? In(ch) : 0;
}

void Out(int ch, int value, int octave = 0) {
Expand Down

0 comments on commit d96fd5f

Please sign in to comment.