diff options
| -rw-r--r-- | keyboards/planck/keymaps/charlesrocket/config.h | 38 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/charlesrocket/keymap.c | 203 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/charlesrocket/readme.md | 55 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/charlesrocket/rules.mk | 8 |
4 files changed, 304 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/charlesrocket/config.h b/keyboards/planck/keymaps/charlesrocket/config.h new file mode 100644 index 000000000..21d65d8f5 --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/config.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #ifdef AUDIO_ENABLE | ||
| 4 | #define STARTUP_SONG SONG(PLANCK_SOUND) | ||
| 5 | #endif | ||
| 6 | |||
| 7 | /* | ||
| 8 | * MIDI options | ||
| 9 | */ | ||
| 10 | |||
| 11 | /* Prevent use of disabled MIDI features in the keymap */ | ||
| 12 | //#define MIDI_ENABLE_STRICT 1 | ||
| 13 | |||
| 14 | /* enable basic MIDI features: | ||
| 15 | - MIDI notes can be sent when in Music mode is on | ||
| 16 | */ | ||
| 17 | |||
| 18 | #define MIDI_BASIC | ||
| 19 | #define AUDIO_CLICKY | ||
| 20 | #define AUDIO_CLICKY_FREQ_DEFAULT 2360.0f | ||
| 21 | #define AUDIO_CLICKY_FREQ_MAX 9500.0f | ||
| 22 | #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.05f | ||
| 23 | #define DAC_SAMPLE_MAX 9754U | ||
| 24 | |||
| 25 | /* enable advanced MIDI features: | ||
| 26 | - MIDI notes can be added to the keymap | ||
| 27 | - Octave shift and transpose | ||
| 28 | - Virtual sustain, portamento, and modulation wheel | ||
| 29 | - etc. | ||
| 30 | */ | ||
| 31 | //#define MIDI_ADVANCED | ||
| 32 | |||
| 33 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ | ||
| 34 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 | ||
| 35 | |||
| 36 | // Most tactile encoders have detents every 4 stages | ||
| 37 | #define ENCODER_RESOLUTION 4 | ||
| 38 | #define ORYX_CONFIGURATOR \ No newline at end of file | ||
diff --git a/keyboards/planck/keymaps/charlesrocket/keymap.c b/keyboards/planck/keymaps/charlesrocket/keymap.c new file mode 100644 index 000000000..f82819c58 --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/keymap.c | |||
| @@ -0,0 +1,203 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #ifdef AUDIO_ENABLE | ||
| 3 | #include "muse.h" | ||
| 4 | #endif | ||
| 5 | #include "eeprom.h" | ||
| 6 | |||
| 7 | #define KC_MAC_UNDO LGUI(KC_Z) | ||
| 8 | #define KC_MAC_CUT LGUI(KC_X) | ||
| 9 | #define KC_MAC_COPY LGUI(KC_C) | ||
| 10 | #define KC_MAC_PASTE LGUI(KC_V) | ||
| 11 | #define KC_PC_UNDO LCTL(KC_Z) | ||
| 12 | #define KC_PC_CUT LCTL(KC_X) | ||
| 13 | #define KC_PC_COPY LCTL(KC_C) | ||
| 14 | #define KC_PC_PASTE LCTL(KC_V) | ||
| 15 | #define ES_LESS_MAC KC_GRAVE | ||
| 16 | #define ES_GRTR_MAC LSFT(KC_GRAVE) | ||
| 17 | #define ES_BSLS_MAC ALGR(KC_6) | ||
| 18 | #define NO_PIPE_ALT KC_GRAVE | ||
| 19 | #define NO_BSLS_ALT KC_EQUAL | ||
| 20 | #define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc) | ||
| 21 | |||
| 22 | enum planck_keycodes { | ||
| 23 | RGB_SLD = EZ_SAFE_RANGE, | ||
| 24 | }; | ||
| 25 | |||
| 26 | enum planck_layers { | ||
| 27 | _BASE, | ||
| 28 | _LOWER, | ||
| 29 | _RAISE, | ||
| 30 | _ADJUST, | ||
| 31 | }; | ||
| 32 | |||
| 33 | #define LOWER MO(_LOWER) | ||
| 34 | #define RAISE MO(_RAISE) | ||
| 35 | |||
| 36 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 37 | [_BASE] = LAYOUT_planck_grid( | ||
| 38 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPACE, | ||
| 39 | KC_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, | ||
| 40 | KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER, | ||
| 41 | WEBUSB_PAIR, KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPACE, KC_NO, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT | ||
| 42 | ), | ||
| 43 | |||
| 44 | [_LOWER] = LAYOUT_planck_grid( | ||
| 45 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
| 46 | KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, | ||
| 47 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NONUS_BSLASH, KC_HOME, KC_END, _______, | ||
| 48 | KC_COMMA, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE | ||
| 49 | ), | ||
| 50 | |||
| 51 | [_RAISE] = LAYOUT_planck_grid( | ||
| 52 | KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
| 53 | KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINUS, KC_EQUAL, KC_LBRACKET, KC_RBRACKET, KC_BSLASH, | ||
| 54 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NONUS_BSLASH, KC_PGUP, KC_PGDOWN, _______, | ||
| 55 | _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE | ||
| 56 | ), | ||
| 57 | |||
| 58 | [_ADJUST] = LAYOUT_planck_grid( | ||
| 59 | _______, CK_UP, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, | ||
| 60 | KC_DELETE, CK_TOGG, AU_ON, AU_OFF, AU_TOG, _______, _______, _______, RGB_VAI,RGB_VAD , _______, RESET, | ||
| 61 | _______, CK_DOWN, MU_ON, MU_OFF, MU_TOG, _______, _______, _______, _______, _______, _______, _______, | ||
| 62 | _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______ | ||
| 63 | ), | ||
| 64 | |||
| 65 | }; | ||
| 66 | |||
| 67 | extern bool g_suspend_state; | ||
| 68 | extern rgb_config_t rgb_matrix_config; | ||
| 69 | |||
| 70 | void keyboard_post_init_user(void) { | ||
| 71 | rgb_matrix_enable(); | ||
| 72 | } | ||
| 73 | |||
| 74 | const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { | ||
| 75 | [0] = { {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255} }, | ||
| 76 | |||
| 77 | [1] = { {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255}, {193,255,255} }, | ||
| 78 | |||
| 79 | [2] = { {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255}, {104,255,255} }, | ||
| 80 | |||
| 81 | [3] = { {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255} }, | ||
| 82 | |||
| 83 | }; | ||
| 84 | |||
| 85 | void set_layer_color(int layer) { | ||
| 86 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | ||
| 87 | HSV hsv = { | ||
| 88 | .h = pgm_read_byte(&ledmap[layer][i][0]), | ||
| 89 | .s = pgm_read_byte(&ledmap[layer][i][1]), | ||
| 90 | .v = pgm_read_byte(&ledmap[layer][i][2]), | ||
| 91 | }; | ||
| 92 | if (!hsv.h && !hsv.s && !hsv.v) { | ||
| 93 | rgb_matrix_set_color( i, 0, 0, 0 ); | ||
| 94 | } else { | ||
| 95 | RGB rgb = hsv_to_rgb( hsv ); | ||
| 96 | float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; | ||
| 97 | rgb_matrix_set_color( i, f * rgb.r, f * rgb.g, f * rgb.b ); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | } | ||
| 101 | |||
| 102 | void rgb_matrix_indicators_user(void) { | ||
| 103 | if (g_suspend_state || keyboard_config.disable_layer_led) { return; } | ||
| 104 | switch (biton32(layer_state)) { | ||
| 105 | case 0: | ||
| 106 | set_layer_color(0); | ||
| 107 | break; | ||
| 108 | case 1: | ||
| 109 | set_layer_color(1); | ||
| 110 | break; | ||
| 111 | case 2: | ||
| 112 | set_layer_color(2); | ||
| 113 | break; | ||
| 114 | case 3: | ||
| 115 | set_layer_color(3); | ||
| 116 | break; | ||
| 117 | default: | ||
| 118 | if (rgb_matrix_get_flags() == LED_FLAG_NONE) | ||
| 119 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 120 | break; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 124 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 125 | switch (keycode) { | ||
| 126 | case RGB_SLD: | ||
| 127 | if (record->event.pressed) { | ||
| 128 | rgblight_mode(1); | ||
| 129 | } | ||
| 130 | return false; | ||
| 131 | } | ||
| 132 | return true; | ||
| 133 | } | ||
| 134 | |||
| 135 | #ifdef AUDIO_ENABLE | ||
| 136 | bool muse_mode = false; | ||
| 137 | uint8_t last_muse_note = 0; | ||
| 138 | uint16_t muse_counter = 0; | ||
| 139 | uint8_t muse_offset = 70; | ||
| 140 | uint16_t muse_tempo = 50; | ||
| 141 | |||
| 142 | void encoder_update(bool clockwise) { | ||
| 143 | if (muse_mode) { | ||
| 144 | if (IS_LAYER_ON(_RAISE)) { | ||
| 145 | if (clockwise) { | ||
| 146 | muse_offset++; | ||
| 147 | } else { | ||
| 148 | muse_offset--; | ||
| 149 | } | ||
| 150 | } else { | ||
| 151 | if (clockwise) { | ||
| 152 | muse_tempo+=1; | ||
| 153 | } else { | ||
| 154 | muse_tempo-=1; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | } else { | ||
| 158 | if (clockwise) { | ||
| 159 | #ifdef MOUSEKEY_ENABLE | ||
| 160 | tap_code(KC_MS_WH_DOWN); | ||
| 161 | #else | ||
| 162 | tap_code(KC_PGDN); | ||
| 163 | #endif | ||
| 164 | } else { | ||
| 165 | #ifdef MOUSEKEY_ENABLE | ||
| 166 | tap_code(KC_MS_WH_UP); | ||
| 167 | #else | ||
| 168 | tap_code(KC_PGUP); | ||
| 169 | #endif | ||
| 170 | } | ||
| 171 | } | ||
| 172 | } | ||
| 173 | |||
| 174 | void matrix_scan_user(void) { | ||
| 175 | #ifdef AUDIO_ENABLE | ||
| 176 | if (muse_mode) { | ||
| 177 | if (muse_counter == 0) { | ||
| 178 | uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; | ||
| 179 | if (muse_note != last_muse_note) { | ||
| 180 | stop_note(compute_freq_for_midi_note(last_muse_note)); | ||
| 181 | play_note(compute_freq_for_midi_note(muse_note), 0xF); | ||
| 182 | last_muse_note = muse_note; | ||
| 183 | } | ||
| 184 | } | ||
| 185 | muse_counter = (muse_counter + 1) % muse_tempo; | ||
| 186 | } | ||
| 187 | #endif | ||
| 188 | } | ||
| 189 | |||
| 190 | bool music_mask_user(uint16_t keycode) { | ||
| 191 | switch (keycode) { | ||
| 192 | case RAISE: | ||
| 193 | case LOWER: | ||
| 194 | return false; | ||
| 195 | default: | ||
| 196 | return true; | ||
| 197 | } | ||
| 198 | } | ||
| 199 | #endif | ||
| 200 | |||
| 201 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 202 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | ||
| 203 | } | ||
diff --git a/keyboards/planck/keymaps/charlesrocket/readme.md b/keyboards/planck/keymaps/charlesrocket/readme.md new file mode 100644 index 000000000..9e9f0d255 --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/readme.md | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | # Red Planck EZ (Glow) with beeps | ||
| 2 | |||
| 3 | QWERTY layout with colored layers (red, purple, green and white) for Planck EZ Glow. Soft beep feedback is On by default. Sound level is hardcoded with `DAC_SAMPLE_MAX` and tone settings (`CK`) are in Adjust (WHITE) layer. | ||
| 4 | |||
| 5 | ``` | ||
| 6 | RED Base | ||
| 7 | ,-----------------------------------------------------------------------------------. | ||
| 8 | | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
| 9 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 10 | | Esc | A | S | D | F | G | H | J | K | L | ; | " | | ||
| 11 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 12 | | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 13 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 14 | | QMK | Ctrl | Alt | OS |Lower | Space |Raise | Left | Down | Up |Right | | ||
| 15 | `-----------------------------------------------------------------------------------' | ||
| 16 | ``` | ||
| 17 | |||
| 18 | ``` | ||
| 19 | PURPLE Lower | ||
| 20 | ,-----------------------------------------------------------------------------------. | ||
| 21 | | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
| 22 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 23 | | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | ||
| 24 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 25 | | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | | ||
| 26 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 27 | | | | | |Lower | |Raise | Next | Vol- | Vol+ | Play | | ||
| 28 | `-----------------------------------------------------------------------------------' | ||
| 29 | ``` | ||
| 30 | |||
| 31 | ``` | ||
| 32 | GREEN Raise | ||
| 33 | ,-----------------------------------------------------------------------------------. | ||
| 34 | | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 35 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 36 | | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 37 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 38 | | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | | ||
| 39 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 40 | | | | | |Lower | |Raise | Next | Vol- | Vol+ | Play | | ||
| 41 | `-----------------------------------------------------------------------------------' | ||
| 42 | ``` | ||
| 43 | |||
| 44 | ``` | ||
| 45 | WHITE (Lower + Raise) | ||
| 46 | ,-----------------------------------------------------------------------------------. | ||
| 47 | | | CkUp | | | | | | | | | | | | ||
| 48 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 49 | | Del | CkTg |Aud On|AudOff|AudTog| | | |BRGTH+|BRGTH-| | Reset| | ||
| 50 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 51 | | | CkDn |Mus On|MusOff|MusTog| | | | | | | | | ||
| 52 | |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 53 | | | | | |Lower | |Raise | | | | | | ||
| 54 | `-----------------------------------------------------------------------------------' | ||
| 55 | ``` | ||
diff --git a/keyboards/planck/keymaps/charlesrocket/rules.mk b/keyboards/planck/keymaps/charlesrocket/rules.mk new file mode 100644 index 000000000..6e4985a8b --- /dev/null +++ b/keyboards/planck/keymaps/charlesrocket/rules.mk | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | SRC += muse.c | ||
| 2 | # Set any rules.mk overrides for your specific keymap here. | ||
| 3 | # See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file | ||
| 4 | LTO_ENABLE = yes | ||
| 5 | COMMAND_ENABLE = no | ||
| 6 | MOUSEKEY_ENABLE = no | ||
| 7 | WEBUSB_ENABLE = yes | ||
| 8 | ORYX_ENABLE = yes | ||
