Пример #1
0
 static void Play(MelodySequence notes, PatchNames instrument = PatchNames.Vibraphone)
 {
     MusicPlayer player = new MusicPlayer();
     player.SetPatch((int)instrument, 1);
     player.Play(notes);
     player.Close();
 }
Пример #2
0
        static void ChordTest()
        {
            MusicPlayer player = new MusicPlayer();
            Chord dminor = new Chord(new NoteNames[] { NoteNames.D, NoteNames.F, NoteNames.A }, 4, Durations.wn);
            Chord dmajor = new Chord(new NoteNames[] { NoteNames.G, NoteNames.B, NoteNames.B }, 4, Durations.wn);
            Chord cmajor = new Chord(new NoteNames[] { NoteNames.C, NoteNames.E, NoteNames.G }, 4, Durations.bn);

            HarmonySequence seq = new HarmonySequence();
            seq.AddChord(dminor); seq.AddChord(dmajor); seq.AddChord(cmajor); seq.AddChord(dminor); seq.AddChord(cmajor); seq.AddChord(dminor); seq.AddChord(dmajor); seq.AddChord(cmajor);
            player.Play(seq);
            player.Close();
        }
Пример #3
0
 static void Play(IEnumerable<Note> notes, PatchNames instrument = PatchNames.Vibraphone)
 {
     MusicPlayer player = new MusicPlayer();
     player.SetPatch((int)instrument, 1);
     player.PlayNotes(notes);
     player.Close();
 }