public void Reset() { NoteOffPending = false; PitchOffset = 0; VolOffset = 0; for (int i = 0; i < PData.Length; i++) { PData[i] = new UnionData(); } mix1 = 0; mix2 = 0; }
public VoiceParameters() { BlockBuffer = new SampleArray(SynthConstants.DefaultBlockSize); //create default number of each component PData = new UnionData[SynthConstants.MaxVoiceComponents]; GeneratorParams = new GeneratorParameters[SynthConstants.MaxVoiceComponents]; Envelopes = new Envelope[SynthConstants.MaxVoiceComponents]; Filters = new Filter[SynthConstants.MaxVoiceComponents]; Lfos = new Lfo[SynthConstants.MaxVoiceComponents]; //initialize each component for (int x = 0; x < SynthConstants.MaxVoiceComponents; x++) { GeneratorParams[x] = new GeneratorParameters(); Envelopes[x] = new Envelope(); Filters[x] = new Filter(); Lfos[x] = new Lfo(); } }