How the hell do I turn this into a tool?

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() 

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 =
  local pat =
  local column =
  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 = ".."

-- 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
    vb:text {
      id = "feedback",
      text = "" 
    vb:button {
      text = "ASSASSINATE!",
      notifier = function()
        local feed =
        feed.text = ("Killed %.2f of notes. You Monster!"):format(noteboom)
  local dialog_buttons = {
    dialog_title, dialog_content, dialog_buttons)

Here’s the manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
  <Author>keef baker []</Author>
  <Name>Note Blaster</Name>
  <Description>Removes a percentage amount of notes from the selected pattern.</Description>

And I’ve put the files in:


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?

Seems to work fine here (Renoise 3.1) keef. Probably just missed a ‘local’ around lines 27 and 29 for the variables ‘notey’ and ‘v’. You have a API version of 4 (might be for Renoise 3.0) in your manifest, Renoise 3.1 uses API version 5, so that probably needs incrementing. The reason the update isn’t happening until after you click the ‘done’ button is probably because you have a modal dialog prompt rather than a non modal dialog tool window, not that it matters :slight_smile:

Thanks, that’s fantastic.

For future reference how do you convert to xrnx?

For future reference how do you convert to xrnx?

Navigate to within the tool folder (where you’ve got main.lua, manifest.xml etc.) and zip the contents. Then rename to xrnx.

Thanks guys, that’s brilliant!

I’m struggling with a different one now. Are there any diagnostic tools that might show you why a lua script will work fine on it’s own but fail miserably when turned into a tool?

ie: Is there any way of getting error reports out for attempting to import a tool?

If you can’t even install the tool, perhaps the log can tell you something about what went wrong?
Help > Show Log File…

Otherwise, best thing is to start (really!) simple and build from there…

A nice trick if you get tired of reloading the tool over and over on each modification is to add this somewhere in your main.lua:

-- reload tool whenever source has changed

Cool. Thanks.

I can’t believe I was debugging for ages and it turns out it was only because I called my xml file manifext.xml instead of manifest.xml

I didn’t see it for ages, then i noticed it’d loaded it as an instrument… I feel like a right wally now!!

Well, I’ve learned a lot today guys, my thanks to you both!