diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-12-12 15:39:07 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-12-12 15:39:07 -0500 |
| commit | 0edfe55bfe4afd037918ff73e49552a28f39a5ca (patch) | |
| tree | db0af9337db80830bbf2103ef39c0a6ca9a29451 | |
| parent | 0213acbdbee91e6d06ed928af4d93d79389c5106 (diff) | |
| download | qmk_firmware-0edfe55bfe4afd037918ff73e49552a28f39a5ca.tar.gz qmk_firmware-0edfe55bfe4afd037918ff73e49552a28f39a5ca.zip | |
re-enable audio and extrakeys
| -rw-r--r-- | keyboards/planck/keymaps/default/Makefile | 2 | ||||
| -rw-r--r-- | keyboards/preonic/rules.mk | 6 | ||||
| -rw-r--r-- | quantum/audio/voices.c | 23 | ||||
| -rw-r--r-- | quantum/audio/voices.h | 1 |
4 files changed, 27 insertions, 5 deletions
diff --git a/keyboards/planck/keymaps/default/Makefile b/keyboards/planck/keymaps/default/Makefile index 267a087ea..17487ebbf 100644 --- a/keyboards/planck/keymaps/default/Makefile +++ b/keyboards/planck/keymaps/default/Makefile | |||
| @@ -10,7 +10,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | |||
| 10 | CONSOLE_ENABLE = no # Console for debug(+400) | 10 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 11 | COMMAND_ENABLE = no # Commands for debug and configuration | 11 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 12 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 12 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 13 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | 13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
| 14 | MIDI_ENABLE = yes # MIDI controls | 14 | MIDI_ENABLE = yes # MIDI controls |
| 15 | AUDIO_ENABLE = yes # Audio output on port C6 | 15 | AUDIO_ENABLE = yes # Audio output on port C6 |
| 16 | UNICODE_ENABLE = no # Unicode | 16 | UNICODE_ENABLE = no # Unicode |
diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk index c4ce2aacc..071bfdc7f 100644 --- a/keyboards/preonic/rules.mk +++ b/keyboards/preonic/rules.mk | |||
| @@ -56,11 +56,11 @@ BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) | |||
| 56 | MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) | 56 | MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) |
| 57 | EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) | 57 | EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) |
| 58 | CONSOLE_ENABLE ?= no # Console for debug(+400) | 58 | CONSOLE_ENABLE ?= no # Console for debug(+400) |
| 59 | COMMAND_ENABLE ?= yes # Commands for debug and configuration | 59 | COMMAND_ENABLE ?= no # Commands for debug and configuration |
| 60 | NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 60 | NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 61 | BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality | 61 | BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality |
| 62 | MIDI_ENABLE ?= no # MIDI controls | 62 | MIDI_ENABLE ?= yes # MIDI controls |
| 63 | AUDIO_ENABLE ?= no # Audio output on port C6 | 63 | AUDIO_ENABLE ?= yes # Audio output on port C6 |
| 64 | UNICODE_ENABLE ?= no # Unicode | 64 | UNICODE_ENABLE ?= no # Unicode |
| 65 | BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID | 65 | BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID |
| 66 | RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | 66 | RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. |
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 6d4172a06..19f7b646e 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c | |||
| @@ -18,7 +18,7 @@ void voice_iterate() { | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | void voice_deiterate() { | 20 | void voice_deiterate() { |
| 21 | voice = (voice - 1) % number_of_voices; | 21 | voice = (voice - 1 + number_of_voices) % number_of_voices; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | float voice_envelope(float frequency) { | 24 | float voice_envelope(float frequency) { |
| @@ -31,6 +31,27 @@ float voice_envelope(float frequency) { | |||
| 31 | polyphony_rate = 0; | 31 | polyphony_rate = 0; |
| 32 | break; | 32 | break; |
| 33 | 33 | ||
| 34 | case something: | ||
| 35 | polyphony_rate = 0; | ||
| 36 | switch (compensated_index) { | ||
| 37 | case 0 ... 9: | ||
| 38 | note_timbre = TIMBRE_12; | ||
| 39 | break; | ||
| 40 | |||
| 41 | case 10 ... 19: | ||
| 42 | note_timbre = TIMBRE_25; | ||
| 43 | break; | ||
| 44 | |||
| 45 | case 20 ... 200: | ||
| 46 | note_timbre = .25 + .125 + pow(((float)compensated_index - 20) / (200 - 20), 2)*.125; | ||
| 47 | break; | ||
| 48 | |||
| 49 | default: | ||
| 50 | note_timbre = .25; | ||
| 51 | break; | ||
| 52 | } | ||
| 53 | break; | ||
| 54 | |||
| 34 | case butts_fader: | 55 | case butts_fader: |
| 35 | polyphony_rate = 0; | 56 | polyphony_rate = 0; |
| 36 | switch (compensated_index) { | 57 | switch (compensated_index) { |
diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index b2495b23b..b43def3d7 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h | |||
| @@ -11,6 +11,7 @@ float voice_envelope(float frequency); | |||
| 11 | 11 | ||
| 12 | typedef enum { | 12 | typedef enum { |
| 13 | default_voice, | 13 | default_voice, |
| 14 | something, | ||
| 14 | butts_fader, | 15 | butts_fader, |
| 15 | octave_crunch, | 16 | octave_crunch, |
| 16 | duty_osc, | 17 | duty_osc, |
