コード例 #1
0
        public void MicrotonalTest()
        {
            Pattern normalScale    = new Pattern("(A4 A#4 B4 C5 C#5 D5 D#5 E5 F5 F#5 G5 G#5 A5 A#5 B5 C6)s");
            Pattern microtoneScale = new Pattern();
            var     preprocessor   = new MicrotonePreprocessor();

            for (double freq = Note.FrequencyForNote("A4"); freq < Note.FrequencyForNote("C6"); freq += 10.5)
            {
                microtoneScale.Add("m" + freq + "s");
            }

            Console.WriteLine("First, playing normal scale: " + normalScale);
            player.Play(normalScale);

            player.Play("Rw5");

            Console.WriteLine($"Second, playing microtone scale. You should hear middle ranges in these notes: {microtoneScale}");
            player.Play(microtoneScale);

            Console.WriteLine("The expanded version of the microtone string is: " + preprocessor.Preprocess(microtoneScale.ToString(), null));

            player.Play("Rw5");

            Pattern pitchWheelDemo = new Pattern();

            Console.WriteLine("Now, let's do a pitch wheel demo. Same note (Middle-C, note 60), played with 163 different pitch wheel settings, each 100 cents apart.");
            for (int i = 0; i < 16383; i += 100)
            {
                pitchWheelDemo.Add(":PW(" + i + ") 60t");
            }
            Console.WriteLine("This should sound like it gradually ramps up.");
            player.Play(pitchWheelDemo);

            player.Play("Rw5");

            Console.WriteLine("Now playing four notes. The first two should sound different from each other, and the second two should sound the same as the first two.");
            string microtone = "m346.0w m356.5w";

            player.Play(microtone);
            player.Play(preprocessor.Preprocess(microtone, null));
        }
コード例 #2
0
 public void Test_microtone_adjustment()
 {
     MicrotonePreprocessor.ConvertFrequencyToStaccato(440.0, "s").Should().Be("57s");
     MicrotonePreprocessor.ConvertFrequencyToStaccato(155.56, "q").Should().Be("39q");
 }