Skip to content

Commit

Permalink
should-remove needless xmls
Browse files Browse the repository at this point in the history
  • Loading branch information
esaruoho committed Nov 25, 2024
1 parent 32b5ef9 commit 090bc21
Show file tree
Hide file tree
Showing 24 changed files with 24,518 additions and 5,112 deletions.
20,953 changes: 20,953 additions & 0 deletions KeyBindings/2024_11_20_PakettiKeyBindings.xml

Large diffs are not rendered by default.

3,824 changes: 22 additions & 3,802 deletions KeyBindings/Debug_Paketti_KeyBindings.log

Large diffs are not rendered by default.

126 changes: 102 additions & 24 deletions Paketti0G01_Loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,67 @@ if os_name=="WINDOWS"then default_executable="C:\\Program Files\\espeak\\espeak.
elseif os_name=="MACINTOSH"then default_executable="/opt/homebrew/bin/espeak-ng"
else default_executable="/usr/bin/espeak-ng" end

-- Define the PakettiPluginEntry class
renoise.Document.create("PakettiPluginEntry") {
name = renoise.Document.ObservableString(),
path = renoise.Document.ObservableString(),
}
-- Function to create a new PakettiPluginEntry
function create_plugin_entry(name, path)
local entry = renoise.Document.instantiate("PakettiPluginEntry")
entry.name.value = name
entry.path.value = path
return entry
end

renoise.Document.create("PakettiDeviceEntry") {
name = renoise.Document.ObservableString(),
path = renoise.Document.ObservableString(),
device_type = renoise.Document.ObservableString(),
}

-- Function to create a new PakettiDeviceEntry
function create_device_entry(name, path, device_type)
local entry = renoise.Document.instantiate("PakettiDeviceEntry")
entry.name.value = name
entry.path.value = path
entry.device_type.value = device_type
return entry
end

-- Define the PakettiDynamicViewStepEntry class
local PakettiDynamicViewStepEntry = renoise.Document.create("PakettiDynamicViewStepEntry") {
upper_frame_index = 1,
middle_frame_index = 1,
lower_frame_index = 1,
sample_record_visible = false,
disk_browser_visible = false,
instrument_box_visible = false,
pattern_matrix_visible = false,
pattern_advanced_edit_visible = false,
}
function create_dynamic_view_step_entry()
local entry = PakettiDynamicViewStepEntry()
return entry
end

-- Define the PakettiDynamicViewEntry class
local PakettiDynamicViewEntry = renoise.Document.create("PakettiDynamicViewEntry") {
steps = renoise.Document.DocumentList(),
}

-- Function to create a new PakettiDynamicViewEntry
function create_dynamic_view_entry()
local entry = PakettiDynamicViewEntry()
-- Initialize steps
for step = 1, steps_per_view do
local step_entry = create_dynamic_view_step_entry()
entry.steps:insert(step, step_entry)
end
return entry
end


preferences = renoise.Document.create("ScriptingToolPreferences") {
pakettiDialogClose="esc",
PakettiDeviceChainPath = "DeviceChains/",
Expand All @@ -80,23 +141,6 @@ preferences = renoise.Document.create("ScriptingToolPreferences") {
renderSampleRate=88200,
renderBitDepth=32,
renderBypass=false,
pakettiTitler = {
textfile_path = "External/wordlist.txt",
notes_file_path = "External/notes.txt",
trackTitlerDateFormat = "YYYY_MM_DD",
},
pakettiMidiPopulator = {
volumeColumn = false,
panningColumn = false,
delayColumn = false,
sampleEffectsColumn = false,
noteColumns = 1.0,
effectColumns = 1.0,
collapsed = false,
incomingAudio = false,
populateSends = true
},

pakettiEditMode=1,
pakettiLoaderInterpolation=1,
pakettiLoaderFilterType="LP Clean",
Expand Down Expand Up @@ -129,7 +173,6 @@ preferences = renoise.Document.create("ScriptingToolPreferences") {
userPreferredDevice10 = "<None>",
userPreferredDeviceLoad = true
},
-- WipeSlices Segment
WipeSlices = {
WipeSlicesLoopMode=2,
WipeSlicesLoopRelease=false,
Expand Down Expand Up @@ -160,6 +203,17 @@ preferences = renoise.Document.create("ScriptingToolPreferences") {
RenoiseLaunchFavoritesLoad = false,
RenoiseLaunchRandomLoad = false
},
UserDefinedSampleFolders01="",
UserDefinedSampleFolders02="",
UserDefinedSampleFolders03="",
UserDefinedSampleFolders04="",
UserDefinedSampleFolders05="",
UserDefinedSampleFolders06="",
UserDefinedSampleFolders07="",
UserDefinedSampleFolders08="",
UserDefinedSampleFolders09="",
UserDefinedSampleFolders10="",

pakettieSpeak = {
word_gap=3,
capitals=5,
Expand Down Expand Up @@ -250,10 +304,31 @@ preferences = renoise.Document.create("ScriptingToolPreferences") {
Length = 64,
SetName = false,
Name = ""
}}

},
pakettiTitler = {
textfile_path = "External/wordlist.txt",
notes_file_path = "External/notes.txt",
trackTitlerDateFormat = "YYYY_MM_DD",
},
pakettiMidiPopulator = {
volumeColumn = false,
panningColumn = false,
delayColumn = false,
sampleEffectsColumn = false,
noteColumns = 1.0,
effectColumns = 1.0,
collapsed = false,
incomingAudio = false,
populateSends = true
},
PakettiPluginLoaders = renoise.Document.DocumentList(),
PakettiDeviceLoaders = renoise.Document.DocumentList(),
PakettiDynamicViews = renoise.Document.DocumentList(),
}

renoise.tool().preferences = preferences


-- Accessing Segments
eSpeak = renoise.tool().preferences.pakettieSpeak
pakettiThemeSelector = renoise.tool().preferences.pakettiThemeSelector
Expand All @@ -263,6 +338,12 @@ RandomizeSettings = renoise.tool().preferences.RandomizeSettings
pakettiColuga = renoise.tool().preferences.pakettiColuga
DynamicViewPrefs = renoise.tool().preferences.PakettiDynamicViews

-- Ensure PakettiDynamicViews exists within preferences
if not preferences:property("PakettiDynamicViews") then
preferences:add_property("PakettiDynamicViews", renoise.Document.create("PakettiDynamicViewsPreferences") {})
end


-- Function to initialize the filter index
local function initialize_filter_index()
if preferences.pakettiLoaderFilterType.value ~= nil then
Expand Down Expand Up @@ -778,14 +859,11 @@ function safe_initialize()
end

function load_Pakettipreferences()
if io.exists("preferences.xml") then
preferences:load_from("preferences.xml")
end
if io.exists("preferences.xml") then preferences:load_from("preferences.xml") end
end

function update_loadPaleGreenTheme_preferences() renoise.app():load_theme("Themes/Lackluster - Pale Green Renoise Theme.xrnc") end


safe_initialize()

renoise.tool():add_menu_entry{name = "Main Menu:Tools:Paketti..:!Preferences..:Paketti Preferences...", invoke = show_paketti_preferences}
Expand Down
2 changes: 2 additions & 0 deletions PakettiAudioProcessing.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- TODO: Phase Shift + Pitch Shift invert mix

local vb = renoise.ViewBuilder()
local buffer = nil
local current_name = nil
Expand Down
45 changes: 24 additions & 21 deletions PakettiAutomation.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

groove_master_track = nil
--groove_master_device = nil
paketti_automation1_device = nil
paketti_automation2_device = nil

PakettiAutomationDoofer = false


-- Utility Functions
local function set_edit_mode(value)
local song = renoise.song()
Expand All @@ -33,13 +31,11 @@ local function set_sample_record(value)
end
else
if is_recording_active then
-- Stop recording
renoise.song().transport:start_stop_sample_recording()
is_recording_active = false -- Update the state to indicate recording has stopped
end
end

-- Always set the middle frame to 1
renoise.app().window.active_middle_frame = 1
end

Expand Down Expand Up @@ -99,21 +95,14 @@ local function inject_xml_to_doofer1(device)
local transport = song.transport

-- Get current values for Groove, BPM, LPB, EditStep, and Octave
local groove1 = transport.groove_amounts[1] * 100 -- Groove amounts are between 0 and 1, so multiply by 100
local groove1 = transport.groove_amounts[1] * 100
local groove2 = transport.groove_amounts[2] * 100
local groove3 = transport.groove_amounts[3] * 100
local groove4 = transport.groove_amounts[4] * 100

-- Map BPM to a 0-100 scale. BPM is between 32 and 187
local bpm_value = ((transport.bpm - 32) / (187 - 32)) * 100

-- Map LPB (Lines Per Beat) to a 0-100 scale. LPB is between 1 and 32
local lpb_value = ((transport.lpb - 1) / (32 - 1)) * 100

-- Map EditStep to a 0-100 scale. EditStep is between 0 and 64
local edit_step_value = (transport.edit_step / 64) * 100

-- Map Octave to a 0-100 scale. Octave is between 0 and 8
local octave_value = (transport.octave / 8) * 100

-- Construct the XML with the dynamic values injected
Expand Down Expand Up @@ -1649,8 +1638,6 @@ renoise.tool():add_keybinding { name = "Global:Paketti..:Automation Top to Cente
renoise.tool():add_keybinding { name = "Global:Paketti..:Automation Center to Bottom (Lin)", invoke = automation_center_to_bottom_lin }
renoise.tool():add_keybinding { name = "Global:Paketti..:Automation Bottom to Center (Lin)", invoke = automation_bottom_to_center_lin }



local function randomize_envelope()
local song = renoise.song()
local automation_parameter = song.selected_automation_parameter
Expand All @@ -1666,25 +1653,41 @@ local function randomize_envelope()
local pattern_length = song:pattern(song.selected_pattern_index).number_of_lines
local selection = envelope and envelope.selection_range

-- Helper to ensure line is valid
local function validate_line(line)
if pattern_length == 512 and line > 512 then
return 512 -- Cap it at 512 if the pattern length is the maximum allowed
end
return math.min(math.max(1, line), pattern_length)
end

if not envelope then
envelope = track_automation:create_automation(automation_parameter)
print("Created new automation envelope for parameter: " .. automation_parameter.name)
for line=1, pattern_length do envelope:add_point_at(line, math.random()) end
for line = 1, pattern_length do
envelope:add_point_at(validate_line(line), math.random())
end
renoise.app():show_status("Filled new envelope across entire pattern with random values.")
print("Randomized entire pattern with random values.")
return
end

if selection then
local start_line, end_line = selection[1], selection[2]
for line=start_line, end_line do envelope:add_point_at(line, math.random()) end
start_line = validate_line(start_line)
end_line = validate_line(end_line)
for line = start_line, end_line do
envelope:add_point_at(validate_line(line), math.random())
end
renoise.app():show_status("Randomized automation points within selected range.")
print("Randomized selection range from line " .. start_line .. " to line " .. end_line)
return
end

envelope:clear()
for line=1, pattern_length do envelope:add_point_at(line, math.random()) end
for line = 1, pattern_length do
envelope:add_point_at(validate_line(line), math.random())
end
renoise.app():show_status("Randomized entire existing envelope across pattern.")
print("Randomized entire existing envelope across the pattern.")
end
Expand Down Expand Up @@ -1718,7 +1721,7 @@ local function randomize_device_envelopes(start_param)
-- Create or clear the envelope
if not envelope then
envelope = track_automation:create_automation(parameter)
print("Created new automation envelope for parameter: " .. parameter.name)
-- print("Created new automation envelope for parameter: " .. parameter.name)
else
envelope:clear()
end
Expand All @@ -1728,9 +1731,9 @@ local function randomize_device_envelopes(start_param)
envelope:add_point_at(line, math.random())
end

print("Randomized entire envelope for parameter: " .. parameter.name)
-- print("Randomized entire envelope for parameter: " .. parameter.name)
else
print("Parameter " .. parameter.name .. " is not automatable, skipping.")
-- print("Parameter " .. parameter.name .. " is not automatable, skipping.")
end
end

Expand Down Expand Up @@ -1915,6 +1918,6 @@ end
for i = 0, 1, 0.1 do
local formatted_value = string.format("%.1f", i)
renoise.tool():add_keybinding{name = "Global:Paketti:Write Automation Value " .. formatted_value,invoke = function() write_automation_value(tonumber(formatted_value)) end}
renoise.tool():add_menu_entry{name = "Main Menu:Tools:Paketti..:Write Automation Value " .. formatted_value,invoke = function() write_automation_value(tonumber(formatted_value)) end}
renoise.tool():add_menu_entry{name = "Main Menu:Tools:Paketti..:Automation..:Write Automation Value " .. formatted_value,invoke = function() write_automation_value(tonumber(formatted_value)) end}
end

2 changes: 2 additions & 0 deletions PakettiBeatDetect.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- TODO Finish BeatDetect

vb = renoise.ViewBuilder()
vbs = vb.views
dialog = nil
Expand Down
10 changes: 2 additions & 8 deletions PakettiColuga.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
--[[
Paketti Coluga Downloader - Complete Script with Dialog Reopen Fix
- Creates a new ViewBuilder instance each time the dialog is opened
- Resets global variables when the dialog is closed
- Ensures no duplicate view IDs are registered
- Includes all helper functions and main functionalities
--]]

-- TODO YT-DLP make it output to GUI Console
-- TODO YT-DLP make sure it finishes downloading
local yt_dlp_path = ""
local ffmpeg_path = ""
local RUNTIME = tostring(os.time())
Expand Down
Loading

0 comments on commit 090bc21

Please sign in to comment.