From bac4b86efdcfad6e986be48b0769f268250650dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Wed, 4 Sep 2024 01:35:24 +0900 Subject: [PATCH 1/7] Added drawline pitch tool --- OpenUtau/ViewModels/NotesViewModel.cs | 3 ++ OpenUtau/Views/NoteEditStates.cs | 50 +++++++++++++++++++++++-- OpenUtau/Views/PianoRollWindow.axaml | 19 +++++++++- OpenUtau/Views/PianoRollWindow.axaml.cs | 13 ++++--- 4 files changed, 75 insertions(+), 10 deletions(-) diff --git a/OpenUtau/ViewModels/NotesViewModel.cs b/OpenUtau/ViewModels/NotesViewModel.cs index c291fdd20..bb1775fa9 100644 --- a/OpenUtau/ViewModels/NotesViewModel.cs +++ b/OpenUtau/ViewModels/NotesViewModel.cs @@ -53,6 +53,7 @@ public class NotesViewModel : ViewModelBase, ICmdSubscriber { [Reactive] public bool PenPlusTool { get; set; } [Reactive] public bool EraserTool { get; set; } [Reactive] public bool DrawPitchTool { get; set; } + [Reactive] public bool DrawLinePitchTool { get; set; } [Reactive] public bool OverwritePitchTool { get; set; } [Reactive] public bool KnifeTool { get; set; } public ReactiveCommand SelectToolCommand { get; } @@ -204,6 +205,7 @@ public NotesViewModel() { } EraserTool = false; DrawPitchTool = false; + DrawLinePitchTool = false; OverwritePitchTool = false; KnifeTool = false; SelectToolCommand = ReactiveCommand.Create(index => { @@ -212,6 +214,7 @@ public NotesViewModel() { PenPlusTool = index == "2+"; EraserTool = index == "3"; DrawPitchTool = index == "4"; + DrawLinePitchTool = index == "4++"; OverwritePitchTool = index == "4+"; KnifeTool = index == "5"; }); diff --git a/OpenUtau/Views/NoteEditStates.cs b/OpenUtau/Views/NoteEditStates.cs index 34029e27b..c906a1ab6 100644 --- a/OpenUtau/Views/NoteEditStates.cs +++ b/OpenUtau/Views/NoteEditStates.cs @@ -413,7 +413,7 @@ public override void Begin(IPointer pointer, Point point) { if (newNote == null) { return; } - + DocManager.Inst.ExecuteCmd(new ChangeNoteLyricCommand(part, newNote, "+")); } @@ -436,8 +436,8 @@ public override void Update(IPointer pointer, Point point) { maxNegDelta = (int)Math.Floor((double)maxNegDelta / snapUnit) * snapUnit; } - int maxNoteTicks = (notesVm.IsSnapOn && snapUnit > 0) - ? (oldDur-1) / snapUnit * snapUnit + int maxNoteTicks = (notesVm.IsSnapOn && snapUnit > 0) + ? (oldDur-1) / snapUnit * snapUnit : oldDur - 15; int maxDelta = maxNoteTicks - note.duration; @@ -1107,6 +1107,50 @@ public override void Update(IPointer pointer, Point point) { } } + class DrawLinePitchState : NoteEditState { + protected override bool ShowValueTip => false; + double? firstPitch; + Point firstPoint; + double? lastPitch; + Point lastPoint; + public DrawLinePitchState( + Control control, + PianoRollViewModel vm, + IValueTip valueTip) : base(control, vm, valueTip) { } + public override void Begin(IPointer pointer, Point point) { + base.Begin(pointer, point); + int tick = vm.NotesViewModel.PointToTick(point); + var samplePoint = vm.NotesViewModel.TickToneToPoint( + (int)Math.Round(tick / 5.0) * 5, + vm.NotesViewModel.PointToToneDouble(point)); + firstPitch = vm.NotesViewModel.HitTest.SamplePitch(samplePoint); + firstPoint = point; + lastPoint = point; + } + public override void Update(IPointer pointer, Point point) { + int tick = vm.NotesViewModel.PointToTick(point); + var samplePoint = vm.NotesViewModel.TickToneToPoint( + (int)Math.Round(tick / 5.0) * 5, + vm.NotesViewModel.PointToToneDouble(point)); + double? pitch = vm.NotesViewModel.HitTest.SamplePitch(samplePoint); + if (pitch == null || vm.NotesViewModel.Part == null) { + return; + } + double tone = vm.NotesViewModel.PointToToneDouble(point); + DocManager.Inst.ExecuteCmd(new SetCurveCommand( + vm.NotesViewModel.Project, + vm.NotesViewModel.Part, + Core.Format.Ustx.PITD, + vm.NotesViewModel.PointToTick(lastPitch == null ? point : lastPoint), + (int)Math.Round(tone * 100 - (lastPitch ?? pitch.Value)), + vm.NotesViewModel.PointToTick(firstPoint), + (int)Math.Round(tone * 100 - (firstPitch == null ? pitch.Value : firstPitch.Value)) + )); + lastPitch = pitch; + lastPoint = point; + } + } + class OverwritePitchState : NoteEditState { protected override bool ShowValueTip => false; double? lastPitch; diff --git a/OpenUtau/Views/PianoRollWindow.axaml b/OpenUtau/Views/PianoRollWindow.axaml index 0959512da..d7c2a7854 100644 --- a/OpenUtau/Views/PianoRollWindow.axaml +++ b/OpenUtau/Views/PianoRollWindow.axaml @@ -195,7 +195,7 @@ - + @@ -227,7 +227,7 @@ - + @@ -421,6 +421,21 @@ + + + + + + + + + + + + ", e); DocManager.Inst.ExecuteCmd(new ErrorMessageNotification(customEx)); } - + }); ViewModel.NoteBatchEdits.AddRange(new List() { new LoadRenderedPitch(), @@ -218,7 +218,7 @@ void OnMenuShowGhostNotes(object sender, RoutedEventArgs args) { Preferences.Save(); ViewModel.RaisePropertyChanged(nameof(ViewModel.ShowGhostNotes)); MessageBus.Current.SendMessage(new PianorollRefreshEvent("Part")); - + } void OnMenuUseTrackColor(object sender, RoutedEventArgs args) { Preferences.Default.UseTrackColor = !Preferences.Default.UseTrackColor; @@ -497,7 +497,7 @@ public void NotesCanvasPointerPressed(object sender, PointerPressedEventArgs arg } private void NotesCanvasLeftPointerPressed(Control control, PointerPoint point, PointerPressedEventArgs args) { - if (ViewModel.NotesViewModel.DrawPitchTool || ViewModel.NotesViewModel.OverwritePitchTool) { + if (ViewModel.NotesViewModel.DrawPitchTool || ViewModel.NotesViewModel.DrawLinePitchTool || ViewModel.NotesViewModel.OverwritePitchTool) { ViewModel.NotesViewModel.DeselectNotes(); if (args.KeyModifiers == KeyModifiers.Alt) { editState = new SmoothenPitchState(control, ViewModel, this); @@ -505,6 +505,8 @@ private void NotesCanvasLeftPointerPressed(Control control, PointerPoint point, } else if (args.KeyModifiers != cmdKey) { if (ViewModel.NotesViewModel.DrawPitchTool) { editState = new DrawPitchState(control, ViewModel, this); + } else if (ViewModel.NotesViewModel.DrawLinePitchTool) { + editState = new DrawLinePitchState(control, ViewModel, this); } else { editState = new OverwritePitchState(control, ViewModel, this); } @@ -584,6 +586,7 @@ private void NotesCanvasLeftPointerPressed(Control control, PointerPoint point, ViewModel.NotesViewModel.PenTool && args.KeyModifiers == cmdKey || ViewModel.NotesViewModel.PenPlusTool && args.KeyModifiers == cmdKey || ViewModel.NotesViewModel.DrawPitchTool && args.KeyModifiers == cmdKey || + ViewModel.NotesViewModel.DrawLinePitchTool && args.KeyModifiers == cmdKey || ViewModel.NotesViewModel.OverwritePitchTool && args.KeyModifiers == cmdKey) { if (args.KeyModifiers == KeyModifiers.None) { // New selection. @@ -608,7 +611,7 @@ private void NotesCanvasLeftPointerPressed(Control control, PointerPoint point, private void NotesCanvasRightPointerPressed(Control control, PointerPoint point, PointerPressedEventArgs args) { var selectedNotes = ViewModel.NotesViewModel.Selection.ToList(); - if (ViewModel.NotesViewModel.DrawPitchTool || ViewModel.NotesViewModel.OverwritePitchTool) { + if (ViewModel.NotesViewModel.DrawPitchTool || ViewModel.NotesViewModel.DrawLinePitchTool || ViewModel.NotesViewModel.OverwritePitchTool) { editState = new ResetPitchState(control, ViewModel, this); return; } @@ -729,7 +732,7 @@ public void NotesCanvasPointerMoved(object sender, PointerEventArgs args) { if (ViewModel?.NotesViewModel?.HitTest == null) { return; } - if(((ViewModel.NotesViewModel.DrawPitchTool || ViewModel.NotesViewModel.OverwritePitchTool) && args.KeyModifiers != cmdKey) || ViewModel.NotesViewModel.EraserTool) { + if(((ViewModel.NotesViewModel.DrawPitchTool || ViewModel.NotesViewModel.DrawLinePitchTool || ViewModel.NotesViewModel.OverwritePitchTool) && args.KeyModifiers != cmdKey) || ViewModel.NotesViewModel.EraserTool) { Cursor = null; return; } From 1dfc0cc3e3c9d89019a0719040f192311e4addfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Thu, 5 Sep 2024 00:41:44 +0900 Subject: [PATCH 2/7] Add description --- OpenUtau/Strings/Strings.axaml | 7 +++++++ OpenUtau/Strings/Strings.ja-JP.axaml | 6 ++++++ OpenUtau/Views/PianoRollWindow.axaml | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/OpenUtau/Strings/Strings.axaml b/OpenUtau/Strings/Strings.axaml index afa89e2ee..355f838b8 100644 --- a/OpenUtau/Strings/Strings.axaml +++ b/OpenUtau/Strings/Strings.axaml @@ -332,6 +332,13 @@ Warning: this option removes custom presets. Right click to reset Hold Ctrl to select Hold Alt to smoothen + + Draw Pitch Tool (draw straight line) + Left click to draw + Right click to reset + Hold Ctrl to select + Hold Alt to smoothen + Eraser Tool (3) Knife Tool (5) Overwrite Pitch Tool (Ctrl + 4) diff --git a/OpenUtau/Strings/Strings.ja-JP.axaml b/OpenUtau/Strings/Strings.ja-JP.axaml index dcfec1fc3..b9eca4a18 100644 --- a/OpenUtau/Strings/Strings.ja-JP.axaml +++ b/OpenUtau/Strings/Strings.ja-JP.axaml @@ -328,6 +328,12 @@ 右クリックでリセット Ctrl長押しで選択 Alt長押しで線をなめらかにする + ピッチ描画ツール (4) + 左クリックで描画(直線を描きます) + 右クリックでリセット + Ctrl長押しで選択 + Alt長押しで線をなめらかにする + 消しゴムツール (3) ナイフツール (5) ピッチ上書きツール (Ctrl + 4) diff --git a/OpenUtau/Views/PianoRollWindow.axaml b/OpenUtau/Views/PianoRollWindow.axaml index d7c2a7854..d2d88178d 100644 --- a/OpenUtau/Views/PianoRollWindow.axaml +++ b/OpenUtau/Views/PianoRollWindow.axaml @@ -424,7 +424,7 @@ + ToolTip.Tip="{DynamicResource pianoroll.tool.drawlinepitch}"> From 39168b918b97161cceef5e1f130784b81ad16ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Mon, 30 Sep 2024 01:40:12 +0900 Subject: [PATCH 3/7] Add Exp Line Tool --- OpenUtau/Views/NoteEditStates.cs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/OpenUtau/Views/NoteEditStates.cs b/OpenUtau/Views/NoteEditStates.cs index c906a1ab6..a9eb80675 100644 --- a/OpenUtau/Views/NoteEditStates.cs +++ b/OpenUtau/Views/NoteEditStates.cs @@ -5,11 +5,13 @@ using Avalonia.Controls; using Avalonia.Controls.Shapes; using Avalonia.Input; +using NWaves.Features; using OpenUtau.App.Controls; using OpenUtau.App.ViewModels; using OpenUtau.Core; using OpenUtau.Core.Ustx; using OpenUtau.Core.Util; +using SharpCompress; namespace OpenUtau.App.Views { class KeyboardPlayState { @@ -615,11 +617,13 @@ public override void Update(IPointer pointer, Point point) { } class ExpSetValueState : NoteEditState { + private Point firstPoint; private Point lastPoint; private UExpressionDescriptor? descriptor; private UTrack track; private double startValue = 0; + private bool ctrlWasHeld = false; private bool shiftWasHeld = false; public ExpSetValueState( Control control, @@ -636,6 +640,7 @@ public ExpSetValueState( } public override void Begin(IPointer pointer, Point point) { base.Begin(pointer, point); + firstPoint = point; lastPoint = point; } public override void End(IPointer pointer, Point point) { @@ -645,11 +650,12 @@ public override void Update(IPointer pointer, Point point, PointerEventArgs args if (descriptor == null) { return; } + bool ctrlHeld = args.KeyModifiers == KeyModifiers.Control; bool shiftHeld = args.KeyModifiers == KeyModifiers.Shift; if (descriptor.type != UExpressionType.Curve) { UpdatePhonemeExp(pointer, point, shiftHeld); } else { - UpdateCurveExp(pointer, point); + UpdateCurveExp(pointer, point, ctrlHeld,shiftHeld); } double viewMax = descriptor.max + (descriptor.type == UExpressionType.Options ? 1 : 0); double displayValue; @@ -675,6 +681,7 @@ public override void Update(IPointer pointer, Point point, PointerEventArgs args } valueTip.UpdateValueTip(valueTipText); lastPoint = point; + ctrlWasHeld = ctrlHeld; shiftWasHeld = shiftHeld; } private void UpdatePhonemeExp(IPointer pointer, Point point, bool shiftHeld) { @@ -714,15 +721,26 @@ private void UpdatePhonemeExp(IPointer pointer, Point point, bool shiftHeld) { } } } - private void UpdateCurveExp(IPointer pointer, Point point) { + private void UpdateCurveExp(IPointer pointer, Point point, bool ctrlHeld, bool shiftHeld) { var notesVm = vm.NotesViewModel; - int lastX = notesVm.PointToTick(lastPoint); - int x = notesVm.PointToTick(point); if (descriptor == null || notesVm.Part == null) { return; } + int lastX = notesVm.PointToTick(lastPoint); + int x = notesVm.PointToTick(point); int lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); int y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - point.Y / control.Bounds.Height)); + if (shiftHeld) { + lastX = notesVm.PointToTick(lastPoint); + x = notesVm.PointToTick(point); + lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - firstPoint.Y / control.Bounds.Height)); + y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - firstPoint.Y / control.Bounds.Height)); + }else if (ctrlHeld) { + lastX = notesVm.PointToTick(firstPoint); + x = notesVm.PointToTick(lastPoint); + lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); + y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); + } DocManager.Inst.ExecuteCmd(new SetCurveCommand(notesVm.Project, notesVm.Part, notesVm.PrimaryKey, x, y, lastX, lastY)); } } From a04c6276a0f10dd70ed2b817e22107e22baad526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Mon, 30 Sep 2024 01:42:29 +0900 Subject: [PATCH 4/7] =?UTF-8?q?Using=E3=81=AE=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenUtau/Views/NoteEditStates.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/OpenUtau/Views/NoteEditStates.cs b/OpenUtau/Views/NoteEditStates.cs index a9eb80675..45db839a0 100644 --- a/OpenUtau/Views/NoteEditStates.cs +++ b/OpenUtau/Views/NoteEditStates.cs @@ -5,13 +5,11 @@ using Avalonia.Controls; using Avalonia.Controls.Shapes; using Avalonia.Input; -using NWaves.Features; using OpenUtau.App.Controls; using OpenUtau.App.ViewModels; using OpenUtau.Core; using OpenUtau.Core.Ustx; using OpenUtau.Core.Util; -using SharpCompress; namespace OpenUtau.App.Views { class KeyboardPlayState { From d25b2b123635818f0452b15e764241a3d7c42de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:28:31 +0900 Subject: [PATCH 5/7] Shortcut keys, revised description. --- OpenUtau/Strings/Strings.axaml | 4 ++-- OpenUtau/Strings/Strings.ja-JP.axaml | 3 ++- OpenUtau/ViewModels/NotesViewModel.cs | 2 +- OpenUtau/Views/NoteEditStates.cs | 17 ++++++++--------- OpenUtau/Views/PianoRollWindow.axaml | 16 ++++++++-------- OpenUtau/Views/PianoRollWindow.axaml.cs | 4 ++++ 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/OpenUtau/Strings/Strings.axaml b/OpenUtau/Strings/Strings.axaml index 355f838b8..ea33aceb5 100644 --- a/OpenUtau/Strings/Strings.axaml +++ b/OpenUtau/Strings/Strings.axaml @@ -333,8 +333,8 @@ Warning: this option removes custom presets. Hold Ctrl to select Hold Alt to smoothen - Draw Pitch Tool (draw straight line) - Left click to draw + Line Draw Pitch Tool (Shift + 4) + Left click to draw (draw straight line) Right click to reset Hold Ctrl to select Hold Alt to smoothen diff --git a/OpenUtau/Strings/Strings.ja-JP.axaml b/OpenUtau/Strings/Strings.ja-JP.axaml index b9eca4a18..005cabb61 100644 --- a/OpenUtau/Strings/Strings.ja-JP.axaml +++ b/OpenUtau/Strings/Strings.ja-JP.axaml @@ -328,7 +328,8 @@ 右クリックでリセット Ctrl長押しで選択 Alt長押しで線をなめらかにする - ピッチ描画ツール (4) + + ラインピッチ描画ツール (Shift + 4) 左クリックで描画(直線を描きます) 右クリックでリセット Ctrl長押しで選択 diff --git a/OpenUtau/ViewModels/NotesViewModel.cs b/OpenUtau/ViewModels/NotesViewModel.cs index bb1775fa9..c2a1d1fd5 100644 --- a/OpenUtau/ViewModels/NotesViewModel.cs +++ b/OpenUtau/ViewModels/NotesViewModel.cs @@ -214,8 +214,8 @@ public NotesViewModel() { PenPlusTool = index == "2+"; EraserTool = index == "3"; DrawPitchTool = index == "4"; - DrawLinePitchTool = index == "4++"; OverwritePitchTool = index == "4+"; + DrawLinePitchTool = index == "4++"; KnifeTool = index == "5"; }); diff --git a/OpenUtau/Views/NoteEditStates.cs b/OpenUtau/Views/NoteEditStates.cs index 45db839a0..e83b5e808 100644 --- a/OpenUtau/Views/NoteEditStates.cs +++ b/OpenUtau/Views/NoteEditStates.cs @@ -413,7 +413,6 @@ public override void Begin(IPointer pointer, Point point) { if (newNote == null) { return; } - DocManager.Inst.ExecuteCmd(new ChangeNoteLyricCommand(part, newNote, "+")); } @@ -621,7 +620,6 @@ class ExpSetValueState : NoteEditState { private UTrack track; private double startValue = 0; - private bool ctrlWasHeld = false; private bool shiftWasHeld = false; public ExpSetValueState( Control control, @@ -679,7 +677,6 @@ public override void Update(IPointer pointer, Point point, PointerEventArgs args } valueTip.UpdateValueTip(valueTipText); lastPoint = point; - ctrlWasHeld = ctrlHeld; shiftWasHeld = shiftHeld; } private void UpdatePhonemeExp(IPointer pointer, Point point, bool shiftHeld) { @@ -728,16 +725,18 @@ private void UpdateCurveExp(IPointer pointer, Point point, bool ctrlHeld, bool s int x = notesVm.PointToTick(point); int lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); int y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - point.Y / control.Bounds.Height)); - if (shiftHeld) { - lastX = notesVm.PointToTick(lastPoint); - x = notesVm.PointToTick(point); - lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - firstPoint.Y / control.Bounds.Height)); - y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - firstPoint.Y / control.Bounds.Height)); - }else if (ctrlHeld) { + if (shiftHeld && ctrlHeld) { lastX = notesVm.PointToTick(firstPoint); x = notesVm.PointToTick(lastPoint); lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); + startValue = y; + } else if (shiftHeld) { + lastX = notesVm.PointToTick(lastPoint); + x = notesVm.PointToTick(point); + lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - firstPoint.Y / control.Bounds.Height)); + y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - firstPoint.Y / control.Bounds.Height)); + startValue = y; } DocManager.Inst.ExecuteCmd(new SetCurveCommand(notesVm.Project, notesVm.Part, notesVm.PrimaryKey, x, y, lastX, lastY)); } diff --git a/OpenUtau/Views/PianoRollWindow.axaml b/OpenUtau/Views/PianoRollWindow.axaml index d2d88178d..446f41abc 100644 --- a/OpenUtau/Views/PianoRollWindow.axaml +++ b/OpenUtau/Views/PianoRollWindow.axaml @@ -422,11 +422,11 @@ + IsChecked="{Binding NotesViewModel.OverwritePitchTool, Mode=OneWay}" + Command="{Binding NotesViewModel.SelectToolCommand}" CommandParameter="4+" + ToolTip.Tip="{DynamicResource pianoroll.tool.overwritepitch}"> - + @@ -437,11 +437,11 @@ + IsChecked="{Binding NotesViewModel.DrawLinePitchTool, Mode=OneWay}" + Command="{Binding NotesViewModel.SelectToolCommand}" CommandParameter="4++" + ToolTip.Tip="{DynamicResource pianoroll.tool.drawlinepitch}"> - + diff --git a/OpenUtau/Views/PianoRollWindow.axaml.cs b/OpenUtau/Views/PianoRollWindow.axaml.cs index f46094924..1201d8b8a 100644 --- a/OpenUtau/Views/PianoRollWindow.axaml.cs +++ b/OpenUtau/Views/PianoRollWindow.axaml.cs @@ -1208,6 +1208,10 @@ bool OnKeyExtendedHandler(KeyEventArgs args) { notesVm.SelectToolCommand?.Execute("4+").Subscribe(); return true; } + if (isShift) { + notesVm.SelectToolCommand?.Execute("4++").Subscribe(); + return true; + } break; case Key.D5: if (isNone) { From 6e047ce1276af5686ae1cb7356b9a10ff349866f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Tue, 1 Oct 2024 01:21:37 +0900 Subject: [PATCH 6/7] Change key combinations --- OpenUtau/Views/NoteEditStates.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/OpenUtau/Views/NoteEditStates.cs b/OpenUtau/Views/NoteEditStates.cs index e83b5e808..584603571 100644 --- a/OpenUtau/Views/NoteEditStates.cs +++ b/OpenUtau/Views/NoteEditStates.cs @@ -638,6 +638,7 @@ public override void Begin(IPointer pointer, Point point) { base.Begin(pointer, point); firstPoint = point; lastPoint = point; + startValue = 0; } public override void End(IPointer pointer, Point point) { base.End(pointer, point); @@ -646,14 +647,15 @@ public override void Update(IPointer pointer, Point point, PointerEventArgs args if (descriptor == null) { return; } - bool ctrlHeld = args.KeyModifiers == KeyModifiers.Control; bool shiftHeld = args.KeyModifiers == KeyModifiers.Shift; - if (descriptor.type != UExpressionType.Curve) { + bool ctrlShiftHeld = args.KeyModifiers == (KeyModifiers.Control | KeyModifiers.Shift); + bool typeOptions = descriptor.type == UExpressionType.Options; + if (typeOptions) { UpdatePhonemeExp(pointer, point, shiftHeld); } else { - UpdateCurveExp(pointer, point, ctrlHeld,shiftHeld); + UpdateCurveExp(pointer, point, ctrlShiftHeld, shiftHeld); } - double viewMax = descriptor.max + (descriptor.type == UExpressionType.Options ? 1 : 0); + double viewMax = descriptor.max + (typeOptions ? 1 : 0); double displayValue; if (shiftHeld) { displayValue = startValue; @@ -662,7 +664,7 @@ public override void Update(IPointer pointer, Point point, PointerEventArgs args displayValue = Math.Max(descriptor.min, Math.Min(descriptor.max, displayValue)); } string valueTipText; - if (descriptor.type == UExpressionType.Options) { + if (typeOptions) { int index = (int)displayValue; if (index >= 0 && index < descriptor.options.Length) { valueTipText = descriptor.options[index]; @@ -716,7 +718,7 @@ private void UpdatePhonemeExp(IPointer pointer, Point point, bool shiftHeld) { } } } - private void UpdateCurveExp(IPointer pointer, Point point, bool ctrlHeld, bool shiftHeld) { + private void UpdateCurveExp(IPointer pointer, Point point, bool ctrlShiftHeld, bool shiftHeld) { var notesVm = vm.NotesViewModel; if (descriptor == null || notesVm.Part == null) { return; @@ -725,12 +727,11 @@ private void UpdateCurveExp(IPointer pointer, Point point, bool ctrlHeld, bool s int x = notesVm.PointToTick(point); int lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); int y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - point.Y / control.Bounds.Height)); - if (shiftHeld && ctrlHeld) { + if (ctrlShiftHeld) { lastX = notesVm.PointToTick(firstPoint); x = notesVm.PointToTick(lastPoint); lastY = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); y = (int)Math.Round(descriptor.min + (descriptor.max - descriptor.min) * (1 - lastPoint.Y / control.Bounds.Height)); - startValue = y; } else if (shiftHeld) { lastX = notesVm.PointToTick(lastPoint); x = notesVm.PointToTick(point); From 5a77bc9c2b5339d9cf9399039e459ab25a600b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=92=E7=8C=AB=E5=A4=A7=E7=A6=8F?= <93469977+rokujyushi@users.noreply.github.com> Date: Tue, 1 Oct 2024 01:44:57 +0900 Subject: [PATCH 7/7] Override Pitch Tool Icon Update --- OpenUtau/Views/PianoRollWindow.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenUtau/Views/PianoRollWindow.axaml b/OpenUtau/Views/PianoRollWindow.axaml index 446f41abc..006355911 100644 --- a/OpenUtau/Views/PianoRollWindow.axaml +++ b/OpenUtau/Views/PianoRollWindow.axaml @@ -426,7 +426,7 @@ Command="{Binding NotesViewModel.SelectToolCommand}" CommandParameter="4+" ToolTip.Tip="{DynamicResource pianoroll.tool.overwritepitch}"> - +