Exemplo n.º 1
0
 public static WaveAudio Reverse(WaveAudio w1)
 {
     WaveAudio clone = w1.Clone();
     for (int ch = 0; ch < clone.data.Length; ch++)
     {
         Array.Reverse( clone.data[ch]);
     }
     return clone;
 }
Exemplo n.º 2
0
        public static WaveAudio Reverse(WaveAudio w1)
        {
            WaveAudio clone = w1.Clone();

            for (int ch = 0; ch < clone.data.Length; ch++)
            {
                Array.Reverse(clone.data[ch]);
            }
            return(clone);
        }
Exemplo n.º 3
0
 public static WaveAudio Derivative(WaveAudio wOriginal)
 {
     WaveAudio w = wOriginal.Clone();
     for (int ch = 0; ch < w.getNumChannels(); ch++)
     {
         for (int i = 0; i < w.data[ch].Length; i++)
         {
             if (i + 1 < w.data[ch].Length)
                 w.data[ch][i] = w.data[ch][i] - w.data[ch][i + 1];
             else
                 w.data[ch][i] = w.data[ch][i] - 0;
         }
     }
     return w;
 }
        public static WaveAudio Phaser(WaveAudio wOriginal, double freq, double fb, int depth, int stages, int drywet)
        {
            double startphaseleft = 0;
            double startphaseright = startphaseleft + Math.PI; //note that left and right channels should start pi out of phase
            double freq_scaled = 2.0 * Math.PI * freq / (double)wOriginal.getSampleRate();

            WaveAudio w = wOriginal.Clone();
            if (w.getNumChannels() == 1)
                effect_phaseraud_impl(w.data[0], freq_scaled, startphaseleft, fb, depth, stages, drywet);
            else
            {
                effect_phaseraud_impl(w.data[0], freq_scaled, startphaseleft, fb, depth, stages, drywet);
                effect_phaseraud_impl(w.data[1], freq_scaled, startphaseright, fb, depth, stages, drywet);
            }
            return w;
        }
        public static WaveAudio Wahwah(WaveAudio wOriginal, double freq, double depth, double freqofs, double res)
        {
            double startphaseleft = 0;
            double startphaseright = startphaseleft + Math.PI; //note that left and right channels should start pi out of phase
            double freq_scaled = 2.0 * Math.PI * freq / (double)wOriginal.getSampleRate();

            WaveAudio w = wOriginal.Clone();
            if (w.getNumChannels() == 1)
                effect_wahwahaud_impl(w.data[0], startphaseleft, freq_scaled, depth, freqofs, res);
            else
            {
                effect_wahwahaud_impl(w.data[0], startphaseleft, freq_scaled, depth, freqofs, res);
                effect_wahwahaud_impl(w.data[1], startphaseright, freq_scaled, depth, freqofs, res);
            }
            return w;
        }
Exemplo n.º 6
0
        public static WaveAudio Phaser(WaveAudio wOriginal, double freq, double fb, int depth, int stages, int drywet)
        {
            double startphaseleft  = 0;
            double startphaseright = startphaseleft + Math.PI; //note that left and right channels should start pi out of phase
            double freq_scaled     = 2.0 * Math.PI * freq / (double)wOriginal.getSampleRate();

            WaveAudio w = wOriginal.Clone();

            if (w.getNumChannels() == 1)
            {
                effect_phaseraud_impl(w.data[0], freq_scaled, startphaseleft, fb, depth, stages, drywet);
            }
            else
            {
                effect_phaseraud_impl(w.data[0], freq_scaled, startphaseleft, fb, depth, stages, drywet);
                effect_phaseraud_impl(w.data[1], freq_scaled, startphaseright, fb, depth, stages, drywet);
            }
            return(w);
        }
Exemplo n.º 7
0
        public static WaveAudio Wahwah(WaveAudio wOriginal, double freq, double depth, double freqofs, double res)
        {
            double startphaseleft  = 0;
            double startphaseright = startphaseleft + Math.PI; //note that left and right channels should start pi out of phase
            double freq_scaled     = 2.0 * Math.PI * freq / (double)wOriginal.getSampleRate();

            WaveAudio w = wOriginal.Clone();

            if (w.getNumChannels() == 1)
            {
                effect_wahwahaud_impl(w.data[0], startphaseleft, freq_scaled, depth, freqofs, res);
            }
            else
            {
                effect_wahwahaud_impl(w.data[0], startphaseleft, freq_scaled, depth, freqofs, res);
                effect_wahwahaud_impl(w.data[1], startphaseright, freq_scaled, depth, freqofs, res);
            }
            return(w);
        }
Exemplo n.º 8
0
        public static WaveAudio Derivative(WaveAudio wOriginal)
        {
            WaveAudio w = wOriginal.Clone();

            for (int ch = 0; ch < w.getNumChannels(); ch++)
            {
                for (int i = 0; i < w.data[ch].Length; i++)
                {
                    if (i + 1 < w.data[ch].Length)
                    {
                        w.data[ch][i] = w.data[ch][i] - w.data[ch][i + 1];
                    }
                    else
                    {
                        w.data[ch][i] = w.data[ch][i] - 0;
                    }
                }
            }
            return(w);
        }