classdef Chorus< matlab.System
%Chorus Add chorus effect to audio signal.
%
%   CHORUS = audioexample.Chorus returns a chorus System object, CHORUS,
%   that adds chorus effect to the audio signal.
%
%   CHORUS = audioexample.Chorus('Name', Value, ...) returns a chorus
%   System object, CHORUS, with each specified property name set to the
%   specified value. You can specify additional name-value pair arguments
%   in any order as (Name1,Value1,...,NameN, ValueN).
%
%   Step method syntax:
%      
%   Y = CHORUS(X) adds chorus effect for the audio input X based on
%   the properties specified in the object CHORUS and returns it as audio
%   output Y. Each column of X is treated as individual channel of input.
%
%   System objects may be called directly like a function instead of using
%   the step method. For example, y = step(obj, x) and y = obj(x) are
%   equivalent.
%
%   Chorus methods:
%
%   step     - See above for the description of the method
%   <a href="matlab:help matlab.System/reset   ">reset</a>    - Resets the internal state to initial conditions
%   clone    - Create Chorus system object with similar property values
%   isLocked - Locked status (logical)
%   
%   Chorus properties:
%   
%   Delay       - Base delay in seconds
%   Depth       - Amplitude of sine wave modulators
%   Rate        - Frequency of sine wave modulators
%   WetDryMix   - Wet to dry signal ratio
%   SampleRate  - Sample rate of the input audio signal   
%
%   % Example: Add chorus effect to an audio signal.
%
%   fileReader = dsp.AudioFileReader('SamplesPerFrame', 1024,...
%     'PlayCount', 3);
% 
%   player = audioDeviceWriter('SampleRate', fileReader.SampleRate);
% 
%   CHORUS = audioexample.Chorus;
% 
%   while ~isDone(fileReader)
%       Input = fileReader();
%       Output = CHORUS(Input);
%       player(Output);
%   end
% 
%   release(fileReader)
%   release(player)

 
% Copyright 2015-2018 The MathWorks, Inc.

    methods
        function out=Chorus
            % Set properties according to name-value pairs.
        end

        function out=IsOutputComplexImpl(~) %#ok<STOUT>
        end

        function out=getOutputDataTypeImpl(~) %#ok<STOUT>
        end

        function out=getOutputSizeImpl(~) %#ok<STOUT>
        end

        function out=isOutputFixedSizeImpl(~) %#ok<STOUT>
        end

        function out=loadObjectImpl(~) %#ok<STOUT>
        end

        function out=processTunedPropertiesImpl(~) %#ok<STOUT>
            % When Delay property changes, we have recalculate
            % pDelayInSamples property. Note that to maintain similar data
            % types throughout the process, cast function is used.
        end

        function out=releaseImpl(~) %#ok<STOUT>
            % Release the Delay and sine wave objects
        end

        function out=resetImpl(~) %#ok<STOUT>
            % Resetting the delay and sine wave objects.
        end

        function out=saveObjectImpl(~) %#ok<STOUT>
        end

        function out=setupImpl(~) %#ok<STOUT>
            % Cache the data type of Input signal.
        end

        function out=stepImpl(~) %#ok<STOUT>
            % Create the delay vector. Delay in samples are added to the
            % sine wave here.
        end

        function out=validateInputsImpl(~) %#ok<STOUT>
            % Validate inputs to the step method at initialization.
        end

    end
    properties
        %Delay Base delay
        %   Specify the base delay for chorus effect as positive scalar
        %   value in seconds. Base delay value must be in the range between
        %   0 and 0.1 seconds. The default value of this property is 0.02.
        Delay;

        %Depth Amplitude of sine wave
        %   Specify the amplitude of modulating sine wave as a positive
        %   scalar value. Pass this value as a vector of maximum of two
        %   elements for two taps. These sinewaves are added to the base
        %   delay value to make the delay sinusoidally modulating. This
        %   value must range between 0 to 10. The default value of this
        %   property is [0.01 0.03].
        Depth;

        %Rate Frequency of sine wave
        %   Specify the frequency of the sine wave as a positive scalar
        %   value in Hz. Pass this value as a vector of maximum of two
        %   elements for two taps. This property controls the chorus rate.
        %   This value must range from 0 to 10 Hz. The default value of
        %   this property is [0.01 0.02].
        Rate;

        %SampleRate Sampling rate of the audio signal.
        %   Specify the sampling rate of the audio signal as a positive
        %   scalar value in Hz. The default value of this property is 44100
        %   Hz.
        SampleRate;

        %WetDryMix Wet/dry mix
        %   Specify the wet/dry mix ratio as a positive scalar. This value
        %   ranges from 0 to 1. For example, for a value of 0.6, the
        %   ratio will be 60% wet to 40% dry signal (Wet - Signal that has
        %   effect in it. Dry - Unaffected signal). The default value of
        %   this property is 0.5.
        WetDryMix;

    end
end
