https://ncg777.github.io/sequence-operator/
Add Merge from the Combine palette group (or search for “merge” or
“interleave”). Wire sequences into x and y, then connect out to a Display
or another node. Merge has no Combiner or Operation selector.
The result alternates elements, starting with x. Both inputs repeat until they
complete a common cycle, producing 2 × LCM(length(x), length(y)) elements:
1 2 3merged with4 5 6→1 4 2 5 3 61 2merged with7 8 9→1 7 2 8 1 9 2 7 1 8 2 91 2 3merged with9→1 9 2 9 3 9
Merge waits for both inputs. An empty sequence produces an empty result. Use Append to join whole sequences end to end. Merge works in saved programs and subprograms with the existing graph format.
The P(x) dialog samples the result sequence at
(d*x³ + a*x² + b*x + c) mod n, where n is its length. It shows Permutation
when every position is used exactly once, or Not a permutation when positions
repeat or are skipped. Both can be applied, and any sequence length is supported.
Leave d = 0 for the existing quadratic behavior. The Patch node also has an
optional d input; existing saved quadratic nodes continue to work.
Build the tools first:
yarn build-toolsThen use the sequence-operator command:
# Combine two sequences
node dist-tools/cli.js combine -x "1 2 3" -y "4 5 6" -c Product -o Add
# → 5 6 7 6 7 8 7 8 9
# Merge two sequences (no combiner or operation required)
node dist-tools/cli.js merge -x "1 2" -y "7 8 9"
# → 1 7 2 8 1 9 2 7 1 8 2 9
# Reverse a sequence
node dist-tools/cli.js reverse -s "1 2 3 4 5"
# → 5 4 3 2 1
# Rotate a sequence
node dist-tools/cli.js rotate -s "1 2 3 4 5" -n 2
# → 4 5 1 2 3
# Cyclical difference
node dist-tools/cli.js cyclical-difference -s "0 1 3 6 10"
# → 1 2 3 4 -10
# Cyclical antidifference
node dist-tools/cli.js cyclical-antidifference -s "1 2 3 4" -k 0
# → 0 1 3 6
# Difference
node dist-tools/cli.js difference -s "0 1 3 6 10"
# → 1 2 3 4
# Antidifference
node dist-tools/cli.js antidifference -s "1 2 3 4" -k 0
# → 0 1 3 6 10
# Signs
node dist-tools/cli.js signs -s "-3 0 5 -1 2"
# → -1 0 1 -1 1
# ax²+bx+c
node dist-tools/cli.js polynomial -s "0 1 2 3 4 5 6 7" -a 1 -b 1 -c 0
# → 0 2 6 4 4 6 2 0
# Cubic: x³ modulo 5 (a permutation)
node dist-tools/cli.js polynomial -s "0 1 2 3 4" -a 0 -b 0 -d 1
# → 0 1 3 2 4
# Permute blocks
node dist-tools/cli.js permute-blocks -s "1 2 3 4 5 6" -p "2 0 1"
# → 5 6 1 2 3 4
# Unary tritwise
node dist-tools/cli.js unary-tritwise -s "1 -1 0 2 -2" -o Not
# → -1 1 0 -2 2
# Hierarchical permute (CDBHP)
node dist-tools/cli.js hierarchical-permute -s "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" -c "1 2 1" -p "2 0 1"
# → 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15
# Permutation orbit
node dist-tools/cli.js permutation-orbit -s "1 2 0"
# → 3 4 -5Run node dist-tools/cli.js --help or node dist-tools/cli.js <command> --help for the full list of options.