diff options
Diffstat (limited to 'keyboard/atomic/keymaps/pvc/keymap.c')
| -rw-r--r-- | keyboard/atomic/keymaps/pvc/keymap.c | 44 |
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 | ||
| 203 | float tone_rs[][2] = { | 201 | float tone_rs[][2] = { |
| 204 | Q_NOTE(_F8 ) , | 202 | Q_NOTE(_A4 ) , |
| 205 | Q_NOTE(_G8 ) , | 203 | Q_NOTE(_A4 ) , |
| 206 | Q_NOTE(_GS8 ) , | 204 | Q_NOTE(_A4 ) , |
| 207 | Q_NOTE(_A8 ) , | 205 | Q_NOTE(_A4 ) , |
| 208 | Q_NOTE(_AS8 ) , | 206 | Q_NOTE(_AS8 ) , |
| 209 | Q_NOTE(_B8 ) , | 207 | Q_NOTE(_B8 ) , |
| 210 | }; | 208 | }; |
| 211 | 209 | ||
| 212 | float 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 | ||
| 224 | void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t layer4, bool order) | 212 | void 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 | |||
| 253 | const uint16_t PROGMEM fn_actions[] = { | 241 | const 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 | ||
| 258 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | 246 | const 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 |
| 296 | float start_up[][2] = { | 284 | float start_up[][2] = { |
| 297 | Q_NOTE(_E4 ) , | 285 | Q_NOTE(_E4 ) , |
| 298 | {0,1} , | ||
| 299 | Q_NOTE(_E4 ) , | 286 | Q_NOTE(_E4 ) , |
| 300 | {0,1} , | ||
| 301 | Q_NOTE(_F4 ) , | 287 | Q_NOTE(_F4 ) , |
| 302 | {0,1} , | ||
| 303 | Q_NOTE(_G4 ) , | 288 | Q_NOTE(_G4 ) , |
| 304 | {0,1} , | ||
| 305 | Q_NOTE(_G4 ) , | 289 | Q_NOTE(_G4 ) , |
| 306 | {0,1} , | ||
| 307 | Q_NOTE(_F4 ) , | 290 | Q_NOTE(_F4 ) , |
| 308 | {0,1} , | ||
| 309 | Q_NOTE(_E4 ) , | 291 | Q_NOTE(_E4 ) , |
| 310 | {0,1} , | ||
| 311 | Q_NOTE(_D4 ) , | 292 | Q_NOTE(_D4 ) , |
| 312 | {0,1} , | ||
| 313 | Q_NOTE(_C4 ) , | 293 | Q_NOTE(_C4 ) , |
| 314 | {0,1} , | ||
| 315 | Q_NOTE(_C4 ) , | 294 | Q_NOTE(_C4 ) , |
| 316 | {0,1} , | ||
| 317 | Q_NOTE(_D4 ) , | 295 | Q_NOTE(_D4 ) , |
| 318 | {0,1} , | ||
| 319 | Q_NOTE(_E4 ) , | 296 | Q_NOTE(_E4 ) , |
| 320 | {0,1} , | ||
| 321 | H_NOTE(_E4 ) , | 297 | H_NOTE(_E4 ) , |
| 322 | {0,1} , | ||
| 323 | Q_NOTE(_D4 ) , | 298 | Q_NOTE(_D4 ) , |
| 324 | {0,1} , | ||
| 325 | H_NOTE(_D4 ) , | 299 | H_NOTE(_D4 ) , |
| 326 | }; | 300 | }; |
| 327 | #endif | 301 | #endif |
| @@ -329,7 +303,7 @@ H_NOTE(_D4 ) , | |||
| 329 | void matrix_init_user(void) { | 303 | void 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 | } |
