Written using Claude Code and z.ai's GLM-4.7 model using this prompt:
Write a script called "pattern_expander.py" that takes two arguments: a sunvox project filename, and a factor (positive int).
The script will use radiant-voices (rv) to open the sunvox file, and for all patterns it will do this:
- expand the length of the pattern by the factor
- rewrite the pattern data so that the pattern data is expanded to fill the new pattern length (e.g. for factor of 2, 1 new blank line between each existing line... for factor of 3, 2 new blank lines, etc.)
- multiply the "x" position of the pattern by the factor