/// <summary> /// Testing method for Tunes module /// </summary> static void TestTunes() { var melody = new Tunes.Melody(); Tunes.MusicNote note = new Tunes.MusicNote(Tunes.Tone.C4, 400); melody.Add(note); // up melody.Add(PlayNote(Tunes.Tone.C4)); melody.Add(PlayNote(Tunes.Tone.D4)); melody.Add(PlayNote(Tunes.Tone.E4)); melody.Add(PlayNote(Tunes.Tone.F4)); melody.Add(PlayNote(Tunes.Tone.G4)); melody.Add(PlayNote(Tunes.Tone.A4)); melody.Add(PlayNote(Tunes.Tone.B4)); melody.Add(PlayNote(Tunes.Tone.C5)); //// back down melody.Add(PlayNote(Tunes.Tone.B4)); melody.Add(PlayNote(Tunes.Tone.A4)); melody.Add(PlayNote(Tunes.Tone.G4)); melody.Add(PlayNote(Tunes.Tone.F4)); melody.Add(PlayNote(Tunes.Tone.E4)); melody.Add(PlayNote(Tunes.Tone.D4)); melody.Add(PlayNote(Tunes.Tone.C4)); //// arpeggio melody.Add(PlayNote(Tunes.Tone.E4)); melody.Add(PlayNote(Tunes.Tone.G4)); melody.Add(PlayNote(Tunes.Tone.C5)); melody.Add(PlayNote(Tunes.Tone.G4)); melody.Add(PlayNote(Tunes.Tone.E4)); melody.Add(PlayNote(Tunes.Tone.C4)); //tunes.Play(); //Thread.Sleep(100); melody.Add(PlayNote(Tunes.Tone.E4)); melody.Add(PlayNote(Tunes.Tone.G4)); melody.Add(PlayNote(Tunes.Tone.C5)); melody.Add(PlayNote(Tunes.Tone.G4)); melody.Add(PlayNote(Tunes.Tone.E4)); melody.Add(PlayNote(Tunes.Tone.C4)); var tunes = new Tunes(FEZRaptor.Socket18.PwmPin.Controller2.Id, FEZRaptor.Socket18.PwmPin.Controller2.PC20); tunes.Play(melody); }
public void SoundAlarm() { var melody = new Tunes.Melody(); melody.Add((int)C4, Quarter); melody.Add((int)F4, Quarter); melody.Add((int)C5, Half); _tunes.Play(melody); }
private void PlayMelody(int menuItem) { RttlMelody melody = new RttlMelody(_melodyRTTL[menuItem]); _Tunes.Play(melody.ToMelody()); }