Last active
August 9, 2016 13:38
-
-
Save andrewjbennett/72de958b88af62dfb3c3f147cf824a3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SONG_BPM 145 | |
/* | |
// Track 3: | |
uint16_t notes[] = { | |
82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, | |
}; | |
uint16_t timings[] = { | |
94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 190, 190, 94, 94, 94, 94, 190, 94, 94, 94, 160, 94, 190, 190, 190, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 190, 190, 94, 94, 94, 94, 190, 94, 94, 94, 160, 94, 190, 190, 190, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 190, 190, 94, 94, 94, 94, 190, 94, 94, 94, 160, 94, 190, 190, 190, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 190, 190, 94, 94, 94, 94, 190, 94, 94, 94, 160, 94, 190, 190, 190, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, | |
}; | |
#define SONG_LEN 348 | |
*/ | |
// Track 2: | |
uint16_t notes[] = { | |
659, 494, 523, 587, 659, 587, 523, 494, 440, 440, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 440, 494, 523, 587, 659, 587, 698, 880, 784, 698, 659, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 659, 494, 523, 587, 659, 587, 523, 494, 440, 440, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 440, 494, 523, 587, 659, 587, 698, 880, 784, 698, 659, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 165, 131, 147, 123, 131, 110, 104, 123, 165, 131, 147, 123, 131, 165, 220, 208, 659, 494, 523, 587, 659, 587, 523, 494, 440, 440, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 440, 494, 523, 587, 659, 587, 698, 880, 784, 698, 659, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 659, 494, 523, 587, 659, 587, 523, 494, 440, 440, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 440, 494, 523, 587, 659, 587, 698, 880, 784, 698, 659, 523, 659, 587, 523, 494, 494, 523, 587, 659, 523, 440, 440, 165, 131, 147, 123, 131, 110, 104, 123, 165, 131, 147, 123, 131, 165, 220, 208, | |
}; | |
uint16_t timings[] = { | |
160, 94, 94, 94, 46, 46, 94, 94, 160, 94, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 46, 46, 46, 46, 94, 190, 94, 160, 94, 94, 256, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 160, 94, 94, 94, 46, 46, 94, 94, 160, 94, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 46, 46, 46, 46, 94, 190, 94, 160, 94, 94, 256, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 160, 160, 336, 720, 160, 94, 94, 94, 46, 46, 94, 94, 160, 94, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 46, 46, 46, 46, 94, 190, 94, 160, 94, 94, 256, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 160, 94, 94, 94, 46, 46, 94, 94, 160, 94, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 46, 46, 46, 46, 94, 190, 94, 160, 94, 94, 256, 94, 160, 94, 94, 160, 94, 94, 160, 160, 160, 160, 160, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 160, 160, 336, 720, | |
}; | |
#define SONG_LEN 212 | |
#define NOTE_MULTIPLIER 1 | |
#define DELAY_BETWEEN_NOTES 0.10 | |
#define CLOCK_SECOND_DIVISOR 7.0 | |
#define TIMING_DIVISOR (SONG_BPM*CLOCK_SECOND_DIVISOR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modification of buzzer.c to support lower frequencies | |
void | |
buzzer_start(int freq) | |
{ | |
uint32_t load; | |
/* Enable GPT0 clocks under active, sleep, deep sleep */ | |
ti_lib_prcm_peripheral_run_enable(PRCM_PERIPH_TIMER0); | |
ti_lib_prcm_peripheral_sleep_enable(PRCM_PERIPH_TIMER0); | |
ti_lib_prcm_peripheral_deep_sleep_enable(PRCM_PERIPH_TIMER0); | |
ti_lib_prcm_load_set(); | |
while(!ti_lib_prcm_load_get()); | |
/* Drive the I/O ID with GPT0 / Timer A */ | |
ti_lib_ioc_port_configure_set(BOARD_IOID_BUZZER, IOC_PORT_MCU_PORT_EVENT0, | |
IOC_STD_OUTPUT); | |
/* GPT0 / Timer A: PWM, Interrupt Enable */ | |
HWREG(GPT0_BASE + GPT_O_TAMR) = (TIMER_CFG_A_PWM & 0xFF) | GPT_TAMR_TAPWMIE; | |
buzzer_on = 1; | |
/* | |
* Register ourself with LPM. This will keep the PERIPH PD powered on | |
* during deep sleep, allowing the buzzer to keep working while the chip is | |
* being power-cycled | |
*/ | |
lpm_register_module(&buzzer_module); | |
/* Stop the timer */ | |
ti_lib_timer_disable(GPT0_BASE, TIMER_A); | |
if(freq > 0) { | |
load = (GET_MCU_CLOCK / freq); | |
ti_lib_timer_load_set(GPT0_BASE, TIMER_A, load); | |
ti_lib_timer_match_set(GPT0_BASE, TIMER_A, load / 2); | |
// changes start here | |
if (load >= (1<<16)-1) { | |
ti_lib_timer_prescale_set(GPT0_BASE, TIMER_A, ((load & 0x00ff0000) >> 16)); | |
ti_lib_timer_prescale_match_set(GPT0_BASE, TIMER_A, ((load / 2) & 0x00ff0000) >> 16); | |
} else { | |
ti_lib_timer_prescale_set(GPT0_BASE, TIMER_A, 0); | |
ti_lib_timer_prescale_match_set(GPT0_BASE, TIMER_A, 0); | |
} | |
// changes end here | |
/* Start */ | |
ti_lib_timer_enable(GPT0_BASE, TIMER_A); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file | |
* Messing around with music | |
* \author | |
* Andrew Bennett <andrew.bennett@unsw.edu.au> | |
*/ | |
#include "contiki.h" | |
#include "buzzer.h" | |
#include "dev/leds.h" | |
// include the song here | |
#include "tetris.h" | |
// songs over 65535 won't fit in memory anyway | |
uint16_t upto = 0; | |
PROCESS(music_process, "Music!"); | |
AUTOSTART_PROCESSES(&music_process); | |
PROCESS_THREAD(music_process, ev, data) { | |
PROCESS_BEGIN(); | |
leds_toggle(LEDS_RED); | |
while (1) { | |
// start the buzzer at the specified pitch, multiplied by some multiplier | |
buzzer_start((uint32_t)(notes[upto]*NOTE_MULTIPLIER)); | |
// wait for the duration of the note | |
clock_wait(CLOCK_SECOND * timings[upto] / TIMING_DIVISOR); | |
// stop the buzzer | |
//buzzer_stop(); | |
// wait before the next note | |
//clock_wait(CLOCK_SECOND*DELAY_BETWEEN_NOTES); | |
upto++; | |
// woohoo party time | |
leds_toggle(LEDS_ALL); | |
// loop the song | |
if (upto >= SONG_LEN) { | |
upto = 0; | |
} | |
} | |
PROCESS_END(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by python script which is Coming Soon(tm) | |
#define SONG_BPM 145 | |
/* | |
// Track 3: | |
uint16_t notes[] = { | |
82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 104, 0, 208, 0, 104, 0, 208, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 123, 0, 131, 0, 147, 0, 73, 0, 73, 0, 73, 0, 110, 0, 87, 0, 65, 0, 131, 0, 131, 0, 65, 0, 98, 0, 98, 0, 123, 0, 247, 0, 247, 0, 165, 0, 208, 0, 110, 0, 165, 0, 110, 0, 165, 0, 110, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 104, 0, 208, 0, 104, 0, 208, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 123, 0, 131, 0, 147, 0, 73, 0, 73, 0, 73, 0, 110, 0, 87, 0, 65, 0, 131, 0, 131, 0, 65, 0, 98, 0, 98, 0, 123, 0, 247, 0, 247, 0, 165, 0, 208, 0, 110, 0, 165, 0, 110, 0, 165, 0, 110, 0, 165, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 104, 0, 208, 0, 104, 0, 208, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 123, 0, 131, 0, 147, 0, 73, 0, 73, 0, 73, 0, 110, 0, 87, 0, 65, 0, 131, 0, 131, 0, 65, 0, 98, 0, 98, 0, 123, 0, 247, 0, 247, 0, 165, 0, 208, 0, 110, 0, 165, 0, 110, 0, 165, 0, 110, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 104, 0, 208, 0, 104, 0, 208, 0, 82, 0, 165, 0, 82, 0, 165, 0, 110, 0, 220, 0, 110, 0, 220, 0, 110, 0, 220, 0, 123, 0, 131, 0, 147, 0, 73, 0, 73, 0, 73, 0, 110, 0, 87, 0, 65, 0, 131, 0, 131, 0, 65, 0, 98, 0, 98, 0, 123, 0, 247, 0, 247, 0, 165, 0, 208, 0, 110, 0, 165, 0, 110, 0, 165, 0, 110, 0, 165, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 220, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, 0, 208, 0, 330, | |
}; | |
uint16_t timings[] = { | |
94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 94, 2, 94, 2, 94, 2, 160, 32, 94, 2, 190, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 194, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 94, 2, 94, 2, 94, 2, 160, 32, 94, 2, 190, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 194, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 94, 2, 94, 2, 94, 2, 160, 32, 94, 2, 190, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 194, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 190, 2, 94, 2, 94, 2, 94, 2, 160, 32, 94, 2, 190, 2, 190, 2, 190, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 194, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, 2, 94, | |
}; | |
#define SONG_LEN 695 | |
*/ | |
// Track 2: | |
uint16_t notes[] = { | |
0, 659, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 523, 0, 494, 0, 440, 0, 440, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 440, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 698, 0, 880, 0, 784, 0, 698, 0, 659, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 659, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 523, 0, 494, 0, 440, 0, 440, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 440, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 698, 0, 880, 0, 784, 0, 698, 0, 659, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 165, 0, 131, 0, 147, 0, 123, 0, 131, 0, 110, 0, 104, 0, 123, 0, 165, 0, 131, 0, 147, 0, 123, 0, 131, 0, 165, 0, 220, 0, 208, 0, 659, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 523, 0, 494, 0, 440, 0, 440, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 440, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 698, 0, 880, 0, 784, 0, 698, 0, 659, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 659, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 523, 0, 494, 0, 440, 0, 440, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 440, 0, 494, 0, 523, 0, 587, 0, 659, 0, 587, 0, 698, 0, 880, 0, 784, 0, 698, 0, 659, 0, 523, 0, 659, 0, 587, 0, 523, 0, 494, 0, 494, 0, 523, 0, 587, 0, 659, 0, 523, 0, 440, 0, 440, 0, 165, 0, 131, 0, 147, 0, 123, 0, 131, 0, 110, 0, 104, 0, 123, 0, 165, 0, 131, 0, 147, 0, 123, 0, 131, 0, 165, 0, 220, 0, 208, | |
}; | |
uint16_t timings[] = { | |
0, 160, 32, 94, 2, 94, 2, 94, 2, 46, 2, 46, 2, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 32, 46, 2, 46, 2, 46, 2, 46, 2, 94, 2, 190, 2, 94, 2, 160, 32, 94, 2, 94, 2, 256, 32, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 224, 160, 32, 94, 2, 94, 2, 94, 2, 46, 2, 46, 2, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 32, 46, 2, 46, 2, 46, 2, 46, 2, 94, 2, 190, 2, 94, 2, 160, 32, 94, 2, 94, 2, 256, 32, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 224, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 160, 32, 160, 32, 336, 48, 720, 48, 160, 32, 94, 2, 94, 2, 94, 2, 46, 2, 46, 2, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 32, 46, 2, 46, 2, 46, 2, 46, 2, 94, 2, 190, 2, 94, 2, 160, 32, 94, 2, 94, 2, 256, 32, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 224, 160, 32, 94, 2, 94, 2, 94, 2, 46, 2, 46, 2, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 32, 46, 2, 46, 2, 46, 2, 46, 2, 94, 2, 190, 2, 94, 2, 160, 32, 94, 2, 94, 2, 256, 32, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 94, 2, 94, 2, 160, 32, 160, 32, 160, 32, 160, 32, 160, 224, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 336, 48, 160, 32, 160, 32, 336, 48, 720, | |
}; | |
#define SONG_LEN 424 | |
#define NOTE_MULTIPLIER 1 | |
#define DELAY_BETWEEN_NOTES 0.01 | |
#define CLOCK_SECOND_DIVISOR 5 | |
#define TIMING_DIVISOR (SONG_BPM*CLOCK_SECOND_DIVISOR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment