Exemple #1
0
        public static Wavetable operator -(Wavetable w1, Wavetable w2)
        {
            float[] waveform = new float[defaultSize];

            for (int i = 0; i < defaultSize; i++)
            {
                waveform[i] = w1.ratio * w1[i * w1.Size / defaultSize] - w2.ratio * w2[i * w2.Size / defaultSize];
            }

            Wavetable output = new Wavetable(waveform);

            output.ratio = w1.ratio + w2.ratio;

            return(output);
        }
Exemple #2
0
		public static Wavetable operator - (Wavetable w1, Wavetable w2){
			
			float[] waveform = new float[defaultSize];
			
			for(int i = 0; i < defaultSize; i++)
				waveform[i] = w1.ratio * w1[i * w1.Size / defaultSize] - w2.ratio * w2[i * w2.Size / defaultSize];

			Wavetable output = new Wavetable(waveform);
			output.ratio = w1.ratio + w2.ratio;

			return output;

		}
Exemple #3
0
 public Oscillator(Wavetable wavetable, float amplitude = 1f, float frequency = 1f)
 {
     Setup(amplitude, frequency);
     this.wavetable = wavetable;
 }
Exemple #4
0
 public Oscillator(Wavetable wavetable, float amplitude = 1f, float frequency = 1f)
 {
     Setup(amplitude, frequency);
     this.wavetable = wavetable;
 }