Skip to content

Commit

Permalink
constrain tuning range
Browse files Browse the repository at this point in the history
  • Loading branch information
twisted-electrons committed Nov 21, 2023
1 parent ff5be7b commit 4191cea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/megafm.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extern bool setupMode;
extern bool fineChanged;

extern byte arpMidiSpeedPending, arpMidiSpeed;
extern byte fine;
extern int fine;
extern byte presetCounts;
extern bool presetTargetMode;
extern byte presetTargetModeChanged;
Expand Down
2 changes: 1 addition & 1 deletion src/MEGAfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool arpJustWentOff;
bool setupMode;
bool fineChanged;
byte arpMidiSpeedPending, arpMidiSpeed;
byte fine;
int fine;
byte presetCounts;
bool presetTargetMode;
byte presetTargetModeChanged;
Expand Down
1 change: 1 addition & 0 deletions src/pots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ void movedPot(byte number, byte data, bool isMidi) {

if (voiceHeld && movedFineKnob) {
fine = finePot + map(data, 0, 255, -10, 10);
fine = constrain(fine, 0, 255);
updateFine();

} else {
Expand Down

0 comments on commit 4191cea

Please sign in to comment.