New Tool (3.1): FormulaOne

Short description: Another workflow tool, allowing the user to type values/formulas in column names. These will have effect when edits are made in the column (kind of like “default values”).

Some examples, from simple to more complex:

volume = 40
volume = 0x40; panning = math.random(40, 70)
delay = ((line_index-1)%8 == 0) and 0 or math.random(5, 12)

Last example would introduce some randomized drag/push on all notes entered, except the ones placed on every 8th line.

Note 1: Regarding values: 0x0A == 10 == “0A” == 0xa
Note 2: An editor is available in the pattern editor context menu, if you want to use it instead of the column name field when doing something complex. The column name field does not support pasting linebreaks. Use the editor for multiline formulas.

It’s bytecoded, so maybe it only works on 64-bit for now.

v0.3:
joule.no0b.FormulaOne.xrnx (7.8 KB)

11 Likes

Updated to v0.3 with some fixes.

  • The line_index variable in the sandbox is now starting at 1 instead of 0 - for the sake of keeping things consistent and general.
  • Function executes on all pattern edits. To make it only react on note value edits, put “if sub_column_type == 1 then…” in function.
  • Added a song_pos class that will help iterate thru lines in song.
  • Added number_of_lines to renoise.PatternSequence (renoise.song().sequencer.number_of_lines)

Here is an even more complex code example. It will spam the pattern with whatever effect is being entered in the note column fx, until a note is found. It’s quite handy when entering/updating Axx arps.

formulaone_fxspammer

FX spammer
-- create a song_pos object, helping us to iterate thru song
local song_pos = renoise.SongPos()

-- iterate thru song until a note is found
for k = global_line_index, renoise.song().sequencer.number_of_lines-1 do

  song_pos.global_line_index = k

  local iter_pattern_idx = song.sequencer.pattern_sequence[song_pos.sequence]

  local iter_note_column = song:pattern(iter_pattern_idx):track(track_index):line(song_pos.line):note_column(column_index)
  
  if (iter_note_column.note_value == renoise.PatternLine.EMPTY_NOTE) then
    iter_note_column.effect_number_value = note_column.effect_number_value
-- Effect spammer
    iter_note_column.effect_amount_value = note_column.effect_amount_value
  else
    -- a note is found. quit function.
    return
  end

end

Since it’s multiline, it has to be pasted in the provided code editor.

Another example, just for “fun”. Track backwards :slight_smile:

formulaone_backwards

renoise.song().transport.edit_step = 0; global_line_index = global_line_index - 2

Status update:

Working on a new version, possibly released this weekend. Some bugs have been found and fixed, like error when editing a group track (thanks ffx). Also optimizations and some behavioral changes that should minimize any confusion during normal tracking.

I’m finishing an editor, preset system and menu at the moment. It’s quite a bit of work making every little detail work properly with preset system and menu updates et c.

6 Likes

Nice work, I didn’t realise note columns could be renamed!

Does bytecoding it give a performance advantage? Curious because some of my tools could do with performance improvements

Thanks. It’s a bit immature so far, but it’s gonna be fine. I’ll release an updated version soon as mentioned, and after that start deciding exactly what should be available in the sandbox before a 1.0 version.

That should be negligable. Bytecoding is mainly for privacy reasons.

(If you want to, I’d be glad to have a look at some tool you find slow and make some suggestions if it’s possible to speed it up.)

1 Like

Thanks for the offer, I’ll PM you once I have something ready… Meanwhile I look forward to the updates of this!