Renoise.song().patterns[].is_empty Doesn't Detect Automation

The documentation claims that renoise.song().patterns[].is_empty will “quickly check if a pattern has some pattern lines or automation.” I’m trying it on a pattern that does have automation though nothing in the Pattern Editor, but it returns true.

I think is_empty was related to pattern commands? I use ins.parameters[].is_automated instead.

Looks like a mistake in the docs.

It’s easily fixable like this

renoise.Pattern.is_really_empty = property(
  function(obj)
    for _, track in pairs(obj.tracks) do
      if #track.automation > 0 then
        return false
      end
    end
    return obj.is_empty
  end
)

print(renoise.song():pattern(1).is_really_empty)
1 Like

Thanks for the excellent example, joule. It solved the issue and there were also few useful things for me to pick up on in there.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.