Esempio n. 1
0
        // Test between 20Hz and 500Hz. This works very well, although it is hard to eliminate octave errors
        // This test will play original, then a sine at the frequency it detected. The two should line up.
        private static void pitchdetectwav(AudioPlayer pl, string strFilename, PitchDetection.PitchDetectAlgorithm algorithm)
        {
            string    strInstdir = mediadir + @"pitchdetect\";
            WaveAudio w          = new WaveAudio(strInstdir + strFilename);

            if (w.getNumChannels() != 1)
            {
                w.setNumChannels(1, true);
            }
            double    dfreq     = PitchDetection.DetectPitch(w, 50, 500, algorithm);
            WaveAudio testPitch = new Triangle(dfreq, 0.7).CreateWaveAudio(1.0);

            pl.Play(w);
            pl.Play(testPitch);
        }
Esempio n. 2
0
 void Start()
 {
     s = this;
     OnNoteChangedPureMidi += stop;
 }
Esempio n. 3
0
 void Start()
 {
     s = this;
 }