Ejemplo n.º 1
0
        private static void Player3_Delay()
        {
            // use clock to schedule

            var player = new MidiPlayer(0);

            player.SetInstrument(0, 43 - 1); // Cello
            player.SetInstrument(1, 0);      // Piano

            player.ScheduleNote(1, 1200f, delay: 0f, duration: 4f);
            player.ScheduleNote(1, 1230f, delay: 1f, duration: 4f);
            player.ScheduleNote(0, 1260f, delay: 2f, duration: 4f);

            player.StartClock(60 * 2, waitForEnd: true);

            player.Dispose();
        }
Ejemplo n.º 2
0
        private static void Player4_Delay()
        {
            var player = new MidiPlayer(0);

            //player.SetInstrument(0, 74-1); // Flute

            int n = 8; // steps in halftone

            for (int i = 0; i <= 12 * n; ++i)
            {
                player.ScheduleNote(
                    0,
                    cents:    100f * i / n,
                    velocity: i % n == 0 ? 0x67 : 0x5F,
                    delay:    i,
                    duration: 1
                    );
            }

            player.StartClock(60 * n, waitForEnd: true);

            player.Dispose();
        }