diff --git a/OpenUtau.Core/Commands/ExpCommands.cs b/OpenUtau.Core/Commands/ExpCommands.cs index df10c5e6e..af90b4876 100644 --- a/OpenUtau.Core/Commands/ExpCommands.cs +++ b/OpenUtau.Core/Commands/ExpCommands.cs @@ -193,16 +193,35 @@ public ResetPitchPointsCommand(UVoicePart part, UNote note) : base(part) { } public class SetPitchPointsCommand : PitchExpCommand { - UPitch oldPitch; + UPitch[] oldPitch; + UNote[] Notes; UPitch newPitch; public SetPitchPointsCommand(UVoicePart part, UNote note, UPitch pitch) : base(part) { - Note = note; - oldPitch = note.pitch; + Notes = new UNote[] { note }; + oldPitch = Notes.Select(note => note.pitch).ToArray(); + newPitch = pitch; + } + + public SetPitchPointsCommand(UVoicePart part, IEnumerable notes, UPitch pitch) : base(part) { + Notes = notes.ToArray(); + oldPitch = Notes.Select(note => note.pitch).ToArray(); newPitch = pitch; } public override string ToString() => "Set pitch points"; - public override void Execute() => Note.pitch = newPitch; - public override void Unexecute() => Note.pitch = oldPitch; + public override void Execute(){ + lock (Part) { + for (var i=0; i