public override PatternActionResult Invoke(long time, PatternContext context) { if (State != PatternActionState.Enabled) { return(PatternActionResult.DoNothing); } context.SaveTime(time); return(new PatternActionResult(time + LengthConverter.ConvertFrom(Step, time, context.TempoMap))); }
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))); }
public PatternActionResult Invoke(long time, PatternContext context) { if (Time != null) { context.SaveTime(time); } return(new PatternActionResult(Time != null ? TimeConverter.ConvertFrom(Time, context.TempoMap) : context.RestoreTime())); }
public PatternActionResult Invoke(long time, PatternContext context) { context.SaveTime(time); var chordLength = LengthConverter.ConvertFrom(ChordDescriptor.Length, time, context.TempoMap); return(new PatternActionResult(time + chordLength, ChordDescriptor.Notes.Select(d => new Note(d.NoteNumber, chordLength, time) { Channel = context.Channel, Velocity = ChordDescriptor.Velocity }))); }
public PatternActionResult Invoke(long time, PatternContext context) { context.SaveTime(time); var noteLength = LengthConverter.ConvertFrom(NoteDescriptor.Length, time, context.TempoMap); var note = new Note(NoteDescriptor.Note.NoteNumber, noteLength, time) { Channel = context.Channel, Velocity = NoteDescriptor.Velocity }; return(new PatternActionResult(time + noteLength, new[] { note })); }
public override PatternActionResult Invoke(long time, PatternContext context) { if (State != PatternActionState.Enabled) { return(PatternActionResult.DoNothing); } if (Time != null) { context.SaveTime(time); } return(new PatternActionResult(Time != null ? TimeConverter.ConvertFrom(Time, context.TempoMap) : context.RestoreTime())); }
public override PatternActionResult Invoke(long time, PatternContext context) { if (State == PatternActionState.Excluded) { return(PatternActionResult.DoNothing); } context.SaveTime(time); var chordLength = LengthConverter.ConvertFrom(ChordDescriptor.Length, time, context.TempoMap); if (State == PatternActionState.Disabled) { return(new PatternActionResult(time + chordLength)); } return(new PatternActionResult(time + chordLength, ChordDescriptor.Notes.Select(d => new Note(d.NoteNumber, chordLength, time) { Channel = context.Channel, Velocity = ChordDescriptor.Velocity }))); }
public override PatternActionResult Invoke(long time, PatternContext context) { if (State == PatternActionState.Excluded) { return(PatternActionResult.DoNothing); } context.SaveTime(time); var noteLength = LengthConverter.ConvertFrom(NoteDescriptor.Length, time, context.TempoMap); if (State == PatternActionState.Disabled) { return(new PatternActionResult(time + noteLength)); } var note = new Note(NoteDescriptor.Note.NoteNumber, noteLength, time) { Channel = context.Channel, Velocity = NoteDescriptor.Velocity }; return(new PatternActionResult(time + noteLength, new[] { note })); }
public override PatternActionResult Invoke(long time, PatternContext context) { context.SaveTime(time); return(new PatternActionResult(time + LengthConverter.ConvertFrom(Step, time, context.TempoMap))); }