From 0edfe55bfe4afd037918ff73e49552a28f39a5ca Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 12 Dec 2016 15:39:07 -0500 Subject: re-enable audio and extrakeys --- quantum/audio/voices.c | 23 ++++++++++++++++++++++- quantum/audio/voices.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'quantum/audio') 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() { } void voice_deiterate() { - voice = (voice - 1) % number_of_voices; + voice = (voice - 1 + number_of_voices) % number_of_voices; } float voice_envelope(float frequency) { @@ -31,6 +31,27 @@ float voice_envelope(float frequency) { polyphony_rate = 0; break; + case something: + polyphony_rate = 0; + switch (compensated_index) { + case 0 ... 9: + note_timbre = TIMBRE_12; + break; + + case 10 ... 19: + note_timbre = TIMBRE_25; + break; + + case 20 ... 200: + note_timbre = .25 + .125 + pow(((float)compensated_index - 20) / (200 - 20), 2)*.125; + break; + + default: + note_timbre = .25; + break; + } + break; + case butts_fader: polyphony_rate = 0; 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); typedef enum { default_voice, + something, butts_fader, octave_crunch, duty_osc, -- cgit v1.2.3-24-g4f1b From 06c64bbff3e228df542149acde64eadaf59b9b0f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 19 Dec 2016 11:18:18 -0500 Subject: rgb clean-up, api clean-up --- quantum/audio/audio.c | 15 ++++++++++----- quantum/audio/voices.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- quantum/audio/voices.h | 1 + 3 files changed, 54 insertions(+), 7 deletions(-) (limited to 'quantum/audio') diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index ead5fbf3e..2a315fd16 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -77,6 +77,7 @@ static bool audio_initialized = false; audio_config_t audio_config; uint16_t envelope_index = 0; +bool glissando = true; void audio_init() { @@ -205,13 +206,17 @@ ISR(TIMER3_COMPA_vect) freq = frequencies[voice_place]; #endif } else { - if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, 440/frequency/12/2); - } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, -440/frequency/12/2); + if (glissando) { + if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, 440/frequency/12/2); + } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, -440/frequency/12/2); + } else { + frequency = frequencies[voices - 1]; + } } else { frequency = frequencies[voices - 1]; - } + } #ifdef VIBRATO_ENABLE if (vibrato_strength > 0) { diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 19f7b646e..06ff275ba 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -6,6 +6,7 @@ extern uint16_t envelope_index; extern float note_timbre; extern float polyphony_rate; +extern bool glissando; voice_type voice = default_voice; @@ -27,11 +28,13 @@ float voice_envelope(float frequency) { switch (voice) { case default_voice: + glissando = true; note_timbre = TIMBRE_50; polyphony_rate = 0; break; case something: + glissando = false; polyphony_rate = 0; switch (compensated_index) { case 0 ... 9: @@ -43,16 +46,51 @@ float voice_envelope(float frequency) { break; case 20 ... 200: - note_timbre = .25 + .125 + pow(((float)compensated_index - 20) / (200 - 20), 2)*.125; + note_timbre = .125 + .125; break; default: - note_timbre = .25; + note_timbre = .125; break; } break; + case drums: + glissando = false; + polyphony_rate = 0; + note_timbre = 0; + switch (envelope_index) { + case 0 ... 20: + note_timbre = 0.5; + default: + frequency = (rand() % (int)(frequency * 1.2 - frequency)) + (frequency * 0.8); + break; + } + // if (frequency < 80.0) { + // switch (envelope_index % 4) { + // case 0: + // frequency = 348.0; + // case 1: + // frequency = 53.0; + // case 2: + // frequency = 128.0; + // case 3: + // frequency = 934.0; + // default: + // break; + // } + // } else if (frequency < 160.0) { + + // } else if (frequency < 320.0) { + + // } else if (frequency < 640.0) { + + // } else if (frequency < 1280.0) { + + // } + break; case butts_fader: + glissando = true; polyphony_rate = 0; switch (compensated_index) { case 0 ... 9: @@ -100,6 +138,7 @@ float voice_envelope(float frequency) { case duty_osc: // This slows the loop down a substantial amount, so higher notes may freeze + glissando = true; polyphony_rate = 0; switch (compensated_index) { default: @@ -114,6 +153,7 @@ float voice_envelope(float frequency) { break; case duty_octave_down: + glissando = true; polyphony_rate = 0; note_timbre = (envelope_index % 2) * .125 + .375 * 2; if ((envelope_index % 4) == 0) @@ -122,6 +162,7 @@ float voice_envelope(float frequency) { note_timbre = 0; break; case delayed_vibrato: + glissando = true; polyphony_rate = 0; note_timbre = TIMBRE_50; #define VOICE_VIBRATO_DELAY 150 diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index b43def3d7..72f139e9c 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h @@ -12,6 +12,7 @@ float voice_envelope(float frequency); typedef enum { default_voice, something, + drums, butts_fader, octave_crunch, duty_osc, -- cgit v1.2.3-24-g4f1b From 438a5d685bb7b726ff59109ce4229eca6303cd8e Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 20 Dec 2016 19:38:22 -0500 Subject: limit voices by default, add some drums --- quantum/audio/voices.c | 105 +++++++++++++++++++++++++++++++++++++------------ quantum/audio/voices.h | 2 + 2 files changed, 82 insertions(+), 25 deletions(-) (limited to 'quantum/audio') diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 06ff275ba..4e3028977 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -33,6 +33,8 @@ float voice_envelope(float frequency) { polyphony_rate = 0; break; + #ifdef AUDIO_VOICES + case something: glissando = false; polyphony_rate = 0; @@ -58,36 +60,87 @@ float voice_envelope(float frequency) { case drums: glissando = false; polyphony_rate = 0; - note_timbre = 0; + // switch (compensated_index) { + // case 0 ... 10: + // note_timbre = 0.5; + // break; + // case 11 ... 20: + // note_timbre = 0.5 * (21 - compensated_index) / 10; + // break; + // default: + // note_timbre = 0; + // break; + // } + // frequency = (rand() % (int)(frequency * 1.2 - frequency)) + (frequency * 0.8); + + if (frequency < 80.0) { + + } else if (frequency < 160.0) { + + // Bass drum: 60 - 100 Hz + frequency = (rand() % (int)(40)) + 60; + switch (envelope_index) { + case 0 ... 10: + note_timbre = 0.5; + break; + case 11 ... 20: + note_timbre = 0.5 * (21 - envelope_index) / 10; + break; + default: + note_timbre = 0; + break; + } + + } else if (frequency < 320.0) { + + + // Snare drum: 1 - 2 KHz + frequency = (rand() % (int)(1000)) + 1000; + switch (envelope_index) { + case 0 ... 5: + note_timbre = 0.5; + break; + case 6 ... 20: + note_timbre = 0.5 * (21 - envelope_index) / 15; + break; + default: + note_timbre = 0; + break; + } + + } else if (frequency < 640.0) { + + // Closed Hi-hat: 3 - 5 KHz + frequency = (rand() % (int)(2000)) + 3000; switch (envelope_index) { - case 0 ... 20: + case 0 ... 15: note_timbre = 0.5; + break; + case 16 ... 20: + note_timbre = 0.5 * (21 - envelope_index) / 5; + break; default: - frequency = (rand() % (int)(frequency * 1.2 - frequency)) + (frequency * 0.8); + note_timbre = 0; break; } - // if (frequency < 80.0) { - // switch (envelope_index % 4) { - // case 0: - // frequency = 348.0; - // case 1: - // frequency = 53.0; - // case 2: - // frequency = 128.0; - // case 3: - // frequency = 934.0; - // default: - // break; - // } - // } else if (frequency < 160.0) { - - // } else if (frequency < 320.0) { - - // } else if (frequency < 640.0) { - - // } else if (frequency < 1280.0) { - - // } + + } else if (frequency < 1280.0) { + + // Open Hi-hat: 3 - 5 KHz + frequency = (rand() % (int)(2000)) + 3000; + switch (envelope_index) { + case 0 ... 35: + note_timbre = 0.5; + break; + case 36 ... 50: + note_timbre = 0.5 * (51 - envelope_index) / 15; + break; + default: + note_timbre = 0; + break; + } + + } break; case butts_fader: glissando = true; @@ -217,6 +270,8 @@ float voice_envelope(float frequency) { // note_timbre = 0.25; // break; + #endif + default: break; } diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index 72f139e9c..52f7e006d 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h @@ -11,6 +11,7 @@ float voice_envelope(float frequency); typedef enum { default_voice, + #ifdef AUDIO_VOICES something, drums, butts_fader, @@ -23,6 +24,7 @@ typedef enum { // duty_fourth_down, // duty_third_down, // duty_fifth_third_down, + #endif number_of_voices // important that this is last } voice_type; -- cgit v1.2.3-24-g4f1b From 2fa36e38cf28f07ad4a4d74722486921fa7b8706 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 21 Dec 2016 00:22:32 -0500 Subject: initial subatomic keymap (text) --- quantum/audio/voices.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'quantum/audio') diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 4e3028977..8326e91ea 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -278,5 +278,3 @@ float voice_envelope(float frequency) { return frequency; } - - -- cgit v1.2.3-24-g4f1b From 1ac5dc9e524444ef98cfab1d9822151a6bfb9621 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 16 Feb 2017 11:37:46 -0500 Subject: fix travis and reduce warnings --- quantum/audio/voices.c | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/audio') diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 8326e91ea..c2edb75f0 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -24,6 +24,7 @@ void voice_deiterate() { float voice_envelope(float frequency) { // envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz + __attribute__ ((unused)) uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency)); switch (voice) { -- cgit v1.2.3-24-g4f1b From 0734f569409974624b40735fcd498dac9adba2d2 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Thu, 2 Mar 2017 12:28:12 -0800 Subject: add debug messages to audio --- quantum/audio/audio.c | 322 +++++++++++++++++++++++++------------------------- 1 file changed, 164 insertions(+), 158 deletions(-) (limited to 'quantum/audio') diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index 2a315fd16..e1e81fd2b 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -89,15 +89,15 @@ void audio_init() } audio_config.raw = eeconfig_read_audio(); - // Set port PC6 (OC3A and /OC4A) as output + // Set port PC6 (OC3A and /OC4A) as output DDRC |= _BV(PORTC6); DISABLE_AUDIO_COUNTER_3_ISR; - // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers - // Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6 - // Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14 (Period = ICR3, Duty Cycle = OCR3A) - // Clock Select (CS3n) = 0b010 = Clock / 8 + // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers + // Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6 + // Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14 (Period = ICR3, Duty Cycle = OCR3A) + // Clock Select (CS3n) = 0b010 = Clock / 8 TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30); TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30); @@ -106,6 +106,8 @@ void audio_init() void stop_all_notes() { + dprintf("audio stop all notes"); + if (!audio_initialized) { audio_init(); } @@ -128,6 +130,8 @@ void stop_all_notes() void stop_note(float freq) { + dprintf("audio stop note freq=%d", (int)freq); + if (playing_note) { if (!audio_initialized) { audio_init(); @@ -183,159 +187,161 @@ float vibrato(float average_freq) { ISR(TIMER3_COMPA_vect) { - float freq; - - if (playing_note) { - if (voices > 0) { - if (polyphony_rate > 0) { - if (voices > 1) { - voice_place %= voices; - if (place++ > (frequencies[voice_place] / polyphony_rate / CPU_PRESCALER)) { - voice_place = (voice_place + 1) % voices; - place = 0.0; - } - } - - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq = vibrato(frequencies[voice_place]); - } else { - freq = frequencies[voice_place]; - } - #else - freq = frequencies[voice_place]; - #endif - } else { - if (glissando) { - if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, 440/frequency/12/2); - } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, -440/frequency/12/2); - } else { - frequency = frequencies[voices - 1]; - } - } else { - frequency = frequencies[voices - 1]; - } - - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq = vibrato(frequency); - } else { - freq = frequency; - } - #else - freq = frequency; - #endif - } - - if (envelope_index < 65535) { - envelope_index++; - } - - freq = voice_envelope(freq); - - if (freq < 30.517578125) { - freq = 30.52; - } - - TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); - TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); - } - } - - if (playing_notes) { - if (note_frequency > 0) { - #ifdef VIBRATO_ENABLE - if (vibrato_strength > 0) { - freq = vibrato(note_frequency); - } else { - freq = note_frequency; - } - #else - freq = note_frequency; - #endif - - if (envelope_index < 65535) { - envelope_index++; - } - freq = voice_envelope(freq); - - TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); - TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); - } else { - TIMER_3_PERIOD = 0; - TIMER_3_DUTY_CYCLE = 0; - } - - note_position++; - bool end_of_note = false; - if (TIMER_3_PERIOD > 0) { - end_of_note = (note_position >= (note_length / TIMER_3_PERIOD * 0xFFFF)); - } else { - end_of_note = (note_position >= (note_length * 0x7FF)); - } - - if (end_of_note) { - current_note++; - if (current_note >= notes_count) { - if (notes_repeat) { - current_note = 0; - } else { - DISABLE_AUDIO_COUNTER_3_ISR; - DISABLE_AUDIO_COUNTER_3_OUTPUT; - playing_notes = false; - return; - } - } - if (!note_resting && (notes_rest > 0)) { - note_resting = true; - note_frequency = 0; - note_length = notes_rest; - current_note--; - } else { - note_resting = false; - envelope_index = 0; - note_frequency = (*notes_pointer)[current_note][0]; - note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); - } - - note_position = 0; - } - } - - if (!audio_config.enable) { - playing_notes = false; - playing_note = false; - } + float freq; + + if (playing_note) { + if (voices > 0) { + if (polyphony_rate > 0) { + if (voices > 1) { + voice_place %= voices; + if (place++ > (frequencies[voice_place] / polyphony_rate / CPU_PRESCALER)) { + voice_place = (voice_place + 1) % voices; + place = 0.0; + } + } + + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq = vibrato(frequencies[voice_place]); + } else { + freq = frequencies[voice_place]; + } + #else + freq = frequencies[voice_place]; + #endif + } else { + if (glissando) { + if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, 440/frequency/12/2); + } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, -440/frequency/12/2); + } else { + frequency = frequencies[voices - 1]; + } + } else { + frequency = frequencies[voices - 1]; + } + + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq = vibrato(frequency); + } else { + freq = frequency; + } + #else + freq = frequency; + #endif + } + + if (envelope_index < 65535) { + envelope_index++; + } + + freq = voice_envelope(freq); + + if (freq < 30.517578125) { + freq = 30.52; + } + + TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); + TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); + } + } + + if (playing_notes) { + if (note_frequency > 0) { + #ifdef VIBRATO_ENABLE + if (vibrato_strength > 0) { + freq = vibrato(note_frequency); + } else { + freq = note_frequency; + } + #else + freq = note_frequency; + #endif + + if (envelope_index < 65535) { + envelope_index++; + } + freq = voice_envelope(freq); + + TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER)); + TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); + } else { + TIMER_3_PERIOD = 0; + TIMER_3_DUTY_CYCLE = 0; + } + + note_position++; + bool end_of_note = false; + if (TIMER_3_PERIOD > 0) { + end_of_note = (note_position >= (note_length / TIMER_3_PERIOD * 0xFFFF)); + } else { + end_of_note = (note_position >= (note_length * 0x7FF)); + } + + if (end_of_note) { + current_note++; + if (current_note >= notes_count) { + if (notes_repeat) { + current_note = 0; + } else { + DISABLE_AUDIO_COUNTER_3_ISR; + DISABLE_AUDIO_COUNTER_3_OUTPUT; + playing_notes = false; + return; + } + } + if (!note_resting && (notes_rest > 0)) { + note_resting = true; + note_frequency = 0; + note_length = notes_rest; + current_note--; + } else { + note_resting = false; + envelope_index = 0; + note_frequency = (*notes_pointer)[current_note][0]; + note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); + } + + note_position = 0; + } + } + + if (!audio_config.enable) { + playing_notes = false; + playing_note = false; + } } void play_note(float freq, int vol) { + dprintf("audio play note freq=%d vol=%d", (int)freq, vol); + if (!audio_initialized) { audio_init(); } - if (audio_config.enable && voices < 8) { - DISABLE_AUDIO_COUNTER_3_ISR; + if (audio_config.enable && voices < 8) { + DISABLE_AUDIO_COUNTER_3_ISR; - // Cancel notes if notes are playing - if (playing_notes) - stop_all_notes(); + // Cancel notes if notes are playing + if (playing_notes) + stop_all_notes(); - playing_note = true; + playing_note = true; - envelope_index = 0; + envelope_index = 0; - if (freq > 0) { - frequencies[voices] = freq; - volumes[voices] = vol; - voices++; - } + if (freq > 0) { + frequencies[voices] = freq; + volumes[voices] = vol; + voices++; + } ENABLE_AUDIO_COUNTER_3_ISR; ENABLE_AUDIO_COUNTER_3_OUTPUT; - } + } } @@ -346,37 +352,37 @@ void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat, float n_rest) audio_init(); } - if (audio_config.enable) { + if (audio_config.enable) { - DISABLE_AUDIO_COUNTER_3_ISR; + DISABLE_AUDIO_COUNTER_3_ISR; - // Cancel note if a note is playing - if (playing_note) - stop_all_notes(); + // Cancel note if a note is playing + if (playing_note) + stop_all_notes(); - playing_notes = true; + playing_notes = true; - notes_pointer = np; - notes_count = n_count; - notes_repeat = n_repeat; - notes_rest = n_rest; + notes_pointer = np; + notes_count = n_count; + notes_repeat = n_repeat; + notes_rest = n_rest; - place = 0; - current_note = 0; + place = 0; + current_note = 0; note_frequency = (*notes_pointer)[current_note][0]; note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100); - note_position = 0; + note_position = 0; ENABLE_AUDIO_COUNTER_3_ISR; ENABLE_AUDIO_COUNTER_3_OUTPUT; - } + } } bool is_playing_notes(void) { - return playing_notes; + return playing_notes; } bool is_audio_on(void) { -- cgit v1.2.3-24-g4f1b From 683754bce806c634f59dd9d926491952778f913b Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 04:11:47 +0000 Subject: added custom tones --- quantum/audio/song_list.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'quantum/audio') diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 8022ca672..400915db9 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -122,4 +122,31 @@ E__NOTE(_E5), \ E__NOTE(_D5), +#define COIN_SOUND \ + E__NOTE(_A5 ), \ + HD_NOTE(_E6 ), + +#define ONE_UP_SOUND \ + Q__NOTE(_E6 ), \ + Q__NOTE(_G6 ), \ + Q__NOTE(_E7 ), \ + Q__NOTE(_C7 ), \ + Q__NOTE(_D7 ), \ + Q__NOTE(_G7 ), + +#define SONIC_RING \ + E__NOTE(_E6), \ + E__NOTE(_G6), \ + HD_NOTE(_C7), + +#define ZELDA_PUZZLE \ + Q__NOTE(_G5), \ + Q__NOTE(_FS5), \ + Q__NOTE(_DS5), \ + Q__NOTE(_A4), \ + Q__NOTE(_GS4), \ + Q__NOTE(_E5), \ + Q__NOTE(_GS5), \ + HD_NOTE(_C6), + #endif -- cgit v1.2.3-24-g4f1b From 23839b8c6d2f955e4da89b0981948c721346c528 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Tue, 28 Mar 2017 15:20:36 -0700 Subject: Clarify the quantum license (#1042) * Clarify the license for files we have signoff on * Update against the currently signed off files * Remove unused and not clearly licensed headers * Replace an #endif I accidentally removed while resolving merge conflicts --- quantum/audio/audio.c | 15 +++++++++++++++ quantum/audio/audio.h | 17 ++++++++++++++++- quantum/audio/audio_pwm.c | 15 +++++++++++++++ quantum/audio/luts.c | 16 ++++++++++++++++ quantum/audio/luts.h | 18 +++++++++++++++++- quantum/audio/musical_notes.h | 18 +++++++++++++++++- quantum/audio/song_list.h | 15 +++++++++++++++ quantum/audio/voices.c | 15 +++++++++++++++ quantum/audio/voices.h | 17 ++++++++++++++++- quantum/audio/wave.h | 18 +++++++++++++++++- 10 files changed, 159 insertions(+), 5 deletions(-) (limited to 'quantum/audio') diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index e1e81fd2b..597073611 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -1,3 +1,18 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include #include //#include diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h index 47f326ea0..27fdc2ab6 100644 --- a/quantum/audio/audio.h +++ b/quantum/audio/audio.h @@ -1,3 +1,18 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #ifndef AUDIO_H #define AUDIO_H @@ -88,4 +103,4 @@ void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat, float n_rest) bool is_playing_notes(void); -#endif \ No newline at end of file +#endif diff --git a/quantum/audio/audio_pwm.c b/quantum/audio/audio_pwm.c index f820eec1b..ded86edee 100644 --- a/quantum/audio/audio_pwm.c +++ b/quantum/audio/audio_pwm.c @@ -1,3 +1,18 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include #include //#include diff --git a/quantum/audio/luts.c b/quantum/audio/luts.c index 9f3de9a05..57f2d5924 100644 --- a/quantum/audio/luts.c +++ b/quantum/audio/luts.c @@ -1,3 +1,19 @@ +/* Copyright 2016 IBNobody + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff --git a/quantum/audio/luts.h b/quantum/audio/luts.h index 7df3078a7..155e34e88 100644 --- a/quantum/audio/luts.h +++ b/quantum/audio/luts.h @@ -1,3 +1,19 @@ +/* Copyright 2016 IBNobody + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -12,4 +28,4 @@ extern const float vibrato_lut[VIBRATO_LUT_LENGTH]; extern const uint16_t frequency_lut[FREQUENCY_LUT_LENGTH]; -#endif /* LUTS_H */ \ No newline at end of file +#endif /* LUTS_H */ diff --git a/quantum/audio/musical_notes.h b/quantum/audio/musical_notes.h index b08d16a6f..a3aaa2f19 100644 --- a/quantum/audio/musical_notes.h +++ b/quantum/audio/musical_notes.h @@ -1,3 +1,19 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef MUSICAL_NOTES_H #define MUSICAL_NOTES_H @@ -214,4 +230,4 @@ #define NOTE_BF8 NOTE_AS8 -#endif \ No newline at end of file +#endif diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 400915db9..3bf20333d 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -1,3 +1,18 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "musical_notes.h" #ifndef SONG_LIST_H diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index c2edb75f0..54ebd423b 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -1,3 +1,18 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "voices.h" #include "audio.h" #include "stdlib.h" diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index 52f7e006d..9403a6b5e 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h @@ -1,3 +1,18 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include #include #include @@ -32,4 +47,4 @@ void set_voice(voice_type v); void voice_iterate(void); void voice_deiterate(void); -#endif \ No newline at end of file +#endif diff --git a/quantum/audio/wave.h b/quantum/audio/wave.h index 6ebc34851..f15615dd1 100644 --- a/quantum/audio/wave.h +++ b/quantum/audio/wave.h @@ -1,3 +1,19 @@ +/* Copyright 2016 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -262,4 +278,4 @@ const uint8_t sinewave[] PROGMEM= //2048 values 0x76,0x77,0x77,0x77,0x78,0x78,0x78,0x79, 0x79,0x7a,0x7a,0x7a,0x7b,0x7b,0x7c,0x7c, 0x7c,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f -}; \ No newline at end of file +}; -- cgit v1.2.3-24-g4f1b