示例#1
0
        public override double GetSoundValue(double time)
        {
            BaseSoundNode input = GetInputValue <BaseSoundNode>(nameof(In), null);

            if (input == null)
            {
                return(0.0);
            }
            return((double)((input.GetSoundValue(time) - InMin) * (OutMax - OutMin) / (InMax - InMin) + OutMin));
        }
        public double GetSoundValue(double time)
        {
            double result = 0;

            BaseSoundNode node = GetInputValue <BaseSoundNode>("OutputSound", null);

            if (node != null)
            {
                result = node.GetSoundValue(time);
            }

            return(result);
        }
示例#3
0
        public override double GetSoundValue(double time)
        {
            double        inputValue = 0.0;
            BaseSoundNode input      = GetInputValue <BaseSoundNode>(nameof(In), null);

            if (input != null)
            {
                inputValue = input.GetSoundValue(time);
            }
            if (inputValue < InMin)
            {
                return(InMin);
            }
            else
            if (inputValue > InMax)
            {
                return(InMax);
            }
            else
            {
                return(inputValue);
            }
        }
示例#4
0
        public override double GetSoundValue(double time)
        {
            BaseSoundNode freqInput  = GetInputValue <BaseSoundNode>(nameof(FreqNode), null);
            BaseSoundNode ampInput   = GetInputValue <BaseSoundNode>(nameof(AmpNode), null);
            BaseSoundNode phaseInput = GetInputValue <BaseSoundNode>(nameof(PhaseNode), null);
            double        freq       = DefaultFreq;
            double        amp        = DefaultAmp;
            double        phase      = DefaultPhase;

            if (freqInput != null)
            {
                freq = freqInput.GetSoundValue(time);
            }
            if (ampInput != null)
            {
                amp = ampInput.GetSoundValue(time);
            }
            if (phaseInput != null)
            {
                phase = phaseInput.GetSoundValue(time);
            }

            return(System.Math.Sin(2f * System.Math.PI * freq * time + phase) * amp);
        }