Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

02 | Tones | 05 | Higher-Dimensional CPS

from klotho import plot
from klotho.tonos import CombinationProductSet, MasterSet
Loading...

Higher-Dimensional Interpretations

Several CPS structures have natural interpretations in 3 or more dimensions. The Hexany’s generating tetrad is actually a 2D projection of a tetrahedron. The asterisk-based master sets represent orthogonal axes in N-dimensional space.

3D views start oriented to match the 2D projection; rotate to reveal depth.

3D Tetrad / Hexany

Tetrad 3D

Regular tetrahedron. The Hexany’s generating geometry lifted into 3D.

print('GENERATING GEOMETRY: Tetrad 3D')
plot(MasterSet.tetrad_3d(), figsize=(7,7))
GENERATING GEOMETRY: Tetrad 3D
Loading...
factors = (1, 3, 5, 7)

for r in (2,):
    cps = CombinationProductSet(factors, r=r, master_set='tetrad_3d')
    n = len(cps.ratios)
    print(f'Tetrad 3D CPS  r={r}  ({n} notes)')
    if r == 2: print('  (= Hexany with this master set)')
    print('Ratios:', *[str(x) for x in cps.ratios])
    plot(cps, node_size=25, text_size=9, figsize=(8,8)).play()
    print()
Tetrad 3D CPS  r=2  (6 notes)
  (= Hexany with this master set)
Ratios: 35/32 5/4 21/16 3/2 7/4 15/8
Loading...

N-D Asterisk / Eikosany

Each spoke of the asterisk is an orthogonal axis in 5D space. MDS projects to 3D for visualization.

Asterisk N-D

5D asterisk—each spoke is an orthogonal axis.

print('GENERATING GEOMETRY: Asterisk N-D')
plot(MasterSet.asterisk_nd(), figsize=(7,7))
GENERATING GEOMETRY: Asterisk N-D
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:744: FutureWarning: The default value of `n_init` will change from 4 to 1 in 1.9. To suppress this warning, provide some value of `n_init`.
  warnings.warn(
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:754: FutureWarning: The default value of `init` will change from 'random' to 'classical_mds' in 1.10. To suppress this warning, provide some value of `init`.
  warnings.warn(
Loading...
factors = (1, 3, 5, 7, 9, 11)

for r in (2, 3):
    cps = CombinationProductSet(factors, r=r, master_set='asterisk_nd')
    n = len(cps.ratios)
    print(f'Asterisk N-D CPS  r={r}  ({n} notes)')
    if r == 2: print('  (= Pentadekany with this master set)')
    if r == 3: print('  (= Eikosany with this master set)')
    print('Ratios:', *[str(x) for x in cps.ratios])
    plot(cps, node_size=20, text_size=8, figsize=(8,8))
    print()
Asterisk N-D CPS  r=2  (15 notes)
  (= Pentadekany with this master set)
Ratios: 33/32 35/32 9/8 77/64 5/4 21/16 11/8 45/32 3/2 99/64 27/16 55/32 7/4 15/8 63/32
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:744: FutureWarning: The default value of `n_init` will change from 4 to 1 in 1.9. To suppress this warning, provide some value of `n_init`.
  warnings.warn(
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:754: FutureWarning: The default value of `init` will change from 'random' to 'classical_mds' in 1.10. To suppress this warning, provide some value of `init`.
  warnings.warn(
Loading...

Asterisk N-D CPS  r=3  (20 notes)
  (= Eikosany with this master set)
Ratios: 33/32 135/128 35/32 297/256 77/64 315/256 165/128 21/16 693/512 45/32 189/128 385/256 99/64 105/64 27/16 55/32 231/128 15/8 495/256 63/32
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:744: FutureWarning: The default value of `n_init` will change from 4 to 1 in 1.9. To suppress this warning, provide some value of `n_init`.
  warnings.warn(
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:754: FutureWarning: The default value of `init` will change from 'random' to 'classical_mds' in 1.10. To suppress this warning, provide some value of `init`.
  warnings.warn(
Loading...

N-D Ogdoad / Hebdomekontany

Ogdoad N-D

7D ogdoad—each spoke is an orthogonal axis.

print('GENERATING GEOMETRY: Ogdoad N-D')
plot(MasterSet.ogdoad_nd(), figsize=(7,7))
GENERATING GEOMETRY: Ogdoad N-D
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:744: FutureWarning: The default value of `n_init` will change from 4 to 1 in 1.9. To suppress this warning, provide some value of `n_init`.
  warnings.warn(
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:754: FutureWarning: The default value of `init` will change from 'random' to 'classical_mds' in 1.10. To suppress this warning, provide some value of `init`.
  warnings.warn(
Loading...
factors = (1, 3, 5, 7, 9, 11, 13, 17)

for r in (4,):
    cps = CombinationProductSet(factors, r=r, master_set='ogdoad_nd')
    n = len(cps.ratios)
    print(f'Ogdoad N-D CPS  r={r}  ({n} notes)')
    if r == 4: print('  (= Hebdomekontany with this master set)')
    print('Ratios:', *[str(x) for x in cps.ratios])
    plot(cps, node_size=15, text_size=5, figsize=(8,8), fit='tight')
    print()
Ogdoad N-D CPS  r=4  (70 notes)
  (= Hebdomekontany with this master set)
Ratios: 2079/2048 8415/8192 17017/16384 1071/1024 2145/2048 135/128 273/256 1105/1024 561/512 9009/8192 2295/2048 1155/1024 4641/4096 585/512 297/256 595/512 2431/2048 2457/2048 9945/8192 5005/4096 315/256 5049/4096 1287/1024 1309/1024 165/128 663/512 5355/4096 1365/1024 21879/16384 693/512 2805/2048 351/256 357/256 715/512 11781/8192 1485/1024 5967/4096 3003/2048 189/128 12155/8192 765/512 385/256 1547/1024 195/128 3213/2048 6435/4096 6545/4096 819/512 3315/2048 105/64 1683/1024 429/256 3465/2048 13923/8192 1755/1024 1785/1024 455/256 7293/4096 459/256 231/128 935/512 945/512 3861/2048 7735/4096 3927/2048 495/256 1989/1024 1001/512 255/128 4095/2048
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:744: FutureWarning: The default value of `n_init` will change from 4 to 1 in 1.9. To suppress this warning, provide some value of `n_init`.
  warnings.warn(
/Users/ryanmillett/klotho-venv/lib/python3.13/site-packages/sklearn/manifold/_mds.py:754: FutureWarning: The default value of `init` will change from 'random' to 'classical_mds' in 1.10. To suppress this warning, provide some value of `init`.
  warnings.warn(
Loading...