Beispiel #1
0
        private void Update(EvaluationContext context)
        {
            var contextLocalTime   = (float)context.LocalTime;
            var contextLocalFxTime = (float)context.LocalFxTime;

            float time = 0;

            switch ((Modes)Mode.GetValue(context))
            {
            case Modes.LocalFxTimeInBars:
                time = contextLocalFxTime;
                break;

            case Modes.LocalTimeInBars:
                time = contextLocalTime;
                break;

            case Modes.PlaybackTimeInSecs:
                time = contextLocalTime * 240 / (float)context.Playback.Bpm;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            TimeInBars.Value = time * SpeedFactor.GetValue(context);
            TimeInSecs.Value = (float)context.Playback.TimeInSecs * SpeedFactor.GetValue(context);
        }
Beispiel #2
0
        private void Update(EvaluationContext context)
        {
            var t = (float)EvaluationContext.BeatTime * SpeedFactor.GetValue(context);

            //var value = Value.GetValue(context);
            var amplitude      = Amplitude.GetValue(context);
            var period         = Period.GetValue(context);
            var offset         = Offset.GetValue(context);
            var phase          = Phase.GetValue(context);
            var amplitudeScale = AmplitudeScale.GetValue(context);

            Result.Value = new System.Numerics.Vector2(
                (float)Math.Sin(t / period.X + phase.X) * amplitude.X * amplitudeScale + offset.X,
                (float)Math.Sin(t / period.Y + phase.Y) * amplitude.Y * amplitudeScale + offset.Y
                );
        }
Beispiel #3
0
        private void Update(EvaluationContext context)
        {
            var t = OverrideTime.IsConnected
                        ? OverrideTime.GetValue(context)
                        : (float)context.LocalFxTime * SpeedFactor.GetValue(context);

            //var value = Value.GetValue(context);
            var amplitude      = Amplitude.GetValue(context);
            var period         = Period.GetValue(context);
            var offset         = Offset.GetValue(context);
            var phase          = Phase.GetValue(context);
            var amplitudeScale = AmplitudeScale.GetValue(context);

            Result.Value = new Vector3(
                (float)Math.Sin(t / period.X + phase.X) * amplitude.X * amplitudeScale + offset.X,
                (float)Math.Sin(t / period.Y + phase.Y) * amplitude.Y * amplitudeScale + offset.Y,
                (float)Math.Sin(t / period.Z + phase.Z) * amplitude.Z * amplitudeScale + offset.Z
                );
        }
Beispiel #4
0
 private void Update(EvaluationContext context)
 {
     BeatTime.Value   = (float)EvaluationContext.BeatTime * SpeedFactor.GetValue(context);
     TimeInSecs.Value = (float)EvaluationContext.GlobalTimeInSecs * SpeedFactor.GetValue(context);
 }