/* * ═══════════════════════════════════════════════════════════════════════════════════ * BUILTINMELODIES.HPP - Firmware-Baked Melody Library * ═══════════════════════════════════════════════════════════════════════════════════ * * 🎵 BUILT-IN MELODY LIBRARY FOR VESPER 🎵 * * This file contains melodies baked directly into the firmware, eliminating * the need for SD card downloads. Each melody is stored in PROGMEM to save RAM. * * 🏗️ ARCHITECTURE: * • Melodies stored in PROGMEM (Flash memory, not RAM) * • Each melody step is 2 bytes (uint16_t bitmask) * • Metadata includes name, UID, default speed * • Easy to add new melodies * * 📦 STORAGE EFFICIENCY: * • Small melodies (~30 steps = 60 bytes) * • Large melodies (~200 steps = 400 bytes) * • 40 melodies average = ~6-10KB total (Flash, not RAM!) * * 🎶 MELODY FORMAT: * Each uint16_t is a bitmask: * - Bit 0-15: Which bells/notes to activate * - Example: 0x0001 = Bell 0, 0x0003 = Bells 0+1, 0x8000 = Bell 15 * * 📋 VERSION: 1.1 * 📅 DATE: 2026-03-19 * 👨‍💻 AUTHOR: bonamin * ═══════════════════════════════════════════════════════════════════════════════════ */ #pragma once #include #include #include namespace BuiltInMelodies { // ═════════════════════════════════════════════════════════════════════════════════ // MELODY METADATA STRUCTURE // ═════════════════════════════════════════════════════════════════════════════════ struct MelodyInfo { const char* name; // Display name const char* pid; // Playback ID const uint16_t* data; // Pointer to melody data in PROGMEM uint16_t stepCount; // Number of steps }; // ═════════════════════════════════════════════════════════════════════════════════ // BuiltIn Melodies // More can be added here // ═════════════════════════════════════════════════════════════════════════════════ // 1 Bell Test Melody const uint16_t PROGMEM one_bell_test[] = { 0x0001, 0x0000, 0x0001, 0x0000 }; // Generated: 2026-03-16 08:57:17 // Melody: Ormilia 1,2,3,4,5,6,7,8 const uint16_t PROGMEM ormilia_1_8[] = { 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0009, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0005, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0009, 0x0000, 0x0001, 0x0002, 0x0005, 0x0000, 0x0001, 0x0002, 0x0009, 0x0000, 0x0001, 0x0002, 0x0005, 0x0000, 0x0001, 0x0002, 0x0011, 0x0002, 0x0001, 0x0002, 0x0021, 0x0002, 0x0001, 0x0002, 0x0011, 0x0002, 0x0001, 0x0002, 0x0021, 0x0002, 0x0041, 0x0002, 0x0081, 0x0002, 0x0009, 0x0002, 0x0041, 0x0002, 0x0081, 0x0002, 0x0009, 0x0002, 0x0041, 0x0002, 0x0081, 0x0002, 0x0005, 0x0002, 0x0001, 0x0000 }; // Melody: Festal 1,2,3,4,5 const uint16_t PROGMEM festive_1_8[] = { 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080 }; // Melody: Festive Chord 1,2,3,4,5 const uint16_t PROGMEM festive_alt_5[] = { 0x0004, 0x0002, 0x0008, 0x0001, 0x0004, 0x0004, 0x0002, 0x0008, 0x0001, 0x0010, 0x0004, 0x0002, 0x0008, 0x0001, 0x0004, 0x0004, 0x0002, 0x0008, 0x0001, 0x0011, 0x0004, 0x0002, 0x0008, 0x0001, 0x0004, 0x0004, 0x0002, 0x0008, 0x0001, 0x0011, 0x0004, 0x0002, 0x0008, 0x0001, 0x0005, 0x0004, 0x0002, 0x0008, 0x0001, 0x0011, 0x0004, 0x0002, 0x0008, 0x0001, 0x0005, 0x0004, 0x0002, 0x0008, 0x0001, 0x0011, 0x0004, 0x0002, 0x0008, 0x0001, 0x0004, 0x0004, 0x0002, 0x0008, 0x0001, 0x0010, 0x0004, 0x0002, 0x0008, 0x0001, 0x0004, 0x0004, 0x0002, 0x0008, 0x0001, 0x0010 }; // Melody: Festive 1,2,3,4,5,6 const uint16_t PROGMEM festive_6[] = { 0x0001, 0x0002, 0x0004, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0008, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0004, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0010, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0009, 0x0002, 0x0001, 0x0002, 0x0011, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0002, 0x0021, 0x0002, 0x0001, 0x0002, 0x0009, 0x0002, 0x0001, 0x0002, 0x0011, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0002, 0x0021, 0x0002, 0x0001, 0x0002, 0x0009, 0x0002, 0x0001, 0x0002, 0x0011, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0002, 0x0021, 0x0002, 0x0001, 0x0002 }; // Melody: Festive 1,2,3,4,5 const uint16_t PROGMEM festive_5[] = { 0x0001, 0x0002, 0x0004, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0008, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0004, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0010, 0x0002, 0x0001, 0x0002 }; // Melody: Festive 1,2,3,4 const uint16_t PROGMEM festive_2_4[] = { 0x0001, 0x0002, 0x0004, 0x0009, 0x0002, 0x0001, 0x0004, 0x0009 }; // Melody: Festive 1 const uint16_t PROGMEM festive_1[] = { 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000 }; // Melody: One By One 1,2,3,4,5,6,7,8 const uint16_t PROGMEM onebyone_4_8[] = { 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0011, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0021, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0041, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0081, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0041, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0021, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0041, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0081, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0041, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0021, 0x0002, 0x0004, 0x0008, 0x0004, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000 }; // Melody: One By One 1,2,3 const uint16_t PROGMEM onebyone_2_3[] = { 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002 }; // Melody: Athonite Extended 1,2,3,4,5,6,7,8 const uint16_t PROGMEM athonite_4_8[] = { 0x0002, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0008, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0009, 0x0002, 0x0001, 0x0011, 0x0002, 0x0001, 0x0022, 0x0002, 0x0001, 0x0081, 0x0002, 0x0001, 0x000A, 0x0002, 0x0001, 0x0041, 0x0002, 0x0001, 0x0012, 0x0002, 0x0001, 0x0021, 0x0002, 0x0001, 0x0082, 0x0002, 0x0001, 0x0009, 0x0002, 0x0001, 0x0042, 0x0002, 0x0001, 0x0011, 0x0002, 0x0001, 0x0022, 0x0002, 0x0001, 0x0081, 0x0002, 0x0001, 0x000A, 0x0002, 0x0001, 0x0041, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0000, 0x0000, 0x0000 }; // Melody: Athonite Extended 1,2,3,4 const uint16_t PROGMEM athonite_3_4[] = { 0x0002, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0008, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0000, 0x0005, 0x0002, 0x0001, 0x0002, 0x0005, 0x0002, 0x0001, 0x0009, 0x0002, 0x0001, 0x0005, 0x0002, 0x0001, 0x000A, 0x0002, 0x0001, 0x0006, 0x0002, 0x0001, 0x0009, 0x0002, 0x0001, 0x0005, 0x0002, 0x0001, 0x000A, 0x0002, 0x0001, 0x0006, 0x0002, 0x0001, 0x0009 }; // Melody: Athonite 1,2,3 const uint16_t PROGMEM athonite_3[] = { 0x0002, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004 }; // Melody: Athonite 2 const uint16_t PROGMEM athonite_1_2[] = { 0x0001, 0x0002, 0x0001, 0x0001, 0x0002, 0x0001, 0x0001, 0x0002, 0x0001, 0x0001, 0x0002, 0x0001, 0x0002 }; // Melody: Talanto 1,2,3,4 const uint16_t PROGMEM talanto_1_4[] = { 0x0001, 0x0001, 0x0001, 0x0002, 0x0001, 0x0001, 0x0001, 0x0008, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0001, 0x0001, 0x0008 }; // Melody: Semantron 1,2,3,4 const uint16_t PROGMEM semantron_1_4[] = { 0x0001, 0x0001, 0x0001, 0x0002, 0x0001, 0x0001, 0x0001, 0x0008, 0x0001, 0x0001, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0008 }; // Melody: Toll Great Friday 1,2,3,4 const uint16_t PROGMEM mournfull_gf_1_4[] = { 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; // Melody: Mournfull Toll 1,2,3,4 const uint16_t PROGMEM mournfull_1_4[] = { 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; // Melody: Orthros Festive 1,2,3 const uint16_t PROGMEM orthros_fst_1_3[] = { 0x0001, 0x0000, 0x0002, 0x0001, 0x0000, 0x0002, 0x0000, 0x0001, 0x0000, 0x0001, 0x0002, 0x0001, 0x0000, 0x0004, 0x0000 }; // Melody: Orthros 2,1 const uint16_t PROGMEM orthros_1_8[] = { 0x0001, 0x0000, 0x0002, 0x0000, 0x0004, 0x0008, 0x0000, 0x0010, 0x0000, 0x0020, 0x0000, 0x0040, 0x0080, 0x0000 }; // Melody: Catechetical 1,2,3 const uint16_t PROGMEM catechetical_1_5[] = { 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0000 }; // Melody: Vesper Festive 1,2,3,4 const uint16_t PROGMEM vesper_fst_1_4[] = { 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0000, 0x0001, 0x0004, 0x0000, 0x0000, 0x0001, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; // Melody: Vesper 1,2,3 const uint16_t PROGMEM vesper_1_3[] = { 0x0001, 0x0002, 0x0004, 0x0000, 0x0001, 0x0002, 0x0004, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0004, 0x0000 }; // Melody: Doxology Festive 1,2,3,4,5,6 const uint16_t PROGMEM doxology_fst_1_6[] = { 0x0002, 0x0004, 0x0009, 0x0004, 0x0002, 0x0004, 0x0011, 0x0004, 0x0002, 0x0004, 0x0021, 0x0004, 0x0002, 0x0004, 0x0011, 0x0004 }; // Melody: Doxology Alternative 1,2,3,4,5 const uint16_t PROGMEM doxology_alt_1_5[] = { 0x0001, 0x0000, 0x0002, 0x0004, 0x0000, 0x0018, 0x0000, 0x0001, 0x0000, 0x0002, 0x0004, 0x0000, 0x0018, 0x0000, 0x0001, 0x0000, 0x0002, 0x0004, 0x0000, 0x0018, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0004, 0x0000, 0x0018, 0x0000 }; // Melody: Doxology 1,2,3,4 const uint16_t PROGMEM doxology_1_4[] = { 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0000, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0008, 0x0000, 0x0000, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0001, 0x0004, 0x0001, 0x0008, 0x0000, 0x0000 }; // ═════════════════════════════════════════════════════════════════════════════════ // PROGMEM for builtin_* UIDs that have no identical current array // ═════════════════════════════════════════════════════════════════════════════════ // builtin_catehetical: same as catechetical_1_5 but without trailing 0x0000 const uint16_t PROGMEM builtin_catehetical[] = { 0x0001, 0x0002, 0x0004, 0x0008, 0x0010 }; // builtin_mournfull_toll_alternative: unique doubled-beat pattern const uint16_t PROGMEM builtin_mournfull_toll_alternative[] = { 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; // ═════════════════════════════════════════════════════════════════════════════════ // MELODY LIBRARY - Array of all built-in melodies // ═════════════════════════════════════════════════════════════════════════════════ const MelodyInfo MELODY_LIBRARY[] = { { "1 Bell Test", "one_bell_test", one_bell_test, sizeof(one_bell_test) / sizeof(uint16_t) }, { "Ormilia 1,2,3,4,5,6,7,8", "ormilia_1_8", ormilia_1_8, sizeof(ormilia_1_8) / sizeof(uint16_t) }, { "Festal 1,2,3,4,5", "festive_1_8", festive_1_8, sizeof(festive_1_8) / sizeof(uint16_t) }, { "Festive Chord 1,2,3,4,5", "festive_alt_5", festive_alt_5, sizeof(festive_alt_5) / sizeof(uint16_t) }, { "Festive 1,2,3,4,5,6", "festive_6", festive_6, sizeof(festive_6) / sizeof(uint16_t) }, { "Festive 1,2,3,4,5", "festive_5", festive_5, sizeof(festive_5) / sizeof(uint16_t) }, { "Festive 1,2,3,4", "festive_2_4", festive_2_4, sizeof(festive_2_4) / sizeof(uint16_t) }, { "Festive 1", "festive_1", festive_1, sizeof(festive_1) / sizeof(uint16_t) }, { "One By One 1,2,3,4,5,6,7,8", "onebyone_4_8", onebyone_4_8, sizeof(onebyone_4_8) / sizeof(uint16_t) }, { "One By One 1,2,3", "onebyone_2_3", onebyone_2_3, sizeof(onebyone_2_3) / sizeof(uint16_t) }, { "Athonite Extended 1,2,3,4,5,6,7,8", "athonite_4_8", athonite_4_8, sizeof(athonite_4_8) / sizeof(uint16_t) }, { "Athonite Extended 1,2,3,4", "athonite_3_4", athonite_3_4, sizeof(athonite_3_4) / sizeof(uint16_t) }, { "Athonite 1,2,3", "athonite_3", athonite_3, sizeof(athonite_3) / sizeof(uint16_t) }, { "Athonite 1,2", "athonite_1_2", athonite_1_2, sizeof(athonite_1_2) / sizeof(uint16_t) }, { "Talanto 1,2,3,4", "talanto_1_4", talanto_1_4, sizeof(talanto_1_4) / sizeof(uint16_t) }, { "Semantron 1,2,3,4", "semantron_1_4", semantron_1_4, sizeof(semantron_1_4) / sizeof(uint16_t) }, { "Toll Great Friday 1,2,3,4", "mournfull_gf_1_4", mournfull_gf_1_4, sizeof(mournfull_gf_1_4) / sizeof(uint16_t) }, { "Mournfull Toll 1,2,3,4", "mournfull_1_4", mournfull_1_4, sizeof(mournfull_1_4) / sizeof(uint16_t) }, { "Orthros Festive 1,2,3", "orthros_fst_1_3", orthros_fst_1_3, sizeof(orthros_fst_1_3) / sizeof(uint16_t) }, { "Orthros 1,2,3,4,5,6,7,8", "orthros_1_8", orthros_1_8, sizeof(orthros_1_8) / sizeof(uint16_t) }, { "Catechetical 1,2,3,4,5", "catechetical_1_5", catechetical_1_5, sizeof(catechetical_1_5) / sizeof(uint16_t) }, { "Vesper Festive 1,2,3,4", "vesper_fst_1_4", vesper_fst_1_4, sizeof(vesper_fst_1_4) / sizeof(uint16_t) }, { "Vesper 1,2,3", "vesper_1_3", vesper_1_3, sizeof(vesper_1_3) / sizeof(uint16_t) }, { "Doxology Festive 1,2,3,4,5,6", "doxology_fst_1_6", doxology_fst_1_6, sizeof(doxology_fst_1_6) / sizeof(uint16_t) }, { "Doxology Alternative 1,2,3,4,5", "doxology_alt_1_5", doxology_alt_1_5, sizeof(doxology_alt_1_5) / sizeof(uint16_t) }, { "Doxology 1,2,3,4", "doxology_1_4", doxology_1_4, sizeof(doxology_1_4) / sizeof(uint16_t) }, // ── builtin_* UIDs — backward-compat aliases for devices using old PIDs ────── { "1 Bell Test", "builtin_1bell_test", one_bell_test, sizeof(one_bell_test) / sizeof(uint16_t) }, { "Doxology Traditional", "builtin_doxology_traditional", doxology_1_4, sizeof(doxology_1_4) / sizeof(uint16_t) }, { "Doxology Alternative", "builtin_doxology_alternative", doxology_alt_1_5, sizeof(doxology_alt_1_5) / sizeof(uint16_t) }, { "Doxology Festive", "builtin_doxology_festive", doxology_fst_1_6, sizeof(doxology_fst_1_6) / sizeof(uint16_t) }, { "Vesper Traditional", "builtin_vesper_traditional", vesper_1_3, sizeof(vesper_1_3) / sizeof(uint16_t) }, { "Vesper Alternative", "builtin_vesper_alternative", vesper_fst_1_4, sizeof(vesper_fst_1_4) / sizeof(uint16_t) }, { "Catehetical", "builtin_catehetical", builtin_catehetical, sizeof(builtin_catehetical) / sizeof(uint16_t) }, { "Orthros Traditional", "builtin_orthros_traditional", orthros_1_8, sizeof(orthros_1_8) / sizeof(uint16_t) }, { "Orthros Alternative", "builtin_orthros_alternative", orthros_fst_1_3, sizeof(orthros_fst_1_3) / sizeof(uint16_t) }, { "Mournfull Toll", "builtin_mournfull_toll", mournfull_1_4, sizeof(mournfull_1_4) / sizeof(uint16_t) }, { "Mournfull Toll Alternative", "builtin_mournfull_toll_alternative", builtin_mournfull_toll_alternative, sizeof(builtin_mournfull_toll_alternative) / sizeof(uint16_t) }, { "Mournfull Toll Meg Par", "builtin_mournfull_toll_meg_par", mournfull_gf_1_4, sizeof(mournfull_gf_1_4) / sizeof(uint16_t) }, { "Sematron", "builtin_sematron", semantron_1_4, sizeof(semantron_1_4) / sizeof(uint16_t) }, { "Sematron Alternative", "builtin_sematron_alternative", talanto_1_4, sizeof(talanto_1_4) / sizeof(uint16_t) }, { "Athonite 1 2 Voices", "builtin_athonite_1_2_voices", athonite_1_2, sizeof(athonite_1_2) / sizeof(uint16_t) }, { "Athonite 3 Voices", "builtin_athonite_3_voices", athonite_3, sizeof(athonite_3) / sizeof(uint16_t) }, { "Athonite 3 4 Voices", "builtin_athonite_3_4_voices", athonite_3_4, sizeof(athonite_3_4) / sizeof(uint16_t) }, { "Athonite 4 8 Voices", "builtin_athonite_4_8_voices", athonite_4_8, sizeof(athonite_4_8) / sizeof(uint16_t) }, { "Onebyone 2 3 Voices", "builtin_onebyone_2_3_voices", onebyone_2_3, sizeof(onebyone_2_3) / sizeof(uint16_t) }, { "Onebyone 4 8 Voices", "builtin_onebyone_4_8_voices", onebyone_4_8, sizeof(onebyone_4_8) / sizeof(uint16_t) }, { "Festive 1Voice", "builtin_festive_1voice", festive_1, sizeof(festive_1) / sizeof(uint16_t) }, { "Festive 4Voices", "builtin_festive_4voices", festive_2_4, sizeof(festive_2_4) / sizeof(uint16_t) }, { "Festive 5Voices", "builtin_festive_5voices", festive_5, sizeof(festive_5) / sizeof(uint16_t) }, { "Festive 5Voice Alternative", "builtin_festive_5voice_alternative", festive_alt_5, sizeof(festive_alt_5) / sizeof(uint16_t) }, { "Festive 6Voices", "builtin_festive_6voices", festive_6, sizeof(festive_6) / sizeof(uint16_t) }, { "Festive 8Voices", "builtin_festive_8voices", festive_1_8, sizeof(festive_1_8) / sizeof(uint16_t) }, { "Ormilia", "builtin_ormilia", ormilia_1_8, sizeof(ormilia_1_8) / sizeof(uint16_t) } }; const uint16_t MELODY_COUNT = sizeof(MELODY_LIBRARY) / sizeof(MelodyInfo); // ═════════════════════════════════════════════════════════════════════════════════ // HELPER FUNCTIONS // ═════════════════════════════════════════════════════════════════════════════════ /** * @brief Check if a PID corresponds to a built-in melody * @param pid The melody PID to check * @return true if the PID exists in the built-in melody library */ inline bool isBuiltInMelody(const String& pid) { for (uint16_t i = 0; i < MELODY_COUNT; i++) { if (pid == MELODY_LIBRARY[i].pid) { return true; } } return false; } /** * @brief Find a built-in melody by PID * @param pid The melody playback ID to find * @return Pointer to MelodyInfo if found, nullptr otherwise */ inline const MelodyInfo* findMelodyByPID(const String& pid) { for (uint16_t i = 0; i < MELODY_COUNT; i++) { if (pid == MELODY_LIBRARY[i].pid) { return &MELODY_LIBRARY[i]; } } return nullptr; } /** * @brief Load a built-in melody into a vector * @param pid The melody playback ID to load * @param melodySteps Vector to fill with melody data * @return true if melody was found and loaded, false otherwise */ inline bool loadBuiltInMelody(const String& pid, std::vector& melodySteps) { const MelodyInfo* melody = findMelodyByPID(pid); if (!melody) { return false; } // Resize vector and copy data from PROGMEM melodySteps.resize(melody->stepCount); for (uint16_t i = 0; i < melody->stepCount; i++) { melodySteps[i] = pgm_read_word(&(melody->data[i])); } return true; } /** * @brief Get list of all built-in melodies as JSON string * @return JSON array string of melody names and PIDs */ inline String getBuiltInMelodiesJSON() { String json = "["; for (uint16_t i = 0; i < MELODY_COUNT; i++) { if (i > 0) json += ","; json += "{"; json += "\"name\":\"" + String(MELODY_LIBRARY[i].name) + "\","; json += "\"pid\":\"" + String(MELODY_LIBRARY[i].pid) + "\""; json += "}"; } json += "]"; return json; } }