Compare commits

...

25 Commits

Author SHA1 Message Date
skullY
0dda5b8541 Add songs to Clueboard 66% Hotswap 2018-03-15 16:56:15 -07:00
skullY
ccb75398c2 Add support for clueboard hotswap audio 2018-03-15 16:44:20 -07:00
skullY
8b15168d0c Make audio debugging easier 2018-03-15 16:40:15 -07:00
skullY
ac36c24e65 Merge remote-tracking branch 'origin/master' into clueboard_hotswap 2018-03-15 16:38:44 -07:00
U-LANDSRAAD\drashna
ad1a868701 Move Narze keymap into Ergodox Infinity folder 2018-03-14 22:01:52 -04:00
U-LANDSRAAD\drashna
9db908f7d1 Fix Preonic layout 2018-03-14 21:54:33 -04:00
ajp10304
added1f062 Planck ajp10304 (#2519)
* Planck ajp10304 layout clean up

* Planck ajp10304 layout add Mac layer extensions

* JJ40 ajp10304 layout add Mac layer extensions
2018-03-13 02:22:35 -04:00
uplus
e8e999dcc0 Fix preonic/rev2 bootloader config 2018-03-13 02:22:10 -04:00
Brian Choromanski
4464d90f4d Fixed plank keymaps so that they will compile for planck light 2018-03-13 02:21:18 -04:00
Joe Wasson
2dacf25f28 Add layout support for contra. 2018-03-12 14:22:56 -04:00
Joe Wasson
bfa34d02b0 Add default keymap for contra 2018-03-12 14:22:56 -04:00
Jon Nall
0b82d08e8d Fixed exit status check for brew 2018-03-09 20:10:44 -08:00
adiron
fdeb7f7665 Added Contra keyboard support (#2501)
* Added Contra keyboard support

The configuration came from a source distribution of the firmware on the
Contra's official website.

I have also included a simple MIDI keymap. (And it works!)

* Changes to Contra config and README

* Readme has been changed as requested by jackhumbert
* Config has been changed to add the Cartel and Contra names to
  the USB configuration.
2018-03-09 14:27:31 -05:00
sparkyman215
141a52982e update ymdk96 files 2018-03-09 13:34:37 -05:00
Danny
ac5326595c Add Viterbi fido keymap (#2454)
* Add fido Viterbi keymap

* Cleanup rules files

* Remove unused WIP code
2018-03-09 13:32:50 -05:00
hypnocrat
400f410c45 XD75 keymap - Germanized (#2441)
* Added a heavily customized German keymap to the XD75RE

* A heavily customized alternative layout for the XD75, for German users

* Fixed capitalization, removed unnecessary files

* Hopefully fixed capitalization, some keymap changes
2018-03-09 13:32:03 -05:00
Brian Choromanski
8d6eadf261 Patched some keyboards that won't compile (#2453) 2018-03-09 13:31:42 -05:00
Louis Orleans
0e6e059ef3 layout(planck): dudeofawesome's layout (#2457)
* layout(planck): new layout initial commit

* feat(planck): add workman layout

* fix(planck): switching to workman

* layout(planck): swapping mnext and mplay

* feat(planck): prep for RGB

* perf(planck): remove plover

saves 256 bytes of memory

* perf(planck): remove colemak

saves 128 bytes

* layout(planck): swapping enter and quote

* perf(planck): disable console

frees 1664 bytes

* feat(planck): RGB under-lighting

* refactor(planck): change RGB pin

Uses pin labeled PB2

* feat(planck): add RGB keycodes

* feat(planck): re-enable audio

* style(planck): fixing indentation

Because who indents like that?

* style(planck): clean up keycodes

* layout(planck): remove del

* feat(planck): add tap-space to layer keys

* docs(planck): specify pin on PCB for RGB

* bug(planck): reducing tap time

* Revert "bug(planck): reducing tap time"

This reverts commit 62606b2dc62c5adcc06cfb5978d7e5305411a658.

* Revert "feat(planck): add tap-space to layer keys"

This reverts commit c74de5a4aa45c5563dcaa463395654c29f50eda3.

* perf(planck): remove backlit case

* feat(planck): swap enter and quote

* bug(planck): moving right shift

* doc(planck): update README

* chore(planck): remove makefile

* 🔨 add userspace config

* 📝 update layer ascii art

* 🔥 disable RGB lighting

*  add Colemak

*  add numpad layer

*  add caps lock on adjust layer

* 📝 update layer renders

* 🔥 remove workman sound def

* 🔨 add userspace config

* 📝 update layer ascii art

* 🔥 disable RGB lighting

*  add Colemak

*  add numpad layer

*  add caps lock on adjust layer

* 📝 update layer renders

* 🔥 remove workman sound def
2018-03-09 13:31:08 -05:00
Jack Humbert
ad982e39d6 implement new features for arm 2018-01-15 23:21:28 -05:00
Jack Humbert
0ad93d7443 Merge branch 'arm_audio_fixes' of github.com:qmk/qmk_firmware into audio_out 2018-01-15 16:18:39 -05:00
Jack Humbert
690a08cbbb fix up arm audio implementation 2018-01-15 16:06:49 -05:00
Jack Humbert
7923376de1 update music functionality 2018-01-06 23:52:20 -05:00
Jack Humbert
8582faab6f add planck audio out config 2018-01-03 14:32:10 -05:00
Jack Humbert
60a0b08da3 add b6/b7 audio 2018-01-03 13:13:50 -05:00
Jack Humbert
5cc7df8750 try out b6 and b7 audio 2017-07-28 11:29:26 -04:00
79 changed files with 2203 additions and 423 deletions

View File

@@ -359,7 +359,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_defaults(); breathing_period_default();
} }
break; break;

View File

@@ -1,4 +1,4 @@
#include "clueboard.h" #include "66.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below. // Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name. // The underscores don't mean anything - you can have a layer called STUFF or any other name.

View File

@@ -64,7 +64,7 @@
{ k20, k21, k22, k23, k24, k25, k26, k27 }, \ { k20, k21, k22, k23, k24, k25, k26, k27 }, \
{ k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
{ k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \
{ k50, k51, k52, k53, k54, k55, KC_NO, k57 }, \ { k50, k51, k52, k53, k54, KC_NO, KC_NO, k57 }, \
{ k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
{ k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
{ k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
@@ -73,7 +73,7 @@
/* LAYOUT_66_iso, standard 67 key ISO layout /* LAYOUT_66_iso, standard 67 key ISO layout
*/ */
#define LAYOUT_ISO( \ #define LAYOUT_66_iso( \
k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \
k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k67, \ k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k67, \
k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k74, k75, \ k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k74, k75, \

View File

@@ -26,7 +26,7 @@
/* Speaker configuration /* Speaker configuration
*/ */
//#define SPEAKER_PIN B7 // FIXME: find the correct name for this define #define B7_AUDIO
/* Backlight configuration /* Backlight configuration
*/ */

View File

@@ -6,6 +6,30 @@
#define _FL 1 #define _FL 1
#define _CL 2 #define _CL 2
enum custom_keycodes {
S_BSKTC = SAFE_RANGE,
S_ODEJY,
S_RCKBY,
S_DOEDR,
S_SCALE,
S_ONEUP,
S_COIN,
S_SONIC,
S_ZELDA
};
#ifdef AUDIO_ENABLE
float song_basketcase[][2] = SONG(BASKET_CASE);
float song_ode_to_joy[][2] = SONG(ODE_TO_JOY);
float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY);
float song_doe_a_deer[][2] = SONG(DOE_A_DEER);
float song_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float song_coin[][2] = SONG(COIN_SOUND);
float song_one_up[][2] = SONG(ONE_UP_SOUND);
float song_sonic_ring[][2] = SONG(SONIC_RING);
float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE);
#endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: Base Layer (Default Layer) /* Keymap _BL: Base Layer (Default Layer)
*/ */
@@ -30,7 +54,67 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_CL] = LAYOUT( [_CL] = LAYOUT(
BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, RGB_TOG, RGB_VAI, \ BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, RGB_TOG, RGB_VAI, \
_______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \
_______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______,_______,MO(_CL),_______,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC, S_ZELDA, \
_______,MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,MO(_FL),_______, RGB_SAI, \ _______,MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,MO(_FL),_______, RGB_SAI, \
_______,_______,_______, RGB_MOD,RGB_MOD, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI), _______,_______,_______, RGB_MOD,RGB_MOD, _______,_______,MO(_FL),_______,RGB_HUD,RGB_SAD,RGB_HUI),
}; };
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case S_BSKTC:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_basketcase);
}
return false;
case S_ODEJY:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_ode_to_joy);
}
return false;
case S_RCKBY:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_rock_a_bye_baby);
}
return false;
case S_DOEDR:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_doe_a_deer);
}
return false;
case S_SCALE:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_scale);
}
return false;
case S_ONEUP:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_one_up);
}
return false;
case S_COIN:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_coin);
}
return false;
case S_SONIC:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_sonic_ring);
}
return false;
case S_ZELDA:
if (record->event.pressed) {
stop_all_notes();
PLAY_SONG(song_zelda_puzzle);
}
return false;
}
return true;
}

View File

@@ -6,6 +6,7 @@ ARCH = AVR8
F_USB = $(F_CPU) F_USB = $(F_CPU)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
OPT_DEFS += -DBOOTLOADER_SIZE=4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096
EXTRAFLAGS += -flto
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
@@ -14,9 +15,9 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
AUDIO_ENABLE = no AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode

58
keyboards/contra/config.h Executable file
View File

@@ -0,0 +1,58 @@
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER Cartel
#define PRODUCT Contra
#define DESCRIPTION Keyboard
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
/* key matrix pins */
#define MATRIX_ROW_PINS { F6, B3, B2, B6 }
#define MATRIX_COL_PINS { F4, F5, B5, B4, E6, D7, C6, D4, D0, D1, D2, D3 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* number of backlight levels */
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 0
#endif
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 0
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif
#endif

1
keyboards/contra/contra.c Executable file
View File

@@ -0,0 +1 @@
#include "contra.h"

46
keyboards/contra/contra.h Executable file
View File

@@ -0,0 +1,46 @@
#ifndef KB_H
#define KB_H
#include "quantum.h"
#define LAYOUT_grid( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \
) { \
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 } \
}
#define LAYOUT_mit( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311 \
) { \
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
{ K300, K301, K302, K303, K304, K305, K305, K307, K308, K309, K310, K311 } \
}
#define KC_LAYOUT_grid( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \
) \
LAYOUT_grid( \
KC_##K000, KC_##K001, KC_##K002, KC_##K003, KC_##K004, KC_##K005, KC_##K006, KC_##K007, KC_##K008, KC_##K009, KC_##K010, KC_##K011, \
KC_##K100, KC_##K101, KC_##K102, KC_##K103, KC_##K104, KC_##K105, KC_##K106, KC_##K107, KC_##K108, KC_##K109, KC_##K110, KC_##K111, \
KC_##K200, KC_##K201, KC_##K202, KC_##K203, KC_##K204, KC_##K205, KC_##K206, KC_##K207, KC_##K208, KC_##K209, KC_##K210, KC_##K211, \
KC_##K300, KC_##K301, KC_##K302, KC_##K303, KC_##K304, KC_##K305, KC_##K306, KC_##K307, KC_##K308, KC_##K309, KC_##K310, KC_##K311 \
)
#define KEYMAP LAYOUT_grid
#define LAYOUT_ortho_4x12 LAYOUT_grid
#define KC_LAYOUT_ortho_4x12 KC_LAYOUT_grid
#endif

View File

@@ -0,0 +1,30 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#undef TAPPING_TERM
#define TAPPING_TERM 190
#define MUSIC_MASK (keycode != KC_NO)
#define MIDI_ADVANCED
#endif

View File

@@ -0,0 +1,37 @@
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
// this is the style you want to emulate.
#include "contra.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | ` | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | Cmd |Lower | Space |Raise | Enter| Cmd | Alt |Ctrl |
* `-----------------------------------------------------------------------------------'
*/
[0] = {
{ MI_C_4, MI_Cs_4, MI_D_4, MI_Ds_4, MI_E_4, MI_F_4, MI_Fs_4, MI_G_4, MI_Gs_4, MI_A_4, MI_As_4, MI_B_4 },
{ MI_C_3, MI_Cs_3, MI_D_3, MI_Ds_3, MI_E_3, MI_F_3, MI_Fs_3, MI_G_3, MI_Gs_3, MI_A_3, MI_As_3, MI_B_3 },
{ MI_C_2, MI_Cs_2, MI_D_2, MI_Ds_2, MI_E_2, MI_F_2, MI_Fs_2, MI_G_2, MI_Gs_2, MI_A_2, MI_As_2, MI_B_2 },
{ MI_C_1, MI_Cs_1, MI_D_1, MI_Ds_1, MI_E_1, MI_F_1, MI_Fs_1, MI_G_1, MI_Gs_1, MI_A_1, MI_As_1, MI_B_1 }
}
};

View File

@@ -0,0 +1,6 @@
# Dana musical MIDI keyboard layout
Has the contra mapped as a MIDI keyboard, where each row is an octave.
The keyboard has only MIDI, nothing else!

View File

@@ -0,0 +1,25 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = yes # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@@ -0,0 +1,42 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "config_common.h"
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
#define MUSIC_MASK (keycode != KC_NO)
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
#endif

View File

@@ -0,0 +1,264 @@
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "contra.h"
#include "action_layer.h"
extern keymap_config_t keymap_config;
enum planck_layers {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_PLOVER,
_ADJUST
};
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
LOWER,
RAISE,
BACKLIT,
EXT_PLV
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
/* Plover layer (http://opensteno.org)
* ,-----------------------------------------------------------------------------------.
* | # | # | # | # | # | # | # | # | # | # | # | # |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | S | T | P | H | * | * | F | P | L | T | D |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | S | K | W | R | * | * | R | B | G | S | Z |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Exit | | | A | O | | E | U | | | |
* `-----------------------------------------------------------------------------------'
*/
[_PLOVER] = {
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL },
{_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
PORTE &= ~(1<<6);
} else {
unregister_code(KC_RSFT);
PORTE |= (1<<6);
}
return false;
break;
case PLOVER:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
PLAY_SONG(plover_song);
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}

View File

@@ -0,0 +1,2 @@
# The Default Contra Layout

View File

@@ -0,0 +1,16 @@
CONTRA
===
![CONTRA](https://cartel.ltd/wp-content/uploads/2018/01/img_3209.jpg)
A 40% keyboard by
Keyboard Maintainer: The QMK Community
Hardware Supported: CONTRA
Hardware Availability: [CARTEL](https://cartel.ltd/projects/contra/)
Make example for this keyboard (after setting up your build environment):
make contra:dana
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.

61
keyboards/contra/rules.mk Executable file
View File

@@ -0,0 +1,61 @@
# MCU name
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
LAYOUTS = ortho_4x12 planck_mit planck_grid
LAYOUTS_HAS_RGB = no

View File

@@ -1,14 +1,16 @@
#include "xd60.h" #include "dz60.h"
#include "action_layer.h" #include "action_layer.h"
#Define _L0 0 #define _L0 0
#Define _L1 1 #define _L1 1
#Define _L2 2 #define _L2 2
#Define _L3 3 #define _L3 3
#Define _L4 4 #define _L4 4
#define _______ KC_TRNS #define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* template * template
* [_L1] = KEYMAP( * [_L1] = KEYMAP(
@@ -22,7 +24,7 @@
*\ *\
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _L0: (Layer 0 - Base Layer) This is the default layer * Keymap _L0: (Layer 0 - Base Layer) This is the default layer
* This layer has a key set to MO(_L1) which means when held down Layer 1 will become active, If Layer 1 does not have anything set for tat key is will revert to uing the key set at layer 0. * This layer has a key set to MO(_L1) which means when held down Layer 1 will become active, If Layer 1 does not have anything set for tat key is will revert to uing the key set at layer 0.
* LT(_L1, KC_1) means that when the "1" key is long touched then it will activate the layer _L1 key(F1) but if the key is just tapped it will activate the "1" key. * LT(_L1, KC_1) means that when the "1" key is long touched then it will activate the layer _L1 key(F1) but if the key is just tapped it will activate the "1" key.
* KC_GESC = Escape when tapped, ` when pressed with Shift or GUI * KC_GESC = Escape when tapped, ` when pressed with Shift or GUI
@@ -45,9 +47,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_L0] = KEYMAP( [_L0] = KEYMAP(
KC_GESC, LT(_L1, KC_1),LT(_L1, KC_2),LT(_L1, KC_3),LT(_L1, KC_4),LT(_L1, KC_5),LT(_L1, KC_6),LT(_L1, KC_7),LT(_L1, KC_8),LT(_L1, KC_9),LT(_L1, KC_0),LT(_L1, KC_MINS),LT(_L1, KC_EQL),KC_BSPC, KC_DEL, \ KC_GESC, LT(_L1, KC_1),LT(_L1, KC_2),LT(_L1, KC_3),LT(_L1, KC_4),LT(_L1, KC_5),LT(_L1, KC_6),LT(_L1, KC_7),LT(_L1, KC_8),LT(_L1, KC_9),LT(_L1, KC_0),LT(_L1, KC_MINS),LT(_L1, KC_EQL),KC_BSPC, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPO, KC_UP, M0(_L1), \ KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, TO(_L1), \
KC_LCTL, KC_LGUI, KC_LALT, TD(LT(_L3,KC_SPACE)),BL_TOGG,TD(TD_SPC_ENT), KC_RGUI, M0(_L2), KC_LEFT, KC_DOWN, KC_RIGHT), KC_LCTL, KC_LGUI, KC_LALT, TD(LT(_L3,KC_SPACE)),BL_TOGG,TD(TD_SPC_ENT), KC_RGUI, TO(_L2), KC_LEFT, KC_DOWN, KC_RIGHT),
/* Keymap _L1: (Layer 1) This is function layer 1 /* Keymap _L1: (Layer 1) This is function layer 1
* This layer is activated while the Fn key is being held down. * This layer is activated while the Fn key is being held down.
@@ -66,8 +68,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_L1] = KEYMAP( [_L1] = KEYMAP(
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \
_______, KC_WH_U, KC_UP, KC_WH_D, _______, _______,_______, _______, _______, _______, KC_PSCR, _______, _______, _______, \ _______, KC_WH_U, KC_UP, KC_WH_D, _______, _______,_______, _______, _______, _______, KC_PSCR, _______, _______, _______, \
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_HOME, _______, _______, _______, KC_HOME, _______, _______, _______, \ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_HOME, _______, _______, _______, KC_HOME, _______, _______, \
_______, _______, _______, KC_APP, BL_STEP,_______, KC_END, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, KC_PGUP, _______, \ _______, _______, KC_APP, BL_STEP,_______, KC_END, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, KC_PGUP, _______, \
_______, _______, _______, _______,_______,_______, _______, _______, KC_HOME, KC_PGDOWN, KC_END), _______, _______, _______, _______,_______,_______, _______, _______, KC_HOME, KC_PGDOWN, KC_END),
/* Keymap _L2: (Layer 2) This is function layer 2 /* Keymap _L2: (Layer 2) This is function layer 2
@@ -89,9 +91,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_L2] = KEYMAP( [_L2] = KEYMAP(
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,LCA(KC_TAB), \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,LCA(KC_TAB), \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, MEH(KC_TAB), \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, MEH(KC_TAB), \
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MS_BTN1,KC_MS_UP,KC_MS_BTN2, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MS_BTN1,KC_MS_UP,KC_MS_BTN2, \
_______,_______,_______, _______,_______,_______, _______,_______,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT, _______,_______,_______, _______,_______,_______, _______,_______,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT)
}; };

View File

@@ -5,22 +5,28 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below. enum jj40_layers {
// The underscores don't mean anything - you can have a layer called STUFF or any other name. _QWERTY,
// Layer names don't all need to be of the same length, obviously, and you can also skip them _MAC,
// entirely and just use numbers. _LOWER,
#define _QWERTY 0 _MLWR,
#define _LOWER 1 _RAISE,
#define _RAISE 2 _MRSE,
#define _FUNC 3 _FUNC,
#define _ADJUST 16 _MFNC,
#define _DYN 6 _ADJUST,
_DYN
};
enum planck_keycodes { enum jj40_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
MAC,
FUNC, FUNC,
MFNC,
LOWER, LOWER,
MLWR,
RAISE, RAISE,
MRSE,
DYNAMIC_MACRO_RANGE DYNAMIC_MACRO_RANGE
}; };
@@ -117,10 +123,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_ADJUST] = KEYMAP(\ [_ADJUST] = KEYMAP(\
M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,\ M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,\
KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ ,\ KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ ,\ TG(_MAC), _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ \ _______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ \
), ),
/* DYN: Macro Recording and Playback /* DYN: Macro Recording and Playback
@@ -139,11 +145,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\
),
[_MAC]= KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, _______\
),
[_MLWR] = KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\
),
[_MRSE] = KEYMAP(\
_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_EQL) ,\
_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_MFNC]= KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) ,\
_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
) )
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
@@ -179,10 +212,42 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; return false;
} case MLWR:
if (record->event.pressed) {
layer_on(_LOWER);
layer_on(_MLWR);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
layer_off(_MLWR);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
case MRSE:
if (record->event.pressed) {
layer_on(_RAISE);
layer_on(_MRSE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
layer_off(_MRSE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
case MFNC:
if (record->event.pressed) {
layer_on(_FUNC);
layer_on(_MFNC);
} else {
layer_off(_FUNC);
layer_off(_MFNC);
}
return false;
}
return true; return true;
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { switch(id) {
// These would trigger when you hit a key mapped as M(0) // These would trigger when you hit a key mapped as M(0)
@@ -201,6 +266,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
END END
); );
} }
case 2: // Word Select - MAC
if (record->event.pressed) {
return MACRO(
DOWN(KC_LALT), DOWN(KC_RIGHT), UP(KC_RIGHT), DOWN(KC_LSFT), DOWN(KC_LEFT), UP(KC_LEFT), UP(KC_LSFT), UP(KC_LALT),
END
);
}
} }
return MACRO_NONE; return MACRO_NONE;
}; };

View File

@@ -1,12 +1,12 @@
# AJP10304 Custom JJ40 Layout # AJP10304 Custom JJ40 Layout
###Based on my Planck layout of the same name. ###Based on my Planck layout of the same name.
**Note:** In the tables below where there are two characters on a key, **Note:** In the tables below where there are two characters on a key,
the second is the output when shift is applied. the second is the output when shift is applied.
**Note:** The below tables assume a UK layout. **Note:** The below tables assume a UK layout.
##### Main Qwerty Layer ##### Main Qwerty Layer
* Tab: when held, operates as shift. * Tab: when held, operates as shift.
* Enter: when held, operates as shift. * Enter: when held, operates as shift.
@@ -33,7 +33,7 @@ Activated when `fn` held in the above `qwerty` layer.
Activated when `Lower` is held in the above `qwerty` layer. Activated when `Lower` is held in the above `qwerty` layer.
* Numbers are along the top row, their shifted counterparts are on row 2. * Numbers are along the top row, their shifted counterparts are on row 2.
* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. * WrdBks: `backspace` with `ctrl` applied. I.e. delete a word.
* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. * WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word.
| | | | | | | | | | | | | | | | | | | | | | | | | |
@@ -42,45 +42,47 @@ Activated when `Lower` is held in the above `qwerty` layer.
| ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| | ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks|
| Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | | Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift |
| | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play |
##### Raise Layer ##### Raise Layer
Activated when `Raise` is held in the above `qwerty` layer. Activated when `Raise` is held in the above `qwerty` layer.
* Preferred layer for typing brackets. * Preferred layer for typing brackets.
* Allows for cursor navigation to be used solely with the right hand. * Allows for cursor navigation to be used solely with the right hand.
* WRDSEL: Select the word where the cursor is. * WRDSEL: Select the word where the cursor is.
* |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. * |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping.
| | | | | | | | | | | | | | | | | | | | | | | | | |
| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| | :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:|
| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| | ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC|
| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| | ` | | | ( | ) | | | HOME | UP | END | |ZOOM +|
| | | | { | } | |&#124;<| LEFT | DOWN |RIGHT |>&#124;|ZOOM -| | | | | { | } | |&#124;<| LEFT | DOWN |RIGHT |>&#124;|ZOOM -|
| | | | | | Alt | Enter |Raise | | | | | | | | | | | Alt | Enter |Raise | | | | |
##### Lower + Raise ##### Lower + Raise
Activated when `Lower` and `Raise` are held together the above `qwerty` layer. Activated when `Lower` and `Raise` are held together the above `qwerty` layer.
* Audio controls in the same position as cursor keys from the `Raise` layer. * Audio controls in the same position as cursor keys from the `Raise` layer.
* ????: Runs a macro for outputting a text string. Do not use this store passwords. * ????: Runs a macro for outputting a text string. Do not use this store passwords.
* Reset: Enter bootloader for flashing firmware to the keyboard. * Reset: Enter bootloader for flashing firmware to the keyboard.
* CAPS: Toggle caps lock. * CAPS: Toggle caps lock.
* DYN: Enter `DYN` layer. * DYN: Enter `DYN` layer.
* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER,
MRSE with RAISE and MFNC with FUNC respectively.
| | | | | | | | | | | | | | | | | | | | | | | | | |
| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| | :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
| ???? | Reset|Qwerty| | | | | | | | | Del | | ???? | Reset|Qwerty| | | | | | | | | Del |
| CAPS | | | | | | | Mute | Vol+ | Play | | | | CAPS | | | | | | | Mute | Vol+ | Play | | |
| | | | | | | | Prev | Vol- | Next | | | | MAC | | | | | | | Prev | Vol- | Next | | |
| | | | | | | | | DYN | | | | | | | | | | | | | DYN | | | |
##### DYN ##### DYN
Activated when `DYN` held along with `Lower` and `Raise` Activated when `DYN` held along with `Lower` and `Raise`
Allows recording of macros. To start recording the macro, press either REC1 or REC2. Allows recording of macros. To start recording the macro, press either REC1 or REC2.
To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2.
| | | | | | | | | | | | | | | | | | | | | | | | | |
| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| | :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
| | | | | | REC1 | REC2 | | | | | | | | | | | | REC1 | REC2 | | | | | |
| | | | | | PLAY1| PLAY2| | | | | | | | | | | | PLAY1| PLAY2| | | | | |
| | | | | | STOP | STOP | | | | | | | | | | | | STOP | STOP | | | | | |

View File

@@ -5,22 +5,28 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below. enum planck_layers {
// The underscores don't mean anything - you can have a layer called STUFF or any other name. _QWERTY,
// Layer names don't all need to be of the same length, obviously, and you can also skip them _MAC,
// entirely and just use numbers. _LOWER,
#define _QWERTY 0 _MLWR,
#define _LOWER 1 _RAISE,
#define _RAISE 2 _MRSE,
#define _FUNC 3 _FUNC,
#define _ADJUST 16 _MFNC,
#define _DYN 6 _ADJUST,
_DYN
};
enum planck_keycodes { enum planck_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
MAC,
FUNC, FUNC,
MFNC,
LOWER, LOWER,
MLWR,
RAISE, RAISE,
MRSE,
DYNAMIC_MACRO_RANGE DYNAMIC_MACRO_RANGE
}; };
@@ -117,10 +123,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_ADJUST] = { [_ADJUST] = {
{M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, {M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
{KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ }, {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ }, {TG(_MAC), _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ } {_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ }
}, },
/* DYN: Macro Recording and Playback /* DYN: Macro Recording and Playback
@@ -141,8 +147,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}, },
};
[_MAC]= {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, _______}
},
[_MLWR] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
[_MRSE] = {
{_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_EQL) },
{_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},
[_MFNC]= {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) },
{_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},
};
void persistant_default_layer_set(uint16_t default_layer) { void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
@@ -179,10 +213,42 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; return false;
} case MLWR:
if (record->event.pressed) {
layer_on(_LOWER);
layer_on(_MLWR);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
layer_off(_MLWR);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
case MRSE:
if (record->event.pressed) {
layer_on(_RAISE);
layer_on(_MRSE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
layer_off(_MRSE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
case MFNC:
if (record->event.pressed) {
layer_on(_FUNC);
layer_on(_MFNC);
} else {
layer_off(_FUNC);
layer_off(_MFNC);
}
return false;
}
return true; return true;
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { switch(id) {
// These would trigger when you hit a key mapped as M(0) // These would trigger when you hit a key mapped as M(0)
@@ -201,6 +267,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
END END
); );
} }
case 2: // Word Select - MAC
if (record->event.pressed) {
return MACRO(
DOWN(KC_LALT), DOWN(KC_RIGHT), UP(KC_RIGHT), DOWN(KC_LSFT), DOWN(KC_LEFT), UP(KC_LEFT), UP(KC_LSFT), UP(KC_LALT),
END
);
}
} }
return MACRO_NONE; return MACRO_NONE;
}; };

View File

@@ -65,12 +65,14 @@ Activated when `Lower` and `Raise` are held together the above `qwerty` layer.
* Reset: Enter bootloader for flashing firmware to the keyboard. * Reset: Enter bootloader for flashing firmware to the keyboard.
* CAPS: Toggle caps lock. * CAPS: Toggle caps lock.
* DYN: Enter `DYN` layer. * DYN: Enter `DYN` layer.
* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER,
MRSE with RAISE and MFNC with FUNC respectively.
| | | | | | | | | | | | | | | | | | | | | | | | | |
| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| | :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
| ???? | Reset|Qwerty| | | | | | | | | Del | | ???? | Reset|Qwerty| | | | | | | | | Del |
| CAPS | | | | | | | Mute | Vol+ | Play | | | | CAPS | | | | | | | Mute | Vol+ | Play | | |
| | | | | | | | Prev | Vol- | Next | | | | MAC | | | | | | | Prev | Vol- | Next | | |
| | | | | | | | | DYN | | | | | | | | | | | | | DYN | | | |
##### DYN ##### DYN

View File

@@ -0,0 +1,47 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "config_common.h"
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
#define MUSIC_MASK (keycode != KC_NO)
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
#define C6_AUDIO
#define B7_AUDIO
#undef BACKLIGHT_PIN
#endif

View File

@@ -0,0 +1,264 @@
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "planck.h"
#include "action_layer.h"
extern keymap_config_t keymap_config;
enum planck_layers {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_PLOVER,
_ADJUST
};
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
LOWER,
RAISE,
BACKLIT,
EXT_PLV
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
/* Plover layer (http://opensteno.org)
* ,-----------------------------------------------------------------------------------.
* | # | # | # | # | # | # | # | # | # | # | # | # |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | S | T | P | H | * | * | F | P | L | T | D |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | S | K | W | R | * | * | R | B | G | S | Z |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Exit | | | A | O | | E | U | | | |
* `-----------------------------------------------------------------------------------'
*/
[_PLOVER] = {
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL },
{_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
PORTE &= ~(1<<6);
} else {
unregister_code(KC_RSFT);
PORTE |= (1<<6);
}
return false;
break;
case PLOVER:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
PLAY_SONG(plover_song);
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}

View File

@@ -0,0 +1,3 @@
AUDIO_ENABLE = yes
BACKLIGHT_ENABLE = no
MIDI_ENABLE = no

View File

@@ -3,7 +3,10 @@
#include "config_common.h" #include "config_common.h"
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 3
#endif
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND) #define STARTUP_SONG SONG(PLANCK_SOUND)

View File

@@ -126,15 +126,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY); set_single_persistent_default_layer(_QWERTY);
breathing_self_disable(); #ifdef BACKLIGHT_BREATHING
breathing_self_disable();
#endif
} }
return false; return false;
break; break;
case DATA: case DATA:
if (record->event.pressed) { if (record->event.pressed) {
set_single_persistent_default_layer(_DATA); set_single_persistent_default_layer(_DATA);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_speed_set(3);
breathing_enable(); breathing_enable();
#endif #endif
} }
@@ -145,8 +146,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_on(_LOWER); layer_on(_LOWER);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_speed_set(3);
breathing_enable(); breathing_enable();
#endif #endif
} }
@@ -155,7 +155,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_off(_LOWER); layer_off(_LOWER);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
breathing_self_disable(); #ifdef BACKLIGHT_BREATHING
breathing_self_disable();
#endif
} }
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
@@ -166,8 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_on(_RAISE); layer_on(_RAISE);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_speed_set(3);
breathing_enable(); breathing_enable();
#endif #endif
} }
@@ -176,7 +177,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_off(_RAISE); layer_off(_RAISE);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
breathing_self_disable(); #ifdef BACKLIGHT_BREATHING
breathing_self_disable();
#endif
} }
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
@@ -185,7 +188,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case BACKLIT: case BACKLIT:
if (record->event.pressed) { if (record->event.pressed) {
register_code(KC_RSFT); register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
backlight_step(); backlight_step();
#endif #endif
} else { } else {

View File

@@ -27,7 +27,10 @@
#include "../../config.h" #include "../../config.h"
#define LEADER_TIMEOUT 300 #define LEADER_TIMEOUT 300
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
/* cbbrowne user configuration */ /* cbbrowne user configuration */

View File

@@ -219,7 +219,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(_RAISE); layer_on(_RAISE);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_period_set(2); breathing_period_set(2);
breathing_pulse(); breathing_pulse();
#endif #endif
@@ -235,7 +235,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(_LOWER); layer_on(_LOWER);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_period_set(2); breathing_period_set(2);
breathing_pulse(); breathing_pulse();
#endif #endif

View File

@@ -2,14 +2,14 @@
#define CONFIG_USER_H #define CONFIG_USER_H
#include "../../config.h" #include "../../config.h"
#include "dudeofawesome.h"
#define WORKMAN_SOUND COLEMAK_SOUND
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND) #define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND) // #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(WORKMAN_SOUND), \
SONG(COLEMAK_SOUND), \ SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \ SONG(DVORAK_SOUND) \
} }
@@ -41,8 +41,4 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2 //#define MIDI_TONE_KEYCODE_OCTAVES 2
#define RGB_DI_PIN B2 // The pin the LED strip is connected to (PB2 by default)
#define RGBLED_NUM 3 // Number of LEDs in your strip
#define RGBLIGHT_ANIMATIONS
#endif #endif

View File

@@ -22,17 +22,20 @@ extern keymap_config_t keymap_config;
enum planck_layers { enum planck_layers {
_QWERTY, _QWERTY,
_DVORAK,
_WORKMAN, _WORKMAN,
_COLEMAK,
_DVORAK,
_LOWER, _LOWER,
_RAISE, _RAISE,
_ADJUST _ADJUST,
_NUMPAD,
}; };
enum planck_keycodes { enum planck_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
DVORAK,
WORKMAN, WORKMAN,
COLEMAK,
DVORAK,
LOWER, LOWER,
RAISE, RAISE,
BACKLIT BACKLIT
@@ -44,61 +47,79 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; |Enter | * | Esc | A | S | D | F | G | H | J | K | L | ; | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / | ' | * | Shift| Z | X | C | V | B | N | M | , | . | / | Enter|
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | RGB | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right|
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_QWERTY] = { [_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC },
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT)}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT)},
{RGB_TOG, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT } {TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT }
},
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S |Enter |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z | / |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | RGB | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC },
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH },
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, RSFT_T(KC_ENT)},
{RGB_TOG, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT }
}, },
/* Workman /* Workman
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | R | W | B | J | F | U | P | ; | Bksp | * | Tab | Q | W | R | W | B | J | F | U | P | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | H | T | G | Y | N | E | O | I |Enter | * | Esc | A | S | H | T | G | Y | N | E | O | I | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | M | C | V | K | L | , | . | / | ' | * | Shift| Z | X | M | C | V | K | L | , | . | / | Enter|
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | RGB | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right|
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_WORKMAN] = { [_WORKMAN] = {
{KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC }, {KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC },
{KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT }, {KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT },
{KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT)}, {KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT)},
{RGB_TOG, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT } {TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT }
},
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / | Enter|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right|
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT)},
{TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z | Enter|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Num | Ctrl | Alt | GUI | Lower| Space | Raise| Left | Down | Up | Right|
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC },
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH },
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, RSFT_T(KC_ENT)},
{TT(_NUMPAD), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT }
}, },
/* Lower /* Lower
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -116,7 +137,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -134,7 +155,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del | * | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Wrkman|Dvorak| | | * |CPSLCK| | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Wrkman|Dvorak|Colemk| |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -143,9 +164,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[_ADJUST] = { [_ADJUST] = {
{_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL }, {_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL },
{_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, DVORAK, _______, _______}, {KC_CAPS, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, DVORAK, COLEMAK, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_M_R, _______, _______, _______, _______}, {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_M_R, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Numpad
* ,-----------------------------------------------------------------------------------.
* | | ✗ | Home | Up | End | PgUp | ✗ | 7 | 8 | 9 | + | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | ✗ | Left | Down | Right| PgDn | ✗ | 4 | 5 | 6 | - | ✗ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | / | * | - | + | Enter| ✗ | 1 | 2 | 3 | * | Enter|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | ✗ | | 0 | 0 | . | / | = |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = {
{_______, KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_P7, KC_P8, KC_P9, KC_PPLS, _______},
{_______, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_NO},
{_______, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_PENT, KC_NO, KC_P1, KC_P2, KC_P3, KC_PAST, KC_PENT},
{_______, _______, _______, _______, KC_NO, _______, _______, KC_P0, KC_P0, KC_PDOT, KC_PSLS, KC_PEQL}
} }
}; };
@@ -168,6 +207,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
set_single_persistent_default_layer(_DVORAK); set_single_persistent_default_layer(_DVORAK);
} }
return false; return false;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
case LOWER: case LOWER:
if (record->event.pressed) { if (record->event.pressed) {
layer_on(_LOWER); layer_on(_LOWER);

View File

@@ -1,17 +1,17 @@
# DudeOfAwesome's Planck Layout # DudeOfAwesome's Planck Layout
A basic Planck layout with simultaneous RGB and audio support. ![Planck Layout](https://i.imgur.com/mOc2Sbd.png)
![Planck Layout](https://i.imgur.com/2p1TEEH.png)
## Features ## Features
- Base Layers - Base Layers
- QWERTY - QWERTY
- Workman - Workman
- Dvorak - Dvorak
- Colemak
- Numpad layer
![numpad layer](https://i.imgur.com/PQENcut.png)
- Audio - Audio
- WS2812b RGB backlight
## Building and flashing ## Building and flashing

View File

@@ -7,4 +7,4 @@ CONSOLE_ENABLE = no # Console for debug(+400)
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
MOUSEKEY_ENABLE = no # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.

View File

@@ -12,7 +12,9 @@
} }
#endif #endif
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
#define TAPPING_TERM 150 #define TAPPING_TERM 150
#define MUSIC_MASK (keycode != KC_NO) #define MUSIC_MASK (keycode != KC_NO)

View File

@@ -123,22 +123,30 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { switch(id) {
case MACRO_BREATH_TOGGLE: case MACRO_BREATH_TOGGLE:
if (record->event.pressed) { if (record->event.pressed) {
breathing_toggle(); #ifdef BACKLIGHT_BREATHING
breathing_toggle();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_INC: case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) { if (record->event.pressed) {
breathing_period_inc(); #ifdef BACKLIGHT_BREATHING
breathing_period_inc();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_DEC: case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) { if (record->event.pressed) {
breathing_period_dec(); #ifdef BACKLIGHT_BREATHING
breathing_period_dec();
#endif
} }
break; break;
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) { if (record->event.pressed) {
breathing_defaults(); #ifdef BACKLIGHT_BREATHING
breathing_period_default();
#endif
} }
break; break;
} }

View File

@@ -25,9 +25,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 12 #define MATRIX_COLS 12
/* Planck PCB default pin-out */ /* Planck PCB default pin-out */
#ifndef LIGHT_CONFIG_H
#define MATRIX_ROW_PINS { D0, D5, B5, B6 } #define MATRIX_ROW_PINS { D0, D5, B5, B6 }
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define UNUSED_PINS #define UNUSED_PINS
#endif
/* /*
* MIDI options * MIDI options
@@ -69,7 +71,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Only print user print statements */ /* Only print user print statements */
#define USER_PRINT #define USER_PRINT
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
/* disable action features */ /* disable action features */
//#define NO_ACTION_LAYER //#define NO_ACTION_LAYER

View File

@@ -316,28 +316,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_BREATH_TOGGLE: case MACRO_BREATH_TOGGLE:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_toggle(); breathing_toggle();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_INC: case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_inc(); breathing_period_inc();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_DEC: case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_dec(); breathing_period_dec();
#endif
} }
break; break;
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_defaults(); #ifdef BACKLIGHT_BREATHING
breathing_period_default();
#endif
} }
break; break;
@@ -352,8 +360,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_UPPER); layer_on(LAYER_UPPER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@@ -367,8 +377,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_LOWER); layer_on(LAYER_LOWER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@@ -381,14 +393,18 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_FUNCTION: case MACRO_FUNCTION:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_period_set(3); #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_period_set(3);
breathing_enable();
#endif
layer_on(LAYER_FUNCTION); layer_on(LAYER_FUNCTION);
} }
else else
{ {
breathing_period_set(1); #ifdef BACKLIGHT_BREATHING
breathing_self_disable(); breathing_period_set(1);
breathing_self_disable();
#endif
layer_off(LAYER_FUNCTION); layer_off(LAYER_FUNCTION);
} }
break; break;

View File

@@ -2,6 +2,7 @@ ifndef QUANTUM_DIR
include ../../../../Makefile include ../../../../Makefile
endif endif
EXTRAKEY_ENABLE = no
MOUSEKEY_ENABLE = no # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER
AUDIO_ENABLE = no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6

View File

@@ -26,9 +26,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 12 #define MATRIX_COLS 12
/* Planck PCB default pin-out */ /* Planck PCB default pin-out */
#ifndef LIGHT_CONFIG_H
#define MATRIX_ROW_PINS { D0, D5, B5, B6 } #define MATRIX_ROW_PINS { D0, D5, B5, B6 }
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define UNUSED_PINS #define UNUSED_PINS
#endif
/* Prevent use of disabled MIDI features in the keymap */ /* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1 //#define MIDI_ENABLE_STRICT 1
@@ -64,7 +66,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Only print user print statements */ /* Only print user print statements */
#define USER_PRINT #define USER_PRINT
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
/* disable action features */ /* disable action features */
//#define NO_ACTION_LAYER //#define NO_ACTION_LAYER

View File

@@ -325,28 +325,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_BREATH_TOGGLE: case MACRO_BREATH_TOGGLE:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_toggle(); breathing_toggle();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_INC: case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_inc(); breathing_period_inc();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_DEC: case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_dec(); breathing_period_dec();
#endif
} }
break; break;
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_defaults(); #ifdef BACKLIGHT_BREATHING
breathing_period_default();
#endif
} }
break; break;
@@ -361,8 +369,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_UPPER); layer_on(LAYER_UPPER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@@ -376,8 +386,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_LOWER); layer_on(LAYER_LOWER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@@ -390,14 +402,18 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_FUNCTION: case MACRO_FUNCTION:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_period_set(3); #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_period_set(3);
breathing_enable();
#endif
layer_on(LAYER_FUNCTION); layer_on(LAYER_FUNCTION);
} }
else else
{ {
breathing_period_set(1); #ifdef BACKLIGHT_BREATHING
breathing_self_disable(); breathing_period_set(1);
breathing_self_disable();
#endif
layer_off(LAYER_FUNCTION); layer_off(LAYER_FUNCTION);
} }
break; break;

View File

@@ -36,7 +36,7 @@ F_USB = $(F_CPU)
# Bootloader # Bootloader
# This definition is optional, and if your keyboard supports multiple bootloaders of # This definition is optional, and if your keyboard supports multiple bootloaders of
# different sizes, comment this out, and the correct address will be loaded # different sizes, comment this out, and the correct address will be loaded
# automatically (+60). See bootloader.mk for all options. # automatically (+60). See bootloader.mk for all options.
ifeq ($(strip $(KEYBOARD)), planck/rev3) ifeq ($(strip $(KEYBOARD)), planck/rev3)
BOOTLOADER = atmel-dfu BOOTLOADER = atmel-dfu
@@ -55,7 +55,7 @@ endif
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Build Options # Build Options
# change to "no" to disable the options, or define them in the Makefile in # change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically # the appropriate keymap folder that will get included automatically
# #
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
@@ -76,5 +76,6 @@ API_SYSEX_ENABLE = no
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LAYOUTS = ortho_4x12 planck_mit planck_grid LAYOUTS = ortho_4x12 planck_mit planck_grid
LAYOUTS_HAS_RGB = no
DEFAULT_FOLDER = planck/rev5 DEFAULT_FOLDER = planck/rev5

View File

@@ -14,7 +14,7 @@
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b }, \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \
{ k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \
} }
@@ -29,7 +29,7 @@
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b }, \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \
{ k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \
} }

View File

@@ -1,3 +1,4 @@
{ {
"identifier": "FEED:6061:0002" "identifier": "FEED:6061:0002",
} "bootloader": "qmk-dfu"
}

View File

@@ -1,5 +1 @@
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@@ -1,5 +1 @@
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@@ -0,0 +1,45 @@
/*
Copyright 2018 Danny Nguyen <danny@keeb.io>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* Use I2C or Serial, not both */
#define USE_SERIAL
// #define USE_I2C
/* Select hand configuration */
#define MASTER_LEFT
#ifndef MASTER_LEFT
#define MASTER_RIGHT
#endif
// #define EE_HANDS
#define TAPPING_TERM 150
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 2
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif

View File

@@ -0,0 +1,74 @@
#include "viterbi.h"
#include "action_layer.h"
#include "eeconfig.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
extern keymap_config_t keymap_config;
#define _QWERTY 0
#define _FN 1
#define KC_ KC_TRNS
#define _______ KC_TRNS
#define KC_FN1 MO(_FN)
#define KC_WD_L LCTL(KC_LEFT)
#define KC_WD_R LCTL(KC_RGHT)
#define KC_RTOG RGB_TOG
#define KC_RMOD RGB_MOD
#define KC_RHUI RGB_HUI
#define KC_RHUD RGB_HUD
#define KC_RSAI RGB_SAI
#define KC_RSAD RGB_SAD
#define KC_RVAI RGB_VAI
#define KC_RVAD RGB_VAD
#define KC_RST RESET
#define KC_CTLZ LCTL(KC_Z)
#define KC_CTLX LCTL(KC_X)
#define KC_CTLC LCTL(KC_C)
#define KC_CTLV LCTL(KC_V)
#define KC_ATAB LALT(KC_TAB)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KC_KEYMAP(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
1 , 2 , 3 , 4 , 5 , 6 ,ESC , DEL , 7 , 8 , 9 , 0 ,MINS,EQL ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
RBRC, Q , W , E , R , T ,TAB , BSPC, Y , U , I , O , P ,LBRC,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
GRV , A , S , D , F , G ,LALT, CAPS, H , J , K , L ,SCLN,QUOT,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
BSLS, Z , X , C , V , B ,LSFT, RSFT, N , M ,COMM,DOT ,SLSH,ENT ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
INS ,PSCR,MENU,LGUI,LCTL,SPC ,FN1 , FN1 ,SPC ,RCTL,RALT, , ,
//`----+----+----+----+----+----+----' `----+----+----+----+----+----+----'
),
[_FN] = KC_KEYMAP(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
F1 , F2 , F3 , F4 , F5 , F6 , , , F7 , F8 , F9 ,F10 ,F11 ,F12 ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
,PGUP,WD_L, UP ,WD_R, ,ATAB, ,RMOD,RHUI,RSAI,RVAI, , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
,HOME,LEFT,DOWN,RGHT, , , , ,RHUD,RSAD,RVAD, , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
,CTLZ,CTLX,CTLC,CTLV, , , ,MUTE,VOLD,VOLU, , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , , , , , , , , , , ,
//`----+----+----+----+----+----+----' `----+----+----+----+----+----+----'
)
};
void led_set_user(uint8_t usb_led) {
#ifdef RGBLIGHT_ENABLE
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
rgblight_enable();
} else {
rgblight_disable();
}
#endif //RGBLIGHT_ENABLE
}

View File

@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes

View File

@@ -1,5 +1 @@
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@@ -1,41 +0,0 @@
#include <stdint.h>
#include <stdbool.h>
#include "split_util.h"
#include "progmem.h"
#include "print.h"
#include "rgblight.h"
#ifdef USE_I2C
# include "i2c.h"
#else // USE_SERIAL
# include "serial.h"
#endif
rgblight_config_t rgblight_config;
void rgblight_slave_update(void) {
//rgblight_effect_christmas();
}
void rgblight_set(void) {
if (rgblight_config.enable) {
#ifdef RGBW
ws2812_setleds_rgbw(led, RGBLED_NUM);
#else
ws2812_setleds(led, RGBLED_NUM);
#endif
} else {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
#ifdef RGBW
ws2812_setleds_rgbw(led, RGBLED_NUM);
#else
ws2812_setleds(led, RGBLED_NUM);
#endif
}
}

View File

@@ -1,6 +0,0 @@
#ifndef SPLIT_RGB_H
#define SPLIT_RGB_H
void rgblight_slave_update(void);
#endif

View File

@@ -0,0 +1,125 @@
/* Copyright 2018 Kolja Brauns
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here
//Tap-Toggle
#define TAPPING_TOGGLE 3
//Tap Dancing
#define TAPPING_TERM 200
// Alt gr
#define ALGR(kc) RALT(kc)
#define DE_ALGR KC_RALT
// normal characters
#define DE_Z KC_Y
#define DE_Y KC_Z
#define DE_A KC_A
#define DE_B KC_B
#define DE_C KC_C
#define DE_D KC_D
#define DE_E KC_E
#define DE_F KC_F
#define DE_G KC_G
#define DE_H KC_H
#define DE_I KC_I
#define DE_J KC_J
#define DE_K KC_K
#define DE_L KC_L
#define DE_M KC_M
#define DE_N KC_N
#define DE_O KC_O
#define DE_P KC_P
#define DE_Q KC_Q
#define DE_R KC_R
#define DE_S KC_S
#define DE_T KC_T
#define DE_U KC_U
#define DE_V KC_V
#define DE_W KC_W
#define DE_X KC_X
#define DE_0 KC_0
#define DE_1 KC_1
#define DE_2 KC_2
#define DE_3 KC_3
#define DE_4 KC_4
#define DE_5 KC_5
#define DE_6 KC_6
#define DE_7 KC_7
#define DE_8 KC_8
#define DE_9 KC_9
#define DE_DOT KC_DOT
#define DE_COMM KC_COMM
#define DE_SS KC_MINS
#define DE_AE KC_QUOT
#define DE_UE KC_LBRC
#define DE_OE KC_SCLN
#define DE_CIRC KC_GRAVE // accent circumflex ^ and ring °
#define DE_ACUT KC_EQL // accent acute ´ and grave `
#define DE_PLUS KC_RBRC // + and * and ~
#define DE_HASH KC_BSLS // # and '
#define DE_LESS KC_NUBS // < and > and |
#define DE_MINS KC_SLSH // - and _
// shifted characters
#define DE_RING LSFT(DE_CIRC) // °
#define DE_EXLM LSFT(KC_1) // !
#define DE_DQOT LSFT(KC_2) // "
#define DE_PARA LSFT(KC_3) // §
#define DE_DLR LSFT(KC_4) // $
#define DE_PERC LSFT(KC_5) // %
#define DE_AMPR LSFT(KC_6) // &
#define DE_SLSH LSFT(KC_7) // /
#define DE_LPRN LSFT(KC_8) // (
#define DE_RPRN LSFT(KC_9) // )
#define DE_EQL LSFT(KC_0) // =
#define DE_QST LSFT(DE_SS) // ?
#define DE_GRV LSFT(DE_ACUT) // `
#define DE_ASTR LSFT(DE_PLUS) // *
#define DE_QUOT LSFT(DE_HASH) // '
#define DE_MORE LSFT(DE_LESS) // >
#define DE_COLN LSFT(KC_DOT) // :
#define DE_SCLN LSFT(KC_COMM) // ;
#define DE_UNDS LSFT(DE_MINS) // _
// Alt Gr-ed characters
#define DE_SQ2 ALGR(KC_2) // ²
#define DE_SQ3 ALGR(KC_3) // ³
#define DE_LCBR ALGR(KC_7) // {
#define DE_LBRC ALGR(KC_8) // [
#define DE_RBRC ALGR(KC_9) // ]
#define DE_RCBR ALGR(KC_0) // }
#define DE_BSLS ALGR(DE_SS) // backslash
#define DE_AT ALGR(KC_Q) // @
#define DE_EURO ALGR(KC_E) // €
#define DE_TILD ALGR(DE_PLUS) // ~
#define DE_PIPE ALGR(DE_LESS) // |
// Launchy
#define ALT_SPC LALT(KC_SPC)
#endif

View File

@@ -0,0 +1,86 @@
/* Copyright 2017 Kolja Brauns
*/
#include "xd75.h"
#ifndef KEYMAP_GERMAN
#define KEYMAP_GERMAN
#include "keymap.h"
#endif
//Tap Dance Declarations
enum {
TD_ESC_RUPT = 0
};
enum {
TD_TAB = 1
};
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap once for Esc, twice Ctrl+Alt+Del
[TD_ESC_RUPT] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, LALT(LCTL(KC_DEL))),
[TD_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, LGUI(KC_TAB))
// Other declarations would go here, separated by commas, if you have them
};
//In Layer declaration, add tap dance item in place of a key code
// Layer shorthand
#define _QWZ 0
#define _FNC 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWZ
* .-----------------------------------------------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | ´ | BckSpc| Esc |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | Tab | Q | W | E | R | T | Z | U | I | O | P | Ü | + | | PgUp |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| Enter |-------|
* | Ctrl/ | A | S | D | F | G | H | J | K | L | Ö | Ä | # | | PgDn |
* | GUITab| | | | | | | | | | | | | | |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | LShift| Y | X | C | V | B | N | M | , | . | - | ^ | Home/ | Up | End |
* | | | | | | | | | | | | | RShift| | |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | LCtrl | LAlt | MO(1)/| Space | Backspace | MO(1)/|AltGr/ | Win | < | Del | Left | Down | Right |
* | | | Enter | | | TO(1) |Pause | | | | | | |
* °-----------------------------------------------------------------------------------------------------------------------°
*/
[_QWZ] = {
{ TD(TD_ESC_RUPT), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_SS, DE_ACUT, KC_BSPC, KC_ESC },
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, KC_NO, KC_PGUP },
{ TD(TD_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, KC_PGDN },
{ KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, DE_CIRC, MT(MOD_RSFT, KC_HOME), KC_UP, KC_END },
{ KC_LCTL, KC_LALT, LT(1, KC_ENT), KC_SPC, KC_NO, KC_BSPC, KC_NO, TT(1), MT(MOD_RALT, KC_PAUS), KC_RGUI, DE_LESS, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT },
},
/* FNC
* .-----------------------------------------------------------------------------------------------------------------------.
* | Reset | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | _____ | _____ |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | _____ | _____ | _____ |Bright+| _____ | _____ | _____ | _____ | _____ | Up | PrtSc | _____ | _____ | _____ | _____ |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | _____ | _____ | _____ |RGB Tog|RGB Mod| _____ | _____ | _____ | Left | Down | Right | _____ | _____ | Play | _____ |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | CpsLck| _____ | _____ |Bright-| _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | VolUp | Mute |
* |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
* | TO(0) | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | Prev | VolDn | Next |
* °-----------------------------------------------------------------------------------------------------------------------°
*/
[_FNC] = {
{ RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS },
{ KC_CAPS, KC_TRNS, KC_TRNS, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_MUTE },
{ TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT },
},
};

View File

@@ -0,0 +1,83 @@
# XD75RE
Copyright 2018 Kolja Brauns
### Current release: 1.7
**Features**
A keymap for German users of the XD75RE keyboard, customized to my needs. Not optimized for ten-finger typing. Some choices are due to me being a lefty.
Designed to ease transition from staggered layouts, with the most important keys in the same positions. All German alphanumerics on main layer. Keyboard language should be set to DE in your OS.
Lots of dual-use keys, mostly with hold/tap. See visual representation below.
Some 2u keys, using PoS caps. If you don't have any you'll have to replace the dummy keys with the relevant keycodes.
Full nav keys on main layer.
Designed to be used with an additional macropad, no numpad configured.
**QWZ** - Layer 0, Default Layer. QWERTZ layout.
.-----------------------------------------------------------------------------------------------------------------------.
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | ´ | BckSpc| Esc |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| Tab | Q | W | E | R | T | Z | U | I | O | P | Ü | + | | PgUp |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| Enter |-------|
| Ctrl/ | A | S | D | F | G | H | J | K | L | Ö | Ä | # | | PgDn |
| GUITab| | | | | | | | | | | | | | |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| LShift| Y | X | C | V | B | N | M | , | . | - | ^ | Home/ | Up | End |
| | | | | | | | | | | | | RShift| | |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| LCtrl | LAlt | MO(1)/| Space | Backspace | MO(1)/|AltGr/ | Win | < | Del | Left | Down | Right |
| | | Enter | | | TO(1) |Pause | | | | | | |
°-----------------------------------------------------------------------------------------------------------------------°
**FNC** - Layer 1, Function Layer. F-Keys, additional useful keys. Usually accessed temporarily, can be toggled if necessary.
.-----------------------------------------------------------------------------------------------------------------------.
| Reset | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | _____ | _____ |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| _____ | _____ | _____ |Bright+| _____ | _____ | _____ | _____ | _____ | Up | PrtSc | _____ | _____ | _____ | _____ |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| _____ | _____ | _____ |RGB Tog|RGB Mod| _____ | _____ | _____ | Left | Down | Right | _____ | _____ | Play | _____ |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| CpsLck| _____ | _____ |Bright-| _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | VolUp | Mute |
|-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
| TO(0) | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | _____ | Prev | VolDn | Next |
°-----------------------------------------------------------------------------------------------------------------------°
*Release 1.1*
Added Printscreen to second layer.
Added shortcut to Launchy to AltGr.
*Release 1.3*
Now using PoS keys for 2u keys, added dummy keys accordingly (not strictly necessary since debouncing handles this, but without this you'll have double input rarely.)
Cleaned keymap up & removed unnecessary layers.
*Release 1.4*
Fixed position of the reset key, replaced right spacebar with backspace.
*Release 1.5*
Reset moved to Esc. Removed Numpad since it wasn't getting any use. Removed random other keys on function layer that weren't getting any use or are covered by my macropad. Added RShift for held home key.
Added secondary arrow keys on JIKL.
*Release 1.6*
Major rework and cleanup.
Capslock removed. Caps now temporarily toggles function layer when held, Esc when tapped. LShift is Capslock when tapped. Esc is Ctrl-Alt-Del on tap.
Left lower MO(1) is now Enter on tap. Right lower Layer(1) is now Tap-Toggle (Toggle:_Tap thrice).
Media keys moved to nav section - Enter=Play, Up=VolUp, Down=VolDn, Left=Prev, Right=Next, End=Mute.
Added PrintScreen on P on Layer 1.
Added cleaner visual representation since the multi-function keys make the actual keymap messy.
Moved old versions into folder together, only current version in root keymap directory now.
*Release 1.7*
Backspace split, includes Esc now.
Capslock moved to function layer to keep smoother LShift operation.
Original Caps key now Ctrl, Alt+GUI on double-tap - inspired by Android.
Cleaned up visual representation in readme.

View File

@@ -0,0 +1,38 @@
# Copyright 2013 Jun Wako <wakojun@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# QMK Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
TAP_DANCE_ENABLE = yes # Enable Tap Dancing
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@@ -10,7 +10,7 @@ using Bootmapper Client to change any keyboard settings, since not all the
USB report options are supported. USB report options are supported.
Here is the default layout, it is fairly simple with a few function keys: Here is the default layout, it is fairly simple with a few function keys:
![YMD96 Layout](https://i.imgur.com/qCwE2ns.png) ![YMD96 Layout](https://i.imgur.com/3QnqVPn.png)
If you have a different layout (since there were many options during the GB), please feel free to contribute! If you have a different layout (since there were many options during the GB), please feel free to contribute!
Keyboard maintainer: [Andrew](https://github.com/sparkyman215) Keyboard maintainer: [Andrew](https://github.com/sparkyman215)
@@ -29,27 +29,18 @@ This firmware was modified from [ps2avrGB](https://github.com/qmk/qmk_firmware/t
## Installing and Building ## Installing and Building
First, install the requirements. These commands are for OSX, but all you Since the YMD96 uses an ATmega32a chip instead of the 32u4, you need to download [HIDBootFlash v.1.0](http://vusb.wikidot.com/project:hidbootflash) for Windows. If anyone knows of a Linux/Mac bootflasher that works, edit this readme!
need is the AVR toolchain and `bootloadHID` for flashing: On Windows, I use [MINGw](http://www.mingw.org/) to compile the keymaps. On Linux, you can simply use the terminal.
```
$ brew cask install crosspack-avr
$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
```
In order to use the `./program` script, which can reboot the board into
the bootloader, you'll need Python 2 with PyUSB installed:
```
$ pip install pyusb
```
Once you have those two pieces of software:
Build the keyboard with Build the keyboard with
``` ```
$ make ymd96:default $ make ymd96-default
``` ```
If you make your own layout, change the `default` word to whatever your layout is. If you make your own layout, change the `default` word to whatever your layout is.
And flash the compiled hex file with `HIDBootFlash`. Simply put the board in flashing mode by plugging it in while holding control, and click `find device`. Then you can specify the .hex file and flash it to the device.
## Troubleshooting ## Troubleshooting
From my experience, it's really hard to brick these boards. But these From my experience, it's really hard to brick these boards. But these
@@ -60,3 +51,5 @@ tricks have been useful when it got stuck in a weird scenario.
done, just reflash the board with the original firmware. done, just reflash the board with the original firmware.
2. Sometimes USB hubs can act weird, so try connecting the board directly 2. Sometimes USB hubs can act weird, so try connecting the board directly
to your computer or plugging/unplugging the USB hub. to your computer or plugging/unplugging the USB hub.
Lastly, if you still need help, you can add me on Discord and I'll be happy to help.

View File

@@ -31,10 +31,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 15 #define MATRIX_COLS 15
#define DIODE_DIRECTION ROW2COL #define DIODE_DIRECTION ROW2COL
#define RGBLED_NUM 20 #define RGB_DI_PIN C4
#define RGBLED_NUM 18
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_VAL_STEP 20
#define NO_UART 1 #define NO_UART 1
#define BOOTLOADHID_BOOTLOADER 1
/* key combination for command */ /* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))

View File

@@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Tab | Q | W | E | R | T | Y | U | I | O | P | { | } | \ | 7 | 8 | 9 | - | 18 keys * | Tab | Q | W | E | R | T | Y | U | I | O | P | { | } | \ | 7 | 8 | 9 | - | 18 keys
* | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Return | 4 | 5 | 6 | + | 17 keys * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Return | 4 | 5 | 6 | + | 17 keys
* | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | 1 | 2 | 3 | En | 16 keys * | LShft | Z | X | C | V | B | N | M | , | . | / | RShft | 1 | 2 | 3 | En | 16 keys
* | Ctrl | Win | Alt | Space | Fn | Win | Left | Down | Up | Right| 0 | . | ter | 12 keys * | Ctrl | Win | Alt | Space | Fn | Win | Left | Down | Up | Right| 0 | . | | 12 keys
*/ */
[_DEFLT] = KEYMAP( [_DEFLT] = KEYMAP(
@@ -46,17 +46,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 1, raise layer /* Layer 1, raise layer
* | | | | | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | * | | |rgb_up|rgb_dn|rgb_mo| | | | | | F22 | F23 | F24 | | | | | |
* | | | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | | | |
* | | | | | | | | | VolDn| VolUp| Mute | Play/Pause | | | | | * | | | | | | | | | VolDn| VolUp| Mute | Play/Pause | | | | |
* | | | | | | | | | | | | | | * | | | | | | |MPrev | | | MNext| | | |
*/ */
[_RAISE] = KEYMAP( [_RAISE] = KEYMAP(
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_F22, KC_F23, KC_F24, ______, ______, ______, ______, ______, \ ______, ______, RGB_VAI, RGB_VAD, RGB_MOD, ______, ______, ______, ______, ______, KC_F22, KC_F23, KC_F24, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD,KC_VOLU, KC_MUTE, KC_MPLY, ______, ______, ______, ______, \ ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD,KC_VOLU, KC_MUTE, KC_MPLY, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \ ______, ______, ______, ______, ______, ______, KC_MPRV, ______, ______, KC_MNXT, ______, ______ \
) )
}; };

View File

@@ -1,4 +1,4 @@
# Enable RGB if not a Planck # Enable RGB if not a Planck
ifeq (,$(findstring planck,$(KEYBOARD))) ifeq ($(LAYOUTS_HAS_RGB),yes)
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
endif endif

View File

@@ -47,6 +47,16 @@
#define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A) #define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
#endif #endif
#ifdef B6_AUDIO
#define ENABLE_AUDIO_COUNTER_1_ISR TIMSK1 |= _BV(OCIE1B)
#define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1B)
#endif
#ifdef B7_AUDIO
#define ENABLE_AUDIO_COUNTER_1_ISR TIMSK1 |= _BV(OCIE1C)
#define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1C)
#endif
// TCCR3A: Timer/Counter #3 Control Register // TCCR3A: Timer/Counter #3 Control Register
// Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6 // Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6
@@ -60,6 +70,16 @@
#define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1A1) | _BV(COM1A0)); #define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1A1) | _BV(COM1A0));
#endif #endif
#ifdef B6_AUDIO
#define ENABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A |= _BV(COM1B1);
#define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1B1) | _BV(COM1B0));
#endif
#ifdef B7_AUDIO
#define ENABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A |= _BV(COM1C1);
#define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1C1) | _BV(COM1C0));
#endif
// Fast PWM Mode Controls // Fast PWM Mode Controls
#ifdef C6_AUDIO #ifdef C6_AUDIO
@@ -72,6 +92,16 @@
#define TIMER_1_DUTY_CYCLE OCR1A #define TIMER_1_DUTY_CYCLE OCR1A
#endif #endif
#ifdef B6_AUDIO
#define TIMER_1_PERIOD ICR1
#define TIMER_1_DUTY_CYCLE OCR1B
#endif
#ifdef B7_AUDIO
#define TIMER_1_PERIOD ICR1
#define TIMER_1_DUTY_CYCLE OCR1C
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -97,7 +127,7 @@ bool playing_note = false;
float note_frequency = 0; float note_frequency = 0;
float note_length = 0; float note_length = 0;
uint8_t note_tempo = TEMPO_DEFAULT; uint8_t note_tempo = TEMPO_DEFAULT;
float note_timbre = TIMBRE_DEFAULT; float note_timbre[NUMBER_OF_TIMERS] = {TIMBRE_DEFAULT};
uint16_t note_position = 0; uint16_t note_position = 0;
float (* notes_pointer)[][2]; float (* notes_pointer)[][2];
uint16_t notes_count; uint16_t notes_count;
@@ -119,8 +149,8 @@ static bool audio_initialized = false;
audio_config_t audio_config; audio_config_t audio_config;
uint16_t envelope_index = 0; uint16_t envelope_index[NUMBER_OF_TIMERS] = {0};
bool glissando = true; bool glissando[NUMBER_OF_TIMERS] = {true};
#ifndef STARTUP_SONG #ifndef STARTUP_SONG
#define STARTUP_SONG SONG(STARTUP_SOUND) #define STARTUP_SONG SONG(STARTUP_SOUND)
@@ -163,11 +193,25 @@ void audio_init()
// PORTB &= ~_BV(PORTB5); // PORTB &= ~_BV(PORTB5);
#endif #endif
#ifdef B6_AUDIO
DDRB |= _BV(PORTB6);
// #else
// DDRB |= _BV(PORTB6);
// PORTB &= ~_BV(PORTB6);
#endif
#ifdef B7_AUDIO
DDRB |= _BV(PORTB7);
// #else
// DDRB |= _BV(PORTB7);
// PORTB &= ~_BV(PORTB7);
#endif
#ifdef C6_AUDIO #ifdef C6_AUDIO
DISABLE_AUDIO_COUNTER_3_ISR; DISABLE_AUDIO_COUNTER_3_ISR;
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
DISABLE_AUDIO_COUNTER_1_ISR; DISABLE_AUDIO_COUNTER_1_ISR;
#endif #endif
@@ -179,14 +223,17 @@ void audio_init()
#ifdef C6_AUDIO #ifdef C6_AUDIO
TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30); TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30); TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER));
TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre[TIMER_3_INDEX]);
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
TCCR1A = (0 << COM1A1) | (0 << COM1A0) | (1 << WGM11) | (0 << WGM10); TCCR1A = (0 << COM1A1) | (0 << COM1A0) | (1 << WGM11) | (0 << WGM10);
TCCR1B = (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (1 << CS11) | (0 << CS10); TCCR1B = (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (1 << CS11) | (0 << CS10);
TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER)); TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER));
TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre); TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre[TIMER_1_INDEX]);
#endif #endif
audio_initialized = true; audio_initialized = true;
@@ -200,7 +247,7 @@ void audio_init()
void stop_all_notes() void stop_all_notes()
{ {
dprintf("audio stop all notes"); dprintf("audio stop all notes\n");
if (!audio_initialized) { if (!audio_initialized) {
audio_init(); audio_init();
@@ -213,7 +260,7 @@ void stop_all_notes()
DISABLE_AUDIO_COUNTER_3_OUTPUT; DISABLE_AUDIO_COUNTER_3_OUTPUT;
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
DISABLE_AUDIO_COUNTER_1_ISR; DISABLE_AUDIO_COUNTER_1_ISR;
DISABLE_AUDIO_COUNTER_1_OUTPUT; DISABLE_AUDIO_COUNTER_1_OUTPUT;
#endif #endif
@@ -233,7 +280,7 @@ void stop_all_notes()
void stop_note(float freq) void stop_note(float freq)
{ {
dprintf("audio stop note freq=%d", (int)freq); dprintf("audio stop note freq=%d\n", (int)freq);
if (playing_note) { if (playing_note) {
if (!audio_initialized) { if (!audio_initialized) {
@@ -258,12 +305,18 @@ void stop_note(float freq)
if (voice_place >= voices) { if (voice_place >= voices) {
voice_place = 0; voice_place = 0;
} }
if (voices == 1) {
#if defined(C6_AUDIO) && defined(B_AUDIO)
DISABLE_AUDIO_COUNTER_1_ISR;
DISABLE_AUDIO_COUNTER_1_OUTPUT;
#endif
}
if (voices == 0) { if (voices == 0) {
#ifdef C6_AUDIO #ifdef C6_AUDIO
DISABLE_AUDIO_COUNTER_3_ISR; DISABLE_AUDIO_COUNTER_3_ISR;
DISABLE_AUDIO_COUNTER_3_OUTPUT; DISABLE_AUDIO_COUNTER_3_OUTPUT;
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
DISABLE_AUDIO_COUNTER_1_ISR; DISABLE_AUDIO_COUNTER_1_ISR;
DISABLE_AUDIO_COUNTER_1_OUTPUT; DISABLE_AUDIO_COUNTER_1_OUTPUT;
#endif #endif
@@ -303,11 +356,11 @@ ISR(TIMER3_COMPA_vect)
if (playing_note) { if (playing_note) {
if (voices > 0) { if (voices > 0) {
#ifdef B5_AUDIO #ifdef B_AUDIO
float freq_alt = 0; float freq_alt = 0;
if (voices > 1) { if (voices > 1) {
if (polyphony_rate == 0) { if (polyphony_rate == 0) {
if (glissando) { if (glissando[TIMER_1_INDEX] && NUMBER_OF_TIMERS == 1) {
if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440/frequencies[voices - 2]/12/2)) { if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440/frequencies[voices - 2]/12/2)) {
frequency_alt = frequency_alt * pow(2, 440/frequency_alt/12/2); frequency_alt = frequency_alt * pow(2, 440/frequency_alt/12/2);
} else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440/frequencies[voices - 2]/12/2)) { } else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440/frequencies[voices - 2]/12/2)) {
@@ -330,18 +383,18 @@ ISR(TIMER3_COMPA_vect)
#endif #endif
} }
if (envelope_index < 65535) { if (envelope_index[TIMER_1_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_1_INDEX]++;
} }
freq_alt = voice_envelope(freq_alt); freq_alt = voice_envelope(freq_alt,TIMER_1_INDEX);
if (freq_alt < 30.517578125) { if (freq_alt < 30.517578125) {
freq_alt = 30.52; freq_alt = 30.52;
} }
TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq_alt * CPU_PRESCALER)); TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq_alt * CPU_PRESCALER));
TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq_alt * CPU_PRESCALER)) * note_timbre); TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq_alt * CPU_PRESCALER)) * note_timbre[TIMER_1_INDEX]);
} }
#endif #endif
@@ -364,7 +417,7 @@ ISR(TIMER3_COMPA_vect)
freq = frequencies[voice_place]; freq = frequencies[voice_place];
#endif #endif
} else { } else {
if (glissando) { if (glissando[TIMER_3_INDEX] && NUMBER_OF_TIMERS == 1) {
if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) {
frequency = frequency * pow(2, 440/frequency/12/2); frequency = frequency * pow(2, 440/frequency/12/2);
} else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) {
@@ -387,18 +440,18 @@ ISR(TIMER3_COMPA_vect)
#endif #endif
} }
if (envelope_index < 65535) { if (envelope_index[TIMER_3_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_3_INDEX]++;
} }
freq = voice_envelope(freq); freq = voice_envelope(freq, TIMER_3_INDEX);
if (freq < 30.517578125) { if (freq < 30.517578125) {
freq = 30.52; freq = 30.52;
} }
TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre[TIMER_3_INDEX]);
} }
} }
@@ -414,13 +467,13 @@ ISR(TIMER3_COMPA_vect)
freq = note_frequency; freq = note_frequency;
#endif #endif
if (envelope_index < 65535) { if (envelope_index[TIMER_3_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_3_INDEX]++;
} }
freq = voice_envelope(freq); freq = voice_envelope(freq, TIMER_3_INDEX);
TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre[TIMER_3_INDEX]);
} else { } else {
TIMER_3_PERIOD = 0; TIMER_3_PERIOD = 0;
TIMER_3_DUTY_CYCLE = 0; TIMER_3_DUTY_CYCLE = 0;
@@ -461,7 +514,7 @@ ISR(TIMER3_COMPA_vect)
} }
} else { } else {
note_resting = false; note_resting = false;
envelope_index = 0; envelope_index[TIMER_3_INDEX] = 0;
note_frequency = (*notes_pointer)[current_note][0]; note_frequency = (*notes_pointer)[current_note][0];
note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
} }
@@ -477,10 +530,16 @@ ISR(TIMER3_COMPA_vect)
} }
#endif #endif
#ifdef B_AUDIO
#ifdef B5_AUDIO #ifdef B5_AUDIO
ISR(TIMER1_COMPA_vect) ISR(TIMER1_COMPA_vect)
#elif defined(B6_AUDIO)
ISR(TIMER1_COMPB_vect)
#elif defined(B7_AUDIO)
ISR(TIMER1_COMPC_vect)
#endif
{ {
#if defined(B5_AUDIO) && !defined(C6_AUDIO) #if defined(B_AUDIO) && !defined(C6_AUDIO)
float freq = 0; float freq = 0;
if (playing_note) { if (playing_note) {
@@ -504,7 +563,7 @@ ISR(TIMER1_COMPA_vect)
freq = frequencies[voice_place]; freq = frequencies[voice_place];
#endif #endif
} else { } else {
if (glissando) { if (glissando[TIMER_1_INDEX] && NUMBER_OF_TIMERS == 1) {
if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) {
frequency = frequency * pow(2, 440/frequency/12/2); frequency = frequency * pow(2, 440/frequency/12/2);
} else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) {
@@ -527,18 +586,18 @@ ISR(TIMER1_COMPA_vect)
#endif #endif
} }
if (envelope_index < 65535) { if (envelope_index[TIMER_1_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_1_INDEX]++;
} }
freq = voice_envelope(freq); freq = voice_envelope(freq, TIMER_1_INDEX);
if (freq < 30.517578125) { if (freq < 30.517578125) {
freq = 30.52; freq = 30.52;
} }
TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre[TIMER_1_INDEX]);
} }
} }
@@ -554,13 +613,13 @@ ISR(TIMER1_COMPA_vect)
freq = note_frequency; freq = note_frequency;
#endif #endif
if (envelope_index < 65535) { if (envelope_index[TIMER_1_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_1_INDEX]++;
} }
freq = voice_envelope(freq); freq = voice_envelope(freq, TIMER_1_INDEX);
TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre[TIMER_1_INDEX]);
} else { } else {
TIMER_1_PERIOD = 0; TIMER_1_PERIOD = 0;
TIMER_1_DUTY_CYCLE = 0; TIMER_1_DUTY_CYCLE = 0;
@@ -601,7 +660,7 @@ ISR(TIMER1_COMPA_vect)
} }
} else { } else {
note_resting = false; note_resting = false;
envelope_index = 0; envelope_index[TIMER_1_INDEX] = 0;
note_frequency = (*notes_pointer)[current_note][0]; note_frequency = (*notes_pointer)[current_note][0];
note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
} }
@@ -620,7 +679,7 @@ ISR(TIMER1_COMPA_vect)
void play_note(float freq, int vol) { void play_note(float freq, int vol) {
dprintf("audio play note freq=%d vol=%d", (int)freq, vol); dprintf("audio play note freq=%d vol=%d\n", (int)freq, vol);
if (!audio_initialized) { if (!audio_initialized) {
audio_init(); audio_init();
@@ -630,7 +689,7 @@ void play_note(float freq, int vol) {
#ifdef C6_AUDIO #ifdef C6_AUDIO
DISABLE_AUDIO_COUNTER_3_ISR; DISABLE_AUDIO_COUNTER_3_ISR;
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
DISABLE_AUDIO_COUNTER_1_ISR; DISABLE_AUDIO_COUNTER_1_ISR;
#endif #endif
@@ -640,7 +699,6 @@ void play_note(float freq, int vol) {
playing_note = true; playing_note = true;
envelope_index = 0;
if (freq > 0) { if (freq > 0) {
frequencies[voices] = freq; frequencies[voices] = freq;
@@ -652,16 +710,23 @@ void play_note(float freq, int vol) {
ENABLE_AUDIO_COUNTER_3_ISR; ENABLE_AUDIO_COUNTER_3_ISR;
ENABLE_AUDIO_COUNTER_3_OUTPUT; ENABLE_AUDIO_COUNTER_3_OUTPUT;
#endif #endif
#ifdef B5_AUDIO
#ifdef B_AUDIO
#ifdef C6_AUDIO #ifdef C6_AUDIO
if (voices > 1) { if (voices > 1) {
envelope_index[TIMER_3_INDEX] = 0;
ENABLE_AUDIO_COUNTER_1_ISR; ENABLE_AUDIO_COUNTER_1_ISR;
ENABLE_AUDIO_COUNTER_1_OUTPUT; ENABLE_AUDIO_COUNTER_1_OUTPUT;
} else {
envelope_index[TIMER_3_INDEX] = 0;
} }
#else #else
envelope_index[TIMER_1_INDEX] = 0;
ENABLE_AUDIO_COUNTER_1_ISR; ENABLE_AUDIO_COUNTER_1_ISR;
ENABLE_AUDIO_COUNTER_1_OUTPUT; ENABLE_AUDIO_COUNTER_1_OUTPUT;
#endif #endif
#else
envelope_index[TIMER_3_INDEX] = 0;
#endif #endif
} }
@@ -679,7 +744,7 @@ void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat)
#ifdef C6_AUDIO #ifdef C6_AUDIO
DISABLE_AUDIO_COUNTER_3_ISR; DISABLE_AUDIO_COUNTER_3_ISR;
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
DISABLE_AUDIO_COUNTER_1_ISR; DISABLE_AUDIO_COUNTER_1_ISR;
#endif #endif
@@ -705,7 +770,7 @@ void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat)
ENABLE_AUDIO_COUNTER_3_ISR; ENABLE_AUDIO_COUNTER_3_ISR;
ENABLE_AUDIO_COUNTER_3_OUTPUT; ENABLE_AUDIO_COUNTER_3_OUTPUT;
#endif #endif
#ifdef B5_AUDIO #ifdef B_AUDIO
#ifndef C6_AUDIO #ifndef C6_AUDIO
ENABLE_AUDIO_COUNTER_1_ISR; ENABLE_AUDIO_COUNTER_1_ISR;
ENABLE_AUDIO_COUNTER_1_OUTPUT; ENABLE_AUDIO_COUNTER_1_OUTPUT;
@@ -803,8 +868,8 @@ void decrease_polyphony_rate(float change) {
// Timbre function // Timbre function
void set_timbre(float timbre) { void set_timbre(float timbre, uint8_t timer_index) {
note_timbre = timbre; note_timbre[timer_index] = timbre;
} }
// Tempo functions // Tempo functions

View File

@@ -36,6 +36,42 @@
// Enable vibrato strength/amplitude - slows down ISR too much // Enable vibrato strength/amplitude - slows down ISR too much
// #define VIBRATO_STRENGTH_ENABLE // #define VIBRATO_STRENGTH_ENABLE
#if defined(__AVR__)
// avr
#ifdef B_AUDIO
#error Please define B5_AUDIO, B6_AUDIO, or B7_AUDIO instead
#endif
#if defined(B5_AUDIO) || defined(B6_AUDIO) || defined(B7_AUDIO)
#define B_AUDIO
#endif
#if defined(C6_AUDIO) && defined (B_AUDIO)
#define NUMBER_OF_TIMERS 2
#elif defined(C6_AUDIO)
#define NUMBER_OF_TIMERS 1
#elif defined(B_AUDIO)
#define NUMBER_OF_TIMERS 1
#else
#define NUMBER_OF_TIMERS 0
#endif
#define TIMER_1_INDEX 0
#define TIMER_3_INDEX 1
#else
// chibios
#define NUMBER_OF_TIMERS 2
#define TIMER_6_INDEX 0
#define TIMER_7_INDEX 1
#endif
typedef union { typedef union {
uint8_t raw; uint8_t raw;
struct { struct {
@@ -75,7 +111,7 @@ void disable_polyphony(void);
void increase_polyphony_rate(float change); void increase_polyphony_rate(float change);
void decrease_polyphony_rate(float change); void decrease_polyphony_rate(float change);
void set_timbre(float timbre); void set_timbre(float timbre, uint8_t timer_index);
void set_tempo(uint8_t tempo); void set_tempo(uint8_t tempo);
void increase_tempo(uint8_t tempo_change); void increase_tempo(uint8_t tempo_change);

View File

@@ -47,7 +47,7 @@ bool playing_note = false;
float note_frequency = 0; float note_frequency = 0;
float note_length = 0; float note_length = 0;
uint8_t note_tempo = TEMPO_DEFAULT; uint8_t note_tempo = TEMPO_DEFAULT;
float note_timbre = TIMBRE_DEFAULT; float note_timbre[NUMBER_OF_TIMERS] = {TIMBRE_DEFAULT};
uint16_t note_position = 0; uint16_t note_position = 0;
float (* notes_pointer)[][2]; float (* notes_pointer)[][2];
uint16_t notes_count; uint16_t notes_count;
@@ -69,8 +69,8 @@ static bool audio_initialized = false;
audio_config_t audio_config; audio_config_t audio_config;
uint16_t envelope_index = 0; uint16_t envelope_index[NUMBER_OF_TIMERS] = {0};
bool glissando = true; bool glissando[NUMBER_OF_TIMERS] = {true};
#ifndef STARTUP_SONG #ifndef STARTUP_SONG
#define STARTUP_SONG SONG(STARTUP_SOUND) #define STARTUP_SONG SONG(STARTUP_SOUND)
@@ -241,7 +241,7 @@ static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = {
* DAC streaming callback. * DAC streaming callback.
*/ */
size_t nx = 0, ny = 0, nz = 0; size_t nx = 0, ny = 0, nz = 0;
static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) { static void end_cb1(DACDriver *dacp, const dacsample_t *buffer, size_t n) {
(void)dacp; (void)dacp;
@@ -434,7 +434,7 @@ static void gpt_cb8(GPTDriver *gptp) {
float freq_alt = 0; float freq_alt = 0;
if (voices > 1) { if (voices > 1) {
if (polyphony_rate == 0) { if (polyphony_rate == 0) {
if (glissando) { if (glissando[TIMER_6_INDEX]) {
if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440/frequencies[voices - 2]/12/2)) { if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440/frequencies[voices - 2]/12/2)) {
frequency_alt = frequency_alt * pow(2, 440/frequency_alt/12/2); frequency_alt = frequency_alt * pow(2, 440/frequency_alt/12/2);
} else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440/frequencies[voices - 2]/12/2)) { } else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440/frequencies[voices - 2]/12/2)) {
@@ -457,16 +457,22 @@ static void gpt_cb8(GPTDriver *gptp) {
#endif #endif
} }
if (envelope_index < 65535) { if (envelope_index[TIMER_6_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_6_INDEX]++;
} }
freq_alt = voice_envelope(freq_alt); freq_alt = voice_envelope(freq_alt, TIMER_6_INDEX);
if (freq_alt < 30.517578125) { if (freq_alt < 30.517578125) {
freq_alt = 30.52; freq_alt = 30.52;
} }
if (GET_CHANNEL_1_FREQ != (uint16_t)freq_alt) {
UPDATE_CHANNEL_1_FREQ(freq_alt);
}
//note_timbre;
} else {
STOP_CHANNEL_1();
if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) { if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) {
UPDATE_CHANNEL_2_FREQ(freq_alt); UPDATE_CHANNEL_2_FREQ(freq_alt);
} }
@@ -492,7 +498,7 @@ static void gpt_cb8(GPTDriver *gptp) {
freq = frequencies[voice_place]; freq = frequencies[voice_place];
#endif #endif
} else { } else {
if (glissando) { if (glissando[TIMER_7_INDEX]) {
if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) {
frequency = frequency * pow(2, 440/frequency/12/2); frequency = frequency * pow(2, 440/frequency/12/2);
} else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) {
@@ -515,17 +521,19 @@ static void gpt_cb8(GPTDriver *gptp) {
#endif #endif
} }
if (envelope_index < 65535) { if (envelope_index[TIMER_7_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_7_INDEX]++;
} }
freq = voice_envelope(freq); freq = voice_envelope(freq, TIMER_7_INDEX);
if (freq < 30.517578125) { if (freq < 30.517578125) {
freq = 30.52; freq = 30.52;
} }
if (GET_CHANNEL_2_FREQ != (uint16_t)freq) {
UPDATE_CHANNEL_2_FREQ(freq);
if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { if (GET_CHANNEL_1_FREQ != (uint16_t)freq) {
UPDATE_CHANNEL_1_FREQ(freq); UPDATE_CHANNEL_1_FREQ(freq);
} }
@@ -545,10 +553,10 @@ static void gpt_cb8(GPTDriver *gptp) {
freq = note_frequency; freq = note_frequency;
#endif #endif
if (envelope_index < 65535) { if (envelope_index[TIMER_6_INDEX] < 65535) {
envelope_index++; envelope_index[TIMER_6_INDEX]++;
} }
freq = voice_envelope(freq); freq = voice_envelope(freq, TIMER_6_INDEX);
if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { if (GET_CHANNEL_1_FREQ != (uint16_t)freq) {
@@ -597,7 +605,7 @@ static void gpt_cb8(GPTDriver *gptp) {
} }
} else { } else {
note_resting = false; note_resting = false;
envelope_index = 0; envelope_index[TIMER_6_INDEX] = 0;
note_frequency = (*notes_pointer)[current_note][0]; note_frequency = (*notes_pointer)[current_note][0];
note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
} }
@@ -628,7 +636,8 @@ void play_note(float freq, int vol) {
playing_note = true; playing_note = true;
envelope_index = 0; envelope_index[TIMER_6_INDEX] = 0;
envelope_index[TIMER_7_INDEX] = 0;
if (freq > 0) { if (freq > 0) {
frequencies[voices] = freq; frequencies[voices] = freq;
@@ -762,8 +771,8 @@ void decrease_polyphony_rate(float change) {
// Timbre function // Timbre function
void set_timbre(float timbre) { void set_timbre(float timbre, uint8_t timer_index) {
note_timbre = timbre; note_timbre[timer_index] = timbre;
} }
// Tempo functions // Tempo functions

View File

@@ -18,73 +18,91 @@
#include "stdlib.h" #include "stdlib.h"
// these are imported from audio.c // these are imported from audio.c
extern uint16_t envelope_index; extern uint16_t envelope_index[NUMBER_OF_TIMERS];
extern float note_timbre; extern float note_timbre[NUMBER_OF_TIMERS];
extern float polyphony_rate; extern float polyphony_rate;
extern bool glissando; extern bool glissando[NUMBER_OF_TIMERS];
voice_type voice = default_voice; voice_type voice[NUMBER_OF_TIMERS] = {default_voice};
void set_voice(voice_type v) { void set_all_voices(voice_type v) {
voice = v; for (uint8_t i = 0; i < NUMBER_OF_TIMERS; i++) {
voice[i] = v;
}
} }
void voice_iterate() { void all_voices_iterate(void) {
voice = (voice + 1) % number_of_voices; for (uint8_t i = 0; i < NUMBER_OF_TIMERS; i++) {
voice[i] = (voice[i] + 1) % number_of_voices;
}
} }
void voice_deiterate() { void all_voices_deiterate(void) {
voice = (voice - 1 + number_of_voices) % number_of_voices; for (uint8_t i = 0; i < NUMBER_OF_TIMERS; i++) {
voice[i] = (voice[i] - 1 + number_of_voices) % number_of_voices;
}
} }
float voice_envelope(float frequency) { void set_voice(voice_type v, uint8_t timer_index) {
// envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz voice[timer_index] = v;
}
void voice_iterate(uint8_t timer_index) {
voice[timer_index] = (voice[timer_index] + 1) % number_of_voices;
}
void voice_deiterate(uint8_t timer_index) {
voice[timer_index] = (voice[timer_index] - 1 + number_of_voices) % number_of_voices;
}
float voice_envelope(float frequency, uint8_t timer_index) {
// envelope_index[timer_index] ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz
__attribute__ ((unused)) __attribute__ ((unused))
uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency)); uint16_t compensated_index = (uint16_t)((float)envelope_index[timer_index] * (880.0 / frequency));
switch (voice) { switch (voice[timer_index]) {
case default_voice: case default_voice:
glissando = false; glissando[timer_index] = false;
note_timbre = TIMBRE_50; note_timbre[timer_index] = TIMBRE_50;
polyphony_rate = 0; polyphony_rate = 0;
break; break;
#ifdef AUDIO_VOICES #ifdef AUDIO_VOICES
case something: case something:
glissando = false; glissando[timer_index] = false;
polyphony_rate = 0; polyphony_rate = 0;
switch (compensated_index) { switch (compensated_index) {
case 0 ... 9: case 0 ... 9:
note_timbre = TIMBRE_12; note_timbre[timer_index] = TIMBRE_12;
break; break;
case 10 ... 19: case 10 ... 19:
note_timbre = TIMBRE_25; note_timbre[timer_index] = TIMBRE_25;
break; break;
case 20 ... 200: case 20 ... 200:
note_timbre = .125 + .125; note_timbre[timer_index] = .125 + .125;
break; break;
default: default:
note_timbre = .125; note_timbre[timer_index] = .125;
break; break;
} }
break; break;
case drums: case drums:
glissando = false; glissando[timer_index] = false;
polyphony_rate = 0; polyphony_rate = 0;
// switch (compensated_index) { // switch (compensated_index) {
// case 0 ... 10: // case 0 ... 10:
// note_timbre = 0.5; // note_timbre[timer_index] = 0.5;
// break; // break;
// case 11 ... 20: // case 11 ... 20:
// note_timbre = 0.5 * (21 - compensated_index) / 10; // note_timbre[timer_index] = 0.5 * (21 - compensated_index) / 10;
// break; // break;
// default: // default:
// note_timbre = 0; // note_timbre[timer_index] = 0;
// break; // break;
// } // }
// frequency = (rand() % (int)(frequency * 1.2 - frequency)) + (frequency * 0.8); // frequency = (rand() % (int)(frequency * 1.2 - frequency)) + (frequency * 0.8);
@@ -95,15 +113,15 @@ float voice_envelope(float frequency) {
// Bass drum: 60 - 100 Hz // Bass drum: 60 - 100 Hz
frequency = (rand() % (int)(40)) + 60; frequency = (rand() % (int)(40)) + 60;
switch (envelope_index) { switch (envelope_index[timer_index]) {
case 0 ... 10: case 0 ... 10:
note_timbre = 0.5; note_timbre[timer_index] = 0.5;
break; break;
case 11 ... 20: case 11 ... 20:
note_timbre = 0.5 * (21 - envelope_index) / 10; note_timbre[timer_index] = 0.5 * (21 - envelope_index[timer_index]) / 10;
break; break;
default: default:
note_timbre = 0; note_timbre[timer_index] = 0;
break; break;
} }
@@ -112,15 +130,15 @@ float voice_envelope(float frequency) {
// Snare drum: 1 - 2 KHz // Snare drum: 1 - 2 KHz
frequency = (rand() % (int)(1000)) + 1000; frequency = (rand() % (int)(1000)) + 1000;
switch (envelope_index) { switch (envelope_index[timer_index]) {
case 0 ... 5: case 0 ... 5:
note_timbre = 0.5; note_timbre[timer_index] = 0.5;
break; break;
case 6 ... 20: case 6 ... 20:
note_timbre = 0.5 * (21 - envelope_index) / 15; note_timbre[timer_index] = 0.5 * (21 - envelope_index[timer_index]) / 15;
break; break;
default: default:
note_timbre = 0; note_timbre[timer_index] = 0;
break; break;
} }
@@ -128,15 +146,15 @@ float voice_envelope(float frequency) {
// Closed Hi-hat: 3 - 5 KHz // Closed Hi-hat: 3 - 5 KHz
frequency = (rand() % (int)(2000)) + 3000; frequency = (rand() % (int)(2000)) + 3000;
switch (envelope_index) { switch (envelope_index[timer_index]) {
case 0 ... 15: case 0 ... 15:
note_timbre = 0.5; note_timbre[timer_index] = 0.5;
break; break;
case 16 ... 20: case 16 ... 20:
note_timbre = 0.5 * (21 - envelope_index) / 5; note_timbre[timer_index] = 0.5 * (21 - envelope_index[timer_index]) / 5;
break; break;
default: default:
note_timbre = 0; note_timbre[timer_index] = 0;
break; break;
} }
@@ -144,96 +162,96 @@ float voice_envelope(float frequency) {
// Open Hi-hat: 3 - 5 KHz // Open Hi-hat: 3 - 5 KHz
frequency = (rand() % (int)(2000)) + 3000; frequency = (rand() % (int)(2000)) + 3000;
switch (envelope_index) { switch (envelope_index[timer_index]) {
case 0 ... 35: case 0 ... 35:
note_timbre = 0.5; note_timbre[timer_index] = 0.5;
break; break;
case 36 ... 50: case 36 ... 50:
note_timbre = 0.5 * (51 - envelope_index) / 15; note_timbre[timer_index] = 0.5 * (51 - envelope_index[timer_index]) / 15;
break; break;
default: default:
note_timbre = 0; note_timbre[timer_index] = 0;
break; break;
} }
} }
break; break;
case butts_fader: case butts_fader:
glissando = true; glissando[timer_index] = true;
polyphony_rate = 0; polyphony_rate = 0;
switch (compensated_index) { switch (compensated_index) {
case 0 ... 9: case 0 ... 9:
frequency = frequency / 4; frequency = frequency / 4;
note_timbre = TIMBRE_12; note_timbre[timer_index] = TIMBRE_12;
break; break;
case 10 ... 19: case 10 ... 19:
frequency = frequency / 2; frequency = frequency / 2;
note_timbre = TIMBRE_12; note_timbre[timer_index] = TIMBRE_12;
break; break;
case 20 ... 200: case 20 ... 200:
note_timbre = .125 - pow(((float)compensated_index - 20) / (200 - 20), 2)*.125; note_timbre[timer_index] = .125 - pow(((float)compensated_index - 20) / (200 - 20), 2)*.125;
break; break;
default: default:
note_timbre = 0; note_timbre[timer_index] = 0;
break; break;
} }
break; break;
// case octave_crunch: case octave_crunch:
// polyphony_rate = 0; polyphony_rate = 0;
// switch (compensated_index) { switch (compensated_index) {
// case 0 ... 9: case 0 ... 9:
// case 20 ... 24: case 20 ... 24:
// case 30 ... 32: case 30 ... 32:
// frequency = frequency / 2; frequency = frequency / 2;
// note_timbre = TIMBRE_12; note_timbre[timer_index] = TIMBRE_12;
// break; break;
// case 10 ... 19: case 10 ... 19:
// case 25 ... 29: case 25 ... 29:
// case 33 ... 35: case 33 ... 35:
// frequency = frequency * 2; frequency = frequency * 2;
// note_timbre = TIMBRE_12; note_timbre[timer_index] = TIMBRE_12;
// break; break;
// default: default:
// note_timbre = TIMBRE_12; note_timbre[timer_index] = TIMBRE_12;
// break; break;
// } }
// break; break;
case duty_osc: case duty_osc:
// This slows the loop down a substantial amount, so higher notes may freeze // This slows the loop down a substantial amount, so higher notes may freeze
glissando = true; glissando[timer_index] = true;
polyphony_rate = 0; polyphony_rate = 0;
switch (compensated_index) { switch (compensated_index) {
default: default:
#define OCS_SPEED 10 #define OCS_SPEED 10
#define OCS_AMP .25 #define OCS_AMP .25
// sine wave is slow // sine wave is slow
// note_timbre = (sin((float)compensated_index/10000*OCS_SPEED) * OCS_AMP / 2) + .5; // note_timbre[timer_index] = (sin((float)compensated_index/10000*OCS_SPEED) * OCS_AMP / 2) + .5;
// triangle wave is a bit faster // triangle wave is a bit faster
note_timbre = (float)abs((compensated_index*OCS_SPEED % 3000) - 1500) * ( OCS_AMP / 1500 ) + (1 - OCS_AMP) / 2; note_timbre[timer_index] = (float)abs((compensated_index*OCS_SPEED % 3000) - 1500) * ( OCS_AMP / 1500 ) + (1 - OCS_AMP) / 2;
break; break;
} }
break; break;
case duty_octave_down: case duty_octave_down:
glissando = true; glissando[timer_index] = true;
polyphony_rate = 0; polyphony_rate = 0;
note_timbre = (envelope_index % 2) * .125 + .375 * 2; note_timbre[timer_index] = (envelope_index[timer_index] % 2) * .125 + .375 * 2;
if ((envelope_index % 4) == 0) if ((envelope_index[timer_index] % 4) == 0)
note_timbre = 0.5; note_timbre[timer_index] = 0.5;
if ((envelope_index % 8) == 0) if ((envelope_index[timer_index] % 8) == 0)
note_timbre = 0; note_timbre[timer_index] = 0;
break; break;
case delayed_vibrato: case delayed_vibrato:
glissando = true; glissando[timer_index] = true;
polyphony_rate = 0; polyphony_rate = 0;
note_timbre = TIMBRE_50; note_timbre[timer_index] = TIMBRE_50;
#define VOICE_VIBRATO_DELAY 150 #define VOICE_VIBRATO_DELAY 150
#define VOICE_VIBRATO_SPEED 50 #define VOICE_VIBRATO_SPEED 50
switch (compensated_index) { switch (compensated_index) {
@@ -246,10 +264,10 @@ float voice_envelope(float frequency) {
break; break;
// case delayed_vibrato_octave: // case delayed_vibrato_octave:
// polyphony_rate = 0; // polyphony_rate = 0;
// if ((envelope_index % 2) == 1) { // if ((envelope_index[timer_index] % 2) == 1) {
// note_timbre = 0.55; // note_timbre[timer_index] = 0.55;
// } else { // } else {
// note_timbre = 0.45; // note_timbre[timer_index] = 0.45;
// } // }
// #define VOICE_VIBRATO_DELAY 150 // #define VOICE_VIBRATO_DELAY 150
// #define VOICE_VIBRATO_SPEED 50 // #define VOICE_VIBRATO_SPEED 50
@@ -262,28 +280,28 @@ float voice_envelope(float frequency) {
// } // }
// break; // break;
// case duty_fifth_down: // case duty_fifth_down:
// note_timbre = 0.5; // note_timbre[timer_index] = 0.5;
// if ((envelope_index % 3) == 0) // if ((envelope_index[timer_index] % 3) == 0)
// note_timbre = 0.75; // note_timbre[timer_index] = 0.75;
// break; // break;
// case duty_fourth_down: // case duty_fourth_down:
// note_timbre = 0.0; // note_timbre[timer_index] = 0.0;
// if ((envelope_index % 12) == 0) // if ((envelope_index[timer_index] % 12) == 0)
// note_timbre = 0.75; // note_timbre[timer_index] = 0.75;
// if (((envelope_index % 12) % 4) != 1) // if (((envelope_index[timer_index] % 12) % 4) != 1)
// note_timbre = 0.75; // note_timbre[timer_index] = 0.75;
// break; // break;
// case duty_third_down: // case duty_third_down:
// note_timbre = 0.5; // note_timbre[timer_index] = 0.5;
// if ((envelope_index % 5) == 0) // if ((envelope_index[timer_index] % 5) == 0)
// note_timbre = 0.75; // note_timbre[timer_index] = 0.75;
// break; // break;
// case duty_fifth_third_down: // case duty_fifth_third_down:
// note_timbre = 0.5; // note_timbre[timer_index] = 0.5;
// if ((envelope_index % 5) == 0) // if ((envelope_index[timer_index] % 5) == 0)
// note_timbre = 0.75; // note_timbre[timer_index] = 0.75;
// if ((envelope_index % 3) == 0) // if ((envelope_index[timer_index] % 3) == 0)
// note_timbre = 0.25; // note_timbre[timer_index] = 0.25;
// break; // break;
#endif #endif

View File

@@ -24,7 +24,7 @@
#ifndef VOICES_H #ifndef VOICES_H
#define VOICES_H #define VOICES_H
float voice_envelope(float frequency); float voice_envelope(float frequency, uint8_t timer_index);
typedef enum { typedef enum {
default_voice, default_voice,
@@ -45,8 +45,12 @@ typedef enum {
number_of_voices // important that this is last number_of_voices // important that this is last
} voice_type; } voice_type;
void set_voice(voice_type v); void set_all_voices(voice_type v);
void voice_iterate(void); void all_voices_iterate(void);
void voice_deiterate(void); void all_voices_deiterate(void);
void set_voice(voice_type v, uint8_t timer_index);
void voice_iterate(uint8_t timer_index);
void voice_deiterate(uint8_t timer_index);
#endif #endif

View File

@@ -38,13 +38,13 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) {
} }
if (keycode == MUV_IN && record->event.pressed) { if (keycode == MUV_IN && record->event.pressed) {
voice_iterate(); all_voices_iterate();
PLAY_SONG(voice_change_song); PLAY_SONG(voice_change_song);
return false; return false;
} }
if (keycode == MUV_DE && record->event.pressed) { if (keycode == MUV_DE && record->event.pressed) {
voice_deiterate(); all_voices_deiterate();
PLAY_SONG(voice_change_song); PLAY_SONG(voice_change_song);
return false; return false;
} }

View File

@@ -28,7 +28,7 @@ bool music_activated = false;
bool midi_activated = false; bool midi_activated = false;
uint8_t music_starting_note = 0x0C; uint8_t music_starting_note = 0x0C;
int music_offset = 7; int music_offset = 7;
uint8_t music_mode = MUSIC_MODE_CHROMATIC; uint8_t music_mode = MUSIC_MODE_MAJOR;
// music sequencer // music sequencer
static bool music_sequence_recording = false; static bool music_sequence_recording = false;

View File

@@ -0,0 +1 @@
#include "dudeofawesome.h"

View File

@@ -0,0 +1,16 @@
#ifndef USERSPACE
#define USERSPACE
#define TAPPING_TOGGLE 2
#ifdef AUDIO_ENABLE
#define WORKMAN_SOUND \
E__NOTE(_GS7), \
ED_NOTE(_E7), \
S__NOTE(_REST), \
E__NOTE(_A6), \
S__NOTE(_REST), \
ED_NOTE(_GS6),
#endif
#endif

View File

@@ -0,0 +1 @@
SRC += dudeofawesome.c

View File

@@ -1 +1,2 @@
TAP_DANCE_ENABLE = yes
SRC += gordon.c SRC += gordon.c

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if brew --version 2>&1 > /dev/null; then if ! brew --version 2>&1 > /dev/null; then
echo "Error! Homebrew not installed or broken!" echo "Error! Homebrew not installed or broken!"
echo -n "Would you like to install homebrew now? [y/n] " echo -n "Would you like to install homebrew now? [y/n] "
while read ANSWER; do while read ANSWER; do