]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
remove unneccesary headers
authorJack Humbert <jack.humb@gmail.com>
Fri, 21 Jul 2017 17:18:36 +0000 (13:18 -0400)
committerJack Humbert <jack.humb@gmail.com>
Sun, 23 Jul 2017 18:59:29 +0000 (14:59 -0400)
docs/modding_your_keyboard.md
keyboards/planck/keymaps/default/keymap.c
keyboards/preonic/keymaps/default/keymap.c
quantum/audio/audio.c

index 30ff4f91af3c572d080fdae4cf71b13b7720a25a..29b0b3b0fbfdb056a0b36185cee2a0c9e7c42091 100644 (file)
@@ -1,12 +1,23 @@
 
 ## Audio output from a speaker
 
-Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
+Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and/or `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
 
-The audio code lives in [quantum/audio/audio.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/audio.h) and in the other files in the audio directory. It's enabled by default on the Planck [stock keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/default/keymap.c). Here are the important bits:
+If you add this to your `rules.mk`:
 
 ```
-#include "audio.h"
+AUDIO_ENABLE = yes
+```
+
+there's a couple different sounds that will automatically be enabled without any other configuration:
+
+
+If you want to implement something custom, you can 
+
+```
+#ifdef AUDIO_ENABLE
+  #include "audio.h"
+#endif
 ```
 
 Then, lower down the file:
@@ -41,14 +52,11 @@ Wherein we bind predefined songs (from [quantum/audio/song_list.h](https://githu
 So now you have something called `tone_plover` for example. How do you make it play the Plover tune, then? If you look further down the keymap, you'll see this:
 
 ```
-PLAY_NOTE_ARRAY(tone_plover, false, LEGATO); // song name, repeat, rest style
-PLAY_SONG(tone_plover);                      // song name (repeat is false, rest is STACCATO)
+PLAY_SONG(tone_plover);                      // song name
 ```
 
 This is inside one of the macros. So when that macro executes, your keyboard plays that particular chime.
 
-"Rest style" in the method signature above (the last parameter) specifies if there's a rest (a moment of silence) between the notes.
-
 ## Music mode
 
 The music mode maps your columns to a chromatic scale, and your rows to octaves. This works best with ortholinear keyboards, but can be made to work with others. All keycodes less than `0xFF` get blocked, so you won't type while playing notes - if you have special keys/mods, those will still work. A work-around for this is to jump to a different layer with KC_NOs before (or after) enabling music mode.  
index ddb93c885743a4a6d24fd725a86c6b22e52351ff..34a011b0c983d58e3688dfa7ec856b022106425a 100644 (file)
 
 #include "planck.h"
 #include "action_layer.h"
-#include "eeconfig.h"
-#ifdef AUDIO_ENABLE
-  #include "audio.h"
-#endif
 
 extern keymap_config_t keymap_config;
 
index a05117c9e60a383110bbdf1a8af5c6ed98e80777..491f4ae850a4c7b4bbd718d9bfb67037c70e7714 100644 (file)
 
 #include "preonic.h"
 #include "action_layer.h"
-#include "eeconfig.h"
-#ifdef AUDIO_ENABLE
-  #include "audio.h"
-#endif
 
 enum preonic_layers {
   _QWERTY,
index baa364eec23fda36c47e8067b15169122b548f30..8e8570d26c580a7634f3631461650fb320b567bf 100644 (file)
@@ -555,7 +555,10 @@ ISR(TIMER1_COMPA_vect)
         note_position++;
         bool end_of_note = false;
         if (TIMER_1_PERIOD > 0) {
-            end_of_note = (note_position >= (note_length / TIMER_1_PERIOD * 0xFFFF - 1));
+            if (!note_resting) 
+                end_of_note = (note_position >= (note_length / TIMER_1_PERIOD * 0xFFFF - 1));
+            else
+                end_of_note = (note_position >= (note_length));
         } else {
             end_of_note = (note_position >= (note_length));
         }