Skip to content

Commit dbe146d

Browse files
Maikostakira
authored andcommitted
Faster vibrato reset
1 parent 0be4700 commit dbe146d

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

OpenUtau.Core/Commands/NoteCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public class SetVibratoCommand : VibratoCommand {
188188
readonly UVibrato oldVibrato;
189189
public SetVibratoCommand(UVoicePart part, UNote note, UVibrato vibrato) : base(part, note) {
190190
this.note = note;
191-
newVibrato = vibrato;
191+
newVibrato = vibrato.Clone();
192192
oldVibrato = note.vibrato;
193193
}
194194
public override string ToString() {

OpenUtau.Core/Editing/ResetBatchEdits.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,9 @@ public ResetVibratos() {
178178
public void Run(UProject project, UVoicePart part, List<UNote> selectedNotes, DocManager docManager) {
179179
var notes = selectedNotes.Count > 0 ? selectedNotes : part.notes.ToList();
180180
docManager.StartUndoGroup(true);
181+
var vibrato = new UVibrato();
181182
foreach (var note in notes) {
182-
docManager.ExecuteCmd(new VibratoPeriodCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoPeriod));
183-
docManager.ExecuteCmd(new VibratoDepthCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoDepth));
184-
docManager.ExecuteCmd(new VibratoFadeInCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoIn));
185-
docManager.ExecuteCmd(new VibratoFadeOutCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoOut));
186-
docManager.ExecuteCmd(new VibratoShiftCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoShift));
187-
docManager.ExecuteCmd(new VibratoDriftCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoDrift));
188-
docManager.ExecuteCmd(new VibratoVolumeLinkCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoVolLink));
183+
docManager.ExecuteCmd(new SetVibratoCommand(part, note, vibrato));
189184
if (NotePresets.Default.AutoVibratoToggle && note.duration >= NotePresets.Default.AutoVibratoNoteDuration) {
190185
docManager.ExecuteCmd(new VibratoLengthCommand(part, note, NotePresets.Default.DefaultVibrato.VibratoLength));
191186
} else {

OpenUtau/ViewModels/NotesViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ public async void PasteSelectedParams(PianoRollWindow window) {
879879
switch (i) {
880880
case 0:
881881
if (vm.Params[i].IsSelected) {
882-
DocManager.Inst.ExecuteCmd(new SetPitchPointsCommand(Part, note, copyNote.pitch.Clone()));
882+
DocManager.Inst.ExecuteCmd(new SetPitchPointsCommand(Part, note, copyNote.pitch));
883883
}
884884
break;
885885
case 1:

0 commit comments

Comments
 (0)