Skip to content

Commit

Permalink
Update OneSmallStep V0.9.9 > V0.9.10 (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTalagan authored Mar 18, 2024
1 parent 64a4a79 commit c6b4f72
Show file tree
Hide file tree
Showing 44 changed files with 3,568 additions and 2,237 deletions.
449 changes: 244 additions & 205 deletions MIDI Editor/talagan_OneSmallStep.lua

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
-- @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";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path;
local S = require "modules/settings";
local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$");


engine_lib.setSetting("EditMode", param)
S.setSetting("EditMode", param)
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
-- @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
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

local S = require "modules/settings"
local D = require "modules/defines"

local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$")

S.setInputMode(D.InputMode[param])
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
-- @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$");
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

engine_lib.setNoteLenModifier(engine_lib.NoteLenModifier[modifier])
local S = require "modules/settings"
local D = require "modules/defines"

local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$")

S.setNoteLenModifier(D.NoteLenModifier[param])
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
-- @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 mode = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$");
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

if mode == 'OSS' then
engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.OSS);
elseif mode == 'ItemConf' then
engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.ItemConf);
elseif mode == 'ProjectGrid' then
engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.ProjectGrid);
end
local S = require "modules/settings"
local D = require "modules/defines"

local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$")

S.setNoteLenParamSource(D.NoteLenParamSource[param])
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
-- @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$");
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path
local S = require "modules/settings"
local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$")

engine_lib.setNoteLen(param);
S.setNoteLen(param)
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
-- @license MIT
-- @description This is part of One Small Step

package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path;
local helper_lib = require "classes/helper_lib";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

local helper_lib = require "helper_lib";

reaper.Undo_BeginBlock();
helper_lib.cleanupAllTrackFXs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
-- @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";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

engine_lib.decreaseNoteLen();
local S = require "modules/settings"

S.decreaseNoteLen()
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
-- @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";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

local E = require "engine_lib";
local param = select(2, reaper.get_action_context()):match("%- ([^%s]*)%.lua$");

if not param or param == "" then
param = "Commit"
end

engine_lib.reaperAction(param)
E.reaperAction(param)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
-- @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";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

local S = require "modules/settings"

S.increaseNoteLen()

engine_lib.increaseNoteLen();
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
-- @license MIT
-- @description This is part of One Small Step. Will replay the n last measures.

package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path;
local engine_lib = require "classes/engine_lib";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

local S = require "modules/settings"
local MK = require "modules/markers"

-- 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)
Expand All @@ -19,20 +21,21 @@ if not (reaper.GetPlayState() == 0) then
return;
end

local rewindMeasureCount = ((param == nil) and engine_lib.getPlaybackMeasureCount() or tonumber(param));
local rewindMeasureCount = ((param == nil) and S.getPlaybackMeasureCount() or tonumber(param));

local pos = reaper.GetCursorPosition();
local posqn = reaper.TimeMap2_timeToQN(0, pos);
local posm = reaper.TimeMap_QNToMeasures(0, posqn);
local pos = reaper.GetCursorPosition()
local posqn = reaper.TimeMap2_timeToQN(0, pos)
local posm = reaper.TimeMap_QNToMeasures(0, posqn)

local timeStart = 0;
local timeStart = 0

if rewindMeasureCount == -1 then
local mkid, mkpos = engine_lib.findPlaybackMarker();
local mkid, mkpos = MK.findPlaybackMarker()

if mkid == nil then
rewindMeasureCount = 0
else
timeStart = mkpos;
timeStart = mkpos
end
end

Expand All @@ -50,8 +53,6 @@ if rewindMeasureCount >= 0 then
timeStart = reaper.TimeMap2_QNToTime(0, measureStart);
end



-- In OSS manual, I encourage users to a tick the option that
-- creates an undo point whenever the Edit cursor is moved
-- This ensures that OSS undo works well (notes are cancelled and the edit cursor moves back to its previous position)
Expand All @@ -62,7 +63,8 @@ end
local SPBA = "OneSmallStep - Start Playback";
local EPBA = "OneSmallStep - End Playback";

function startPlayback()
local waitEndOfPlayback
local function startPlayback()
-- Move the cursor back and hit play
reaper.Undo_BeginBlock();
reaper.SetEditCurPos(timeStart, true, true);
Expand All @@ -71,7 +73,7 @@ function startPlayback()
reaper.defer(waitEndOfPlayback);
end

function onPlaybackEnd()
local function onPlaybackEnd()
reaper.Undo_BeginBlock();
reaper.SetEditCurPos(pos, false, false);
reaper.Undo_EndBlock(EPBA,0);
Expand All @@ -86,7 +88,6 @@ function onPlaybackEnd()
end

function waitEndOfPlayback()

local ps = reaper.GetPlayState();
local curtime = reaper.GetPlayPosition();
local antiglitch = 0.1;
Expand All @@ -96,10 +97,9 @@ function waitEndOfPlayback()
else
return;
end

end

function stopPlayback()
local function stopPlayback()
reaper.OnStopButton();
onPlaybackEnd();
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- @noindex
-- @author Ben 'Talagan' Babut
-- @license MIT
-- @description This is part of One Small Step. Will replay the n last measures.

package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path
local MK = require "modules/markers"

MK.setOperationMarkerAtCurrentPos()
Original file line number Diff line number Diff line change
Expand Up @@ -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[[^@?(.*[\/])actions[\/][^\/]-$]] .."?.lua;".. package.path;
local engine_lib = require "classes/engine_lib";
package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path
local MK = require "modules/markers"

engine_lib.setPlaybackMarkerAtCurrentPos();
MK.setPlaybackMarkerAtCurrentPos()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- @noindex
-- @author Ben 'Talagan' Babut
-- @license MIT
-- @description Enables/Disables debugging with mobdebug

package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])actions[\/][^\/]-$]] .. "classes/" .. "?.lua;".. package.path

local S = require "modules/settings"

local don = S.getSetting("UseDebugger")
don = not don

S.setSetting("UseDebugger", don)
Loading

0 comments on commit c6b4f72

Please sign in to comment.