예제 #1
0
        public PatternActionResult Invoke(long time, PatternContext context)
        {
            context.SaveTime(time);

            var newContext = new PatternContext(context.TempoMap, context.Channel);

            return(Pattern.InvokeActions(time, newContext));
        }
예제 #2
0
        public override PatternActionResult Invoke(long time, PatternContext context)
        {
            var tempoMap = context.TempoMap;

            context.SaveTime(time);

            var convertedTime = TimeConverter.ConvertFrom(new MathTime(time, Step, MathOperation.Subtract), tempoMap);

            return(new PatternActionResult(Math.Max(convertedTime, 0)));
        }
예제 #3
0
        public override PatternActionResult Invoke(long time, PatternContext context)
        {
            var tempoMap = context.TempoMap;

            context.SaveTime(time);

            var convertedTime = TimeConverter.ConvertFrom(((MidiTimeSpan)time).Subtract(Step, TimeSpanMode.TimeLength), tempoMap);

            return(new PatternActionResult(Math.Max(convertedTime, 0)));
        }
예제 #4
0
        public PatternActionResult Invoke(long time, PatternContext context)
        {
            context.SaveTime(time);

            var chordLength = LengthConverter.ConvertFrom(Length, time, context.TempoMap);

            return(new PatternActionResult(time + chordLength,
                                           NoteDefinitions.Select(d => new Note(d.NoteNumber, chordLength, time)
            {
                Channel = context.Channel,
                Velocity = Velocity
            })));
        }
예제 #5
0
        public PatternActionResult Invoke(long time, PatternContext context)
        {
            context.SaveTime(time);

            var noteLength = LengthConverter.ConvertFrom(Length, time, context.TempoMap);

            var note = new Note(Note.NoteNumber, noteLength, time)
            {
                Channel  = context.Channel,
                Velocity = Velocity
            };

            return(new PatternActionResult(time + noteLength, new[] { note }));
        }