[].is_empty Doesn't Detect Automation

The documentation claims that[].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(
    for _, track in pairs(obj.tracks) do
      if #track.automation > 0 then
        return false
    return obj.is_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.