int main()                                    // Main function
{
  badge_setup();                              // Set up badge systems

  audio = sound_run(9, 10);                   // Run sound, get audio pointer
  
  oledprint("CH  = 0 NOTE=C5 ");              // Display Ch and note
  sound_note(audio, 0, C5);                   // Play ch and note
  pause(250);
  oledprint("CH  = 0 NOTE=D5 ");              // Repeat for octave
  sound_note(audio, 0, D5);
  pause(250);
  oledprint("CH  = 0 NOTE=E5 ");
  sound_note(audio, 0, E5);
  pause(250);
  oledprint("CH  = 0 NOTE=F5 ");
  sound_note(audio, 0, F5);
  pause(250);
  oledprint("CH  = 0 NOTE=G5 ");
  sound_note(audio, 0, G5);
  pause(250);
  oledprint("CH  = 0 NOTE=A5 ");
  sound_note(audio, 0, A5);
  pause(250);
  oledprint("CH  = 0 NOTE=B5 ");
  sound_note(audio, 0, B5);
  pause(250);
  oledprint("CH  = 0 NOTE=C6 ");              // Up an octave   
  sound_note(audio, 0, C6);
  pause(500);
  oledprint("CH  = 0  f  = 0 ");              // Sound off
  sound_freq(audio, 0, 0);
}
Exemple #2
0
void play_sine_wave () {
	int i;
	int *ptr;


	ptr = &sine_samples;

	i=0;
	while (1) {
		// sound_note(52, 1);
		for (i = 0; i < 33; i++) {
			sound_note(MIDI_OFFSET + i, 1);
		}
		for (i = 32; i >=0; i--) {
			sound_note(MIDI_OFFSET + i, 1);
		}
	}
}
Exemple #3
0
void play_song(linked_list* notes_list){
	stems_t* current_note;
	uint16_t i;

	for (i=0; i<notes_list->length; i++) {
		current_note = (stems_t*)linked_list_getIndexData(notes_list,i);
		char_display_note_info(current_note);
		sound_note(current_note->midi + current_note->mod, current_note->duration);
	}
}