aboutsummaryrefslogtreecommitdiff
path: root/keyboard/atomic/keymaps/pvc/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/atomic/keymaps/pvc/keymap.c')
-rw-r--r--keyboard/atomic/keymaps/pvc/keymap.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/keyboard/atomic/keymaps/pvc/keymap.c b/keyboard/atomic/keymaps/pvc/keymap.c
index 229708344..c2081f525 100644
--- a/keyboard/atomic/keymaps/pvc/keymap.c
+++ b/keyboard/atomic/keymaps/pvc/keymap.c
@@ -75,8 +75,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
75 }, 75 },
76}; 76};
77 77
78#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer)))
79#define IS_LAYER_OFF(layer) (!IS_LAYER_ON(layer))
80 78
81#ifdef AUDIO_ENABLE 79#ifdef AUDIO_ENABLE
82 80
@@ -201,24 +199,14 @@ Q_NOTE(_B8 ) ,
201}; 199};
202 200
203float tone_rs[][2] = { 201float tone_rs[][2] = {
204Q_NOTE(_F8 ) , 202Q_NOTE(_A4 ) ,
205Q_NOTE(_G8 ) , 203Q_NOTE(_A4 ) ,
206Q_NOTE(_GS8 ) , 204Q_NOTE(_A4 ) ,
207Q_NOTE(_A8 ) , 205Q_NOTE(_A4 ) ,
208Q_NOTE(_AS8 ) , 206Q_NOTE(_AS8 ) ,
209Q_NOTE(_B8 ) , 207Q_NOTE(_B8 ) ,
210}; 208};
211 209
212float tone_fn[][2] = {
213 {440.0*pow(2.0,(59)/12.0), 8},
214 {440.0*pow(2.0,(60)/12.0), 8},
215 {0, 4},
216 {440.0*pow(2.0,(67)/12.0), 16},
217 {0, 4},
218 {440.0*pow(2.0,(69)/12.0), 16},
219 {0, 4},
220 {440.0*pow(2.0,(67)/12.0), 16}
221};
222#endif 210#endif
223 211
224void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t layer4, bool order) 212void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t layer4, bool order)
@@ -253,18 +241,18 @@ void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t l
253const uint16_t PROGMEM fn_actions[] = { 241const uint16_t PROGMEM fn_actions[] = {
254}; 242};
255 243
256#define ARRAY_SIZE(x) ((sizeof x) / (sizeof *x)) 244//#define MUSIC_ARRAY_SIZE(x) (((int)(sizeof(x) / (sizeof(x[0][0])))) / 2)
257 245
258const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 246const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
259{ 247{
248
260 // MACRODOWN only works in this function 249 // MACRODOWN only works in this function
261 switch(id) { 250 switch(id) {
262 case M_LW: 251 case M_LW:
263 if (record->event.pressed) { 252 if (record->event.pressed) {
264 #ifdef AUDIO_ENABLE 253 #ifdef AUDIO_ENABLE
265 println("PlayNotes LW"); 254 println("PlayNotes LW");
266 print_val_hex32(ARRAY_SIZE(tone_lw)); 255 PLAY_NOTE_ARRAY(tone_lw, false, STACCATO);
267 play_notes(&tone_lw, 96, false);
268 #endif 256 #endif
269 layer_on(_LW); 257 layer_on(_LW);
270 update_tri_layer(_LW, _RS, _FN); 258 update_tri_layer(_LW, _RS, _FN);
@@ -277,7 +265,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
277 if (record->event.pressed) { 265 if (record->event.pressed) {
278 #ifdef AUDIO_ENABLE 266 #ifdef AUDIO_ENABLE
279 println("PlayNotes RS"); 267 println("PlayNotes RS");
280 play_notes(&tone_rs, 6, false); 268 PLAY_NOTE_ARRAY(tone_rs, false, LEGATO);
281 #endif 269 #endif
282 layer_on(_RS); 270 layer_on(_RS);
283 update_tri_layer(_LW, _RS, _FN); 271 update_tri_layer(_LW, _RS, _FN);
@@ -295,33 +283,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
295#ifdef AUDIO_ENABLE 283#ifdef AUDIO_ENABLE
296float start_up[][2] = { 284float start_up[][2] = {
297Q_NOTE(_E4 ) , 285Q_NOTE(_E4 ) ,
298{0,1} ,
299Q_NOTE(_E4 ) , 286Q_NOTE(_E4 ) ,
300{0,1} ,
301Q_NOTE(_F4 ) , 287Q_NOTE(_F4 ) ,
302{0,1} ,
303Q_NOTE(_G4 ) , 288Q_NOTE(_G4 ) ,
304{0,1} ,
305Q_NOTE(_G4 ) , 289Q_NOTE(_G4 ) ,
306{0,1} ,
307Q_NOTE(_F4 ) , 290Q_NOTE(_F4 ) ,
308{0,1} ,
309Q_NOTE(_E4 ) , 291Q_NOTE(_E4 ) ,
310{0,1} ,
311Q_NOTE(_D4 ) , 292Q_NOTE(_D4 ) ,
312{0,1} ,
313Q_NOTE(_C4 ) , 293Q_NOTE(_C4 ) ,
314{0,1} ,
315Q_NOTE(_C4 ) , 294Q_NOTE(_C4 ) ,
316{0,1} ,
317Q_NOTE(_D4 ) , 295Q_NOTE(_D4 ) ,
318{0,1} ,
319Q_NOTE(_E4 ) , 296Q_NOTE(_E4 ) ,
320{0,1} ,
321H_NOTE(_E4 ) , 297H_NOTE(_E4 ) ,
322{0,1} ,
323Q_NOTE(_D4 ) , 298Q_NOTE(_D4 ) ,
324{0,1} ,
325H_NOTE(_D4 ) , 299H_NOTE(_D4 ) ,
326}; 300};
327#endif 301#endif
@@ -329,7 +303,7 @@ H_NOTE(_D4 ) ,
329void matrix_init_user(void) { 303void matrix_init_user(void) {
330 #ifdef AUDIO_ENABLE 304 #ifdef AUDIO_ENABLE
331 init_notes(); 305 init_notes();
332 play_notes(&start_up, 29, false); 306 PLAY_NOTE_ARRAY(start_up, false, STACCATO);
333 println("Matrix Init"); 307 println("Matrix Init");
334 #endif 308 #endif
335} 309}