aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/planck/keymaps/motform/config.h35
-rw-r--r--keyboards/planck/keymaps/motform/keymap.c110
-rw-r--r--keyboards/planck/keymaps/motform/readme.md5
-rw-r--r--keyboards/planck/keymaps/motform/rules.mk1
4 files changed, 12 insertions, 139 deletions
diff --git a/keyboards/planck/keymaps/motform/config.h b/keyboards/planck/keymaps/motform/config.h
index 9020d2b9f..6f70f09be 100644
--- a/keyboards/planck/keymaps/motform/config.h
+++ b/keyboards/planck/keymaps/motform/config.h
@@ -1,36 +1 @@
1#pragma once #pragma once
2
3#ifdef AUDIO_ENABLE
4 #define STARTUP_SONG SONG(PLANCK_SOUND)
5 // #define STARTUP_SONG SONG(NO_SOUND)
6
7 #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
8 SONG(COLEMAK_SOUND), \
9 SONG(DVORAK_SOUND) \
10 }
11#endif
12
13/*
14 * MIDI options
15 */
16
17/* enable basic MIDI features:
18 - MIDI notes can be sent when in Music mode is on
19*/
20
21#define MIDI_BASIC
22
23/* enable advanced MIDI features:
24 - MIDI notes can be added to the keymap
25 - Octave shift and transpose
26 - Virtual sustain, portamento, and modulation wheel
27 - etc.
28*/
29//#define MIDI_ADVANCED
30
31/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
32//#define MIDI_TONE_KEYCODE_OCTAVES 2
33
34// Most tactile encoders have detents every 4 stages
35#define ENCODER_RESOLUTION 4
36
diff --git a/keyboards/planck/keymaps/motform/keymap.c b/keyboards/planck/keymaps/motform/keymap.c
index caa9a1899..6414b5db7 100644
--- a/keyboards/planck/keymaps/motform/keymap.c
+++ b/keyboards/planck/keymaps/motform/keymap.c
@@ -15,7 +15,6 @@
15 */ 15 */
16 16
17#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
18#include "muse.h"
19#include "keymap_swedish.h" 18#include "keymap_swedish.h"
20 19
21extern keymap_config_t keymap_config; 20extern keymap_config_t keymap_config;
@@ -64,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
64* |------+------+------+------+------+-------------+------+------+------+------+------| 63* |------+------+------+------+------+-------------+------+------+------+------+------|
65* | | ! | " | # | ? | % | LEFT | / | \ | = | + | * | 64* | | ! | " | # | ? | % | LEFT | / | \ | = | + | * |
66* |------+------+------+------+------+------|------+------+------+------+------+------| 65* |------+------+------+------+------+------|------+------+------+------+------+------|
67* | | | | [ | { | | UP | } | ] | | | | 66* | | | | [ | ] | | UP | { | } | | | |
68* |------+------+------+------+------+------+------+------+------+------+------+------| 67* |------+------+------+------+------+------+------+------+------+------+------+------|
69* | | | | | | | DEL | | Next | Vol- | Vol+ | Play | 68* | | | | | | | DEL | | Next | Vol- | Vol+ | Play |
70* `-----------------------------------------------------------------------------------' 69* `-----------------------------------------------------------------------------------'
@@ -73,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
73( 72(
74 _______, SE_PIPE_MAC, SE_APOS, SE_AT_MAC_V, SE_AMPR, _______, KC_DOWN, KC_NO, KC_RGHT, SE_GRV, SE_GRV, SE_TILD, 73 _______, SE_PIPE_MAC, SE_APOS, SE_AT_MAC_V, SE_AMPR, _______, KC_DOWN, KC_NO, KC_RGHT, SE_GRV, SE_GRV, SE_TILD,
75 _______, KC_EXLM, SE_QUO2, KC_HASH, SE_QUES, KC_PERC, KC_LEFT, SE_SLSH, SE_BSLS_MAC, SE_EQL, KC_PPLS, KC_PAST, 74 _______, KC_EXLM, SE_QUO2, KC_HASH, SE_QUES, KC_PERC, KC_LEFT, SE_SLSH, SE_BSLS_MAC, SE_EQL, KC_PPLS, KC_PAST,
76 _______, KC_NO, KC_NO, SE_LBRC, SE_LCBR_MAC, KC_NO, KC_UP, SE_RCBR_MAC, SE_RBRC, KC_NO, KC_NO, _______, 75 _______, KC_NO, KC_NO, SE_LBRC, SE_RBRC, KC_NO, KC_UP, SE_LCBR_MAC, SE_RCBR_MAC, KC_NO, KC_NO, _______,
77 _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY 76 _______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
78 ), 77 ),
79 78
@@ -83,16 +82,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
83* |------+------+------+------+------+-------------+------+------+------+------+------| 82* |------+------+------+------+------+-------------+------+------+------+------+------|
84* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | $ | 83* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | $ |
85* |------+------+------+------+------+------|------+------+------+------+------+------| 84* |------+------+------+------+------+------|------+------+------+------+------+------|
86* | | | | < | ( | | | ) | > |Pg Up |Pg Dn | | 85* | | | | < | > | | | ( | ) |Pg Up |Pg Dn | |
87* |------+------+------+------+------+------+------+------+------+------+------+------| 86* |------+------+------+------+------+------+------+------+------+------+------+------|
88* | | | | | | | | Next | Vol- | Vol+ | Play | 87* | | | | | | | | Next | Vol- | Vol+ | Play |
89* `-----------------------------------------------------------------------------------' 88* `-----------------------------------------------------------------------------------'
90*/ 89*/
91[_RAISE] = LAYOUT_planck_grid 90[_RAISE] = LAYOUT_planck_grid
92( 91(
93 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, 92 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
94 SE_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_DLR_MAC_V, 93 SE_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_DLR_MAC_V,
95 _______, KC_NO, KC_NO, SE_LESS_MAC, SE_LPRN, KC_NO, KC_NO, SE_RPRN, SE_GRTR_MAC, KC_PGUP, KC_PGDN, KC_NO, 94 _______, KC_NO, KC_NO, SE_LESS_MAC, SE_GRTR_MAC, KC_NO, KC_NO, SE_LPRN, SE_RPRN, KC_PGUP, KC_PGDN, KC_NO,
96 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY 95 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
97 ), 96 ),
98 97
@@ -100,9 +99,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
100 * ,-----------------------------------------------------------------------------------. 99 * ,-----------------------------------------------------------------------------------.
101 * | | Reset| Debug| | | | | | | | | | 100 * | | Reset| Debug| | | | | | | | | |
102 * |------+------+------+------+------+-------------+------+------+------+------+------| 101 * |------+------+------+------+------+-------------+------+------+------+------+------|
103 * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | 102 * | | | | | | | | | | | | |
104 * |------+------+------+------+------+------|------+------+------+------+------+------| 103 * |------+------+------+------+------+------|------+------+------+------+------+------|
105 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TRMon |TRMoff| | | | 104 * | | | | | | | | | | | | |
106 * |------+------+------+------+------+------+------+------+------+------+------+------| 105 * |------+------+------+------+------+------+------+------+------+------+------+------|
107 * | | | | | | | | | | | | 106 * | | | | | | | | | | | |
108 * `-----------------------------------------------------------------------------------' 107 * `-----------------------------------------------------------------------------------'
@@ -110,8 +109,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
110[_ADJUST] = LAYOUT_planck_grid 109[_ADJUST] = LAYOUT_planck_grid
111( 110(
112 _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, 111 _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______,
113 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, 112 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
114 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, 113 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
115 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 114 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
116 ) 115 )
117 116
@@ -120,92 +119,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
120uint32_t layer_state_set_user(uint32_t state) { 119uint32_t layer_state_set_user(uint32_t state) {
121 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); 120 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
122} 121}
123
124bool muse_mode = false;
125uint8_t last_muse_note = 0;
126uint16_t muse_counter = 0;
127uint8_t muse_offset = 70;
128uint16_t muse_tempo = 50;
129
130void encoder_update(bool clockwise) {
131 if (muse_mode) {
132 if (IS_LAYER_ON(_RAISE)) {
133 if (clockwise) {
134 muse_offset++;
135 } else {
136 muse_offset--;
137 }
138 } else {
139 if (clockwise) {
140 muse_tempo+=1;
141 } else {
142 muse_tempo-=1;
143 }
144 }
145 } else {
146 if (clockwise) {
147 #ifdef MOUSEKEY_ENABLE
148 register_code(KC_MS_WH_DOWN);
149 unregister_code(KC_MS_WH_DOWN);
150 #else
151 register_code(KC_PGDN);
152 unregister_code(KC_PGDN);
153 #endif
154 } else {
155 #ifdef MOUSEKEY_ENABLE
156 register_code(KC_MS_WH_UP);
157 unregister_code(KC_MS_WH_UP);
158 #else
159 register_code(KC_PGUP);
160 unregister_code(KC_PGUP);
161 #endif
162 }
163 }
164}
165
166void dip_update(uint8_t index, bool active) {
167 switch (index) {
168 case 0:
169 if (active) {
170 layer_on(_ADJUST);
171 } else {
172 layer_off(_ADJUST);
173 }
174 break;
175 case 1:
176 if (active) {
177 muse_mode = true;
178 } else {
179 muse_mode = false;
180 #ifdef AUDIO_ENABLE
181 stop_all_notes();
182 #endif
183 }
184 }
185}
186
187void matrix_scan_user(void) {
188 #ifdef AUDIO_ENABLE
189 if (muse_mode) {
190 if (muse_counter == 0) {
191 uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
192 if (muse_note != last_muse_note) {
193 stop_note(compute_freq_for_midi_note(last_muse_note));
194 play_note(compute_freq_for_midi_note(muse_note), 0xF);
195 last_muse_note = muse_note;
196 }
197 }
198 muse_counter = (muse_counter + 1) % muse_tempo;
199 }
200 #endif
201}
202
203bool music_mask_user(uint16_t keycode) {
204 switch (keycode) {
205 case RAISE:
206 case LOWER:
207 return false;
208 default:
209 return true;
210 }
211}
diff --git a/keyboards/planck/keymaps/motform/readme.md b/keyboards/planck/keymaps/motform/readme.md
index 47091c0aa..d9bda6121 100644
--- a/keyboards/planck/keymaps/motform/readme.md
+++ b/keyboards/planck/keymaps/motform/readme.md
@@ -2,10 +2,9 @@
2 2
3This layout is based off the [colemak-se](github.com/motform/colemak-se) 3This layout is based off the [colemak-se](github.com/motform/colemak-se)
4layout and features many tweaks to make working with Emacs and 4layout and features many tweaks to make working with Emacs and
5evil-mode more ergonomi. As with the colemak layout itself, the idea 5evil-mode more ergonomic. As with the colemak layout itself, the idea
6is to concentrate as much movement as possible to the home row. 6is to concentrate as much movement as possible to the home row.
7 7
8To properly use the layout in Emacs, set Super to LGUI and Meta to RGUI. 8To properly use the layout in Emacs, set Super to LGUI and Meta to RGUI.
9Unless you are running a permutation of the MacOS Swedish QWERTY-layout, 9Unless you are running a permutation of the MacOS Swedish QWERTY-layout,
10modifiers will probably not work. For future develoment, I’m planning 10modifiers will probably not work.
11to add support for MS Windows SE-QWERTY in the form of a secondary layer.
diff --git a/keyboards/planck/keymaps/motform/rules.mk b/keyboards/planck/keymaps/motform/rules.mk
index dcf16bef3..e69de29bb 100644
--- a/keyboards/planck/keymaps/motform/rules.mk
+++ b/keyboards/planck/keymaps/motform/rules.mk
@@ -1 +0,0 @@
1SRC += muse.c