Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicky frequency modulation #12

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions keyboards/planck/keymaps/jetpacktuxedo/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,24 @@ uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 20;

extern float clicky_rand;

void encoder_update(bool clockwise) {
if (is_clicky_on()) {
if (clockwise) {
clicky_freq_up();
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
clicky_rand += 0.5f;
} else {
clicky_rand -= 0.5f;
}
} else {
clicky_freq_down();
if (clockwise) {
clicky_freq_up();
} else {
clicky_freq_down();
}
}
} else
if (muse_mode) {
} else if (muse_mode) {
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
muse_offset++;
Expand Down Expand Up @@ -255,7 +264,8 @@ void dip_update(uint8_t index, bool active) {
stop_all_notes();
#endif
}
case 2:
break;
case 3:
if (active) {
clicky_on();
} else {
Expand Down