Exemple #1
0
        public WaveTableOsc(AudioProcessor Processor, OscParameters paramOwnr)
        {
            processor     = Processor;
            paramOwner    = paramOwnr;
            phasor        = 0.0;
            phaseInc      = 0.0;
            phaseOfs      = 0.5;
            numWaveTables = 0;
            for (int idx = 0; idx < numWaveTableSlots; idx++)
            {
                waveTables[idx].topFreq      = 0;
                waveTables[idx].waveTableLen = 0;
                waveTables[idx].waveTable    = null;
            }

            paramOwner.OscillatorType.OnValueChange += OscTypeChanged;
            if (paramOwner.OscillatorType.Value == EOscillatorType.Sine || paramOwner.OscillatorType.Value == EOscillatorType.Saw)
            {
                SetOsc(baseFrequency, EOscillatorType.Saw);
            }
            else if (paramOwner.OscillatorType.Value == EOscillatorType.Square)
            {
                SetOsc(baseFrequency, EOscillatorType.Square);
            }
            else if (paramOwner.OscillatorType.Value == EOscillatorType.Triangle)
            {
                SetOsc(baseFrequency, EOscillatorType.Triangle);
            }
        }
Exemple #2
0
        public Oscillator(AudioProcessor audioProcessor, OscParameters paramOwner, int note, double detune, double phase) :
            base(audioProcessor)
        {
            audioProcessor.OnSampleRateChanged      += SampleRateChanged;
            paramOwner.OscillatorType.OnValueChange += TypeChanged;

            type = paramOwner.OscillatorType.Value;
            calc = twoPI / Processor.SampleRate;

            this.note       = note;
            this.phase      = phase;
            this.detune     = detune;
            this.paramOwner = paramOwner;
        }
Exemple #3
0
        public AudioProcessor(PluginController pluginController) :
            base(0, 2, 0)
        {
            PluginController = pluginController;

            OscillatorA   = new OscParameters(this);
            OscillatorB   = new OscParameters(this);
            EnvelopeSound = new EnvelopeParameters(this);
            Filter        = new FilterParameters(this);
            FilterEnv     = new EnvelopeParameters(this);
            Distortion    = new Distortion(this);
            LFOModifierA  = new LFO(this);
            LFOModifierB  = new LFO(this);

            VoicesGenereator = new VoiceManager(this);

            OnBypassChanged += (sender, args) =>
            {
                Power.Value = (Bypass) ? EPowerStatus.Off : EPowerStatus.On;
            };
        }