Skip to content

Commit

Permalink
quick upload
Browse files Browse the repository at this point in the history
  • Loading branch information
esaruoho committed Jun 26, 2024
1 parent 004270e commit 37c5c5a
Show file tree
Hide file tree
Showing 19 changed files with 25,563 additions and 317 deletions.
11,498 changes: 11,498 additions & 0 deletions KeyBindings_2024_06_22_Renoise_for_Paketti.xml

Large diffs are not rendered by default.

11,545 changes: 11,545 additions & 0 deletions KeyBindings_2024_06_23_Renoise_for_Paketti.xml

Large diffs are not rendered by default.

29 changes: 28 additions & 1 deletion Paketti0G01_Loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,34 @@ preferences = renoise.Document.create("ScriptingToolPreferences") {
AppSelection3 = "",
AppSelection4 = "",
AppSelection5 = "",
AppSelection6 = ""
AppSelection6 = "",
SmartFoldersApp1 = "",
SmartFoldersApp2 = "",
SmartFoldersApp3 = "",
pakettiRandomizeSelectedDevicePercentage = 50,
pakettiRandomizeSelectedDevicePercentageUserPreference1 = 10,
pakettiRandomizeSelectedDevicePercentageUserPreference2 = 25,
pakettiRandomizeSelectedDevicePercentageUserPreference3 = 50,
pakettiRandomizeSelectedDevicePercentageUserPreference4 = 75,
pakettiRandomizeSelectedDevicePercentageUserPreference5 = 90,
pakettiRandomizeAllDevicesPercentage = 50,
pakettiRandomizeAllDevicesPercentageUserPreference1 = 10,
pakettiRandomizeAllDevicesPercentageUserPreference2 = 25,
pakettiRandomizeAllDevicesPercentageUserPreference3 = 50,
pakettiRandomizeAllDevicesPercentageUserPreference4 = 75,
pakettiRandomizeAllDevicesPercentageUserPreference5 = 90,
pakettiRandomizeSelectedPluginPercentage = 50,
pakettiRandomizeSelectedPluginPercentageUserPreference1 = 10,
pakettiRandomizeSelectedPluginPercentageUserPreference2 = 20,
pakettiRandomizeSelectedPluginPercentageUserPreference3 = 30,
pakettiRandomizeSelectedPluginPercentageUserPreference4 = 40,
pakettiRandomizeSelectedPluginPercentageUserPreference5 = 50,
pakettiRandomizeAllPluginsPercentage = 50,
pakettiRandomizeAllPluginsPercentageUserPreference1 = 10,
pakettiRandomizeAllPluginsPercentageUserPreference2 = 20,
pakettiRandomizeAllPluginsPercentageUserPreference3 = 30,
pakettiRandomizeAllPluginsPercentageUserPreference4 = 40,
pakettiRandomizeAllPluginsPercentageUserPreference5 = 50
}

renoise.tool().preferences = preferences
Expand Down
6 changes: 3 additions & 3 deletions PakettiAutomation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ function gainerExpCurveVol()
for i = 0, total_points - 1 do
local position = i / (total_points - 1) * (length - 1) -- Scale position in the range of 0 to length-1
local expValue = math.pow(curve, position)
local normalizedValue = (expValue - 1) / (max_exp_value - 1)
local normalizedValue = (expValue - 1) / (max_exp_value - 1) * 0.25 -- Adjust the normalized value to cap at 0.25
envelope:add_point_at(math.floor(position + 1), math.max(0, normalizedValue)) -- Ensure the point is within valid range
end

Expand Down Expand Up @@ -645,15 +645,15 @@ function gainerExpReverseCurveVol()
for i = 0, total_points - 1 do
local position = i / (total_points - 1) * (length - 1) -- Scale position in the range of 0 to length-1
local expValue = math.pow(curve, (length - 1) - position) -- Reverse the curve calculation
local normalizedValue = (expValue - 1) / (max_exp_value - 1)
local normalizedValue = (expValue - 1) / (max_exp_value - 1) * 0.25 -- Adjust the normalized value to cap at 0.25
envelope:add_point_at(math.floor(position + 1), math.max(0, normalizedValue)) -- Ensure the point is within valid range
end

song.transport.edit_mode = false
renoise.app().window.active_lower_frame = renoise.ApplicationWindow.LOWER_FRAME_TRACK_AUTOMATION
end

renoise.tool():add_keybinding{name="Global:Paketti:Gainer Exponential Curve Up", invoke = function() gainerExpCurveVol() end}
renoise.tool():add_keybinding{name="Global:Paketti:Gainer Exponential Curve Up", invoke=function() gainerExpCurveVol() end}
renoise.tool():add_menu_entry{name="Pattern Editor:Paketti..:Gainer Exponential Curve Up", invoke=function() gainerExpCurveVol() end}
renoise.tool():add_menu_entry{name="Pattern Matrix:Paketti..:Gainer Exponential Curve Up", invoke=function() gainerExpCurveVol() end}
renoise.tool():add_menu_entry{name="--Track Automation:Paketti..:Gainer Exponential Curve Up", invoke=function() gainerExpCurveVol() end}
Expand Down
115 changes: 79 additions & 36 deletions PakettiControls.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
-- Shortcuts 2nd / 3rds
--
renoise.tool():add_keybinding{name="Pattern Editor:Paketti:Keep Sequence Sorted False",invoke=function() renoise.song().sequencer.keep_sequence_sorted=false end}
renoise.tool():add_keybinding{name="Pattern Editor:Paketti:Keep Sequence Sorted True",invoke=function() renoise.song().sequencer.keep_sequence_sorted=true end}
renoise.tool():add_keybinding{name="Pattern Editor:Paketti:Keep Sequence Sorted Toggle",invoke=function()
if renoise.song().sequencer.keep_sequence_sorted==false then renoise.song().sequencer.keep_sequence_sorted=true else
renoise.song().sequencer.keep_sequence_sorted=false end end}

--2nd Save Song bind
function saveSong()
renoise.app():save_song()
Expand Down Expand Up @@ -255,36 +249,6 @@ renoise.tool():add_keybinding{name="Global:Paketti:Insert Track (2nd)", invoke=f


--------
-- Function to clone the currently selected pattern sequence row
function clone_current_sequence()
-- Access the Renoise song
local song = renoise.song()

-- Retrieve the currently selected sequence index
local current_sequence_pos = song.selected_sequence_index
-- Get the total number of sequences
local total_sequences = #song.sequencer.pattern_sequence

-- Debug information
print("Current Sequence Index:", current_sequence_pos)
print("Total Sequences:", total_sequences)

-- Clone the sequence range, appending it right after the current position
if current_sequence_pos <= total_sequences then
song.sequencer:clone_range(current_sequence_pos, current_sequence_pos)
-- Debug information
print("Cloned Sequence Index:", current_sequence_pos)
-- Select the newly created sequence
song.selected_sequence_index = current_sequence_pos + 1
else
renoise.app():show_status("Cannot clone the sequence: The current sequence is the last one.")
end
end

renoise.tool():add_menu_entry{name="Pattern Sequencer:Paketti..:Clone Current Sequence",invoke=clone_current_sequence}
renoise.tool():add_menu_entry{name="Pattern Matrix:Paketti..:Clone Current Sequence",invoke=clone_current_sequence}
renoise.tool():add_keybinding{name="Global:Tools:Clone Current Sequence",invoke=clone_current_sequence}
renoise.tool():add_midi_mapping{name="Global:Tools:Clone Current Sequence",invoke=clone_current_sequence}

---------
-- Define a table with the middle frame constants
Expand Down Expand Up @@ -344,4 +308,83 @@ end

renoise.tool():add_keybinding{name="Global:Paketti:Select LoopBlock Backwards (Previous)", invoke=function() loopblockback() end}
renoise.tool():add_keybinding{name="Global:Paketti:Select LoopBlock Forwards (Next)", invoke=function() loopblockforward() end}
--------
-- Define the function to toggle mute state
function toggle_mute_tracks()
-- Get the current song
local song = renoise.song()

-- Determine the range of selected tracks
local selection = song.selection_in_pattern

-- Check if there is a valid selection
local start_track, end_track
if selection then
start_track = selection.start_track
end_track = selection.end_track
end

-- If no specific selection is made, operate on the currently selected track
if not start_track or not end_track then
start_track = song.selected_track_index
end_track = song.selected_track_index
end

-- Check if any track in the selection is muted, ignoring the master track
local any_track_muted = false
for track_index = start_track, end_track do
local track = song:track(track_index)
if track.type ~= renoise.Track.TRACK_TYPE_MASTER and track.mute_state == renoise.Track.MUTE_STATE_ACTIVE then
any_track_muted = true
break
end
end

-- Determine the desired mute state for all tracks
local new_mute_state
if any_track_muted then
new_mute_state = renoise.Track.MUTE_STATE_OFF
else
new_mute_state = renoise.Track.MUTE_STATE_ACTIVE
end

-- Iterate over the range of tracks and set the new mute state, ignoring the master track
for track_index = start_track, end_track do
local track = song:track(track_index)
if track.type ~= renoise.Track.TRACK_TYPE_MASTER then
track.mute_state = new_mute_state
end
end

-- Additionally, handle groups if they are within the selected range
for track_index = start_track, end_track do
local track = song:track(track_index)
if track.type == renoise.Track.TRACK_TYPE_GROUP then
local group = track.group_parent
if group then
-- Set the mute state for the group and its member tracks, ignoring the master track
set_group_mute_state(group, new_mute_state)
end
end
end
end

-- Helper function to set mute state for a group and its member tracks
function set_group_mute_state(group, mute_state)
-- Ensure we don't attempt to mute the master track
if group.type ~= renoise.Track.TRACK_TYPE_MASTER then
group.mute_state = mute_state
end

-- Set mute state for all member tracks of the group, ignoring the master track
for _, track in ipairs(group.members) do
if track.type ~= renoise.Track.TRACK_TYPE_MASTER then
track.mute_state = mute_state
end
end
end

renoise.tool():add_menu_entry{name="Main Menu:Tools:Paketti..:Pattern Editor:Toggle Mute Tracks",invoke=toggle_mute_tracks}
renoise.tool():add_keybinding{name="Global:Paketti:Toggle Mute Tracks",invoke=toggle_mute_tracks}
renoise.tool():add_midi_mapping{name="Paketti:Toggle Mute Tracks",invoke=toggle_mute_tracks}

Loading

0 comments on commit 37c5c5a

Please sign in to comment.