summaryrefslogtreecommitdiff
path: root/keyboard
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-01-13 00:25:31 -0500
committerJack Humbert <jack.humb@gmail.com>2016-01-13 00:25:31 -0500
commit4c100dbbef5b97290cbe6d4846575a940649c958 (patch)
tree86cb7b86333342e323c35e16071e492b475731ea /keyboard
parent263344d42f8b16e1cd80c4c871e15fa86208d086 (diff)
note seq, start-up beeps, function beeps
Diffstat (limited to 'keyboard')
-rw-r--r--keyboard/planck/keymaps/keymap_lock.c73
1 files changed, 57 insertions, 16 deletions
diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c
index c8e1b8fa86..5e5390b036 100644
--- a/keyboard/planck/keymaps/keymap_lock.c
+++ b/keyboard/planck/keymaps/keymap_lock.c
@@ -2,6 +2,7 @@
// #include "backlight.h"
#include "action_layer.h"
#include "keymap_midi.h"
+#include "beeps.h"
#include <avr/boot.h>
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -63,12 +64,26 @@ uint16_t hextokeycode(int hex) {
}
}
+float walk_up[][2] = {
+ {440.0*pow(2.0,(60)/12.0), 400},
+ {0, 50},
+ {440.0*pow(2.0,(67)/12.0), 400},
+};
+
+float walk_dn[][2] = {
+ {440.0*pow(2.0,(67)/12.0), 400},
+ {0, 50},
+ {440.0*pow(2.0,(60)/12.0), 400},
+};
+
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
+
+ play_notes(&walk_up, 3, false);
// play_note(440, 20);
// register_code(KC_RSFT);
// backlight_set(BACKLIGHT_LEVELS);
@@ -107,7 +122,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
// note(0+24, 20);
} else {
unregister_code(KC_RSFT);
- stop_all_notes();
+ play_notes(&walk_dn, 3, false);
// backlight_set(0);
default_layer_and(0);
default_layer_or(0);
@@ -120,32 +135,58 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
return MACRO_NONE;
};
+float start_up[][2] = {
+ {440.0*pow(2.0,(67)/12.0), 600},
+ {0, 50},
+ {440.0*pow(2.0,(64)/12.0), 400},
+ {0, 50},
+ {440.0*pow(2.0,(55)/12.0), 400},
+ {0, 50},
+ {440.0*pow(2.0,(60)/12.0), 400},
+ {0, 50},
+ {440.0*pow(2.0,(64)/12.0), 1000},
+};
void * matrix_init_user(void) {
init_notes();
- play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF);
- _delay_ms(50);
+ play_notes(&start_up, 9, false);
+ // play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF);
+ // _delay_ms(50);
- play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
- _delay_ms(25);
- stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
+ // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
+ // _delay_ms(25);
+ // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
- play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
- _delay_ms(25);
- stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
+ // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
+ // _delay_ms(25);
+ // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
- stop_note(((double)261.6*3)*pow(2.0,(36)/12.0));
+ // stop_note(((double)261.6*3)*pow(2.0,(36)/12.0));
- play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF);
- _delay_ms(50);
- stop_note(((double)261.6*3)*pow(2.0,(62)/12.0));
+ // play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF);
+ // _delay_ms(50);
+ // stop_note(((double)261.6*3)*pow(2.0,(62)/12.0));
- play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF);
- _delay_ms(50);
- stop_note(((double)261.6*3)*pow(2.0,(64)/12.0));
+ // play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF);
+ // _delay_ms(50);
+ // stop_note(((double)261.6*3)*pow(2.0,(64)/12.0));
}
+
+
+// void * matrix_scan_user(void) {
+// if (layer_state & (1<<2)) {
+// if (!playing_notes)
+// play_notes(&start_up, 9, true);
+// } else if (layer_state & (1<<3)) {
+// if (!playing_notes)
+// play_notes(&start_up, 9, true);
+// } else {
+// if (playing_notes)
+// stop_all_notes();
+// }
+// } \ No newline at end of file