예제 #1
0
파일: Fuzz.cs 프로젝트: neilmckg/WPFSynth
 public Fuzz(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new ClipCore();
     InputValueChanged(null);
     Output = GetSample;
 }
예제 #2
0
파일: Fader.cs 프로젝트: neilmckg/WPFSynth
 public Fader(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new FaderCore();
     InputValueChanged(null);
     Output = GetSample;
 }
예제 #3
0
 public Echo(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new EchoCore(audioLink);
     InputValueChanged(null);
     Output = GetSample;
 }
예제 #4
0
 public Oscillator(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new OscillatorCore(audioLink);
     InputValueChanged(null);
     Output = GetSample;
 }
예제 #5
0
 public Translate(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new TranslateCore();
     _core.OutputChanged += HandleCoreOutputChanged;
     InputValueChanged(null);
 }
예제 #6
0
파일: Noise.cs 프로젝트: neilmckg/WPFSynth
 public Noise(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new NoiseCore();
     InputValueChanged(null);
     Output = GetSample;
 }
예제 #7
0
파일: Glide.cs 프로젝트: neilmckg/WPFSynth
 public Glide(IAudioLink audioLink)
     : base(audioLink)
 {
     _core = new GlideCore(audioLink);
     _core.OutputChanged += HandleCoreOutputChanged;
     InputValueChanged(null);
     Unloaded += (s, e) => _core.Dispose();
 }
예제 #8
0
        public Mixer(IAudioLink audioLink)
            : base(audioLink)
        {
            _core = new MixerCore();
            RegisterChildCollection(_core.Channels);

            Output = GetSample;
        }
예제 #9
0
 public void Dispose()
 {
     if (_audioLink != null)
     {
         _audioLink.DetachClockListener(this);
     }
     _audioLink = null;
 }
예제 #10
0
        public LowPassFilter(IAudioLink audioLink)
            : base(audioLink)
        {
            SetCurrentValue(DescriptionProperty, "LP Filter");

            _core = new LowPassFilterCore(audioLink);
            InputValueChanged(null);
            Output = GetSample;
        }
예제 #11
0
파일: LFO.cs 프로젝트: neilmckg/WPFSynth
        public LFO(IAudioLink audioLink)
            : base(audioLink)
        {
            // TODO: supress tick handling until loading is complete?

            _core = new LfoCore(audioLink);
            _core.OutputChanged += HandleCoreOutputChanged;
            InputValueChanged(null);
            Unloaded += (s, e) => _core.Dispose();
        }
예제 #12
0
        protected Module(IAudioLink audioLink)
        {
            if (audioLink == null && !this.IsInDesignMode())
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            Loaded   += HandleLoaded;
            Unloaded += HandleUnloaded;
        }
예제 #13
0
        public EchoCore(IAudioLink audioLink, float initialSeconds = 0.4f)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            InitializeInputs(initialSeconds);

            HandleQualityChanged(null, null);
            _audioLink.SampleRateChanged += HandleQualityChanged;
        }
예제 #14
0
        public OscillatorCore(IAudioLink audioLink, float initialPitch = DEFAULT_PITCH)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            InitializeInputs(initialPitch);

            HandleQualityChanged(null, null);
            _audioLink.SampleRateChanged += HandleQualityChanged;
        }
예제 #15
0
        public LowPassFilterCore(IAudioLink audioLink, float initialCutoffPitch = 0.5f, float initialResonance = 0.2f)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            CutoffPitch = new FloatInput("Cutoff Pitch", initialCutoffPitch, 0, 0.85f, ValueOutOfRangeStrategy.ForceIntoRange, (name, v0, v1) => SetFilterCoefficients());
            Resonance   = new FloatInput("Resonance", initialResonance, 0, 0.85f, ValueOutOfRangeStrategy.ForceIntoRange, (name, v0, v1) => SetFilterCoefficients());

            SetFilterCoefficients();
            _audioLink.SampleRateChanged += HandleQualityChanged;
        }
예제 #16
0
        public AudioMeter(IAudioLink audioLink)
            : base(audioLink)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            IsEnabledChanged += HandleIsEnabledChanged;

            Loaded   += HandleLoaded;
            Unloaded += HandleUnloaded;
        }
예제 #17
0
        public LfoCore(IAudioLink audioLink, float initialFrequency = 5, float initialAmount = 0)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            InitializeInputs(initialFrequency, initialAmount);

            _clockSource = new AudioClockDivider(_audioLink, 100, id => HandleControlClockTick());

            HandleQualityChanged(null, null);
            _audioLink.SampleRateChanged += HandleQualityChanged;
        }
예제 #18
0
        public GlideCore(IAudioLink audioLink)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            SourceValue = new FloatInput("Source Value", 0, float.MinValue, float.MaxValue, ValueOutOfRangeStrategy.Accept, (name, v0, v1) => HandleSourceValueChanged(v1));
            Rate        = new FloatInput("Rate", 1, 0, 1, ValueOutOfRangeStrategy.ForceIntoRange, (name, v0, v1) => HandleRateChanged());

            HandleQualityChanged(null, null);
            _audioLink.SampleRateChanged += HandleQualityChanged;

            _clockSource = new AudioClockDivider(_audioLink, 100, id => HandleControlClockTick());
        }
예제 #19
0
        public Envelope(IAudioLink audioLink)
            : base(audioLink)
        {
            _core = new EnvelopeCore(audioLink);

            RegisterChildCollection(_core.Attack);
            RegisterChildCollection(_core.Loop);
            RegisterChildCollection(_core.Release);

            _core.StepsChanged  += HandleCoreStepsChanged;
            _core.PhaseChanged  += HandleCorePhaseChanged;
            _core.OutputChanged += HandleCoreOutputChanged;

            InputValueChanged(TimeScaleProperty.Name);

            Unloaded += (s, e) => _core.Dispose();
        }
예제 #20
0
        public EnvelopeCore(IAudioLink audioLink)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            SetOutput(0);

            InitializeInputs();
            InitializeStepCollections();
            _steps = new[] { Attack, Loop, Release };

            _audioLink.SampleRateChanged += HandleQualityChanged;
            _clockSource = new AudioClockDivider(_audioLink, 50, id => HandleControlClockTick());

            HandleQualityChanged(null, null);
        }
예제 #21
0
        public SynthWindow(IAudioLink audioLink, IMidiLink midiLink)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            if (midiLink == null)
            {
                throw new ArgumentNullException("midiLink");
            }
            _midiLink = midiLink;

            Loaded += HandleLoaded;

            //SetAlternateColors();

            InitializeComponent();
        }
예제 #22
0
        public AudioClockDivider(IAudioLink audioLink, int targetClockRate, Action <ulong> tickHandler, bool rateMustBeExact = false)
        {
            if (audioLink == null)
            {
                throw new ArgumentNullException("audioLink");
            }
            _audioLink = audioLink;

            if (tickHandler == null)
            {
                throw new ArgumentNullException("tickHandler");
            }
            _tickHandler = tickHandler;

            _rateMustBeExact = rateMustBeExact;
            _targetRate      = targetClockRate;

            ApplyTargetRate();
            _audioLink.SampleRateChanged += HandleAudioQualityChanged;
            _audioLink.AttachClockListener(this);
        }
예제 #23
0
 public Vibrato(IAudioLink audioLink)
     : base(audioLink)
 {
     InitializeComponent();
 }
예제 #24
0
 public HostModule(IAudioLink audioLink)
     : base(audioLink)
 {
     DataContext = this;
 }