From 09214ba438e8d91bd44ebbd78fd3b0ce33273b69 Mon Sep 17 00:00:00 2001 From: Ben Talagan Babut Date: Thu, 29 Feb 2024 06:40:51 +0100 Subject: [PATCH] Update OneSmallStep v0.9.4 > v0.9.5 (#1326) * Update OneSmallStep v0.9.4 > v0.9.5 --- ...talagan_OneSmallStep Change input mode.lua | 15 - ..._OneSmallStep Change note len modifier.lua | 21 -- .../talagan_OneSmallStep Change note len.lua | 11 - .../talagan_OneSmallStep Commit back.lua | 9 - MIDI Editor/talagan_OneSmallStep Commit.lua | 9 - ...talagan_OneSmallStep Decrease note len.lua | 9 - ...talagan_OneSmallStep Increase note len.lua | 9 - MIDI Editor/talagan_OneSmallStep.lua | 277 +++++++++------- ...talagan_OneSmallStep Change input mode.lua | 13 + ..._OneSmallStep Change note len modifier.lua | 10 + ...SmallStep Change note len param source.lua | 10 +- .../talagan_OneSmallStep Change note len.lua | 10 + ...agan_OneSmallStep Cleanup helper JSFXs.lua | 5 +- .../talagan_OneSmallStep Commit back.lua | 9 + .../actions/talagan_OneSmallStep Commit.lua | 9 + ...talagan_OneSmallStep Decrease note len.lua | 9 + ...talagan_OneSmallStep Increase note len.lua | 9 + ...alagan_OneSmallStep Insert Commit back.lua | 9 + .../talagan_OneSmallStep Insert Commit.lua | 9 + .../talagan_OneSmallStep Playback.lua | 4 +- ...mallStep Set or remove playback marker.lua | 4 +- .../classes/KeyActivityManager.lua | 27 +- .../classes/KeyPressActivityManager.lua | 2 +- .../classes/KeyReleaseActivityManager.lua | 2 +- .../engine_lib.lua} | 307 +++++++++++++++--- .../helper_lib.lua} | 0 .../images/indicator_back.lua | 15 + .../images/indicator_delete.lua | 14 + .../images/indicator_insert.lua | 13 + 29 files changed, 603 insertions(+), 247 deletions(-) delete mode 100644 MIDI Editor/talagan_OneSmallStep Change input mode.lua delete mode 100644 MIDI Editor/talagan_OneSmallStep Change note len modifier.lua delete mode 100644 MIDI Editor/talagan_OneSmallStep Change note len.lua delete mode 100644 MIDI Editor/talagan_OneSmallStep Commit back.lua delete mode 100644 MIDI Editor/talagan_OneSmallStep Commit.lua delete mode 100644 MIDI Editor/talagan_OneSmallStep Decrease note len.lua delete mode 100644 MIDI Editor/talagan_OneSmallStep Increase note len.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua rename MIDI Editor/{ => talagan_OneSmallStep/actions}/talagan_OneSmallStep Change note len param source.lua (61%) create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua rename MIDI Editor/{ => talagan_OneSmallStep/actions}/talagan_OneSmallStep Cleanup helper JSFXs.lua (56%) create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit back.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Decrease note len.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Increase note len.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit back.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit.lua rename MIDI Editor/{ => talagan_OneSmallStep/actions}/talagan_OneSmallStep Playback.lua (96%) rename MIDI Editor/{ => talagan_OneSmallStep/actions}/talagan_OneSmallStep Set or remove playback marker.lua (67%) rename MIDI Editor/talagan_OneSmallStep/{talagan_OneSmallStep Engine lib.lua => classes/engine_lib.lua} (75%) rename MIDI Editor/talagan_OneSmallStep/{talagan_OneSmallStep Helper lib.lua => classes/helper_lib.lua} (100%) create mode 100644 MIDI Editor/talagan_OneSmallStep/images/indicator_back.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/images/indicator_delete.lua create mode 100644 MIDI Editor/talagan_OneSmallStep/images/indicator_insert.lua diff --git a/MIDI Editor/talagan_OneSmallStep Change input mode.lua b/MIDI Editor/talagan_OneSmallStep Change input mode.lua deleted file mode 100644 index bc01dabc8..000000000 --- a/MIDI Editor/talagan_OneSmallStep Change input mode.lua +++ /dev/null @@ -1,15 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; - -local mode = engine_lib.InputMode[param]; -if mode then - engine_lib.setInputMode(mode) -end diff --git a/MIDI Editor/talagan_OneSmallStep Change note len modifier.lua b/MIDI Editor/talagan_OneSmallStep Change note len modifier.lua deleted file mode 100644 index 34a5633f2..000000000 --- a/MIDI Editor/talagan_OneSmallStep Change note len modifier.lua +++ /dev/null @@ -1,21 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local modifier = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; - - -if modifier == 'Triplet' then - engine_lib.setNoteLenModifier(engine_lib.NoteLenModifier.Triplet); -elseif modifier == 'Dotted' then - engine_lib.setNoteLenModifier(engine_lib.NoteLenModifier.Dotted); -elseif modifier == 'Straight' then - engine_lib.setNoteLenModifier(engine_lib.NoteLenModifier.Straight); -elseif modifier == 'Tuplet' then - engine_lib.setNoteLenModifier(engine_lib.NoteLenModifier.Tuplet); -end diff --git a/MIDI Editor/talagan_OneSmallStep Change note len.lua b/MIDI Editor/talagan_OneSmallStep Change note len.lua deleted file mode 100644 index 263f066d6..000000000 --- a/MIDI Editor/talagan_OneSmallStep Change note len.lua +++ /dev/null @@ -1,11 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local note_len = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; -engine_lib.setNoteLen(note_len); diff --git a/MIDI Editor/talagan_OneSmallStep Commit back.lua b/MIDI Editor/talagan_OneSmallStep Commit back.lua deleted file mode 100644 index bd184d6a4..000000000 --- a/MIDI Editor/talagan_OneSmallStep Commit back.lua +++ /dev/null @@ -1,9 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; -engine_lib.reaperActionCommitBack(); diff --git a/MIDI Editor/talagan_OneSmallStep Commit.lua b/MIDI Editor/talagan_OneSmallStep Commit.lua deleted file mode 100644 index 6e2bcd982..000000000 --- a/MIDI Editor/talagan_OneSmallStep Commit.lua +++ /dev/null @@ -1,9 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; -engine_lib.reaperActionCommit(); diff --git a/MIDI Editor/talagan_OneSmallStep Decrease note len.lua b/MIDI Editor/talagan_OneSmallStep Decrease note len.lua deleted file mode 100644 index 7bd93e9cc..000000000 --- a/MIDI Editor/talagan_OneSmallStep Decrease note len.lua +++ /dev/null @@ -1,9 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; -engine_lib.decreaseNoteLen(); diff --git a/MIDI Editor/talagan_OneSmallStep Increase note len.lua b/MIDI Editor/talagan_OneSmallStep Increase note len.lua deleted file mode 100644 index e9d674f04..000000000 --- a/MIDI Editor/talagan_OneSmallStep Increase note len.lua +++ /dev/null @@ -1,9 +0,0 @@ --- @noindex --- @author Ben 'Talagan' Babut --- @license MIT --- @description This is part of One Small Step - -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; -engine_lib.increaseNoteLen(); diff --git a/MIDI Editor/talagan_OneSmallStep.lua b/MIDI Editor/talagan_OneSmallStep.lua index 5ca6c7897..a4e5f2b8a 100644 --- a/MIDI Editor/talagan_OneSmallStep.lua +++ b/MIDI Editor/talagan_OneSmallStep.lua @@ -1,54 +1,50 @@ --[[ @description One Small Step : Alternative Step Input -@version 0.9.4 +@version 0.9.5 @author Ben 'Talagan' Babut @license MIT @metapackage @provides [main=main,midi_editor] . - [main=main,midi_editor] talagan_OneSmallStep Change input mode.lua > talagan_OneSmallStep Change input mode - KeyboardPress.lua - [main=main,midi_editor] talagan_OneSmallStep Change input mode.lua > talagan_OneSmallStep Change input mode - KeyboardRelease.lua - [main=main,midi_editor] talagan_OneSmallStep Change input mode.lua > talagan_OneSmallStep Change input mode - Punch.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len param source.lua > talagan_OneSmallStep Change note len param source - OSS.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len param source.lua > talagan_OneSmallStep Change note len param source - ItemConf.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len param source.lua > talagan_OneSmallStep Change note len param source - ProjectGrid.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep Change note len modifier - Straight.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep Change note len modifier - Triplet.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep Change note len modifier - Dotted.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep Change note len modifier - Modified.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep Change note len modifier - Tuplet.lua - [main=main,midi_editor] talagan_OneSmallStep Increase note len.lua - [main=main,midi_editor] talagan_OneSmallStep Decrease note len.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1_64.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1_32.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1_16.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1_8.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1_4.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1_2.lua - [main=main,midi_editor] talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep Change note len - 1.lua - [main=main,midi_editor] talagan_OneSmallStep Cleanup helper JSFXs.lua - [main=main,midi_editor] talagan_OneSmallStep Commit back.lua - [main=main,midi_editor] talagan_OneSmallStep Commit.lua - [main=main,midi_editor] talagan_OneSmallStep Set or remove playback marker.lua - [main=main,midi_editor] talagan_OneSmallStep Playback.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode - KeyboardPress.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode - KeyboardRelease.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode - Punch.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source - OSS.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source - ItemConf.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source - ProjectGrid.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier - Straight.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier - Triplet.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier - Dotted.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier - Modified.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier - Tuplet.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1_64.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1_32.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1_16.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1_8.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1_4.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1_2.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua > talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len - 1.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Increase note len.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Decrease note len.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Cleanup helper JSFXs.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Commit back.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Commit.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit back.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Set or remove playback marker.lua + [main=main,midi_editor] talagan_OneSmallStep/actions/talagan_OneSmallStep Playback.lua [nomain] talagan_OneSmallStep/classes/*.lua [nomain] talagan_OneSmallStep/images/*.lua - [nomain] talagan_OneSmallStep/talagan_OneSmallStep Engine lib.lua - [nomain] talagan_OneSmallStep/talagan_OneSmallStep Helper lib.lua [effect] talagan_OneSmallStep/One Small Step Helper.jsfx [data] talagan_OneSmallStep/toolbar_icons/toolbar_one_small_step.png > toolbar_icons/toolbar_one_small_step.png [data] talagan_OneSmallStep/toolbar_icons/toolbar_one_small_step_cleanup.png > toolbar_icons/toolbar_one_small_step_cleanup.png @screenshot https://stash.reaper.fm/48269/oss_094.png @changelog - - [Feature] Added option to allow erasing note endings that do not match cursor when steping back - - [Feature] Keypress Mode : Added Sustain Inertia to detect held keys when pressing other keys - - [Feature] Added options to tweak Key Release / Key Press reaction times - - [Feature] Added option to choose if input notes are selected or not - - [Feature] Added option to automatically cleanup JSFXs on closing (thanks @stevie !) - - [Feature] Added an option to prevent notes from being inserted if the sustain pedal modifier key is pressed (this blocks insertion, useful in KP mode when starting an erase operation) - - [Bug Fix] Project boundaries were not updated if the edited item was the last one and was extended (thanks @daodan !) - - [Bug Fix] Reduced intensive CPU usage when OSS is runing due to unuseful calls to Undo_Begin/End + - [Feature] Added insert/cursor mode (inserts + move things forward, deletes backwards) + - [Feature] Added pedal repeater + - [UI] Aded status icons for modifier modes/keys (insert / backward / insert+backward) + - [Rework] Changed folder structure @about # Purpose @@ -192,7 +188,7 @@ end -- Path and modules package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; +local engine_lib = require "talagan_OneSmallStep/classes/engine_lib"; ------------------------------- -- Check dependencies @@ -454,7 +450,7 @@ function RecordBadge(track) local recarmed = reaper.GetMediaTrackInfo_Value(track, "I_RECARM"); local playState = reaper.GetPlayState(); - reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)+1); + reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)); if (recarmed == 1) and not (engine_lib.getInputMode() == engine_lib.InputMode.None) and playState == 0 then local alpha = math.sin(reaper.time_precise()*4); @@ -498,12 +494,11 @@ function TakeInfo(take) local _, track_name = reaper.GetTrackName(track); local take_name = reaper.GetTakeName(take); - reaper.ImGui_TextColored(ctx, 0xA0A0FFFF, track_name .. " / " .. take_name); - -- Glowing indicator - SL(); RecordBadge(track); SL(); + reaper.ImGui_TextColored(ctx, 0xA0A0FFFF, track_name .. " / " .. take_name); + SL(); RecordIssues(track); end @@ -511,12 +506,11 @@ end function TrackInfo(track) local _, track_name = reaper.GetTrackName(track); + RecordBadge(track); + SL(); reaper.ImGui_TextColored(ctx, 0xA0A0FFFF, track_name .. " /"); SL(); reaper.ImGui_TextColored(ctx, 0xFFA0A0FF, "No Item"); - - SL(); - RecordBadge(track); SL(); RecordIssues(track); end @@ -526,7 +520,7 @@ end -- MINIBAR : Input Mode function InputModeMiniBar() local mode = engine_lib.getInputMode(); - local modifkey = engine_lib.getSustainPedalModifierKey().name or ""; + local modifkey = engine_lib.getSPStepBackModifierKey().name or ""; local pedalmanual = "\z The sustain pedal and the commit action :\n\n\z @@ -661,7 +655,7 @@ end function NTupletComboBox() local combo_items = { '4', '5', '6', '7', '8', '9', '10', '11', '12' } - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 4); + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5); reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)); reaper.ImGui_PushID(ctx, "nlet_combo"); @@ -690,7 +684,7 @@ function NoteADSignComboBox() local val = engine_lib.getNoteADSign(); local combo_items = { '+', '-' }; - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 4); + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5); reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)); reaper.ImGui_PushID(ctx, "augmented_diminshed_sign"); @@ -716,7 +710,7 @@ function NoteADFactorComboBox() local val = engine_lib.getNoteADFactor(); - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 4); + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5); reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)); reaper.ImGui_PushID(ctx, "augmented_diminished_combo"); @@ -759,7 +753,7 @@ function PlayBackMeasureCountComboBox() reaper.ImGui_PushStyleColor(ctx, reaper.ImGui_Col_Header(), 0x00C000FF); reaper.ImGui_PushStyleColor(ctx, reaper.ImGui_Col_HeaderHovered(), 0x00C000FF); - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 4); + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5); local curm = engine_lib.getPlaybackMeasureCount(); local function label(mnum) @@ -798,7 +792,7 @@ end function PlaybackButton() reaper.ImGui_PushID(ctx, "playback"); ButtonGroupImageButton("playback", false, function() - local id = reaper.NamedCommandLookup("_RSb38bb99e06254b3b6e60fc7755e7af02d54341b4"); + local id = reaper.NamedCommandLookup("_RS0bbcbcb0cb7174a2406403352d006c0573c4c8b4"); reaper.Main_OnCommand(id, 0); end, 0, true ); @@ -832,10 +826,74 @@ function PlaybackWidget() reaper.ImGui_PopStyleVar(ctx,2); end +function SliderReset(setting) + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_ItemSpacing(), 2, 0); + SL(); + if reaper.ImGui_Button(ctx,"R##" .. setting) then + engine_lib.resetSetting(setting) + end + TT("Reset") + reaper.ImGui_PopStyleVar(ctx); +end + +function SettingSlider(setting, in_label, out_label, tooltip, use_help_interrogation_for_tooltip, width) + + if width then + reaper.ImGui_SetNextItemWidth(ctx, width) + end + + local spec = engine_lib.getSettingSpec(setting) + + local slider_func = nil + if spec.type == 'int' then + slider_func = reaper.ImGui_SliderInt + elseif spec.type == 'double' then + slider_func = reaper.ImGui_SliderDouble + else + error("Contact developer, forgot to handle type " .. spec.type) + end + + local change, v1 = slider_func(ctx, "##slider_" .. setting , engine_lib.getSetting(setting), spec.min, spec.max, in_label, reaper.ImGui_SliderFlags_NoInput()) + if change then + engine_lib.setSetting(setting, v1); + end + + if tooltip and not use_help_interrogation_for_tooltip then + TT(tooltip) + end + + SL(); + SliderReset(setting) + if out_label then + SL(); + reaper.ImGui_Text(ctx, out_label); + end + if use_help_interrogation_for_tooltip and tooltip then + SL() + reaper.ImGui_TextColored(ctx, 0xB0B0B0FF, "(?)"); + TT(tooltip) + end +end + function TargetLine(take) PlaybackWidget(); SL(); - MiniBarSeparator(0); + + if engine_lib.IsSPStepBackModifierKeyPressed() then + if engine_lib.IsSPInsertModifierKeyPressed() then + MiniBarSeparator(0); SL(); + reaper.ImGui_Image(ctx, getImage("indicator_delete"),20,20); SL(); + else + MiniBarSeparator(0); SL(); + reaper.ImGui_Image(ctx, getImage("indicator_back"),20,20); SL(); + end + elseif engine_lib.IsSPInsertModifierKeyPressed() then + MiniBarSeparator(0); SL(); + reaper.ImGui_Image(ctx, getImage("indicator_insert"),20,20); SL(); + else + MiniBarSeparator(0); SL(); + end + SL(); if not take then @@ -869,7 +927,7 @@ function PlaybackMarkerSettingComboBox() local combo_items = { 'Hide/Restore', 'Keep visible', 'Remove' } local curval = engine_lib.getSetting("PlaybackMarkerPolicyWhenClosed"); - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 4); + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5); reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)); reaper.ImGui_PushID(ctx, "playback_marker_policy"); @@ -894,14 +952,14 @@ function PlaybackMarkerSettingComboBox() reaper.ImGui_Text(ctx, "playback marker when closing"); end -function StepBackSustainPedalModifierKeyComboBox() + +function SPModifierKeyComboBox(setting, info_label) local combo_items = engine_lib.ModifierKeys; - local setting = "StepBackSustainPedalModifierKey"; - local modkey = engine_lib.getSustainPedalModifierKey() or {}; + local modkey = engine_lib.ModifierKeyLookup[engine_lib.getSetting(setting)] or {}; local label = modkey.name or ""; local curval = modkey.vkey or 0; - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 4); + reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5); reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx)); reaper.ImGui_PushID(ctx, setting); @@ -910,7 +968,7 @@ function StepBackSustainPedalModifierKeyComboBox() for i,v in ipairs(combo_items) do local is_selected = (curval == v.vkey); if reaper.ImGui_Selectable(ctx, v.name, is_selected) then - engine_lib.setSetting("StepBackSustainPedalModifierKey", v.vkey); + engine_lib.setSetting(setting, v.vkey); end if is_selected then reaper.ImGui_SetItemDefaultFocus(ctx) @@ -923,9 +981,19 @@ function StepBackSustainPedalModifierKeyComboBox() SL(); - reaper.ImGui_Text(ctx, "+ sustain pedal : performs step back action"); + reaper.ImGui_Text(ctx, info_label); +end + + +function StepBackSustainPedalModifierKeyComboBox() + SPModifierKeyComboBox("StepBackSustainPedalModifierKey", "+ sustain pedal : performs step back action") +end + +function InsertModeSustainPedalModifierKeyComboBox() + SPModifierKeyComboBox("InsertModeSustainPedalModifierKey", ": activates insert mode") end + function SettingsPanel() if reaper.ImGui_BeginTabBar(ctx, 'settings_tab_bar', reaper.ImGui_TabBarFlags_None()) then reaper.ImGui_PushStyleColor(ctx, reaper.ImGui_Col_Tab(), 0x00000000); @@ -968,9 +1036,27 @@ function SettingsPanel() reaper.ImGui_EndTabItem(ctx) end - if reaper.ImGui_BeginTabItem(ctx, 'Step Back') then + + if reaper.ImGui_BeginTabItem(ctx, 'Controls') then ImGui_VerticalSpacer(ctx,5); + StepBackSustainPedalModifierKeyComboBox(); + InsertModeSustainPedalModifierKeyComboBox(); + + curval = engine_lib.getSetting("PedalRepeatEnabled"); + if reaper.ImGui_Checkbox(ctx, "Pedal repeat every", curval) then + engine_lib.setSetting("PedalRepeatEnabled", not curval); + end + SL(); + SettingSlider("PedalRepeatTime", "%.3f seconds", "and", "Repeat time for the pedal event when pressed", false, 120) + SL(); + SettingSlider("PedalRepeatFirstHitMultiplier", "x %.d", "on first hit", "Multiplication factor for first hit", false, 50) + + reaper.ImGui_EndTabItem(ctx) + end + + if reaper.ImGui_BeginTabItem(ctx, 'Step Back') then + ImGui_VerticalSpacer(ctx,5); curval = engine_lib.getSetting("PreventAddingNotesIfModifierKeyIsPressed"); if reaper.ImGui_Checkbox(ctx, "Do not add notes if the step back modifier key is pressed", curval) then @@ -988,39 +1074,21 @@ function SettingsPanel() if reaper.ImGui_BeginTabItem(ctx, 'KP Mode') then ImGui_VerticalSpacer(ctx,5); - ------------ - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_ItemSpacing(), 2, 0); - if reaper.ImGui_Button(ctx,"rst##KPM_CA_rst") then - engine_lib.resetSetting("KeyPressModeAggregationTime") - end - SL(); - reaper.ImGui_PopStyleVar(ctx); - - local change, v1 = reaper.ImGui_SliderDouble(ctx, "Chord Aggregation##keypress", engine_lib.getSetting("KeyPressModeAggregationTime"), 0, 0.1, "%.3f seconds", reaper.ImGui_SliderFlags_NoInput()) - if change then - engine_lib.setSetting("KeyPressModeAggregationTime", v1); - end - SL(); - reaper.ImGui_TextColored(ctx, 0xB0B0B0FF, "(?)"); - TT("Key press events happening within this time\nwindow are aggregated as a chord") + SettingSlider("KeyPressModeAggregationTime", + "%.3f seconds", + "Chord Aggregation", + "Key press events happening within this time\nwindow are aggregated as a chord", + true, nil) + + SettingSlider("KeyPressModeInertiaTime", + "%.3f seconds", + "Sustain Inertia", + "If key A is pressed, and then key B is pressed but\n\z + key A was still held for more than this time,\n\z + then A is considered sustained and not released.\n\n\z + This setting allows to enter new notes overlapping sustained notes.", + true, nil) - ------------ - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_ItemSpacing(), 2, 0); - if reaper.ImGui_Button(ctx,"rst##KPM_HI_rst") then - engine_lib.resetSetting("KeyPressModeInertiaTime") - end - SL(); - reaper.ImGui_PopStyleVar(ctx); - - ------------ - change, v1 = reaper.ImGui_SliderDouble(ctx, "Sustain inertia##keypress", engine_lib.getSetting("KeyPressModeInertiaTime"), 0.2, 1.0, "%.3f seconds", reaper.ImGui_SliderFlags_NoInput()) - if change then - engine_lib.setSetting("KeyPressModeInertiaTime", v1) - end - SL(); - reaper.ImGui_TextColored(ctx, 0xB0B0B0FF, "(?)"); - TT("If key A is pressed, and then key B is pressed but\nkey A was still held for more than this time,\nthen A is considered sustained and not released.\n\n\z - This setting allows to enter new notes overlapping sustained notes.") SL(); curval = engine_lib.getSetting("KeyPressModeInertiaEnabled"); @@ -1035,23 +1103,14 @@ function SettingsPanel() if reaper.ImGui_BeginTabItem(ctx, 'KR Mode') then ImGui_VerticalSpacer(ctx,5); - reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_ItemSpacing(), 2, 0); - if reaper.ImGui_Button(ctx,"rst##KRM_CA_rst") then - engine_lib.resetSetting("KeyReleaseModeForgetTime") - end - SL(); - reaper.ImGui_PopStyleVar(ctx); - local change, v1 = reaper.ImGui_SliderDouble(ctx, "Forget time", engine_lib.getSetting("KeyReleaseModeForgetTime"), 0.05, 0.4, "%.3f s", reaper.ImGui_SliderFlags_NoInput()) - if change then - engine_lib.setSetting("KeyReleaseModeForgetTime", v1); - end - SL(); - reaper.ImGui_TextColored(ctx, 0xB0B0B0FF, "(?)"); - TT("How long a key should be remembered after release,\n\z - if other keys are still pressed.\n\n\z - This is used to know if a note should be forgotten/trashed\n\z - or used as part of the input chord.") - SL(); + SettingSlider("KeyReleaseModeForgetTime", + "%.3f seconds", + "Forget time", + "How long a key should be remembered after release,\n\z + if other keys are still pressed.\n\n\z + This is used to know if a note should be forgotten/trashed\n\z + or used as part of the input chord.", + true, nil) reaper.ImGui_EndTabItem(ctx) end @@ -1080,7 +1139,7 @@ function ui_loop() -- Since we use a trick to give back the focus to reaper, we don't want the window to glitch. reaper.ImGui_PushStyleColor(ctx, reaper.ImGui_Col_TitleBgActive(), 0x0A0A0AFF); - local visible, open = reaper.ImGui_Begin(ctx, 'One Small Step v0.9.4', true, flags); + local visible, open = reaper.ImGui_Begin(ctx, 'One Small Step v0.9.5', true, flags); reaper.ImGui_PopStyleColor(ctx,1); if visible then diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua new file mode 100644 index 000000000..bac1a17dd --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change input mode.lua @@ -0,0 +1,13 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; +local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); + +local mode = engine_lib.InputMode[param]; +if mode then + engine_lib.setInputMode(mode) +end diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua new file mode 100644 index 000000000..a9cb80f76 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len modifier.lua @@ -0,0 +1,10 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; +local modifier = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); + +engine_lib.setNoteLenModifier(engine_lib.NoteLenModifier[modifier]) \ No newline at end of file diff --git a/MIDI Editor/talagan_OneSmallStep Change note len param source.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source.lua similarity index 61% rename from MIDI Editor/talagan_OneSmallStep Change note len param source.lua rename to MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source.lua index 069a0671e..8c58b9e37 100644 --- a/MIDI Editor/talagan_OneSmallStep Change note len param source.lua +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len param source.lua @@ -3,11 +3,9 @@ -- @license MIT -- @description This is part of One Small Step -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local mode = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); - -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; +local mode = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); if mode == 'OSS' then engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.OSS); @@ -15,4 +13,4 @@ elseif mode == 'ItemConf' then engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.ItemConf); elseif mode == 'ProjectGrid' then engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.ProjectGrid); -end \ No newline at end of file +end diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua new file mode 100644 index 000000000..0bfc370e0 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Change note len.lua @@ -0,0 +1,10 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; +local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$"); + +engine_lib.setNoteLen(param); diff --git a/MIDI Editor/talagan_OneSmallStep Cleanup helper JSFXs.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Cleanup helper JSFXs.lua similarity index 56% rename from MIDI Editor/talagan_OneSmallStep Cleanup helper JSFXs.lua rename to MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Cleanup helper JSFXs.lua index 0f4716817..27b83c9a9 100644 --- a/MIDI Editor/talagan_OneSmallStep Cleanup helper JSFXs.lua +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Cleanup helper JSFXs.lua @@ -3,9 +3,8 @@ -- @license MIT -- @description This is part of One Small Step -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; - -local helper_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Helper lib"; +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local helper_lib = require "classes/helper_lib"; reaper.Undo_BeginBlock(); helper_lib.cleanupAllTrackFXs(); diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit back.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit back.lua new file mode 100644 index 000000000..960ebe285 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit back.lua @@ -0,0 +1,9 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; + +engine_lib.reaperActionCommitBack(); diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit.lua new file mode 100644 index 000000000..4c75e0dcb --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Commit.lua @@ -0,0 +1,9 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; + +engine_lib.reaperActionCommit(); diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Decrease note len.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Decrease note len.lua new file mode 100644 index 000000000..f980b9e8e --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Decrease note len.lua @@ -0,0 +1,9 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; + +engine_lib.decreaseNoteLen(); diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Increase note len.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Increase note len.lua new file mode 100644 index 000000000..59c4a0296 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Increase note len.lua @@ -0,0 +1,9 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; + +engine_lib.increaseNoteLen(); diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit back.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit back.lua new file mode 100644 index 000000000..c19a3783b --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit back.lua @@ -0,0 +1,9 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; + +engine_lib.reaperActionInsertBack(); diff --git a/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit.lua new file mode 100644 index 000000000..fec932021 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Insert Commit.lua @@ -0,0 +1,9 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; + +engine_lib.reaperActionInsert(); diff --git a/MIDI Editor/talagan_OneSmallStep Playback.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Playback.lua similarity index 96% rename from MIDI Editor/talagan_OneSmallStep Playback.lua rename to MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Playback.lua index da43d92d3..f266569a5 100644 --- a/MIDI Editor/talagan_OneSmallStep Playback.lua +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Playback.lua @@ -3,8 +3,8 @@ -- @license MIT -- @description This is part of One Small Step. Will replay the n last measures. -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; -- Give the possibility to this script to be duplicated and called -- With a param at the end of the lua file name (it overrides OSS config) diff --git a/MIDI Editor/talagan_OneSmallStep Set or remove playback marker.lua b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Set or remove playback marker.lua similarity index 67% rename from MIDI Editor/talagan_OneSmallStep Set or remove playback marker.lua rename to MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Set or remove playback marker.lua index ce0ee7df6..56f750b04 100644 --- a/MIDI Editor/talagan_OneSmallStep Set or remove playback marker.lua +++ b/MIDI Editor/talagan_OneSmallStep/actions/talagan_OneSmallStep Set or remove playback marker.lua @@ -3,7 +3,7 @@ -- @license MIT -- @description This is part of One Small Step. Will replay the n last measures. -package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?.lua;".. package.path; -local engine_lib = require "talagan_OneSmallStep/talagan_OneSmallStep Engine lib"; +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path; +local engine_lib = require "classes/engine_lib"; engine_lib.setPlaybackMarkerAtCurrentPos(); diff --git a/MIDI Editor/talagan_OneSmallStep/classes/KeyActivityManager.lua b/MIDI Editor/talagan_OneSmallStep/classes/KeyActivityManager.lua index a16f70134..ac2682d09 100644 --- a/MIDI Editor/talagan_OneSmallStep/classes/KeyActivityManager.lua +++ b/MIDI Editor/talagan_OneSmallStep/classes/KeyActivityManager.lua @@ -45,13 +45,34 @@ function KeyActivityManager:pullPedalTriggerForTrack(track) local pedal_activity = self.activity[trackid].pedal; if pedal_activity.first_ts and not pedal_activity.committed then - pedal_activity.committed = true - return true; + pedal_activity.committed = true + pedal_activity.last_commit = reaper.time_precise() + pedal_activity.commit_count = (pedal_activity.commit_count or 0) + 1 + return true end - return false; + return false end +function KeyActivityManager:forgetPedalTriggerForTrack(track, time, first_hit_multiplier) + local trackid = reaper.GetTrackGUID(track); + local pedal_activity = self.activity[trackid].pedal; + + if not pedal_activity.committed then + return + end + + if pedal_activity.commit_count == 1 then + time = time * first_hit_multiplier -- The first time, take more time + end + + if (reaper.time_precise() - pedal_activity.last_commit) > time then + -- reset commit flag. The pedal can be pulled again. + pedal_activity.committed = nil + end +end + + function KeyActivityManager:updateActivity(track, oss_state) local trackid = reaper.GetTrackGUID(track); diff --git a/MIDI Editor/talagan_OneSmallStep/classes/KeyPressActivityManager.lua b/MIDI Editor/talagan_OneSmallStep/classes/KeyPressActivityManager.lua index dabd15b52..e0928cd72 100644 --- a/MIDI Editor/talagan_OneSmallStep/classes/KeyPressActivityManager.lua +++ b/MIDI Editor/talagan_OneSmallStep/classes/KeyPressActivityManager.lua @@ -3,7 +3,7 @@ -- @license MIT -- @description This is part of One Small Step -local KeyActivityManager = require "classes/KeyActivityManager"; +local KeyActivityManager = require "KeyActivityManager"; -- Inherit from generic KeyActivityManager KeyPressActivityManager = KeyActivityManager:new(); diff --git a/MIDI Editor/talagan_OneSmallStep/classes/KeyReleaseActivityManager.lua b/MIDI Editor/talagan_OneSmallStep/classes/KeyReleaseActivityManager.lua index 02fd542d1..ae196b586 100644 --- a/MIDI Editor/talagan_OneSmallStep/classes/KeyReleaseActivityManager.lua +++ b/MIDI Editor/talagan_OneSmallStep/classes/KeyReleaseActivityManager.lua @@ -3,7 +3,7 @@ -- @license MIT -- @description This is part of One Small Step -local KeyActivityManager = require "classes/KeyActivityManager"; +local KeyActivityManager = require "KeyActivityManager"; -- Inherit from generic KeyActivityManager KeyReleaseActivityManager = KeyActivityManager:new(); diff --git a/MIDI Editor/talagan_OneSmallStep/talagan_OneSmallStep Engine lib.lua b/MIDI Editor/talagan_OneSmallStep/classes/engine_lib.lua similarity index 75% rename from MIDI Editor/talagan_OneSmallStep/talagan_OneSmallStep Engine lib.lua rename to MIDI Editor/talagan_OneSmallStep/classes/engine_lib.lua index ff0342acc..a6491bae1 100644 --- a/MIDI Editor/talagan_OneSmallStep/talagan_OneSmallStep Engine lib.lua +++ b/MIDI Editor/talagan_OneSmallStep/classes/engine_lib.lua @@ -8,11 +8,11 @@ local upperDir = scriptDir:match( "((.*)[\\/](.+)[\\/])(.+)$" ); package.path = scriptDir .."?.lua;".. package.path -local helper_lib = require "talagan_OneSmallStep Helper lib"; +local helper_lib = require "helper_lib"; -local KeyActivityManager = require "classes/KeyActivityManager"; -local KeyReleaseActivityManager = require "classes/KeyReleaseActivityManager"; -local KeyPressActivityManager = require "classes/KeyPressActivityManager"; +local KeyActivityManager = require "KeyActivityManager"; +local KeyReleaseActivityManager = require "KeyReleaseActivityManager"; +local KeyPressActivityManager = require "KeyPressActivityManager"; local launchTime = reaper.time_precise(); @@ -71,7 +71,8 @@ local OtherOSModifierKeys = { { vkey = 18, name = 'Alt' } }; -local ModifierKeys = (reaper.GetOS():find('OSX') ~= nil) and MacOSModifierKeys or OtherOSModifierKeys; +local IsMacos = (reaper.GetOS():find('OSX') ~= nil); +local ModifierKeys = IsMacos and MacOSModifierKeys or OtherOSModifierKeys; local NoteLenLookup = {}; for i,v in ipairs(NoteLenDefs) do @@ -129,15 +130,20 @@ local SettingDefs = { AllowErasingWhenNoteEndDoesNotMatchCursor = { type = "bool", default = true }, PlaybackMarkerPolicyWhenClosed = { type = "string", default = "Keep visible" }, StepBackSustainPedalModifierKey = { type = "int", default = 16 }, + InsertModeSustainPedalModifierKey = { type = "int", default = 17 }, PreventAddingNotesIfModifierKeyIsPressed = { type = "bool", default = true}, CleanupJsfxAtClosing = { type = "bool", default = true}, SelectInputNotes = { type = "bool", default = true}, ------ - KeyPressModeAggregationTime = { type = "double", default = 0.05 }, - KeyPressModeInertiaTime = { type = "double", default = 0.5 }, + KeyPressModeAggregationTime = { type = "double", default = 0.05, min = 0, max = 0.1 }, + KeyPressModeInertiaTime = { type = "double", default = 0.5, min = 0.2, max = 1.0 }, KeyPressModeInertiaEnabled = { type = "bool", default = true}, - KeyReleaseModeForgetTime = { type = "double", default = 0.200 }, + KeyReleaseModeForgetTime = { type = "double", default = 0.200, min = 0.05, max = 0.4}, + + PedalRepeatEnabled = { type = "bool" , default = true }, + PedalRepeatTime = { type = "double", default = 0.200, min = 0.05, max = 0.5 }, + PedalRepeatFirstHitMultiplier = { type = "int", default = 4, min = 1, max = 10 } }; local function unsafestr(str) @@ -196,6 +202,9 @@ end local function resetSetting(setting) setSetting(setting, SettingDefs[setting].default) end +local function getSettingSpec(setting) + return SettingDefs[setting] +end local function setPlaybackMeasureCount(c) return setSetting("PlaybackMeasureCount", c) end local function getPlaybackMeasureCount() return getSetting("PlaybackMeasureCount") end @@ -280,13 +289,21 @@ local function clearActionTrigger(action_name) reaper.DeleteExtState("OneSmallStep", action_name, true); end -local function setCommitActionTrigger() return setActionTrigger( "CommitActionTrigger") end -local function getCommitActionTrigger() return getActionTrigger( "CommitActionTrigger") end -local function clearCommitActionTrigger() return clearActionTrigger( "CommitActionTrigger") end +local function setCommitActionTrigger() return setActionTrigger( "CommitActionTrigger") end +local function getCommitActionTrigger() return getActionTrigger( "CommitActionTrigger") end +local function clearCommitActionTrigger() return clearActionTrigger( "CommitActionTrigger") end + +local function setCommitBackActionTrigger() return setActionTrigger( "CommitBackActionTrigger") end +local function getCommitBackActionTrigger() return getActionTrigger( "CommitBackActionTrigger") end +local function clearCommitBackActionTrigger() return clearActionTrigger( "CommitBackActionTrigger") end + +local function setInsertActionTrigger() return setActionTrigger( "InsertActionTrigger") end +local function getInsertActionTrigger() return getActionTrigger( "InsertActionTrigger") end +local function clearInsertActionTrigger() return clearActionTrigger( "InsertActionTrigger") end -local function setCommitBackActionTrigger() return setActionTrigger( "CommitBackActionTrigger") end -local function getCommitBackActionTrigger() return getActionTrigger( "CommitBackActionTrigger") end -local function clearCommitBackActionTrigger() return clearActionTrigger( "CommitBackActionTrigger") end +local function setInsertBackActionTrigger() return setActionTrigger( "InsertBackActionTrigger") end +local function getInsertBackActionTrigger() return getActionTrigger( "InsertBackActionTrigger") end +local function clearInsertBackActionTrigger() return clearActionTrigger( "InsertBackActionTrigger") end ------------ @@ -342,18 +359,28 @@ end ------------------ -local function IsSustainPedalModifierKeyPressed() +local function IsSPStepBackModifierKeyPressed() -- Avoid inconsistencies and only follow events during the lifetime of the plugin, so use launchTime -- This will prevent bugs from a session to another (when for example the plugin crashes) local keys = reaper.JS_VKeys_GetState(launchTime); local c1 = keys:byte(getSetting("StepBackSustainPedalModifierKey")); return (c1 == 1); end - -local function getSustainPedalModifierKey() +local function getSPStepBackModifierKey() return ModifierKeyLookup[getSetting("StepBackSustainPedalModifierKey")]; end +local function IsSPInsertModifierKeyPressed() + -- Avoid inconsistencies and only follow events during the lifetime of the plugin, so use launchTime + -- This will prevent bugs from a session to another (when for example the plugin crashes) + local keys = reaper.JS_VKeys_GetState(launchTime); + local c1 = keys:byte(getSetting("InsertModeSustainPedalModifierKey")); + return (c1 == 1); +end +local function getSPInsertModifierKey() + return ModifierKeyLookup[getSetting("InsertModeSustainPedalModifierKey")]; +end + ----------------- local function getNoteLenModifierFactor() @@ -397,7 +424,6 @@ end ------------------- - local function MediaItemContainsCursor(mediaItem, cusorPos) local pos = reaper.GetMediaItemInfo_Value(mediaItem, "D_POSITION") local len = reaper.GetMediaItemInfo_Value(mediaItem, "D_LENGTH") @@ -605,25 +631,78 @@ local function CreateItemIfMissing(track) return take; end + +local function GetNote(take, ni) + local _, selected, muted, startPPQ, endPPQ, chan, pitch, vel = reaper.MIDI_GetNote(take, ni); + return { + selected = selected, + muted = muted, + pitch = pitch, + startPPQ = startPPQ, + endPPQ = endPPQ, + chan = chan, + pitch = pitch, + vel = vel, + index = ni + }; +end + +local function SetNote(take, n, nosort) + reaper.MIDI_SetNote(take, n.index, n.selected, n.muted, n.startPPQ, n.endPPQ, n.chan, n.pitch, n.vel, nosort) +end + -- Commits the currently held notes into the take local function commit(take, notes_to_add, notes_to_extend) + local insertModeOn = IsSPInsertModifierKeyPressed() or getInsertActionTrigger(); + local note_len = resolveNoteLenQN(take); local mediaItem = reaper.GetMediaItemTake_Item(take) local track = reaper.GetMediaItemTake_Track(take) local cursorTime = reaper.GetCursorPosition() local cursorQN = reaper.TimeMap2_timeToQN(0, cursorTime) - local advanceTime = reaper.TimeMap2_QNToTime(0, cursorQN + note_len) + local advanceQN = cursorQN + note_len; + local advanceTime = reaper.TimeMap2_QNToTime(0, advanceQN) local cursorPPQ = reaper.MIDI_GetPPQPosFromProjTime(take, cursorTime) local advancePPQ = reaper.MIDI_GetPPQPosFromProjTime(take, advanceTime) + local newMaxQN = advanceQN + local extcount = 0; local addcount = 0; reaper.Undo_BeginBlock(); + -- First, move some notes if insert mode is on + if insertModeOn then + local _, notecnt, _, _ = reaper.MIDI_CountEvts(take) + local ni = 0 + + while (ni < notecnt) do + local n = GetNote(take, ni); + local startsAfterCursor = (cursorPPQ - 1 < n.startPPQ) + + if startsAfterCursor then + local startQN = reaper.MIDI_GetProjQNFromPPQPos(take, n.startPPQ) + note_len + local endQN = reaper.MIDI_GetProjQNFromPPQPos(take, n.endPPQ) + note_len + + reaper.MIDI_SetNote(take, ni, nil, nil, + reaper.MIDI_GetPPQPosFromProjQN(take, startQN), + reaper.MIDI_GetPPQPosFromProjQN(take, endQN), + nil, nil, nil, true) + + -- For updating item extents + if endQN > newMaxQN then + newMaxQN = endQN + end + end + + ni = ni + 1 + end + end + -- Try to extend existing notes if #notes_to_extend > 0 then local _, notecnt, _, _ = reaper.MIDI_CountEvts(take); @@ -642,7 +721,7 @@ local function commit(take, notes_to_add, notes_to_extend) -- Extend the note if found if endsMatchesCursor and chan == exnote.chan and pitch == exnote.note then - reaper.MIDI_SetNote(take, ni, nil, nil, nil, advancePPQ, nil, nil, nil, nil); + reaper.MIDI_SetNote(take, ni, nil, nil, nil, advancePPQ, nil, nil, nil, true); extcount = extcount + 1; found = true end @@ -665,6 +744,7 @@ local function commit(take, notes_to_add, notes_to_extend) end -- Advance and mark dirty + reaper.MIDI_Sort(take) reaper.UpdateItemInProject(mediaItem) reaper.SetEditCurPos(advanceTime, false, false); @@ -672,12 +752,13 @@ local function commit(take, notes_to_add, notes_to_extend) local itemStartTime = reaper.GetMediaItemInfo_Value(mediaItem, "D_POSITION") local itemLength = reaper.GetMediaItemInfo_Value(mediaItem, "D_LENGTH") local itemEndTime = itemStartTime + itemLength; + local newMaxTime = reaper.TimeMap2_QNToTime(0, newMaxQN) - if(itemEndTime >= advanceTime) then + if(itemEndTime >= newMaxTime) then -- Cool, the item is big enough else local itemStartQN = reaper.TimeMap2_timeToQN(0, itemStartTime) - local itemEndQN = reaper.TimeMap2_timeToQN(0, advanceTime) + local itemEndQN = reaper.TimeMap2_timeToQN(0, newMaxTime) reaper.MIDI_SetItemExtents(mediaItem, itemStartQN, itemEndQN) reaper.UpdateItemInProject(mediaItem); @@ -706,10 +787,136 @@ local function commit(take, notes_to_add, notes_to_extend) end +local function deleteMoveBack(take) + local mediaItem = reaper.GetMediaItemTake_Item(take) + local track = reaper.GetMediaItemTake_Track(take) + + local note_len = resolveNoteLenQN(take); + + local cursorTime = reaper.GetCursorPosition() + local cursorQN = reaper.TimeMap2_timeToQN(0, cursorTime) + local rewindTime = reaper.TimeMap2_QNToTime(0, cursorQN - note_len) + + local cursorPPQ = reaper.MIDI_GetPPQPosFromProjTime(take, cursorTime) + local rewindPPQ = reaper.MIDI_GetPPQPosFromProjTime(take, rewindTime) + + local shcount = 0 + local remcount = 0 + local mvcount = 0 + + reaper.Undo_BeginBlock(); + + -- Try to extend existing notes + local torem = {} + local tomove = {} + + local _, notecnt, _, _ = reaper.MIDI_CountEvts(take); + + local ni = 0; + while (ni < notecnt) do + + -- Examine each note in item + local n = GetNote(take, ni); + + local startsBetweenRewindAndCursor = (rewindPPQ-1 < n.startPPQ) and (n.startPPQ < cursorPPQ+1) + local endsBetweenRewindAndcursor = (rewindPPQ-1 < n.endPPQ) and (n.endPPQ < cursorPPQ+1) + local endsMatchesCursor = (math.abs(n.endPPQ - cursorPPQ) < 1.0) + local shortenable = endsBetweenRewindAndcursor or endsMatchesCursor + local startsAfterCursor = (cursorPPQ-1 < n.startPPQ) + + if startsBetweenRewindAndCursor then + + if endsBetweenRewindAndcursor then + torem[#torem+1] = n + else + local startQN = reaper.MIDI_GetProjQNFromPPQPos(take, cursorPPQ) - note_len + local endQN = reaper.MIDI_GetProjQNFromPPQPos(take, n.endPPQ) - note_len + + n.startPPQ = reaper.MIDI_GetPPQPosFromProjQN(take, startQN) + n.endPPQ = reaper.MIDI_GetPPQPosFromProjQN(take, endQN) + + tomove[#tomove+1] = n + torem[#torem+1] = n + + remcount = remcount + 1 + end + + elseif shortenable then + + if rewindPPQ <= (n.startPPQ + 1.0) then + torem[#torem+1] = n + remcount = remcount + 1 + else + shcount = shcount + 1 + n.endPPQ = rewindPPQ + SetNote(take, n, true) + end + + elseif startsAfterCursor then + -- Has to be moved. When moving multiple notes at once, they should be removed and re-inserted ... (says the doc) + -- Move back + local startQN = reaper.MIDI_GetProjQNFromPPQPos(take, n.startPPQ) - note_len + local endQN = reaper.MIDI_GetProjQNFromPPQPos(take, n.endPPQ) - note_len + + n.startPPQ = reaper.MIDI_GetPPQPosFromProjQN(take, startQN) + n.endPPQ = reaper.MIDI_GetPPQPosFromProjQN(take, endQN) + + tomove[#tomove+1] = n + torem[#torem+1] = n + + remcount = remcount + 1 + end + + ni = ni + 1; + end + + -- Delete notes that were shorten too much + -- Do this in reverse order to be sure that indices are descending + for ri = #torem, 1, -1 do + reaper.MIDI_DeleteNote(take, torem[ri].index); + end + + -- Reinsert moved notes + for ri = 1, #tomove, 1 do + local n = tomove[ri] + reaper.MIDI_InsertNote(take, n.selected, n.muted, n.startPPQ, n.endPPQ, n.chan, n.pitch, n.vel, true ) + end + + -- Rewind and mark dirty + reaper.MIDI_Sort(take); + reaper.UpdateItemInProject(mediaItem) + reaper.SetEditCurPos(rewindTime, false, false); + reaper.MarkTrackItemsDirty(track, mediaItem) + + local description = ""; + + if shcount == 0 then + if remcount == 0 then + description = "One Small Step: Stepping back" + else + description = "One Small Step: Removed " .. remcount .. " notes." + end + else + if remcount == 0 then + description = "One Small Step: Shortened " .. shcount .. " notes." + else + description = "One Small Step: Removed " .. remcount .. " notes, and shortened " .. shcount .. " notes." + end + end + + reaper.Undo_EndBlock("One Small Step: " .. description,-1); +end + -- Commits the currently held notes into the take local function commitBack(take, notes_to_shorten) + local insertModeOn = IsSPInsertModifierKeyPressed() or getInsertBackActionTrigger(); + + if insertModeOn then + return deleteMoveBack(take) + end + local mediaItem = reaper.GetMediaItemTake_Item(take) local track = reaper.GetMediaItemTake_Track(take) @@ -746,14 +953,14 @@ local function commitBack(take, notes_to_shorten) local shortenable = endsMatchesCursor or (getSetting("AllowErasingWhenNoteEndDoesNotMatchCursor") and endsBetweenRewindAndcursor); if shortenable and chan == shnote.chan and pitch == shnote.note then - reaper.MIDI_SetNote(take, ni, nil, nil, nil, rewindPPQ, nil, nil, nil, nil); - if rewindPPQ <= (startPPQ + 1.0) then torem[#torem+1] = ni; remcount = remcount + 1 else shcount = shcount + 1 end + + reaper.MIDI_SetNote(take, ni, nil, nil, nil, rewindPPQ, nil, nil, nil, true); end end @@ -761,7 +968,6 @@ local function commitBack(take, notes_to_shorten) end end - -- Delete notes that were shorten too much -- Do this in reverse order to be sure that indices are descending for ri = #torem, 1, -1 do @@ -769,6 +975,7 @@ local function commitBack(take, notes_to_shorten) end -- Rewind and mark dirty + reaper.MIDI_Sort(take); reaper.UpdateItemInProject(mediaItem) reaper.SetEditCurPos(rewindTime, false, false); reaper.MarkTrackItemsDirty(track, mediaItem) @@ -854,7 +1061,7 @@ local function listenToEvents() -- Update manager with new info from the helper JSFX manager:updateActivity(track, oss_state); - local spmod = IsSustainPedalModifierKeyPressed(); + local spmod = IsSPStepBackModifierKeyPressed(); local pedal = manager:pullPedalTriggerForTrack(track); local preventcommitwhenspmod = getSetting("PreventAddingNotesIfModifierKeyIsPressed"); @@ -875,9 +1082,7 @@ local function listenToEvents() ); -- Allow the use of the action or pedal - if (pedal and not spmod) or getCommitActionTrigger() then - clearCommitActionTrigger(); - + if (pedal and not spmod) or getCommitActionTrigger() or getInsertActionTrigger() then manager:simpleCommit(track, function(commit_candidates, extend_candidates) if take == nil then -- The condition is very large, because it may be a rest insertion @@ -886,10 +1091,12 @@ local function listenToEvents() commit(take, commit_candidates, extend_candidates); end ); + + clearCommitActionTrigger() + clearInsertActionTrigger() end - if (pedal and spmod) or getCommitBackActionTrigger() then - clearCommitBackActionTrigger(); + if (pedal and spmod) or getCommitBackActionTrigger() or getInsertBackActionTrigger() then manager:simpleCommitBack(track, function(shorten_candidates) if (take == nil) then justStepBack(); @@ -898,22 +1105,35 @@ local function listenToEvents() end end ); + + clearCommitBackActionTrigger() + clearInsertBackActionTrigger() end - manager:clearOutdatedActivity(); + manager:clearOutdatedActivity() + -- Clear Insert action triggers + + clearInsertBackActionTrigger() + + if getSetting("PedalRepeatEnabled") then + manager:forgetPedalTriggerForTrack(track, getSetting("PedalRepeatTime"), getSetting("PedalRepeatFirstHitMultiplier")) + end end -- To be called from companion action script function reaperActionCommit() setCommitActionTrigger(); end - --- To be called from companion action script function reaperActionCommitBack() setCommitBackActionTrigger() end +function reaperActionInsert() + setInsertActionTrigger() +end +function reaperActionInsertBack() + setInsertBackActionTrigger() +end --- To be called from companion action script function cleanupCompanionFXs() reaper.Undo_BeginBlock() helper_lib.cleanupAllTrackFXs(); @@ -960,7 +1180,11 @@ function atStart() -- Then we can uncomment this automatic cleanup -- cleanupCompanionFXs(); - clearCommitActionTrigger(); + clearCommitActionTrigger() + clearInsertActionTrigger() + clearCommitBackActionTrigger() + clearInsertBackActionTrigger() + mayRestorePlaybackMarkerOnStart(); end @@ -979,13 +1203,19 @@ function atLoop() end EngineLib = { + + IsSPStepBackModifierKeyPressed = IsSPStepBackModifierKeyPressed, + IsSPInsertModifierKeyPressed = IsSPInsertModifierKeyPressed, + -- Enums InputMode = InputMode, NoteLenParamSource = NoteLenParamSource, NoteLenModifier = NoteLenModifier, ModifierKeys = ModifierKeys, - getSustainPedalModifierKey = getSustainPedalModifierKey, + ModifierKeyLookup = ModifierKeyLookup, + getSPStepBackModifierKey = getSPStepBackModifierKey, + getSPInsertModifierKey = getSPInsertModifierKey, NoteLenDefs = NoteLenDefs, AugmentedDiminishedDefs = AugmentedDiminishedDefs, @@ -1030,9 +1260,12 @@ EngineLib = { getSetting = getSetting, setSetting = setSetting, resetSetting = resetSetting, + getSettingSpec = getSettingSpec, reaperActionCommit = reaperActionCommit, reaperActionCommitBack = reaperActionCommitBack, + reaperActionInsert = reaperActionInsert, + reaperActionInsertBack = reaperActionInsertBack, TakeForEdition = TakeForEdition, TrackForEditionIfNoItemFound = TrackForEditionIfNoItemFound, diff --git a/MIDI Editor/talagan_OneSmallStep/talagan_OneSmallStep Helper lib.lua b/MIDI Editor/talagan_OneSmallStep/classes/helper_lib.lua similarity index 100% rename from MIDI Editor/talagan_OneSmallStep/talagan_OneSmallStep Helper lib.lua rename to MIDI Editor/talagan_OneSmallStep/classes/helper_lib.lua diff --git a/MIDI Editor/talagan_OneSmallStep/images/indicator_back.lua b/MIDI Editor/talagan_OneSmallStep/images/indicator_back.lua new file mode 100644 index 000000000..537a56ae6 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/images/indicator_back.lua @@ -0,0 +1,15 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +return "\z +\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8D\x89\x1D\x0D\x00\x00\x00\x09\x70\x48\x59\z +\x73\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x00\xEA\x49\x44\x41\x54\x38\x8D\xAD\xD5\xB1\x4A\x03\x41\x10\xC6\xF1\x5F\xCE\x80\x08\x62\xA3\x65\z +\x1A\xB1\xF6\x45\x7C\x26\xC1\x04\x2C\x7D\x1E\x9F\x43\xB0\x13\x8E\x34\x29\xB5\x09\x81\x90\xE2\xB8\x14\xB7\x1B\xF5\xB2\x77\x2B\x71\xBF\x6E\xD9\xE5\x3F\xDF\xCC\xCE\z +\xCE\x4E\xDA\xB6\x55\x52\x55\x51\x1A\xA6\x1E\xD7\x43\x7B\x77\x98\xE1\x06\x9F\x58\xA1\x1E\xA5\x3D\x5F\x99\x8E\xC0\x1E\x70\x1D\xD6\x3B\x7C\x64\x81\xD2\x29\xF7\x61\z +\x4F\x38\xC7\x6D\x0E\x86\x23\x87\x29\x58\xD4\x25\xE6\xBD\xF3\x0D\xB6\x58\xE2\x0D\xF5\x4F\xE0\x18\x6C\x48\x67\x21\xD0\x7D\x58\x1F\x80\x39\x58\x0E\xBE\x10\x4A\x52\z +\x9D\xE8\x2C\xA5\x8B\x08\x9C\x15\x80\xD1\xA5\xAF\xD2\xF5\xD9\x7F\x61\x07\x55\xBA\xA6\xA5\xAB\x43\x11\xE0\x0A\x5F\x05\xA0\x4D\x04\xD6\x78\x2D\x00\xDD\xF2\xDD\xD8\z +\x11\x1A\x6F\x7B\xE1\x77\x4D\xFF\x12\x64\x19\x1D\x46\x9D\xE2\xB4\xC1\x06\xEF\xBA\x97\x72\xF4\xF4\xC6\x9C\x6E\xF0\x92\x8B\x90\x1A\x0E\x29\xA7\x3B\x21\xA5\x9C\x86\z +\xC6\x57\x84\xF6\xE7\x61\x56\x93\xD2\x5F\xC0\x1E\x5A\x34\x3C\x8C\xFB\x89\xD6\x81\x00\x00\x00\x00\x49\x45\x4E\x44\xAE\x42\x60\x82" +; diff --git a/MIDI Editor/talagan_OneSmallStep/images/indicator_delete.lua b/MIDI Editor/talagan_OneSmallStep/images/indicator_delete.lua new file mode 100644 index 000000000..7731cce17 --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/images/indicator_delete.lua @@ -0,0 +1,14 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +return "\z +\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8D\x89\x1D\x0D\x00\x00\x00\x09\x70\x48\x59\z +\x73\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x00\xC5\x49\x44\x41\x54\x38\x8D\xAD\xD5\xC1\x0D\x83\x30\x0C\x40\xD1\x4F\xE0\x52\xA9\x37\xBA\x40\z +\xC5\xB9\x1D\xA1\x03\xB0\x52\x0F\x94\xA5\x18\x84\x7B\x47\xC8\xA1\x03\x54\xED\xA1\x04\x99\x28\x22\x4E\x1A\xDF\x40\xF1\x93\x1D\x6C\x51\x7D\xEE\xAF\x0E\xE8\x81\x96\z +\xFF\xC2\x02\x53\xE3\x61\x43\x26\x36\x2E\x46\x6F\x0A\x60\x32\xB7\x35\x05\xB0\x0D\x6A\x62\xA7\xF8\xB5\xA3\x8E\x18\x98\x84\xC5\xC0\x64\x0C\xA0\x89\x60\x6F\xA0\x56\z +\xE0\xEB\x37\x08\x81\x2E\xD9\x02\x33\x70\x02\xCE\xC0\x61\xC1\x93\x2A\x94\xD8\x04\x3C\x23\xF9\x0F\xFF\x85\xBC\x43\xD9\xD6\xAC\xC0\x82\x21\x41\x39\x8B\x57\xA0\xCB\z +\x01\xFD\x96\x07\xC4\x1A\x91\x71\x87\xA1\xB1\x59\xD7\x08\xB8\x01\x17\xE0\xA8\xC1\x42\x15\xFA\x95\xD6\xE2\x59\x15\x7B\x83\x9D\xB5\xDF\xB1\xD5\x4B\x46\x1D\xB8\xB7\z +\x09\x5A\x74\x74\xA0\x55\xA0\x2A\x0C\xB0\x55\xE9\x5F\xC0\x17\xFE\xF2\x24\x8A\xAC\xF9\xB7\xB2\x00\x00\x00\x00\x49\x45\x4E\x44\xAE\x42\x60\x82" +; diff --git a/MIDI Editor/talagan_OneSmallStep/images/indicator_insert.lua b/MIDI Editor/talagan_OneSmallStep/images/indicator_insert.lua new file mode 100644 index 000000000..62f01a8bc --- /dev/null +++ b/MIDI Editor/talagan_OneSmallStep/images/indicator_insert.lua @@ -0,0 +1,13 @@ +-- @noindex +-- @author Ben 'Talagan' Babut +-- @license MIT +-- @description This is part of One Small Step + +return "\z +\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8D\x89\x1D\x0D\x00\x00\x00\x09\x70\x48\x59\z +\x73\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x00\xA2\x49\x44\x41\x54\x38\x8D\xBD\x95\xDB\x0D\x80\x20\x0C\x45\x2F\xC4\x0D\x1C\xC1\x6D\x5C\xC9\z +\x0F\xD2\xA5\xDC\x8A\x0F\x27\xD0\x1F\xC1\xD2\x80\x3C\x6C\xBC\x09\xA1\x69\xE0\xD0\x07\x04\x73\x6E\xC7\x02\x60\x05\x30\xE3\x9B\x3C\x80\x7D\x12\x30\x37\x08\xA3\x9B\z +\xB1\x5A\x05\x18\xDF\x3B\x5B\x05\x58\x02\xB5\xB5\x55\xBD\x9A\x98\x4D\xB9\x13\x7B\xC5\x23\x74\x05\x7B\x18\xA8\xA2\xDF\x81\xC4\x66\x59\x63\xCA\xF9\x5B\x22\x24\x3C\z +\x35\x25\xE1\x0B\x23\x42\x5B\x80\x4E\xCC\x6F\x6B\x92\x6B\xD3\xA3\x24\x2A\x0D\x60\x02\x01\x2B\xCB\x68\x97\x65\x83\xA2\x4A\x2F\x85\x37\x22\xA7\xA6\x94\x73\x00\xE9\z +\xAB\xBE\xA6\x90\x72\x31\x85\x0E\x51\x00\x7A\x05\x68\xD8\xEB\x8D\xF6\x17\x70\x01\xE1\x64\x24\x05\x58\xE3\x2E\x77\x00\x00\x00\x00\x49\x45\x4E\x44\xAE\x42\x60\x82" +;