Hi everyone.
Just started making my own tool for the first time so i apologize if these questions are massively n00bish.
After watching a Brian Eno Documentary I wanted to make a tool that would delete a certain portion of notes in a given column, so I made it, and that pretty much works the way I want it to.
But getting it into a menu I can’t seem to do… If I take the registration section out and just execute it, it seems to work fine (well, it doesn’t execute till you exit for some reason but I can live with that)
Here’s my main.lua (apologies, first bit of lua I’ve written):
----------------
-- Registration
----------------
renoise.tool():add_menu_entry {
name = "Main Menu:Tools:Keef Baker:Note Blaster",
invoke = function()
menubob()
end
}
renoise.tool():add_menu_entry {
name = "Pattern Editor:Pattern:Note Blaster",
invoke = function() menubob() end
}
-----------------
-- Actual code
-----------------
-- note killer
function blast_those_notes(probability)
local pat_track = renoise.song().selected_pattern_track
local pat = renoise.song().selected_pattern
local column = renoise.song().selected_note_column_index
for line = 1,pat.number_of_lines do
notey = pat_track:line(line):note_column(column).note_string
if notey ~= "---" then
v = math.random (1,100)
if v > probability then
pat_track:line(line):note_column(column).note_string = "---"
pat_track:line(line):note_column(column).instrument_string = ".."
end
end
end
end
-- menu
function menubob()
local noteboom = 20
local vb = renoise.ViewBuilder()
local dialog_title = "Note Blaster"
local dialog_content = vb:column {
vb:text {
text = "What's the percentage chance of your notes surviving?"
},
vb:slider {
min = 1.0,
max = 100,
value = 20.0,
notifier = function(value)
noteboom = value
end
},
vb:text {
id = "feedback",
text = ""
},
vb:button {
text = "ASSASSINATE!",
notifier = function()
blast_those_notes(noteboom)
local feed = vb.views.feedback
feed.text = ("Killed %.2f of notes. You Monster!"):format(noteboom)
end
}
}
local dialog_buttons = {
"Done"
}
renoise.app():show_custom_prompt(
dialog_title, dialog_content, dialog_buttons)
end
Here’s the manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<RenoiseScriptingTool>
<ApiVersion>4.0</ApiVersion>
<Version>1.0</Version>
<Id>com.keefbaker.NoteBlaster</Id>
<Author>keef baker [nimonambient@gmail.com]</Author>
<Category>randomization</Category>
<Name>Note Blaster</Name>
<Description>Removes a percentage amount of notes from the selected pattern.</Description>
</RenoiseScriptingTool>
And I’ve put the files in:
C:\Users\keith.baker\AppData\Roaming\Renoise\V3.1.0\Scripts\Tools\com.keebaker.NoteBlaster
But When I reload renoise, it doesn’t appear in any menus or the Tool Browser and I get no errors.
Any ideas what i’ve missed or buggered up?
Also how do you package to xrnx when done, do you just zip and change the extension?