New shortcut: Increment and decrement instrument number

It would be useful for when layering/duplicating tracks to quickly change the instrument number like you do with Transpose notes up and down.

2 Likes

I would love this. Coming from MilkyTracker I used that shortcut a lot to try different instruments with a column in a pattern.

You can totally do this with the value stepper and a lot more too

3 Likes

Oh I wonder how I didn’t pick up on that as I use his tools already, thanks.

Unless makes some really useful tools, I use beat selector all the time which makes it so easy to copy a beat and do a continuous paste :+1:

1 Like

The value stepper is my favorite. Super useful

hmm I’m afraid I can’t use it as it only works at its most in a block selection of a single pattern whereas I need it to shift all values on a track in every pattern of the song.

When layering an instrument I usually duplicate a track including its patterns and then use the advanced pattern editor operations tab to remap the instrument numbers, that’s quite a bit of clicking with the mouse.

Anyway I have just found Ledgers tool Convert Instrument Number, that’s works well instead.

It doesn’t work when you highlight the instrument number column?

Not across multiple patterns

Oh I missed that part

Here is a multifunction that I have written for these things. You just have to use it in your Lua tool to add some keyboard commands.

This function can work in 5 different ways, depending on the variables you pass through the function (“=” “-” “+”, and even adding “true”).

With “=” the pattern-track will switch you to the index of the instrument selected in the instrument box.

If you add “true”, it will detect the first note first and use that index as a basis for increasing or decreasing the instrument index value throughout the pattern-track.

The function will also automatically select the final instrument index in the instrument box.

--the main function
local function up_down_instrument_to_change_pat_trk(nav,bol)
  local song=renoise.song()
  local ins_val=song.selected_instrument_index-1
  local function change_instrument_in_pat_trk(ins_val,bol)
    local pat_trk=song.selected_pattern_track
    if (not pat_trk.is_empty) then
      local pat=song.selected_pattern
      local vnc=song.selected_track.visible_note_columns
      for l=1,pat.number_of_lines do
        local lne=pat_trk:line(l)
        if (not lne.is_empty) then
          for c=1,vnc do
            local clm=lne:note_column(c)
            if (not clm.is_empty) and (clm.note_value<=119) then
              if (bol) then
                ins_val=clm.instrument_value--1
                --print("ins_val_1",ins_val)
                return ins_val
              else
                clm.instrument_value=ins_val
              end
            end
          end
        end
      end
    end
  end
  if (bol) then
    ins_val=change_instrument_in_pat_trk(ins_val,true)
  end
  --print("ins_val_2",ins_val)
  if (nav=="+") then
    if (ins_val+1<#song.instruments) then
      ins_val=ins_val+1
      song.selected_instrument_index=ins_val+1
      return change_instrument_in_pat_trk(ins_val)
    end
  elseif (nav=="-") then
    if (ins_val>0) then
      ins_val=ins_val-1
      song.selected_instrument_index=ins_val+1
      return change_instrument_in_pat_trk(ins_val)
    end
  elseif (nav=="=") then
    return change_instrument_in_pat_trk(ins_val)
  end
end

--bang
up_down_instrument_to_change_pat_trk("=")
--up_down_instrument_to_change_pat_trk("+")
--up_down_instrument_to_change_pat_trk("-")
--up_down_instrument_to_change_pat_trk("+",true)
--up_down_instrument_to_change_pat_trk("-",true)

If you are a programmer you can try it in your test.lua and then adapt it…

I was thinking about this too, it would be super useful in general to have a shortcut like this for any highlighted column. You could increase/decrease instrument number, or velocity value, or delay value, etc.