Skip to content

Commit

Permalink
Update OneSmallStep v0.9.4 > v0.9.5 (#1326)
Browse files Browse the repository at this point in the history
* Update OneSmallStep v0.9.4 > v0.9.5
  • Loading branch information
BenTalagan authored Feb 29, 2024
1 parent 1da4bc6 commit 09214ba
Show file tree
Hide file tree
Showing 29 changed files with 603 additions and 247 deletions.
15 changes: 0 additions & 15 deletions MIDI Editor/talagan_OneSmallStep Change input mode.lua

This file was deleted.

21 changes: 0 additions & 21 deletions MIDI Editor/talagan_OneSmallStep Change note len modifier.lua

This file was deleted.

11 changes: 0 additions & 11 deletions MIDI Editor/talagan_OneSmallStep Change note len.lua

This file was deleted.

9 changes: 0 additions & 9 deletions MIDI Editor/talagan_OneSmallStep Commit back.lua

This file was deleted.

9 changes: 0 additions & 9 deletions MIDI Editor/talagan_OneSmallStep Commit.lua

This file was deleted.

9 changes: 0 additions & 9 deletions MIDI Editor/talagan_OneSmallStep Decrease note len.lua

This file was deleted.

9 changes: 0 additions & 9 deletions MIDI Editor/talagan_OneSmallStep Increase note len.lua

This file was deleted.

277 changes: 168 additions & 109 deletions MIDI Editor/talagan_OneSmallStep.lua

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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])
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
-- @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);
elseif mode == 'ItemConf' then
engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.ItemConf);
elseif mode == 'ProjectGrid' then
engine_lib.setNoteLenParamSource(engine_lib.NoteLenParamSource.ProjectGrid);
end
end
Original file line number Diff line number Diff line change
@@ -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);
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[[^@?(.*[\/])[^\/]-$]] .."?.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();
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

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

engine_lib.reaperActionCommitBack();
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

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

engine_lib.reaperActionCommit();
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

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

engine_lib.decreaseNoteLen();
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

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

engine_lib.increaseNoteLen();
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

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

engine_lib.reaperActionInsertBack();
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

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

engine_lib.reaperActionInsert();
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. 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)
Expand Down
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[[^@?(.*[\/])[^\/]-$]] .."?.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();
27 changes: 24 additions & 3 deletions MIDI Editor/talagan_OneSmallStep/classes/KeyActivityManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
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

local KeyActivityManager = require "classes/KeyActivityManager";
local KeyActivityManager = require "KeyActivityManager";

-- Inherit from generic KeyActivityManager
KeyPressActivityManager = KeyActivityManager:new();
Expand Down
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

local KeyActivityManager = require "classes/KeyActivityManager";
local KeyActivityManager = require "KeyActivityManager";

-- Inherit from generic KeyActivityManager
KeyReleaseActivityManager = KeyActivityManager:new();
Expand Down
Loading

0 comments on commit 09214ba

Please sign in to comment.