]> git.earman.xyz Git - sensor-watch.git/commitdiff
movement: add custom hourly chime tunes (#209)
authorJeremy O'Brien <neutral@fastmail.com>
Sat, 10 Jun 2023 15:55:09 +0000 (11:55 -0400)
committerGitHub <noreply@github.com>
Sat, 10 Jun 2023 15:55:09 +0000 (11:55 -0400)
* movement: add custom hourly chime tunes

* slightly tweak note timings

* add kim possible ringtone

movement/movement.c
movement/movement_config.h
movement/movement_custom_signal_tunes.h [new file with mode: 0644]

index 902bc4d55fa86ff9aeec516d7717432c7acebf59..40247c650f710934453fbdefff03bee8c5df9f49 100644 (file)
@@ -292,9 +292,7 @@ void movement_request_wake() {
 }
 
 void movement_play_signal(void) {
-    watch_buzzer_play_note(BUZZER_NOTE_C8, 75);
-    watch_buzzer_play_note(BUZZER_NOTE_REST, 100);
-    watch_buzzer_play_note(BUZZER_NOTE_C8, 100);
+    watch_buzzer_play_sequence(signal_tune, NULL);
 }
 
 void movement_play_alarm(void) {
index 9e446d4d62db09401fd82084490c4c345e5d2086..b1410a8b7d1f804d2e05afdca9f81ecf4289c803 100644 (file)
@@ -46,4 +46,8 @@ const watch_face_t watch_faces[] = {
  */
 #define MOVEMENT_SECONDARY_FACE_INDEX 0 // or (MOVEMENT_NUM_FACES - 2)
 
+/* Custom hourly chime tune. Check movement_custom_signal_tunes.h for options */
+#define SIGNAL_TUNE_DEFAULT
+#include "movement_custom_signal_tunes.h"
+
 #endif // MOVEMENT_CONFIG_H_
diff --git a/movement/movement_custom_signal_tunes.h b/movement/movement_custom_signal_tunes.h
new file mode 100644 (file)
index 0000000..cc21a5a
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2023 Jeremy O'Brien
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef MOVEMENT_CUSTOM_SIGNAL_TUNES_H_
+#define MOVEMENT_CUSTOM_SIGNAL_TUNES_H_
+
+#ifdef SIGNAL_TUNE_DEFAULT
+int8_t signal_tune[] = {
+    BUZZER_NOTE_C8, 5,
+    BUZZER_NOTE_REST, 6,
+    BUZZER_NOTE_C8, 5,
+    0
+};
+#endif // SIGNAL_TUNE_DEFAULT
+
+#ifdef SIGNAL_TUNE_ZELDA_SECRET
+int8_t signal_tune[] = {
+    BUZZER_NOTE_G5, 8,
+    BUZZER_NOTE_F5SHARP_G5FLAT, 8,
+    BUZZER_NOTE_D5SHARP_E5FLAT, 8,
+    BUZZER_NOTE_A4, 8,
+    BUZZER_NOTE_G4SHARP_A4FLAT, 8,
+    BUZZER_NOTE_E5, 8,
+    BUZZER_NOTE_G5SHARP_A5FLAT, 8,
+    BUZZER_NOTE_C6, 20,
+    0
+};
+#endif // SIGNAL_TUNE_ZELDA_SECRET
+
+#ifdef SIGNAL_TUNE_MARIO_THEME
+int8_t signal_tune[] = {
+    BUZZER_NOTE_E6, 7,
+    BUZZER_NOTE_REST, 2,
+    BUZZER_NOTE_E6, 7,
+    BUZZER_NOTE_REST, 10,
+    BUZZER_NOTE_E6, 7,
+    BUZZER_NOTE_REST, 11,
+    BUZZER_NOTE_C6, 7,
+    BUZZER_NOTE_REST, 1,
+    BUZZER_NOTE_E6, 7,
+    BUZZER_NOTE_REST, 10,
+    BUZZER_NOTE_G6, 8,
+    BUZZER_NOTE_REST, 30,
+    BUZZER_NOTE_G5, 8,
+    0
+};
+#endif // SIGNAL_TUNE_MARIO_THEME
+
+#ifdef SIGNAL_TUNE_KIM_POSSIBLE
+int8_t signal_tune[] = {
+    BUZZER_NOTE_G7, 6,
+    BUZZER_NOTE_REST, 1,
+    BUZZER_NOTE_G4, 3,
+    BUZZER_NOTE_REST, 5,
+    BUZZER_NOTE_G7, 6,
+    BUZZER_NOTE_REST, 1,
+    BUZZER_NOTE_G4, 3,
+    BUZZER_NOTE_REST, 5,
+    BUZZER_NOTE_A7SHARP_B7FLAT, 6,
+    BUZZER_NOTE_REST, 2,
+    BUZZER_NOTE_G7, 6,
+    0
+};
+#endif // SIGNAL_TUNE_KIM_POSSIBLE
+
+#endif // MOVEMENT_CUSTOM_SIGNAL_TUNES_H_