Exemplo n.º 1
0
        public static void operations_test(AudioPlayer pl)
        {
            WaveAudio noteLongLow = new Triangle(Triangle.FrequencyFromMidiNote(60), 0.5).CreateWaveAudio(1.0);
            WaveAudio noteShortHi = new Triangle(Triangle.FrequencyFromMidiNote(64), 0.5).CreateWaveAudio(0.5);

            pl.Play(WaveAudio.Concatenate(noteLongLow, noteShortHi));
            pl.Play(WaveAudio.Concatenate(noteShortHi, noteLongLow));
            pl.Play(WaveAudio.Mix(noteShortHi, noteLongLow));
            pl.Play(WaveAudio.Mix(noteLongLow, noteShortHi));
            WaveAudio tmp = new Sine(200, 1.0).CreateWaveAudio(4.0);

            tmp.setNumChannels(2, true);
            pl.Play(WaveAudio.Modulate(new WaveAudio(mediadir + "d44k16bit2ch.wav"), tmp));

            WaveAudio cp;

            cp = noteLongLow.Clone(); cp.FadeIn(0.3); pl.Play(cp);
            cp = noteLongLow.Clone(); cp.FadeOut(0.3); pl.Play(cp);
            cp = noteLongLow.Clone(); cp.Amplify(0.5); pl.Play(cp);
            cp = noteLongLow.Clone(); cp.Amplify(2.0); pl.Play(cp);
        }