AVRly - AVR Development Resources
sweet_child_o_mine.c File Reference

This file contains the implementation of the sequencing to reproduce the intro to Sweet Child O' Mine by Guns N Roses. More...

#include "sweet_child_o_mine.h"
#include "am_radio.h"

Go to the source code of this file.

Functions

void sweet_child_riff_part_1 (void)
 
void sweet_child_riff_part_2 (void)
 
void sweet_child_riff_part_3 (void)
 
void init_radio (void)
 
void sweet_child_riff (void)
 

Detailed Description

This file contains the implementation of the sequencing to reproduce the intro to Sweet Child O' Mine by Guns N Roses.

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.

Author
Jason Duffy
Date
10th September 2022

Definition in file sweet_child_o_mine.c.

Function Documentation

◆ sweet_child_riff_part_1()

void sweet_child_riff_part_1 ( void  )

Definition at line 62 of file sweet_child_o_mine.c.

63{
64 // Intro, Bar 1
65 am_radio_transmit_note(C2, QUAVER);
66 am_radio_transmit_note(C3, QUAVER);
67 am_radio_transmit_note(G2, QUAVER);
68 am_radio_transmit_note(F2, QUAVER);
69 am_radio_transmit_note(F3, QUAVER);
70 am_radio_transmit_note(G2, QUAVER);
71 am_radio_transmit_note(E3, QUAVER);
72 am_radio_transmit_note(G2, QUAVER);
73}
void am_radio_transmit_note(note_pitch_t pitch, note_duration_t note_length)
Transmits a square wave, monophonic note for the specified duration.
Definition: am_radio.c:94

◆ sweet_child_riff_part_2()

void sweet_child_riff_part_2 ( void  )

Definition at line 76 of file sweet_child_o_mine.c.

77{
78 // Intro, Bar 3
79 am_radio_transmit_note(D2, QUAVER);
80 am_radio_transmit_note(C3, QUAVER);
81 am_radio_transmit_note(G2, QUAVER);
82 am_radio_transmit_note(F2, QUAVER);
83 am_radio_transmit_note(F3, QUAVER);
84 am_radio_transmit_note(G2, QUAVER);
85 am_radio_transmit_note(E3, QUAVER);
86 am_radio_transmit_note(G2, QUAVER);
87}

◆ sweet_child_riff_part_3()

void sweet_child_riff_part_3 ( void  )

Definition at line 90 of file sweet_child_o_mine.c.

91{
92 // Intro, Bar 5
93 am_radio_transmit_note(F2, QUAVER);
94 am_radio_transmit_note(C3, QUAVER);
95 am_radio_transmit_note(G2, QUAVER);
96 am_radio_transmit_note(F2, QUAVER);
97 am_radio_transmit_note(F3, QUAVER);
98 am_radio_transmit_note(G2, QUAVER);
99 am_radio_transmit_note(E3, QUAVER);
100 am_radio_transmit_note(G2, QUAVER);
101}

◆ init_radio()

void init_radio ( void  )

Definition at line 40 of file sweet_child_o_mine.c.

41{
42 // Initialisation routines
43 init_am_radio(_1000_KHZ);
44 // Set tempo in BPM
46}
void init_am_radio(frequency_khz_t carrier_freq)
Initialises timer/counter for radio transmission at a specified carrier frequency.
Definition: am_radio.c:47
void am_radio_set_tempo(uint8_t bpm)
Sets tempo for musical tones to be transmitted (in BPM).
Definition: am_radio.c:80

◆ sweet_child_riff()

void sweet_child_riff ( void  )

Definition at line 49 of file sweet_child_o_mine.c.

50{
51 sweet_child_riff_part_1();
52 sweet_child_riff_part_1();
53 sweet_child_riff_part_2();
54 sweet_child_riff_part_2();
55 sweet_child_riff_part_3();
56 sweet_child_riff_part_3();
57 sweet_child_riff_part_1();
58 sweet_child_riff_part_1();
59}