Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OneSmallStep 0.9.11 > 0.9.12 #1373

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions MIDI Editor/talagan_OneSmallStep.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
@description One Small Step : Alternative Step Input
@version 0.9.11
@version 0.9.12
@author Ben 'Talagan' Babut
@license MIT
@metapackage
Expand Down Expand Up @@ -56,7 +56,10 @@
@screenshot
https://stash.reaper.fm/48269/oss_094.png
@changelog
- [Feature] Velocity limiter
- [Feature] Added some options to tweak the insert mode behavior when inserting in the middle of existing notes (thanks @samlletas !)
- [Bug Fix] Repitch mode would not work for fresh installs (thanks @samlletas !)
- [Bug Fix] Navigation mode snap would not work for fresh installs
- [Rework] Ported all operation to the 'MIDIUtils' library by @sockmonkey72 (thanks Jeremy !!)
@about
# Purpose

Expand All @@ -76,17 +79,18 @@

# Credits

This tool takes a lot of inspiration in tenfour's "tenfour-step" scripts. Epic hail to tenfour for opening the way !
One Small Step uses Jeremy Bernstein (sockmonkey72)'s MIDIUtils library. Thanks for the precious work !

One Small Step uses Jeremy Bernstein (sockmonkey72)'s MIDIUtils library . Thanks for the precious work !
This tool takes a lot of inspiration in tenfour's "tenfour-step" scripts. Epic hail to tenfour for opening the way !

Thanks to @cfillion for the precious pieces of advice when reviewing this source !

A lot of thanks to all donators, and forum members that help this tool to get better ! @stevie, @hipox, @MartinTL, @henu, @Thonex, @smandrap, @SoaSchas, @daodan, @inthevoid, @dahya, @User41, @Spookye, @R.Cato
A lot of thanks to all donators, and forum members that help this tool to get better !
@stevie, @hipox, @MartinTL, @henu, @Thonex, @smandrap, @SoaSchas, @daodan, @inthevoid, @dahya, @User41, @Spookye, @R.Cato, @samlletas

--]]

VERSION = "0.9.11"
VERSION = "0.9.12"
DOC_URL = "https://bentalagan.github.io/onesmallstep-doc/index.html?ver=" .. VERSION

PATH = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]]
Expand Down Expand Up @@ -925,8 +929,11 @@ function SettingComboBox(setting, pre_label, tooltip, width)
reaper.ImGui_PushStyleVar(ctx, reaper.ImGui_StyleVar_FramePadding(), 5, 3.5)

if pre_label ~= "" then
reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx) + 3)
reaper.ImGui_Text(ctx, pre_label);
SL()
SL();
reaper.ImGui_SetNextItemWidth(ctx, 180);
reaper.ImGui_SetCursorPosY(ctx, reaper.ImGui_GetCursorPosY(ctx) - 3)
end

reaper.ImGui_SetNextItemWidth(ctx, width);
Expand Down Expand Up @@ -1198,7 +1205,6 @@ function EditModeComboBox(editModeName, callback)
end

function RepitchModeComboBox()

local setting = "RepitchModeAffects"
local combo_items = S.getSettingSpec("RepitchModeAffects").inclusion
local curval = S.getSetting("RepitchModeAffects")
Expand Down Expand Up @@ -1228,6 +1234,8 @@ function RepitchModeComboBox()
reaper.ImGui_PopStyleVar(ctx,1);
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);
Expand Down Expand Up @@ -1402,6 +1410,26 @@ function SettingsPanel()
S.setSetting("DoNotRewindOnStepBackIfNothingErased", not curval);
end

ImGui_VerticalSpacer(ctx,5);
SEP("Insert mode")

reaper.ImGui_Text(ctx, "When inserting in the middle of an existing note...")
ImGui_VerticalSpacer(ctx,5);

SettingComboBox("InsertModeInMiddleOfMatchingNotesBehaviour",
" · if a pressed note matches, then",
"This option defines OSS's behavior when you try to insert some notes\n\z
in the middle of existing notes, if one of the key you are pressing/holding\n\z
matches (same pitch) one of the existing notes",
220)

SettingComboBox("InsertModeInMiddleOfNonMatchingNotesBehaviour",
" · if no pressed note matches, then",
"This option defines OSS's behavior when you try to insert some notes\n\z
in the middle of existing notes, if any of the key you are pressing/holding\n\z
does NOT match (same pitch) any existing note",
220)

ImGui_VerticalSpacer(ctx,5);
SEP("Repitch mode")

Expand Down
4 changes: 2 additions & 2 deletions MIDI Editor/talagan_OneSmallStep/classes/engine_lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ local function handleMarkerOnExit(policy_setting_name, marker_name)
-- Need to backup the position
-- Save on master track to be project dependent
local id, pos = MK.findMarker(marker_name)
local masterTrack = reaper.GetMasterTrack()
local masterTrack = reaper.GetMasterTrack(0)
local str = "";

if not (id == nil) then
Expand All @@ -349,7 +349,7 @@ end
local function mayRestoreMarkerOnStart(policy_setting_name, marker_name)
local setting = S.getSetting("PlaybackMarkerPolicyWhenClosed");
if setting == "Hide/Restore" then
local masterTrack = reaper.GetMasterTrack()
local masterTrack = reaper.GetMasterTrack(0)
local succ, str = reaper.GetSetMediaTrackInfo_String(masterTrack, "P_EXT:OneSmallStep:MarkerBackup:" .. marker_name, '', false);
if succ and str ~= "" then
MK.setMarkerAtPos(marker_name, tonumber(str))
Expand Down
Loading
Loading