scgen.py :  » Media-Sound-Audio » athenaCL » athenaCL » libATH » libUtil » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Media Sound Audio » athenaCL 
athenaCL » athenaCL » libATH » libUtil » scgen.py
#-----------------------------------------------------------------||||||||||||--
#-----------------------------------------------------------------||||||||||||--

from athenaCL.libATH import SCdata# found in /athenaCL/libATH
TNMAX=SCdata.TNMAX# dictionary
TNIMAX=SCdata.TNIMAX# ref dictionary
TNREF=SCdata.TNREF# ref dcitionary
forte=SCdata.forte# classic forte table
# utility functions fr sets    
fromathenaCL.libATHSC
from athenaCL.libATH import pitchTools
transposer = pitchTools.pcTransposer
pcSetTransposer = SC.pcSetTransposer
inverter = SC.pcInverter
findNormal = SC.findNormal

# still used in text processing
import string 

#-----------------------------------------------------------------||||||||||||--
#-----------------------------------------------------------------||||||||||||--

#dictionary of slices needed to produce all trichord subsets
#slices are the same for tn and tn/i, shared in cv and cx def's below

SLICEtri   ={'tetr_1' : [(0,3), (1,4)],
             'tetr_2' : [(0,1,2,4), (0,2,3,4)], 
             'tetr_3' : [],
             'pent_1' : [(2,5)],
             'pent_2' : [(0,1,3,5), (1,2,3,5),  (0,2,4,5), (1,3,4,5)], 
             'pent_3' : [(0,1,2,3,4,5)], 
             'hex_1'  : [(3,6)],
             'hex_2'  : [(1,2,4,6), (2,3,4,6), (1,3,5,6), (2,4,5,6), (0,1,4,6), (0,2,5,6)],
             'hex_3'  : [(0,1,2,3,5,6), (1,2,3,4,5,6), (0,1,3,4,5,6)],
             'sept_1' : [(4,7)],
             'sept_2' : [(0,1,5,7), (0,2,6,7), (1,2,5,7), (2,3,5,7), (3,4,5,7), (1,3,6,7), (2,4,6,7), (3,5,6,7)],
             'sept_3' : [(0,1,2,3,6,7), (1,2,3,4,6,7), (0,1,3,4,6,7), 
                         (0,1,4,5,6,7), (1,2,4,5,6,7), (2,3,4,5,6,7)],
             'oct_1'  : [(5,8)],
             'oct_2'  : [(0,1,6,8), (0,2,7,8), (1,2,6,8), (2,3,6,8), (3,4,6,8), 
                         (4,5,6,8), (1,3,7,8), (2,4,7,8), (3,5,7,8), (4,6,7,8)],
             'oct_3'  : [(0,1,2,3,7,8), (0,1,3,4,7,8), (0,1,4,5,7,8), (0,1,5,6,7,8), (1,2,3,4,7,8), 
                         (1,2,4,5,7,8), (1,2,5,6,7,8), (2,3,4,5,7,8), (2,3,5,6,7,8), (3,4,5,6,7,8)],
             'non_1'  : [(6,9)],
             'non_2'  : [(0,1,7,9), (0,2,8,9), (1,2,7,9), (2,3,7,9), (3,4,7,9), (4,5,7,9),
                         (5,6,7,9), (1,3,8,9), (2,4,8,9), (3,5,8,9), (4,6,8,9), (5,7,8,9)],
             'non_3'  : [(0,1,2,3,8,9), (0,1,3,4,8,9), (0,1,4,5,8,9), (0,1,5,6,8,9), (0,1,6,7,8,9), 
                         (1,2,3,4,8,9), (1,2,4,5,8,9), (1,2,5,6,8,9), (1,2,6,7,8,9), (2,3,4,5,8,9), 
                         (2,3,5,6,8,9), (2,3,6,7,8,9), (3,4,5,6,8,9), (3,4,6,7,8,9), (4,5,6,7,8,9)],  
             'dec_1'  : [(7,10)],
             'dec_2'  : [(0,1,8,10), (0,2,9,10), (1,2,8,10), (2,3,8,10), (3,4,8,10), (4,5,8,10), (5,6,8,10), (6,7,8,10),
                         (1,3,9,10), (2,4,9,10), (3,5,9,10), (4,6,9,10), (5,7,9,10), (6,8,9,10)],
             'dec_3'  : [(0,1,2,3,9,10), (0,1,3,4,9,10), (0,1,4,5,9,10), (0,1,5,6,9,10), (0,1,6,7,9,10), (0,1,7,8,9,10), 
                         (1,2,3,4,9,10), (1,2,4,5,9,10), (1,2,5,6,9,10), (1,2,6,7,9,10), (1,2,7,8,9,10), 
                         (2,3,4,5,9,10), (2,3,5,6,9,10), (2,3,6,7,9,10), (2,3,7,8,9,10),
                         (3,4,5,6,9,10), (3,4,6,7,9,10), (3,4,7,8,9,10), 
                         (4,5,6,7,9,10), (4,5,7,8,9,10),
                         (5,6,7,8,9,10)],  
             'und_1'  : [(8,11)],
             'und_2'  : [(0,1,9,11), (0,2,10,11), (1,2,9,11), (2,3,9,11), (3,4,9,11), (4,5,9,11), (5,6,9,11), (6,7,9,11), (7,8,9,11),
                         (1,3,10,11), (2,4,10,11), (3,5,10,11), (4,6,10,11), (5,7,10,11), (6,8,10,11), (7,9,10,11)],
             'und_3'  : [(0,1,2,3,10,11), (0,1,3,4,10,11), (0,1,4,5,10,11), (0,1,5,6,10,11), (0,1,6,7,10,11), (0,1,7,8,10,11), (0,1,8,9,10,11), 
                         (1,2,3,4,10,11), (1,2,4,5,10,11), (1,2,5,6,10,11), (1,2,6,7,10,11), (1,2,7,8,10,11), (1,2,8,9,10,11), 
                         (2,3,4,5,10,11), (2,3,5,6,10,11), (2,3,6,7,10,11), (2,3,7,8,10,11), (2,3,8,9,10,11),
                         (3,4,5,6,10,11), (3,4,6,7,10,11), (3,4,7,8,10,11), (3,4,8,9,10,11), 
                         (4,5,6,7,10,11), (4,5,7,8,10,11), (4,5,8,9,10,11),
                         (5,6,7,8,10,11), (5,6,8,9,10,11),
                         (6,7,8,9,10,11)],  
             'dod_1'  : [(9,12)],
             'dod_2'  : [(0,1,10,12), (0,2,11,12), (1,2,10,12), (2,3,10,12), (3,4,10,12), (4,5,10,12), (5,6,10,12), (6,7,10,12), (7,8,10,12), (8,9,10,12),
                         (1,3,11,12), (2,4,11,12), (3,5,11,12), (4,6,11,12), (5,7,11,12), (6,8,11,12), (7,9,11,12), (8,10,11,12)],
             'dod_3'  : [(0,1,2,3,11,12), (0,1,3,4,11,12), (0,1,4,5,11,12), (0,1,5,6,11,12), (0,1,6,7,11,12), (0,1,7,8,11,12), (0,1,8,9,11,12), (0,1,9,10,11,12), 
                         (1,2,3,4,11,12), (1,2,4,5,11,12), (1,2,5,6,11,12), (1,2,6,7,11,12), (1,2,7,8,11,12), (1,2,8,9,11,12), (1,2,9,10,11,12), 
                         (2,3,4,5,11,12), (2,3,5,6,11,12), (2,3,6,7,11,12), (2,3,7,8,11,12), (2,3,8,9,11,12), (2,3,9,10,11,12),
                         (3,4,5,6,11,12), (3,4,6,7,11,12), (3,4,7,8,11,12), (3,4,8,9,11,12), (3,4,9,10,11,12), 
                         (4,5,6,7,11,12), (4,5,7,8,11,12), (4,5,8,9,11,12), (4,5,9,10,11,12),
                         (5,6,7,8,11,12), (5,6,8,9,11,12), (5,6,9,10,11,12),
                         (6,7,8,9,11,12), (6,7,8,9,11,12),
                         (7,8,9,10,11,12)]    
             }#####


#-------------------||||||||||||

SLICEtetr ={'pent_1' : [(0,4), (1,5)],
             'pent_2' : [(0,1,2,5), (0,2,3,5), (0,3,4,5)], 
             'pent_3' : [], 
             'hex_1'  : [(2,6)],
             'hex_2'  : [(0,3,5,6), (1,4,5,6), (0,1,3,6), (1,2,3,6), (0,2,4,6), (1,3,4,6)],
             'hex_3'  : [(0,1,2,4,5,6), (0,1,2,3,4,6), (0,2,3,4,5,6)],
             'sept_1' : [(3,7)],
             'sept_2' : [(0,3,6,7), (1,4,6,7), (2,5,6,7), (0,1,4,7), (1,2,4,7), (2,3,4,7), (0,2,5,7), (1,3,5,7), (2,4,5,7)],
             'sept_3' : [(0,2,3,4,6,7), (0,2,4,5,6,7), (0,1,2,4,6,7), (0,1,2,3,5,7),
                         (0,1,3,4,5,7), (0,1,3,5,6,7), (1,2,3,5,6,7), (1,2,3,4,5,7), (1,3,4,5,6,7)],
             'sept_4' : [(0,1,2,3,4,5,6,7)], 
             'oct_1'  : [(4,8)],
             'oct_2'  : [(0,3,7,8), (1,4,7,8), (2,5,7,8), (3,6,7,8), (0,1,5,8), (1,2,5,8), 
                         (2,3,5,8), (3,4,5,8), (0,2,6,8), (1,3,6,8), (2,4,6,8), (3,5,6,8)],
             'oct_3'  : [(0,2,3,4,7,8), (0,2,4,5,7,8), (0,2,5,6,7,8), (0,1,2,4,7,8), (0,1,3,5,7,8), (0,1,4,6,7,8), 
                         (0,1,2,3,6,8), (0,1,3,4,6,8), (0,1,4,5,6,8), (1,2,3,5,7,8), (1,2,4,6,7,8), (1,2,3,4,6,8), 
                         (1,2,4,5,6,8), (1,3,4,5,7,8), (1,3,5,6,7,8), (2,3,4,5,6,8), (2,4,5,6,7,8), (2,3,4,6,7,8)],
             'oct_4'  : [(0,1,2,3,4,5,7,8), (0,1,3,4,5,6,7,8), 
                         (1,2,3,4,5,6,7,8), (0,1,2,3,5,6,7,8)], 
             'non_1'  : [(5,9)],
             'non_2'  : [(0,3,8,9), (1,4,8,9), (2,5,8,9), (3,6,8,9), (4,7,8,9), 
                         (0,1,6,9), (1,2,6,9), (2,3,6,9), (3,4,6,9), (4,5,6,9), 
                         (0,2,7,9), (1,3,7,9), (2,4,7,9), (3,5,7,9), (4,6,7,9)],
             'non_3'  : [(0,1,2,4,8,9), (0,1,3,5,8,9), (0,1,4,6,8,9), (0,1,5,7,8,9), (0,1,2,3,7,9), (0,1,3,4,7,9), (0,1,4,5,7,9), (0,1,5,6,7,9), (0,2,3,4,8,9), (0,2,4,5,8,9),
                         (0,2,5,6,8,9), (0,2,6,7,8,9), (1,2,3,5,8,9), (1,2,4,6,8,9), (1,2,5,7,8,9), (1,2,3,4,7,9), (1,2,4,5,7,9), (1,2,5,6,7,9), (1,3,4,5,8,9), (1,3,5,6,8,9),
                         (1,3,6,7,8,9), (2,3,4,6,8,9), (2,3,5,7,8,9), (2,3,4,5,7,9), (2,3,5,6,7,9), (2,4,5,6,8,9), (2,4,6,7,8,9), (3,4,5,7,8,9), (3,4,5,6,7,9), (3,5,6,7,8,9)],  
             'non_4'  : [(0,1,2,3,4,5,8,9), (0,1,3,4,5,6,8,9), (0,1,4,5,6,7,8,9), (1,2,3,4,5,6,8,9), (1,2,4,5,6,7,8,9), 
                         (1,2,3,4,6,7,8,9), (2,3,4,5,6,7,8,9), (0,1,2,3,5,6,8,9), (0,1,2,3,6,7,8,9), (0,1,3,4,6,7,8,9)],

             'dec_1'  : [(6,10)],
             'dec_2'  : [(0,3,9,10), (1,4,9,10), (2,5,9,10), (3,6,9,10), (4,7,9,10), (5,8,9,10), 
                         (0,1,7,10), (1,2,7,10), (2,3,7,10), (3,4,7,10), (4,5,7,10), (5,6,7,10), 
                         (0,2,8,10), (1,3,8,10), (2,4,8,10), (3,5,8,10), (4,6,8,10), (5,7,8,10)],
             'dec_3'  : [(0,1,2,4,9,10), (0,1,3,5,9,10), (0,1,4,6,9,10), (0,1,5,7,9,10), (0,1,6,8,9,10), 
                         (0,1,2,3,8,10), (0,1,3,4,8,10), (0,1,4,5,8,10), (0,1,5,6,8,10), (0,1,6,7,8,10), 
                         (0,2,3,4,9,10), (0,2,4,5,9,10), (0,2,5,6,9,10), (0,2,6,7,9,10), (0,2,7,8,9,10), 
                         (1,2,3,5,9,10), (1,2,4,6,9,10), (1,2,5,7,9,10), (1,2,6,8,9,10), 
                         (1,2,3,4,8,10), (1,2,4,5,8,10), (1,2,5,6,8,10), (1,2,6,7,8,10), 
                         (1,3,4,5,9,10), (1,3,5,6,9,10), (1,3,6,7,9,10), (1,3,7,8,9,10), 
                         (2,3,4,6,9,10), (2,3,5,7,9,10), (2,3,6,8,9,10), 
                         (2,3,4,5,8,10), (2,3,5,6,8,10), (2,3,6,7,8,10), 
                         (2,4,5,6,9,10), (2,4,6,7,9,10), (2,4,7,8,9,10), 
                         (3,4,5,7,9,10), (3,4,6,8,9,10), 
                         (3,4,5,6,8,10), (3,4,6,7,8,10), 
                         (3,5,6,7,9,10), (3,5,7,8,9,10),
                         (4,5,6,8,9,10), 
                         (4,5,6,7,8,10), 
                         (4,6,7,8,9,10)],  
             'dec_4'  : [(0,1,2,3,4,5,9,10), (0,1,2,3,5,6,9,10), (0,1,2,3,6,7,9,10), (0,1,2,3,7,8,9,10), 
                         (0,1,3,4,5,6,9,10), (0,1,3,4,6,7,9,10), (0,1,3,4,7,8,9,10),
                         (0,1,4,5,6,7,9,10), (0,1,4,5,7,8,9,10), 
                         (0,1,5,6,7,8,9,10),
                         (1,2,3,4,5,6,9,10), (1,2,3,4,6,7,9,10), (1,2,3,4,7,8,9,10),
                         (1,2,4,5,6,7,9,10), (1,2,4,5,7,8,9,10), 
                         (1,2,5,6,7,8,9,10),
                         (2,3,4,5,6,7,9,10), (2,3,4,5,7,8,9,10),
                         (2,3,5,6,7,8,9,10),
                         (3,4,5,6,7,8,9,10)],
             'und_1'  : [(7,11)],
             'und_2'  : [(0,3,10,11), (1,4,10,11), (2,5,10,11), (3,6,10,11), (4,7,10,11), (5,8,10,11), (6,9,10,11), 
                         (0,1,8,11), (1,2,8,11), (2,3,8,11), (3,4,8,11), (4,5,8,11), (5,6,8,11), (6,7,8,11), 
                         (0,2,9,11), (1,3,9,11), (2,4,9,11), (3,5,9,11), (4,6,9,11), (5,7,9,11), (6,8,9,11)],
             'und_3'  : [(0,1,2,4,10,11), (0,1,3,5,10,11), (0,1,4,6,10,11), (0,1,5,7,10,11), (0,1,6,8,10,11), (0,1,7,9,10,11), 
                         (0,1,2,3,9,11),  (0,1,3,4,9,11),  (0,1,4,5,9,11),  (0,1,5,6,9,11),  (0,1,6,7,9,11),  (0,1,7,8,9,11), 
                         (0,2,3,4,10,11), (0,2,4,5,10,11), (0,2,5,6,10,11), (0,2,6,7,10,11), (0,2,7,8,10,11), (0,2,8,9,10,11), 
                         (1,2,3,5,10,11), (1,2,4,6,10,11), (1,2,5,7,10,11), (1,2,6,8,10,11), (1,2,7,9,10,11), 
                         (1,2,3,4,9,11),  (1,2,4,5,9,11),  (1,2,5,6,9,11),  (1,2,6,7,9,11),  (1,2,7,8,9,11), 
                         (1,3,4,5,10,11), (1,3,5,6,10,11), (1,3,6,7,10,11), (1,3,7,8,10,11), (1,3,8,9,10,11), 
                         (2,3,4,6,10,11), (2,3,5,7,10,11), (2,3,6,8,10,11), (2,3,7,9,10,11), 
                         (2,3,4,5,9,11),  (2,3,5,6,9,11),  (2,3,6,7,9,11),  (2,3,7,8,9,11), 
                         (2,4,5,6,10,11), (2,4,6,7,10,11), (2,4,7,8,10,11), (2,4,8,9,10,11), 
                         (3,4,5,7,10,11), (3,4,6,8,10,11), (3,4,7,9,10,11), 
                         (3,4,5,6,9,11),  (3,4,6,7,9,11),  (3,4,7,8,9,11), 
                         (3,5,6,7,10,11), (3,5,7,8,10,11), (3,5,8,9,10,11),
                         (4,5,6,8,10,11), (4,5,7,9,10,11), 
                         (4,5,6,7,9,11),  (4,5,7,8,9,11), 
                         (4,6,7,8,10,11), (4,6,8,9,10,11),
                         (5,6,7,9,10,11),
                         (5,6,7,8,9,11), 
                         (5,7,8,9,10,11)],  
             'und_4'  : [(0,1,2,3,4,5,10,11), (0,1,2,3,5,6,10,11), (0,1,2,3,6,7,10,11), (0,1,2,3,7,8,10,11), (0,1,2,3,8,9,10,11), 
                         (0,1,3,4,5,6,10,11), (0,1,3,4,6,7,10,11), (0,1,3,4,7,8,10,11), (0,1,3,4,8,9,10,11),
                         (0,1,4,5,6,7,10,11), (0,1,4,5,7,8,10,11), (0,1,4,5,8,9,10,11), 
                         (0,1,5,6,7,8,10,11), (0,1,5,6,8,9,10,11), 
                         (0,1,6,7,8,9,10,11),
                         (1,2,3,4,5,6,10,11), (1,2,3,4,6,7,10,11), (1,2,3,4,7,8,10,11), (1,2,3,4,8,9,10,11),
                         (1,2,4,5,6,7,10,11), (1,2,4,5,7,8,10,11), (1,2,4,5,8,9,10,11), 
                         (1,2,5,6,7,8,10,11), (1,2,5,6,8,9,10,11),
                         (1,2,6,7,8,9,10,11), 
                         (2,3,4,5,6,7,10,11), (2,3,4,5,7,8,10,11), (2,3,4,5,8,9,10,11),
                         (2,3,5,6,7,8,10,11), (2,3,5,6,8,9,10,11),
                         (2,3,6,7,8,9,10,11),
                         (3,4,5,6,7,8,10,11), (3,4,5,6,8,9,10,11),
                         (3,4,6,7,8,9,10,11),
                         (4,5,6,7,8,9,10,11)],
             'dod_1'  : [(8,12)],
             'dod_2'  : [(0,3,11,12), (1,4,11,12), (2,5,11,12), (3,6,11,12), (4,7,11,12), (5,8,11,12), (6,9,11,12), (7,10,11,12), 
                         (0,1,9,12),  (1,2,9,12),   (2,3,9,12), (3,4,9,12),  (4,5,9,12),  (5,6,9,12),  (6,7,9,12),  (7,8,9,12), 
                         (0,2,10,12), (1,3,10,12), (2,4,10,12), (3,5,10,12), (4,6,10,12), (5,7,10,12), (6,8,10,12), (7,9,10,12)],
             'dod_3'  : [(0,1,2,4,11,12), (0,1,3,5,11,12), (0,1,4,6,11,12), (0,1,5,7,11,12), (0,1,6,8,11,12), (0,1,7,9,11,12), (0,1,8,10,11,12), 
                         (0,1,2,3,10,12), (0,1,3,4,10,12), (0,1,4,5,10,12), (0,1,5,6,10,12), (0,1,6,7,10,12), (0,1,7,8,10,12), (0,1,8,9,10,12), 
                         (0,2,3,4,11,12), (0,2,4,5,11,12), (0,2,5,6,11,12), (0,2,6,7,11,12), (0,2,7,8,11,12), (0,2,8,9,11,12), (0,2,9,10,11,12), 
                         (1,2,3,5,11,12), (1,2,4,6,11,12), (1,2,5,7,11,12), (1,2,6,8,11,12), (1,2,7,9,11,12), (1,2,8,10,11,12), 
                         (1,2,3,4,10,12), (1,2,4,5,10,12), (1,2,5,6,10,12), (1,2,6,7,10,12), (1,2,7,8,10,12), (1,2,8,9,10,12), 
                         (1,3,4,5,11,12), (1,3,5,6,11,12), (1,3,6,7,11,12), (1,3,7,8,11,12), (1,3,8,9,11,12), (1,3,9,10,11,12), 
                         (2,3,4,6,11,12), (2,3,5,7,11,12), (2,3,6,8,11,12), (2,3,7,9,11,12), (2,3,8,10,11,12), 
                         (2,3,4,5,10,12), (2,3,5,6,10,12), (2,3,6,7,10,12), (2,3,7,8,10,12), (2,3,8,9,10,12), 
                         (2,4,5,6,11,12), (2,4,6,7,11,12), (2,4,7,8,11,12), (2,4,8,9,11,12), (2,4,9,10,11,12), 
                         (3,4,5,7,11,12), (3,4,6,8,11,12), (3,4,7,9,11,12), (3,4,8,10,11,12), 
                         (3,4,5,6,10,12), (3,4,6,7,10,12), (3,4,7,8,10,12), (3,4,8,9,10,12), 
                         (3,5,6,7,11,12), (3,5,7,8,11,12), (3,5,8,9,11,12), (3,5,9,10,11,12),
                         (4,5,6,8,11,12), (4,5,7,9,11,12), (4,5,8,10,11,12), 
                         (4,5,6,7,10,12), (4,5,7,8,10,12), (4,5,8,9,10,12), 
                         (4,6,7,8,11,12), (4,6,8,9,11,12), (4,6,9,10,11,12),
                         (5,6,7,9,11,12), (5,6,8,10,11,12),
                         (5,6,7,8,10,12), (5,6,8,9,10,12), 
                         (5,7,8,9,11,12), (5,7,9,10,11,12),
                         (6,7,8,10,11,12),
                         (6,7,8,9,10,12), 
                         (6,8,9,10,11,12)],  
             'dod_4'  : [(0,1,2,3,4,5,11,12), (0,1,2,3,5,6,11,12), (0,1,2,3,6,7,11,12), (0,1,2,3,7,8,11,12), (0,1,2,3,8,9,11,12), (0,1,2,3,9,10,11,12), 
                         (0,1,3,4,5,6,11,12), (0,1,3,4,6,7,11,12), (0,1,3,4,7,8,11,12), (0,1,3,4,8,9,11,12), (0,1,3,4,9,10,11,12),
                         (0,1,4,5,6,7,11,12), (0,1,4,5,7,8,11,12), (0,1,4,5,8,9,11,12), (0,1,4,5,9,10,11,12), 
                         (0,1,5,6,7,8,11,12), (0,1,5,6,8,9,11,12), (0,1,5,6,9,10,11,12),  
                         (0,1,6,7,8,9,11,12), (0,1,6,7,9,10,11,12),
                         (0,1,7,8,9,10,11,12), 
                         (1,2,3,4,5,6,11,12), (1,2,3,4,6,7,11,12), (1,2,3,4,7,8,11,12), (1,2,3,4,8,9,11,12), (1,2,3,4,9,10,11,12),
                         (1,2,4,5,6,7,11,12), (1,2,4,5,7,8,11,12), (1,2,4,5,8,9,11,12), (1,2,4,5,9,10,11,12), 
                         (1,2,5,6,7,8,11,12), (1,2,5,6,8,9,11,12), (1,2,5,6,9,10,11,12),
                         (1,2,6,7,8,9,11,12), (1,2,6,7,9,10,11,12),
                         (1,2,7,8,9,10,11,12),
                         (2,3,4,5,6,7,11,12), (2,3,4,5,7,8,11,12), (2,3,4,5,8,9,11,12), (2,3,4,5,9,10,11,12),
                         (2,3,5,6,7,8,11,12), (2,3,5,6,8,9,11,12), (2,3,5,6,9,10,11,12),
                         (2,3,6,7,8,9,11,12), (2,3,6,7,9,10,11,12),
                         (2,3,7,8,9,10,11,12),
                         (3,4,5,6,7,8,11,12), (3,4,5,6,8,9,11,12), (3,4,5,6,9,10,11,12),
                         (3,4,6,7,8,9,11,12), (3,4,6,7,9,10,11,12),
                         (3,4,7,8,9,10,11,12),
                         (4,5,6,7,8,9,11,12), (4,5,6,7,9,10,11,12),
                         (4,5,7,8,9,10,11,12),
                         (5,6,7,8,9,10,11,12)],
             }#####



#-------------------||||||||||||


SLICEpent  ={'hex_1'  : [(0,5), (1,6)],
             'hex_2'  : [(0,1,2,6), (0,2,3,6), (0,3,4,6), (0,4,5,6)],
             'hex_3'  : [],
             'sept_1' : [(2,7)],
             'sept_2' : [(0,4,6,7), (1,5,6,7), (0,1,3,7), (1,2,3,7), (0,2,4,7), (1,3,4,7), (0,3,5,7), (1,4,5,7)],
             'sept_3' : [(0,1,2,4,5,7), (0,2,3,5,6,7), (0,2,3,4,5,7), (0,1,2,5,6,7), (0,3,4,5,6,7), (0,1,2,3,4,7)],
             'oct_1'  : [(3,8)],
             'oct_2'  : [(0,1,4,8), (1,2,4,8), (2,5,4,8), (0,2,5,8), (1,3,5,8), (2,4,5,8), 
                         (0,3,6,8), (1,4,6,8), (2,5,6,8), (0,4,7,8), (1,5,7,8), (2,6,7,8)],
             'oct_3'  : [(0,1,2,4,6,8), (0,1,3,5,6,8), (0,2,3,5,7,8), (0,2,4,6,7,8), (0,2,3,4,6,8), (0,2,4,5,6,8), (0,1,2,5,7,8), 
                         (0,1,3,6,7,8), (0,3,4,5,7,8), (0,3,5,6,7,8), (0,1,2,3,5,8), (0,1,3,4,5,8), (1,2,3,5,6,8), (1,3,4,5,6,8), 
                         (1,3,4,6,7,8), (1,2,3,6,7,8), (1,4,5,6,7,8), (1,2,3,4,5,8)],
             'oct_4'  : [(0,1,2,3,4,5,6,8), (0,2,3,4,5,6,7,8), (0,1,2,4,5,6,7,8), (0,1,2,3,4,6,7,8)], 
             'non_1'  : [(4,9)],
             'non_2'  : [(0,1,5,9), (1,2,5,9), (2,3,5,9), (3,4,5,9), (0,2,6,9), (1,3,6,9), (2,4,6,9), (3,5,6,9), 
                         (0,3,7,9), (1,4,7,9), (2,5,7,9), (3,6,7,9), (0,4,8,9), (1,5,8,9), (2,6,8,9), (3,7,8,9)],
             'non_3'  : [(0,1,2,4,7,9), (0,1,3,5,7,9), (0,1,4,6,7,9), (0,2,3,5,8,9), (0,2,4,6,8,9), (0,2,5,7,8,9), (0,2,3,4,7,9), (0,2,4,5,7,9),
                         (0,2,5,6,7,9), (0,1,2,5,8,9), (0,1,3,6,8,9), (0,1,4,7,8,9), (0,3,4,5,8,9), (0,3,5,6,8,9), (0,3,6,7,8,9), (0,1,2,3,6,9), 
                         (0,1,3,4,6,9), (0,1,4,5,6,9), (1,2,3,5,7,9), (1,2,4,6,7,9), (1,3,4,5,7,9), (1,3,5,6,7,9), (1,3,4,6,8,9), (1,3,5,7,8,9), 
                         (1,2,3,6,8,9), (1,2,4,7,8,9), (1,4,5,6,8,9), (1,4,6,7,8,9), (1,2,3,4,6,9), (1,2,4,5,6,9), (2,3,4,5,6,9), (2,3,4,7,8,9), 
                         (2,5,6,7,8,9), (2,4,5,6,7,9), (2,3,4,6,7,9), (2,4,5,7,8,9)],  
             'non_4'  : [(0,1,2,3,4,5,7,9), (0,1,3,4,5,6,7,9), (0,1,2,3,5,6,7,9), (0,2,3,4,5,6,8,9), (0,2,4,5,6,7,8,9), (0,2,3,4,6,7,8,9), (0,1,2,4,5,6,8,9), (0,1,2,4,6,7,8,9),
                         (0,1,3,5,6,7,8,9), (0,1,2,3,4,6,8,9), (0,1,2,3,5,7,8,9), (0,1,3,4,5,7,8,9), (1,2,3,4,5,6,7,9), (1,2,3,4,5,7,8,9), (1,2,3,5,6,7,8,9), (1,3,4,5,6,7,8,9)],
             'non_5'  : [(0,1,2,3,4,5,6,7,8,9)],
             'dec_1'  : [(5,10)],
             'dec_2'  : [(0,1,6,10), (1,2,6,10), (2,3,6,10), (3,4,6,10), (4,5,6,10),     # 1 4
                         (0,2,7,10), (1,3,7,10), (2,4,7,10), (3,5,7,10), (4,6,7,10), 
                         (0,3,8,10), (1,4,8,10), (2,5,8,10), (3,6,8,10), (4,7,8,10),
                         (0,4,9,10), (1,5,9,10), (2,6,9,10), (3,7,9,10), (4,8,9,10)],

             'dec_3'  : [(0,1,2,4,8,10), (0,1,3,5,8,10), (0,1,4,6,8,10), (0,1,5,7,8,10), # 1 2 2
                         (0,2,3,5,9,10), (0,2,4,6,9,10), (0,2,5,7,9,10), (0,2,6,8,9,10),
                         (0,2,3,4,8,10), (0,2,4,5,8,10), (0,2,5,6,8,10), (0,2,6,7,8,10),
                         (0,1,2,5,9,10), (0,1,3,6,9,10), (0,1,4,7,9,10), (0,1,5,8,9,10), # 1 3 1
                         (0,3,4,5,9,10), (0,3,5,6,9,10), (0,3,6,7,9,10), (0,3,7,8,9,10),
                         (0,1,2,3,7,10), (0,1,3,4,7,10), (0,1,4,5,7,10), (0,1,5,6,7,10),
 
                         (1,2,3,5,8,10), (1,2,4,6,8,10), (1,2,5,7,8,10),
                         (1,3,4,5,8,10), (1,3,5,6,8,10), (1,3,6,7,8,10),
                         (1,3,4,6,9,10), (1,3,5,7,9,10), (1,3,6,8,9,10), 
                         (1,2,3,6,9,10), (1,2,4,7,9,10), (1,2,5,8,9,10),
                         (1,4,5,6,9,10), (1,4,6,7,9,10), (1,4,7,8,9,10),
                         (1,2,3,4,7,10), (1,2,4,5,7,10), (1,2,5,6,7,10),

                         (2,3,4,5,7,10), (2,3,5,6,7,10),
                         (2,3,4,6,8,10), (2,3,5,7,8,10),
                         (2,3,4,7,9,10), (2,3,5,8,9,10), 
                         (2,4,5,6,8,10), (2,4,6,7,8,10),
                         (2,4,5,7,9,10), (2,4,6,8,9,10),
                         (2,5,6,7,9,10), (2,5,7,8,9,10),

                         (3,4,5,6,7,10), # 1 1 3
                         (3,4,5,8,9,10), # 1 3 1
                         (3,6,7,8,9,10), # 3 1 1
                         (3,5,6,7,8,10), # 2 1 2
                         (3,4,5,7,8,10), # 1 2 2
                         (3,5,6,8,9,10)],# 2 2 1

             'dec_4'  : [(0,1,2,3,4,5,8,10), (0,1,2,3,5,6,8,10), (0,1,2,3,6,7,8,10), # 1 1 1 2
                         (0,1,3,4,5,6,8,10), (0,1,3,4,6,7,8,10),
                         (0,1,4,5,6,7,8,10), 

                         (0,1,2,4,5,6,9,10), (0,1,2,4,6,7,9,10), (0,1,2,4,7,8,9,10),
                         (0,1,3,5,6,7,9,10), (0,1,3,5,7,8,9,10),
                         (0,1,4,6,7,8,9,10),
 
                         (0,1,2,3,4,6,9,10), (0,1,2,3,5,7,9,10), (0,1,2,3,6,8,9,10),
                         (0,1,3,4,5,7,9,10), (0,1,3,4,6,8,9,10),
                         (0,1,4,5,6,8,9,10),
 
                         (0,2,3,4,5,6,9,10), (0,2,3,4,6,7,9,10), (0,2,3,4,7,8,9,10),
                         (0,2,4,5,6,7,9,10), (0,2,4,5,7,8,9,10),
                         (0,2,5,6,7,8,9,10), 
 
                         (1,2,3,4,5,6,8,10), (1,2,3,4,6,7,8,10), 
                         (1,2,4,5,6,7,8,10), 
 
                         (1,2,3,4,5,7,9,10), (1,2,3,4,6,8,9,10),
                         (1,2,4,5,6,8,9,10),
                         
                         (1,2,3,5,6,7,9,10), (1,2,3,5,7,8,9,10),
                         (1,2,4,6,7,8,9,10),

                         (1,3,4,5,6,7,9,10), (1,3,4,5,7,8,9,10),
                         (1,3,5,6,7,8,9,10),

                         (2,3,4,5,6,7,8,10),
                         (2,3,4,5,6,8,9,10),
                         (2,3,4,6,7,8,9,10),
                         (2,4,5,6,7,8,9,10)],


             'dec_5'  : [(0,1,2,3,4,5,6,7,9,10),
                         (0,1,2,3,4,5,7,8,9,10),
                         (0,1,2,3,5,6,7,8,9,10),
                         (0,1,3,4,5,6,7,8,9,10),
                         (1,2,3,4,5,6,7,8,9,10)],


             'und_1'  : [(6,11)],
             'und_2'  : [(0,1,7,11), (1,2,7,11), (2,3,7,11), (3,4,7,11), (4,5,7,11), (5,6,7,11),     # 1 4
                         (0,2,8,11), (1,3,8,11), (2,4,8,11), (3,5,8,11), (4,6,8,11), (5,7,8,11), 
                         (0,3,9,11), (1,4,9,11), (2,5,9,11), (3,6,9,11), (4,7,9,11), (5,8,9,11),
                         (0,4,10,11), (1,5,10,11), (2,6,10,11), (3,7,10,11), (4,8,10,11), (5,9,10,11)],

             'und_3'  : [(0,1,2,4,9,11),  (0,1,3,5,9,11),  (0,1,4,6,9,11),  (0,1,5,7,9,11),  (0,1,6,8,9,11), # 1 2 2
                         (0,2,3,5,10,11), (0,2,4,6,10,11), (0,2,5,7,10,11), (0,2,6,8,10,11), (0,2,7,9,10,11),
                         (0,2,3,4,9,11),  (0,2,4,5,9,11),  (0,2,5,6,9,11),  (0,2,6,7,9,11),  (0,2,7,8,9,11),
                         (0,1,2,5,10,11), (0,1,3,6,10,11), (0,1,4,7,10,11), (0,1,5,8,10,11), (0,1,6,9,10,11), # 1 3 1
                         (0,3,4,5,10,11), (0,3,5,6,10,11), (0,3,6,7,10,11), (0,3,7,8,10,11), (0,3,8,9,10,11),
                         (0,1,2,3,8,11),  (0,1,3,4,8,11),  (0,1,4,5,8,11),  (0,1,5,6,8,11),  (0,1,6,7,8,11),
 
                         (1,2,3,5,9,11),  (1,2,4,6,9,11),  (1,2,5,7,9,11),  (1,2,6,8,9,11),
                         (1,3,4,5,9,11),  (1,3,5,6,9,11),  (1,3,6,7,9,11),  (1,3,7,8,9,11),
                         (1,3,4,6,10,11), (1,3,5,7,10,11), (1,3,6,8,10,11), (1,3,7,9,10,11),
                         (1,2,3,6,10,11), (1,2,4,7,10,11), (1,2,5,8,10,11), (1,2,6,9,10,11),
                         (1,4,5,6,10,11), (1,4,6,7,10,11), (1,4,7,8,10,11), (1,4,8,9,10,11),
                         (1,2,3,4,8,11),  (1,2,4,5,8,11),  (1,2,5,6,8,11),  (1,2,6,7,8,11),

                         (2,3,4,5,8,11),  (2,3,5,6,8,11),  (2,3,6,7,8,11),
                         (2,3,4,6,9,11),  (2,3,5,7,9,11),  (2,3,6,8,9,11),
                         (2,3,4,7,10,11), (2,3,5,8,10,11), (2,3,6,9,10,11),  
                         (2,4,5,6,9,11),  (2,4,6,7,9,11),  (2,4,7,8,9,11),
                         (2,4,5,7,10,11), (2,4,6,8,10,11), (2,4,7,9,10,11),
                         (2,5,6,7,10,11), (2,5,7,8,10,11), (2,5,8,9,10,11),

                         (3,4,5,6,8,11),  (3,4,6,7,8,11),  # 1 1 3
                         (3,4,5,8,10,11), (3,4,6,9,10,11), # 1 3 1
                         (3,6,7,8,10,11), (3,6,8,9,10,11), # 3 1 1
                         (3,5,6,7,9,11),  (3,5,7,8,9,11),  # 2 1 2
                         (3,4,5,7,9,11),  (3,4,6,8,9,11),  # 1 2 2
                         (3,5,6,8,10,11), (3,5,7,9,10,11), # 2 2 1

                         (4,5,6,7,8,11),  # 1 1 3
                         (4,5,6,9,10,11), # 1 3 1
                         (4,7,8,9,10,11), # 3 1 1
                         (4,6,7,8,9,11),  # 2 1 2
                         (4,5,6,8,9,11),  # 1 2 2
                         (4,6,7,9,10,11)],# 2 2 1

             'und_4'  : [(0,1,2,3,4,5,9,11), (0,1,2,3,5,6,9,11), (0,1,2,3,6,7,9,11), (0,1,2,3,7,8,9,11), # 1 1 1 2
                         (0,1,3,4,5,6,9,11), (0,1,3,4,6,7,9,11), (0,1,3,4,7,8,9,11),
                         (0,1,4,5,6,7,9,11), (0,1,4,5,7,8,9,11),
                         (0,1,5,6,7,8,9,11), 

                         (0,1,2,4,5,6,10,11), (0,1,2,4,6,7,10,11), (0,1,2,4,7,8,10,11), (0,1,2,4,8,9,10,11),
                         (0,1,3,5,6,7,10,11), (0,1,3,5,7,8,10,11), (0,1,3,5,8,9,10,11),
                         (0,1,4,6,7,8,10,11), (0,1,4,6,8,9,10,11),
                         (0,1,5,7,8,9,10,11),
 
                         (0,1,2,3,4,6,10,11), (0,1,2,3,5,7,10,11), (0,1,2,3,6,8,10,11), (0,1,2,3,7,9,10,11),
                         (0,1,3,4,5,7,10,11), (0,1,3,4,6,8,10,11), (0,1,3,4,7,9,10,11),
                         (0,1,4,5,6,8,10,11), (0,1,4,5,7,9,10,11),
                         (0,1,5,6,7,9,10,11),
 
                         (0,2,3,4,5,6,10,11), (0,2,3,4,6,7,10,11), (0,2,3,4,7,8,10,11), (0,2,3,4,8,9,10,11),
                         (0,2,4,5,6,7,10,11), (0,2,4,5,7,8,10,11), (0,2,4,5,8,9,10,11),
                         (0,2,5,6,7,8,10,11), (0,2,5,6,8,9,10,11),
                         (0,2,6,7,8,9,10,11), 
 
                         (1,2,3,4,5,6,9,11), (1,2,3,4,6,7,9,11), (1,2,3,4,7,8,9,11),  
                         (1,2,4,5,6,7,9,11), (1,2,4,5,7,8,9,11),
                         (1,2,5,6,7,8,9,11), 
 
                         (1,2,3,4,5,7,10,11), (1,2,3,4,6,8,10,11), (1,2,3,4,7,9,10,11),
                         (1,2,4,5,6,8,10,11), (1,2,4,5,7,9,10,11),
                         (1,2,5,6,7,9,10,11),
                         
                         (1,2,3,5,6,7,10,11), (1,2,3,5,7,8,10,11), (1,2,3,5,8,9,10,11),
                         (1,2,4,6,7,8,10,11), (1,2,4,6,8,9,10,11),
                         (1,2,5,7,8,9,10,11),

                         (1,3,4,5,6,7,10,11), (1,3,4,5,7,8,10,11), (1,3,4,5,8,9,10,11),
                         (1,3,5,6,7,8,10,11), (1,3,5,6,8,9,10,11),
                         (1,3,6,7,8,9,10,11),

                         (2,3,4,5,6,7,9,11), (2,3,4,5,7,8,9,11),
                         (2,3,5,6,7,8,9,11),

                         (2,3,4,5,6,8,10,11), (2,3,4,5,7,9,10,11),
                         (2,3,5,6,7,9,10,11),

                         (2,3,4,6,7,8,10,11), (2,3,4,6,8,9,10,11),
                         (2,3,5,7,8,9,10,11),

                         (2,4,5,6,7,8,10,11), (2,4,5,6,8,9,10,11),
                         (2,4,6,7,8,9,10,11),

                         (3,4,5,6,7,8,9,11),
                         (3,4,5,6,7,9,10,11),
                         (3,4,5,7,8,9,10,11),
                         (3,5,6,7,8,9,10,11)],

             'und_5'  : [(0,1,2,3,4,5,6,7,10,11), (0,1,2,3,4,5,7,8,10,11), (0,1,2,3,4,5,8,9,10,11),
                         (0,1,2,3,5,6,7,8,10,11), (0,1,2,3,5,6,8,9,10,11),
                         (0,1,2,3,6,7,8,9,10,11),

                         (0,1,3,4,5,6,7,8,10,11), (0,1,3,4,5,6,8,9,10,11),
                         (0,1,3,4,6,7,8,9,10,11),

                         (0,1,4,5,6,7,8,9,10,11),

                         (1,2,3,4,5,6,7,8,10,11), (1,2,3,4,5,6,8,9,10,11),
                         (1,2,3,4,6,7,8,9,10,11),

                         (1,2,4,5,6,7,8,9,10,11),

                         (2,3,4,5,6,7,8,9,10,11)],

             'dod_1'  : [(7,12)],
             'dod_2'  : [(0,1,8,12), (1,2,8,12), (2,3,8,12), (3,4,8,12), (4,5,8,12), (5,6,8,12), (6,7,8,12),     # 1 4
                         (0,2,9,12), (1,3,9,12), (2,4,9,12), (3,5,9,12), (4,6,9,12), (5,7,9,12), (6,8,9,12), 
                         (0,3,10,12), (1,4,10,12), (2,5,10,12), (3,6,10,12), (4,7,10,12), (5,8,10,12), (6,9,10,12),
                         (0,4,11,12), (1,5,11,12), (2,6,11,12), (3,7,11,12), (4,8,11,12), (5,9,11,12), (6,10,11,12)],

             'dod_3'  : [(0,1,2,4,10,12), (0,1,3,5,10,12), (0,1,4,6,10,12), (0,1,5,7,10,12), (0,1,6,8,10,12), (0,1,7,9,10,12), # 1 2 2
                         (0,2,3,5,11,12), (0,2,4,6,11,12), (0,2,5,7,11,12), (0,2,6,8,11,12), (0,2,7,9,11,12), (0,2,8,10,11,12),
                         (0,2,3,4,10,12), (0,2,4,5,10,12), (0,2,5,6,10,12), (0,2,6,7,10,12), (0,2,7,8,10,12), (0,2,8,9,10,12),
                         (0,1,2,5,11,12), (0,1,3,6,11,12), (0,1,4,7,11,12), (0,1,5,8,11,12), (0,1,6,9,11,12), (0,1,7,10,11,12),  # 1 3 1
                         (0,3,4,5,11,12), (0,3,5,6,11,12), (0,3,6,7,11,12), (0,3,7,8,11,12), (0,3,8,9,11,12), (0,3,9,10,11,12),
                         (0,1,2,3,9,12),  (0,1,3,4,9,12),  (0,1,4,5,9,12),  (0,1,5,6,9,12),  (0,1,6,7,9,12),  (0,1,7,8,9,12),
 
                         (1,2,3,5,10,12), (1,2,4,6,10,12), (1,2,5,7,10,12), (1,2,6,8,10,12), (1,2,7,9,10,12),
                         (1,3,4,5,10,12), (1,3,5,6,10,12), (1,3,6,7,10,12), (1,3,7,8,10,12), (1,3,8,9,10,12),
                         (1,3,4,6,11,12), (1,3,5,7,11,12), (1,3,6,8,11,12), (1,3,7,9,11,12), (1,3,8,10,11,12),
                         (1,2,3,6,11,12), (1,2,4,7,11,12), (1,2,5,8,11,12), (1,2,6,9,11,12), (1,2,7,10,11,12),
                         (1,4,5,6,11,12), (1,4,6,7,11,12), (1,4,7,8,11,12), (1,4,8,9,11,12), (1,4,9,10,11,12),
                         (1,2,3,4,9,12),  (1,2,4,5,9,12),  (1,2,5,6,9,12),  (1,2,6,7,9,12),  (1,2,7,8,9,12),

                         (2,3,4,5,9,12),  (2,3,5,6,9,12),  (2,3,6,7,9,12),  (2,3,7,8,9,12),
                         (2,3,4,6,10,12), (2,3,5,7,10,12), (2,3,6,8,10,12), (2,3,7,9,10,12),
                         (2,3,4,7,11,12), (2,3,5,8,11,12), (2,3,6,9,11,12), (2,3,7,10,11,12),  
                         (2,4,5,6,10,12), (2,4,6,7,10,12), (2,4,7,8,10,12), (2,4,8,9,10,12),
                         (2,4,5,7,11,12), (2,4,6,8,11,12), (2,4,7,9,11,12), (2,4,8,10,11,12),
                         (2,5,6,7,11,12), (2,5,7,8,11,12), (2,5,8,9,11,12), (2,5,9,10,11,12),

                         (3,4,5,6,9,12),  (3,4,6,7,9,12),  (3,4,7,8,9,12),  # 1 1 3
                         (3,4,5,8,11,12), (3,4,6,9,11,12), (3,4,7,10,11,12), # 1 3 1
                         (3,6,7,8,11,12), (3,6,8,9,11,12), (3,6,9,10,11,12),# 3 1 1
                         (3,5,6,7,10,12), (3,5,7,8,10,12), (3,5,8,9,10,12),  # 2 1 2
                         (3,4,5,7,10,12), (3,4,6,8,10,12), (3,4,7,9,10,12),  # 1 2 2
                         (3,5,6,8,11,12), (3,5,7,9,11,12), (3,5,8,10,11,12), # 2 2 1

                         (4,5,6,7,9,12),  (4,5,7,8,9,12),  # 1 1 3
                         (4,5,6,9,11,12), (4,5,7,10,11,12), # 1 3 1
                         (4,7,8,9,11,12), (4,7,9,10,11,12), # 3 1 1
                         (4,6,7,8,10,12), (4,6,8,9,10,12),  # 2 1 2
                         (4,5,6,8,10,12), (4,5,7,9,10,12),  # 1 2 2
                         (4,6,7,9,11,12), (4,6,8,10,11,12), # 2 2 1

                         (5,6,7,8,9,12),   # 1 1 3
                         (5,6,7,10,11,12), # 1 3 1
                         (5,8,9,10,11,12), # 3 1 1
                         (5,7,8,9,10,12),  # 2 1 2
                         (5,6,7,9,10,12),  # 1 2 2
                         (5,7,8,10,11,12)],# 2 2 1
                                                            
             'dod_4'  : [(0,1,2,3,4,5,10,12), (0,1,2,3,5,6,10,12), (0,1,2,3,6,7,10,12), (0,1,2,3,7,8,10,12), (0,1,2,3,8,9,10,12), # 1 1 1 2
                         (0,1,3,4,5,6,10,12), (0,1,3,4,6,7,10,12), (0,1,3,4,7,8,10,12), (0,1,3,4,8,9,10,12),
                         (0,1,4,5,6,7,10,12), (0,1,4,5,7,8,10,12), (0,1,4,5,8,9,10,12),
                         (0,1,5,6,7,8,10,12), (0,1,5,6,8,9,10,12),
                         (0,1,6,7,8,9,10,12), 
                         (0,1,2,4,5,6,11,12), (0,1,2,4,6,7,11,12), (0,1,2,4,7,8,11,12), (0,1,2,4,8,9,11,12), (0,1,2,4,9,10,11,12),
                         (0,1,3,5,6,7,11,12), (0,1,3,5,7,8,11,12), (0,1,3,5,8,9,11,12), (0,1,3,5,9,10,11,12),
                         (0,1,4,6,7,8,11,12), (0,1,4,6,8,9,11,12), (0,1,4,6,9,10,11,12),
                         (0,1,5,7,8,9,11,12), (0,1,5,7,9,10,11,12),
                         (0,1,6,8,9,10,11,12),
                         (0,1,2,3,4,6,11,12), (0,1,2,3,5,7,11,12), (0,1,2,3,6,8,11,12), (0,1,2,3,7,9,11,12), (0,1,2,3,8,10,11,12),
                         (0,1,3,4,5,7,11,12), (0,1,3,4,6,8,11,12), (0,1,3,4,7,9,11,12), (0,1,3,4,8,10,11,12),
                         (0,1,4,5,6,8,11,12), (0,1,4,5,7,9,11,12), (0,1,4,5,8,10,11,12),
                         (0,1,5,6,7,9,11,12), (0,1,5,6,8,10,11,12),
                         (0,1,6,7,8,10,11,12),
                         (0,2,3,4,5,6,11,12), (0,2,3,4,6,7,11,12), (0,2,3,4,7,8,11,12), (0,2,3,4,8,9,11,12), (0,2,3,4,9,10,11,12),
                         (0,2,4,5,6,7,11,12), (0,2,4,5,7,8,11,12), (0,2,4,5,8,9,11,12), (0,2,4,5,9,10,11,12),
                         (0,2,5,6,7,8,11,12), (0,2,5,6,8,9,11,12), (0,2,5,6,9,10,11,12),
                         (0,2,6,7,8,9,11,12), (0,2,6,7,9,10,11,12),
                         (0,2,7,8,9,10,11,12), 
 
                         (1,2,3,4,5,6,10,12), (1,2,3,4,6,7,10,12), (1,2,3,4,7,8,10,12), (1,2,3,4,8,9,10,12),  
                         (1,2,4,5,6,7,10,12), (1,2,4,5,7,8,10,12), (1,2,4,5,8,9,10,12),
                         (1,2,5,6,7,8,10,12), (1,2,5,6,8,9,10,12),
                         (1,2,6,7,8,9,10,12),
                         (1,2,3,4,5,7,11,12), (1,2,3,4,6,8,11,12), (1,2,3,4,7,9,11,12), (1,2,3,4,8,10,11,12),
                         (1,2,4,5,6,8,11,12), (1,2,4,5,7,9,11,12), (1,2,4,5,8,10,11,12),
                         (1,2,5,6,7,9,11,12), (1,2,5,6,8,10,11,12),
                         (1,2,6,7,8,10,11,12),
                         (1,2,3,5,6,7,11,12), (1,2,3,5,7,8,11,12), (1,2,3,5,8,9,11,12), (1,2,3,5,9,10,11,12),
                         (1,2,4,6,7,8,11,12), (1,2,4,6,8,9,11,12), (1,2,4,6,9,10,11,12),
                         (1,2,5,7,8,9,11,12), (1,2,5,7,9,10,11,12),
                         (1,2,6,8,9,10,11,12),
                         (1,3,4,5,6,7,11,12), (1,3,4,5,7,8,11,12), (1,3,4,5,8,9,11,12), (1,3,4,5,9,10,11,12),
                         (1,3,5,6,7,8,11,12), (1,3,5,6,8,9,11,12), (1,3,5,6,9,10,11,12),
                         (1,3,6,7,8,9,11,12), (1,3,6,7,9,10,11,12),
                         (1,3,7,8,9,10,11,12),

                         (2,3,4,5,6,7,10,12), (2,3,4,5,7,8,10,12), (2,3,4,5,8,9,10,12),
                         (2,3,5,6,7,8,10,12), (2,3,5,6,8,9,10,12),
                         (2,3,6,7,8,9,10,12),
                         (2,3,4,5,6,8,11,12), (2,3,4,5,7,9,11,12), (2,3,4,5,8,10,11,12),
                         (2,3,5,6,7,9,11,12), (2,3,5,6,8,10,11,12),
                         (2,3,6,7,8,10,11,12),
                         (2,3,4,6,7,8,11,12), (2,3,4,6,8,9,11,12), (2,3,4,6,9,10,11,12),
                         (2,3,5,7,8,9,11,12), (2,3,5,7,9,10,11,12),
                         (2,3,6,8,9,10,11,12),
                         (2,4,5,6,7,8,11,12), (2,4,5,6,8,9,11,12), (2,4,5,6,9,10,11,12),
                         (2,4,6,7,8,9,11,12), (2,4,6,7,9,10,11,12),
                         (2,4,7,8,9,10,11,12),

                         (3,4,5,6,7,8,10,12), (3,4,5,6,8,9,10,12),
                         (3,4,6,7,8,9,10,12),
                         (3,4,5,6,7,9,11,12), (3,4,5,6,8,10,11,12),
                         (3,4,6,7,8,10,11,12),
                         (3,4,5,7,8,9,11,12), (3,4,5,7,9,10,11,12),
                         (3,4,6,8,9,10,11,12),
                         (3,5,6,7,8,9,11,12), (3,5,6,7,9,10,11,12),
                         (3,5,7,8,9,10,11,12),

                         (4,5,6,7,8,9,10,12),
                         (4,5,6,7,8,10,11,12),
                         (4,5,6,8,9,10,11,12),
                         (4,6,7,8,9,10,11,12)],


             'dod_5'  : [(0,1,2,3,4,5,6,7,11,12), (0,1,2,3,4,5,7,8,11,12), (0,1,2,3,4,5,8,9,11,12), (0,1,2,3,4,5,9,10,11,12),
                         (0,1,2,3,5,6,7,8,11,12), (0,1,2,3,5,6,8,9,11,12), (0,1,2,3,5,6,9,10,11,12),
                         (0,1,2,3,6,7,8,9,11,12), (0,1,2,3,6,7,9,10,11,12),
                         (0,1,2,3,7,8,9,10,11,12),
                         (0,1,3,4,5,6,7,8,11,12), (0,1,3,4,5,6,8,9,11,12), (0,1,3,4,5,6,9,10,11,12),
                         (0,1,3,4,6,7,8,9,11,12), (0,1,3,4,6,7,9,10,11,12),
                         (0,1,3,4,7,8,9,10,11,12),
                         (0,1,4,5,6,7,8,9,11,12), (0,1,4,5,6,7,9,10,11,12),
                         (0,1,4,5,7,8,9,10,11,12),

                         (0,1,5,6,7,8,9,10,11,12),

                         (1,2,3,4,5,6,7,8,11,12), (1,2,3,4,5,6,8,9,11,12), (1,2,3,4,5,6,9,10,11,12),
                         (1,2,3,4,6,7,8,9,11,12), (1,2,3,4,6,7,9,10,11,12),
                         (1,2,3,4,7,8,9,10,11,12),
                         (1,2,4,5,6,7,8,9,11,12), (1,2,4,5,6,7,9,10,11,12),
                         (1,2,4,5,7,8,9,10,11,12),

                         (1,2,5,6,7,8,9,10,11,12),

                         (2,3,4,5,6,7,8,9,11,12), (2,3,4,5,6,7,9,10,11,12),
                         (2,3,4,5,7,8,9,10,11,12),

                         (2,3,5,6,7,8,9,10,11,12),

                         (3,4,5,6,7,8,9,10,11,12)],
             }#####

#-------------------||||||||||||
SLICEhex  ={ 'sept_1' : [(0,6), (1,7)],
             'sept_2' : [(0,1,2,7), (0,2,3,7), (0,3,4,7), (0,4,5,7), (0,5,6,7)],
             'oct_1'  : [(2,8)],
             'oct_2'  : [(0,1,3,8), (1,2,3,8), (0,2,4,8), (1,3,4,8), (0,3,5,8), (1,4,5,8), (0,4,6,8), (1,5,6,8), (0,5,7,8), (1,6,7,8)],
             'oct_3'  : [(0,1,2,4,5,8), (0,1,2,5,6,8), (0,2,3,4,5,8), (0,2,3,6,7,8), (0,3,4,5,6,8), (0,3,4,6,7,8), (0,4,5,6,7,8), (0,1,2,6,7,8), (0,1,2,3,4,8), (0,2,3,5,6,8)],

             'non_1'  : [(3,9)],
             'non_2'  : [(0,1,4,9), (1,2,4,9), (2,3,4,9), (0,2,5,9), (1,3,5,9), (2,4,5,9), (0,3,6,9), (1,4,6,9), 
                         (2,5,6,9), (0,4,7,9), (1,5,7,9), (2,6,7,9), (0,5,8,9), (1,6,8,9), (2,7,8,9)],
             'non_3'  : [(0,1,2,4,6,9), (0,1,3,5,6,9), (0,1,2,5,7,9), (0,1,3,6,7,9), (0,2,3,4,6,9), (0,2,4,5,6,9), 
                         (0,2,3,6,8,9), (0,2,4,7,8,9), (0,3,4,5,7,9), (0,3,5,6,7,9), (0,3,4,6,8,9), (0,3,5,7,8,9),
                         (0,4,5,6,8,9), (0,4,6,7,8,9), (0,1,2,6,8,9), (0,1,3,7,8,9), (0,1,2,3,5,9), (0,1,3,4,5,9),
                         (0,2,3,5,7,9), (0,2,4,6,7,9), (1,2,3,5,6,9), (1,2,3,6,7,9), (1,4,5,7,8,9), (1,4,5,6,7,9), 
                         (1,3,4,5,6,9), (1,3,4,7,8,9), (1,5,6,7,8,9), (1,2,3,7,8,9), (1,2,3,4,5,9), (1,3,4,6,7,9)],  
             'non_4'  : [(0,1,2,3,4,5,6,9), (0,1,2,3,4,7,8,9), (0,1,2,5,6,7,8,9), (0,3,4,5,6,7,8,9), (0,1,2,3,4,6,7,9), 
                         (0,1,2,4,5,6,7,9), (0,2,3,4,5,7,8,9), (0,2,3,5,6,7,8,9), (0,2,3,4,5,6,7,9), (0,1,2,4,5,7,8,9)],
              ##### total_new partitions == 126
             'dec_1'  : [(4,10)],
             'dec_2'  : [(0,1,5,10), (1,2,5,10), (2,3,5,10), (3,4,5,10),
                         (0,2,6,10), (1,3,6,10), (2,4,6,10), (3,5,6,10),
                         (0,3,7,10), (1,4,7,10), (2,5,7,10), (3,6,7,10),  
                         (0,4,8,10), (1,5,8,10), (2,6,8,10), (3,7,8,10),
                         (0,5,9,10), (1,6,9,10), (2,7,9,10), (3,8,9,10)],   ### 1 + 20

             'dec_3'  : [(0,1,2,4,7,10), (0,1,3,5,7,10), (0,1,4,6,7,10),
                         (0,1,2,5,8,10), (0,1,3,6,8,10), (0,1,4,7,8,10),
                         (0,2,3,4,7,10), (0,2,4,5,7,10), (0,2,5,6,7,10), 
                         (0,2,3,6,9,10), (0,2,4,7,9,10), (0,2,5,8,9,10),
                         (0,3,4,5,8,10), (0,3,5,6,8,10), (0,3,6,7,8,10),
                         (0,3,4,6,9,10), (0,3,5,7,9,10), (0,3,6,8,9,10),
                         (0,4,5,6,9,10), (0,4,6,7,9,10), (0,4,7,8,9,10),  
                         (0,1,2,6,9,10), (0,1,3,7,9,10), (0,1,4,8,9,10),
                         (0,1,2,3,6,10), (0,1,3,4,6,10), (0,1,4,5,6,10),
                         (0,2,3,5,8,10), (0,2,4,6,8,10), (0,2,5,7,8,10),   ### 30

                         (1,2,3,5,7,10), (1,2,4,6,7,10),
                         (1,2,3,6,8,10), (1,2,4,7,8,10),
                         (1,4,5,7,9,10), (1,4,6,8,9,10),
                         (1,4,5,6,8,10), (1,4,6,7,8,10), 
                         (1,3,4,5,7,10), (1,3,5,6,7,10),
                         (1,3,4,7,9,10), (1,3,5,8,9,10),
                         (1,5,6,7,9,10), (1,5,7,8,9,10),
                         (1,2,3,7,9,10), (1,2,4,8,9,10),
                         (1,2,3,4,6,10), (1,2,4,5,6,10),
                         (1,3,4,6,8,10), (1,3,5,7,8,10),    ### 20

                         (2,3,4,6,7,10),
                         (2,3,4,7,8,10),
                         (2,5,6,8,9,10),
                         (2,5,6,7,8,10), 
                         (2,4,5,6,7,10),
                         (2,4,5,8,9,10),
                         (2,6,7,8,9,10),
                         (2,3,4,8,9,10),
                         (2,3,4,5,6,10),
                         (2,4,5,7,8,10)    ### 10, # 81
                         ],   
  
             'dec_4'  : [(0,1,2,3,4,5,7,10), (0,1,2,3,5,6,7,10),
                         (0,1,3,4,5,6,7,10),
                         (0,1,2,3,4,7,9,10), (0,1,2,3,5,8,9,10),
                         (0,1,3,4,5,8,9,10),
                         (0,1,2,5,6,7,9,10), (0,1,2,5,7,8,9,10),
                         (0,1,3,6,7,8,9,10),
                         (0,3,4,5,6,7,9,10), (0,3,4,5,7,8,9,10),
                         (0,3,5,6,7,8,9,10),
                         (0,1,2,3,4,6,8,10), (0,1,2,3,5,7,8,10),
                         (0,1,3,4,5,7,8,10),
                         (0,1,2,4,5,6,8,10), (0,1,2,4,6,7,8,10),
                         (0,1,3,5,6,7,8,10),
                         (0,2,3,4,5,7,9,10), (0,2,3,4,6,8,9,10),
                         (0,2,4,5,6,8,9,10),
                         (0,2,3,5,6,7,9,10), (0,2,3,5,7,8,9,10),
                         (0,2,4,6,7,8,9,10),
                         (0,2,3,4,5,6,8,10), (0,2,3,4,6,7,8,10),
                         (0,2,4,5,6,7,8,10),
                         (0,1,2,4,5,7,9,10), (0,1,2,4,6,8,9,10),
                         (0,1,3,5,6,8,9,10),                       ###30

                         (1,2,3,4,5,6,7,10),
                         (1,2,3,4,5,8,9,10),
                         (1,2,3,6,7,8,9,10),
                         (1,4,5,6,7,8,9,10),
                         (1,2,3,4,5,7,8,10),
                         (1,2,3,5,6,7,8,10),
                         (1,3,4,5,6,8,9,10),
                         (1,3,4,6,7,8,9,10),
                         (1,3,4,5,6,7,8,10),
                         (1,2,3,5,6,8,9,10)                   ###10, #121
                         ],

             'dec_5'  : [(0,1,2,3,4,5,6,7,8,10),
                         (0,1,2,3,4,5,6,8,9,10),
                         (0,1,2,3,4,6,7,8,9,10),
                         (0,1,2,4,5,6,7,8,9,10),
                         (0,2,3,4,5,6,7,8,9,10),              ### 5, 126
                         ],
              ##### total_new partitions == 252
             'und_1'  : [(5,11)],
             'und_2'  : [(0,1,6,11), (1,2,6,11), (2,3,6,11), (3,4,6,11), (4,5,6,11),
                         (0,2,7,11), (1,3,7,11), (2,4,7,11), (3,5,7,11), (4,6,7,11),
                         (0,3,8,11), (1,4,8,11), (2,5,8,11), (3,6,8,11), (4,7,8,11),  
                         (0,4,9,11), (1,5,9,11), (2,6,9,11), (3,7,9,11), (4,8,9,11),
                         (0,5,10,11), (1,6,10,11), (2,7,10,11), (3,8,10,11), (4,9,10,11)],   ### 1 + 25

             'und_3'  : [(0,1,2,4,8,11),  (0,1,3,5,8,11),  (0,1,4,6,8,11),  (0,1,5,7,8,11),
                         (0,1,2,5,9,11),  (0,1,3,6,9,11),  (0,1,4,7,9,11),  (0,1,5,8,9,11),
                         (0,2,3,4,8,11),  (0,2,4,5,8,11),  (0,2,5,6,8,11),  (0,2,6,7,8,11), 
                         (0,2,3,6,10,11), (0,2,4,7,10,11), (0,2,5,8,10,11), (0,2,6,9,10,11),
                         (0,3,4,5,9,11),  (0,3,5,6,9,11),  (0,3,6,7,9,11),  (0,3,7,8,9,11),
                         (0,3,4,6,10,11), (0,3,5,7,10,11), (0,3,6,8,10,11), (0,3,7,9,10,11),
                         (0,4,5,6,10,11), (0,4,6,7,10,11), (0,4,7,8,10,11), (0,4,8,9,10,11),  
                         (0,1,2,6,10,11), (0,1,3,7,10,11), (0,1,4,8,10,11), (0,1,5,9,10,11),
                         (0,1,2,3,7,11),  (0,1,3,4,7,11),  (0,1,4,5,7,11),  (0,1,5,6,7,11),
                         (0,2,3,5,9,11),  (0,2,4,6,9,11),  (0,2,5,7,9,11),  (0,2,6,8,9,11),   ### 40

                         (1,2,3,5,8,11),  (1,2,4,6,8,11),  (1,2,5,7,8,11),
                         (1,2,3,6,9,11),  (1,2,4,7,9,11),  (1,2,5,8,9,11),
                         (1,4,5,7,10,11), (1,4,6,8,10,11), (1,4,7,9,10,11),
                         (1,4,5,6,9,11),  (1,4,6,7,9,11),  (1,4,7,8,9,11), 
                         (1,3,4,5,8,11),  (1,3,5,6,8,11),  (1,3,5,6,8,11),
                         (1,3,4,7,10,11), (1,3,5,8,10,11), (1,3,6,9,10,11),
                         (1,5,6,7,10,11), (1,5,7,8,10,11), (1,5,8,9,10,11),
                         (1,2,3,7,10,11), (1,2,4,8,10,11), (1,2,5,9,10,11),
                         (1,2,3,4,7,11),  (1,2,4,5,7,11),  (1,2,5,6,7,11),
                         (1,3,4,6,9,11),  (1,3,5,7,9,11),  (1,3,6,8,9,11),    ### 30

                         (2,3,4,6,8,11), (2,3,5,7,8,11), 
                         (2,3,4,7,9,11), (2,3,5,8,9,11),
                         (2,5,6,8,10,11), (2,5,7,9,10,11),
                         (2,5,6,7,9,11), (2,5,7,8,9,11), 
                         (2,4,5,6,8,11), (2,4,6,7,8,11),
                         (2,4,5,8,10,11), (2,4,6,9,10,11),
                         (2,6,7,8,10,11), (2,6,8,9,10,11),
                         (2,3,4,8,10,11), (2,3,5,9,10,11),
                         (2,3,4,5,7,11), (2,3,5,6,7,11),
                         (2,4,5,7,9,11), (2,4,6,8,9,11),    ### 20

                         (3,4,5,7,8,11), 
                         (3,4,5,8,9,11),
                         (3,6,7,9,10,11),
                         (3,6,7,8,9,11), 
                         (3,5,6,7,8,11),
                         (3,5,6,9,10,11),
                         (3,7,8,9,10,11),
                         (3,4,5,9,10,11),
                         (3,4,5,6,7,11),
                         (3,5,6,8,9,11),    ### 10, 126
                         ],   
  
             'und_4'  : [(0,1,2,3,4,5,8,11), (0,1,2,3,5,6,8,11), (0,1,2,3,6,7,8,11),
                         (0,1,3,4,5,6,8,11), (0,1,3,4,6,7,8,11),
                         (0,1,4,5,6,7,8,11),
                         (0,1,2,3,4,7,10,11), (0,1,2,3,5,8,10,11), (0,1,2,3,6,9,10,11),
                         (0,1,3,4,5,8,10,11), (0,1,3,4,6,9,10,11),
                         (0,1,4,5,6,9,10,11),
                         (0,1,2,5,6,7,10,11), (0,1,2,5,7,8,10,11), (0,1,2,5,8,9,10,11),
                         (0,1,3,6,7,8,10,11), (0,1,3,6,8,9,10,11),
                         (0,1,4,7,8,9,10,11),
                         (0,3,4,5,6,7,10,11), (0,3,4,5,7,8,10,11), (0,3,4,5,8,9,10,11),
                         (0,3,5,6,7,8,10,11), (0,3,5,6,8,9,10,11),
                         (0,3,6,7,8,9,10,11),
                         (0,1,2,3,4,6,9,11), (0,1,2,3,5,7,9,11), (0,1,2,3,6,8,9,11),
                         (0,1,3,4,5,7,9,11), (0,1,3,4,6,8,9,11),
                         (0,1,4,5,6,8,9,11),
                         (0,1,2,4,5,6,9,11), (0,1,2,4,6,7,9,11), (0,1,2,4,7,8,9,11),
                         (0,1,3,5,6,7,9,11), (0,1,3,5,7,8,9,11),
                         (0,1,4,6,7,8,9,11),
                         (0,2,3,4,5,7,10,11), (0,2,3,4,6,8,10,11), (0,2,3,4,7,9,10,11),
                         (0,2,4,5,6,8,10,11), (0,2,4,5,7,9,10,11),
                         (0,2,5,6,7,9,10,11),
                         (0,2,3,5,6,7,10,11), (0,2,3,5,7,8,10,11), (0,2,3,5,8,9,10,11),
                         (0,2,4,6,7,8,10,11), (0,2,4,6,8,9,10,11),
                         (0,2,5,6,8,9,10,11),
                         (0,2,3,4,5,6,9,11), (0,2,3,4,6,7,9,11), (0,2,3,4,7,8,9,11),
                         (0,2,4,5,6,7,9,11), (0,2,4,5,7,8,9,11),
                         (0,2,5,6,7,8,9,11),
                         (0,1,2,4,5,7,10,11), (0,1,2,4,6,8,10,11), (0,1,2,4,7,9,10,11),
                         (0,1,3,5,6,8,10,11), (0,1,3,5,7,9,10,11),
                         (0,1,4,6,7,9,10,11),                             ###60, 186

                         (1,2,3,4,5,6,8,11), (1,2,3,4,6,7,8,11),
                         (1,2,4,5,6,7,8,11),
                         (1,2,3,4,5,8,10,11), (1,2,3,4,6,9,10,11),
                         (1,2,4,5,6,9,10,11),
                         (1,2,3,6,7,8,10,11), (1,2,3,6,8,9,10,11),
                         (1,2,4,7,8,9,10,11),
                         (1,4,5,6,7,8,10,11), (1,4,5,6,8,9,10,11),
                         (1,4,6,7,8,9,10,11),
                         (1,2,3,4,5,7,9,11), (1,2,3,4,6,8,9,11),
                         (1,2,4,5,6,8,9,11),
                         (1,2,3,5,6,7,9,11), (1,2,3,5,7,8,9,11),
                         (1,2,4,6,7,8,9,11),
                         (1,3,4,5,6,8,10,11), (1,3,4,5,7,9,10,11),
                         (1,3,5,6,7,9,10,11),
                         (1,3,4,6,7,8,10,11), (1,3,4,6,8,9,10,11),
                         (1,3,5,7,8,9,10,11),
                         (1,3,4,5,6,7,9,11), (1,3,4,5,7,8,9,11),
                         (1,3,5,6,7,8,9,11),
                         (1,2,3,5,6,8,10,11), (1,2,3,5,7,9,10,11),                  
                         (1,2,4,6,7,9,10,11),                           ###30, 216

                         (2,3,4,5,6,7,8,11),
                         (2,3,4,5,6,9,10,11),
                         (2,3,4,7,8,9,10,11),
                         (2,5,6,7,8,9,10,11),
                         (2,3,4,5,6,8,9,11),
                         (2,3,4,6,7,8,9,11),
                         (2,4,5,6,7,9,10,11),
                         (2,4,5,7,8,9,10,11),
                         (2,4,5,6,7,8,9,11),
                         (2,3,4,6,7,9,10,11),                           ###10, 226
                         ],


             'und_5'  : [(0,1,2,3,4,5,6,7,9,11), (0,1,2,3,4,5,7,8,9,11),
                         (0,1,2,3,5,6,7,8,9,11),
                         (0,1,3,4,5,6,7,8,9,11),
                         (0,1,2,3,4,5,6,8,10,11), (0,1,2,3,4,5,7,9,10,11),
                         (0,1,2,3,5,6,7,9,10,11),
                         (0,1,3,4,5,6,7,9,10,11),
                         (0,1,2,3,4,6,7,8,10,11), (0,1,2,3,4,6,8,9,10,11),
                         (0,1,2,3,5,7,8,9,10,11),
                         (0,1,3,4,5,7,8,9,10,11),
                         (0,1,2,4,5,6,7,8,10,11), (0,1,2,4,5,6,8,9,10,11),
                         (0,1,2,4,6,7,8,9,10,11),
                         (0,1,3,5,6,7,8,9,10,11),
                         (0,2,3,4,5,6,7,8,10,11), (0,2,3,4,5,6,8,9,10,11),
                         (0,2,3,4,6,7,8,9,10,11),
                         (0,2,4,5,6,7,8,9,10,11),   ### 20, 246

                         (1,2,3,4,5,6,7,8,9,11),
                         (1,2,3,4,5,6,7,9,10,11),
                         (1,2,3,4,5,7,8,9,10,11),
                         (1,2,3,5,6,7,8,9,10,11),
                         (1,3,4,5,6,7,8,9,10,11),   ### 5, 251
                         ],

             'und_6'  : [(0,1,2,3,4,5,6,7,8,9,10,11),   ### 252
                         ],


              ##### total_new partitions == 462
             'dod_1'  : [(6,12)],
             'dod_2'  : [(0,1,7,12), (1,2,7,12), (2,3,7,12), (3,4,7,12), (4,5,7,12), (5,6,7,12),
                         (0,2,8,12), (1,3,8,12), (2,4,8,12), (3,5,8,12), (4,6,8,12), (5,7,8,12),
                         (0,3,9,12), (1,4,9,12), (2,5,9,12), (3,6,9,12), (4,7,9,12), (5,8,9,12),  
                         (0,4,10,12), (1,5,10,12), (2,6,10,12), (3,7,10,12), (4,8,10,12), (5,9,10,12),
                         (0,5,11,12), (1,6,11,12), (2,7,11,12), (3,8,11,12), (4,9,11,12), (5,10,11,12)],   ### 1 + 30

             'dod_3'  : [(0,1,2,4,9,12),   (0,1,3,5,9,12),   (0,1,4,6,9,12),   (0,1,5,7,9,12),  (0,1,6,8,9,12),
                         (0,1,2,5,10,12),  (0,1,3,6,10,12),  (0,1,4,7,10,12),  (0,1,5,8,10,12), (0,1,6,9,10,12),
                         (0,2,3,4,9,12),   (0,2,4,5,9,12),   (0,2,5,6,9,12),   (0,2,6,7,9,12),  (0,2,7,8,9,12), 
                         (0,2,3,6,11,12),  (0,2,4,7,11,12),  (0,2,5,8,11,12),  (0,2,6,9,11,12), (0,2,7,10,11,12),
                         (0,3,4,5,10,12),  (0,3,5,6,10,12),  (0,3,6,7,10,12),  (0,3,7,8,10,12), (0,3,8,9,10,12),
                         (0,3,4,6,11,12),  (0,3,5,7,11,12),  (0,3,6,8,11,12),  (0,3,7,9,11,12), (0,3,8,10,11,12),
                         (0,4,5,6,11,12),  (0,4,6,7,11,12),  (0,4,7,8,11,12),  (0,4,8,9,11,12), (0,4,9,10,11,12), 
                         (0,1,2,6,11,12),  (0,1,3,7,11,12),  (0,1,4,8,11,12),  (0,1,5,9,11,12), (0,1,6,10,11,12),
                         (0,1,2,3,8,12),   (0,1,3,4,8,12),   (0,1,4,5,8,12),   (0,1,5,6,8,12),  (0,1,6,7,8,12),
                         (0,2,3,5,10,12),  (0,2,4,6,10,12),  (0,2,5,7,10,12),  (0,2,6,8,10,12), (0,2,7,9,10,12),   ### 50

                         (1,2,3,5,9,12),  (1,2,4,6,9,12),  (1,2,5,7,9,12),  (1,2,6,8,9,12),
                         (1,2,3,6,10,12), (1,2,4,7,10,12), (1,2,5,8,10,12), (1,2,6,9,10,12),
                         (1,4,5,7,11,12), (1,4,6,8,11,12), (1,4,7,9,11,12), (1,4,8,10,11,12),
                         (1,4,5,6,10,12), (1,4,6,7,10,12), (1,4,7,8,10,12), (1,4,8,9,10,12), 
                         (1,3,4,5,9,12),  (1,3,5,6,9,12),  (1,3,6,7,9,12),  (1,3,7,8,9,12),
                         (1,3,4,7,11,12), (1,3,5,8,11,12), (1,3,6,9,11,12), (1,3,7,10,11,12),
                         (1,5,6,7,11,12), (1,5,7,8,11,12), (1,5,8,9,11,12), (1,5,9,10,11,12),
                         (1,2,3,7,11,12), (1,2,4,8,11,12), (1,2,5,9,11,12), (1,2,6,10,11,12),
                         (1,2,3,4,8,12),  (1,2,4,5,8,12),  (1,2,5,6,8,12),  (1,2,6,7,8,12),
                         (1,3,4,6,10,12), (1,3,5,7,10,12), (1,3,6,8,10,12), (1,3,7,9,10,12),    ### 40

                         (2,3,4,6,9,12),  (2,3,5,7,9,12),  (2,3,6,8,9,12), 
                         (2,3,4,7,10,12), (2,3,5,8,10,12), (2,3,6,9,10,12),
                         (2,5,6,8,11,12), (2,5,7,9,11,12), (2,5,8,10,11,12),
                         (2,5,6,7,10,12), (2,5,7,8,10,12), (2,5,8,9,10,12), 
                         (2,4,5,6,9,12),  (2,4,6,7,9,12),  (2,4,7,8,9,12),
                         (2,4,5,8,11,12), (2,4,6,9,11,12), (2,4,7,10,11,12),
                         (2,6,7,8,11,12), (2,6,8,9,11,12), (2,6,9,10,11,12),
                         (2,3,4,8,11,12), (2,3,5,9,11,12), (2,3,6,10,11,12),
                         (2,3,4,5,8,12),  (2,3,5,6,8,12),  (2,3,6,7,8,12),
                         (2,4,5,7,10,12), (2,4,6,8,10,12), (2,4,7,9,10,12),    ### 30

                         (3,4,5,7,9,12),  (3,4,6,8,9,12), 
                         (3,4,5,8,10,12), (3,4,6,9,10,12),
                         (3,6,7,9,11,12), (3,6,8,10,11,12),
                         (3,6,7,8,10,12), (3,6,8,9,10,12), 
                         (3,5,6,7,9,12),  (3,5,7,8,9,12),
                         (3,5,6,9,11,12), (3,5,7,10,11,12),
                         (3,7,8,9,11,12), (3,7,9,10,11,12),
                         (3,4,5,9,11,12), (3,4,6,10,11,12),
                         (3,4,5,6,8,12),  (3,4,6,7,8,12),
                         (3,5,6,8,10,12), (3,5,7,9,10,12),    ### 20

                         (4,5,6,8,9,12), 
                         (4,5,6,9,10,12),
                         (4,7,8,10,11,12),
                         (4,7,8,9,10,12), 
                         (4,6,7,8,9,12),
                         (4,6,7,10,11,12),
                         (4,8,9,10,11,12),
                         (4,5,6,10,11,12),
                         (4,5,6,7,8,12),
                         (4,6,7,9,10,12),    ### 10, 181
                         ],   
  
             'dod_4'  : [(0,1,2,3,4,5,9,12), (0,1,2,3,5,6,9,12), (0,1,2,3,6,7,9,12), (0,1,2,3,7,8,9,12),
                         (0,1,3,4,5,6,9,12), (0,1,3,4,6,7,9,12), (0,1,3,4,7,8,9,12),
                         (0,1,4,5,6,7,9,12), (0,1,4,5,7,8,9,12),
                         (0,1,5,6,7,8,9,12),
                         (0,1,2,3,4,7,11,12), (0,1,2,3,5,8,11,12), (0,1,2,3,6,9,11,12), (0,1,2,3,7,10,11,12),
                         (0,1,3,4,5,8,11,12), (0,1,3,4,6,9,11,12), (0,1,3,4,7,10,11,12),
                         (0,1,4,5,6,9,11,12), (0,1,4,5,7,10,11,12),
                         (0,1,5,6,7,10,11,12),
                         (0,1,2,5,6,7,11,12), (0,1,2,5,7,8,11,12), (0,1,2,5,8,9,11,12), (0,1,2,5,9,10,11,12),
                         (0,1,3,6,7,8,11,12), (0,1,3,6,8,9,11,12), (0,1,3,6,9,10,11,12),
                         (0,1,4,7,8,9,11,12), (0,1,4,7,9,10,11,12),
                         (0,1,5,8,9,10,11,12),
                         (0,3,4,5,6,7,11,12), (0,3,4,5,7,8,11,12), (0,3,4,5,8,9,11,12), (0,3,4,5,9,10,11,12),
                         (0,3,5,6,7,8,11,12), (0,3,5,6,8,9,11,12), (0,3,5,6,9,10,11,12),
                         (0,3,6,7,8,9,11,12), (0,3,6,7,9,10,11,12),
                         (0,3,7,8,9,10,11,12),
                         (0,1,2,3,4,6,10,12), (0,1,2,3,5,7,10,12), (0,1,2,3,6,8,10,12), (0,1,2,3,7,9,10,12),
                         (0,1,3,4,5,7,10,12), (0,1,3,4,6,8,10,12), (0,1,3,4,7,9,10,12),
                         (0,1,4,5,6,8,10,12), (0,1,4,5,7,9,10,12),
                         (0,1,5,6,7,9,10,12),
                         (0,1,2,4,5,6,10,12), (0,1,2,4,6,7,10,12), (0,1,2,4,7,8,10,12), (0,1,2,4,8,9,10,12),
                         (0,1,3,5,6,7,10,12), (0,1,3,5,7,8,10,12), (0,1,3,5,8,9,10,12),
                         (0,1,4,6,7,8,10,12), (0,1,4,6,8,9,10,12),
                         (0,1,5,7,8,9,10,12),
                         (0,2,3,4,5,7,11,12), (0,2,3,4,6,8,11,12), (0,2,3,4,7,9,11,12), (0,2,3,4,8,10,11,12),
                         (0,2,4,5,6,8,11,12), (0,2,4,5,7,9,11,12), (0,2,4,5,8,10,11,12),
                         (0,2,5,6,7,9,11,12), (0,2,5,6,8,10,11,12),
                         (0,2,6,7,8,10,11,12),
                         (0,2,3,5,6,7,11,12), (0,2,3,5,7,8,11,12), (0,2,3,5,8,9,11,12), (0,2,3,5,9,10,11,12),
                         (0,2,4,6,7,8,11,12), (0,2,4,6,8,9,11,12), (0,2,4,6,9,10,11,12),
                         (0,2,5,6,8,9,11,12), (0,2,5,6,9,10,11,12),
                         (0,2,6,7,9,10,11,12),
                         (0,2,3,4,5,6,10,12), (0,2,3,4,6,7,10,12), (0,2,3,4,7,8,10,12), (0,2,3,4,8,9,10,12),
                         (0,2,4,5,6,7,10,12), (0,2,4,5,7,8,10,12), (0,2,4,5,8,9,10,12),
                         (0,2,5,6,7,8,10,12), (0,2,5,6,8,9,10,12),
                         (0,2,6,7,8,9,10,12),
                         (0,1,2,4,5,7,11,12), (0,1,2,4,6,8,11,12), (0,1,2,4,7,9,11,12), (0,1,2,4,8,10,11,12),
                         (0,1,3,5,6,8,11,12), (0,1,3,5,7,9,11,12), (0,1,3,5,8,10,11,12),
                         (0,1,4,6,7,9,11,12), (0,1,4,6,8,10,11,12), 
                         (0,1,5,7,8,10,11,12),                       ###100, 281


                         (1,2,3,4,5,6,9,12), (1,2,3,4,6,7,9,12),  (1,2,3,4,7,8,9,12),
                         (1,2,4,5,6,7,9,12), (1,2,4,5,7,8,9,12),
                         (1,2,5,6,7,8,9,12),
                         (1,2,3,4,5,8,11,12), (1,2,3,4,6,9,11,12), (1,2,3,4,7,10,11,12),
                         (1,2,4,5,6,9,11,12), (1,2,4,5,7,10,11,12),
                         (1,2,5,6,7,10,11,12),
                         (1,2,3,6,7,8,11,12), (1,2,3,6,8,9,11,12), (1,2,3,6,9,10,11,12),
                         (1,2,4,7,8,9,11,12), (1,2,4,7,9,10,11,12),
                         (1,2,5,8,9,10,11,12),
                         (1,4,5,6,7,8,11,12), (1,4,5,6,8,9,11,12), (1,4,5,6,9,10,11,12),
                         (1,4,6,7,8,9,11,12), (1,4,6,7,9,10,11,12),
                         (1,4,7,8,9,10,11,12),
                         (1,2,3,4,5,7,10,12), (1,2,3,4,6,8,10,12), (1,2,3,4,7,9,10,12),
                         (1,2,4,5,6,8,10,12), (1,2,4,5,7,9,10,12),
                         (1,2,5,6,7,9,10,12),
                         (1,2,3,5,6,7,10,12), (1,2,3,5,7,8,10,12), (1,2,3,5,8,9,10,12),
                         (1,2,4,6,7,8,10,12), (1,2,4,6,8,9,10,12),
                         (1,2,5,7,8,9,10,12),
                         (1,3,4,5,6,8,11,12), (1,3,4,5,7,9,11,12), (1,3,4,5,8,10,11,12),
                         (1,3,5,6,7,9,11,12), (1,3,5,6,8,10,11,12),
                         (1,3,6,7,8,10,11,12),
                         (1,3,4,6,7,8,11,12), (1,3,4,6,8,9,11,12), (1,3,4,6,9,10,11,12),
                         (1,3,5,7,8,9,11,12), (1,3,5,7,9,10,11,12),
                         (1,3,6,8,9,10,11,12),
                         (1,3,4,5,6,7,10,12), (1,3,4,5,7,8,10,12), (1,3,4,5,8,9,10,12),
                         (1,3,5,6,7,8,10,12), (1,3,5,6,8,9,10,12),
                         (1,3,6,7,8,9,10,12),
                         (1,2,3,5,6,8,11,12), (1,2,3,5,7,9,11,12), (1,2,3,5,8,10,11,12),                  
                         (1,2,4,6,7,9,11,12), (1,2,4,6,8,10,11,12),
                         (1,2,5,7,8,10,11,12),                          ###60, 341
                                              

                         (2,3,4,5,6,7,9,12), (2,3,4,5,7,8,9,12),
                         (2,3,5,6,7,8,9,12),
                         (2,3,4,5,6,9,11,12), (2,3,4,5,7,10,11,12),
                         (2,3,5,6,7,10,11,12),
                         (2,3,4,7,8,9,11,12), (2,3,4,7,9,10,11,12),
                         (2,3,5,8,9,10,11,12),
                         (2,5,6,7,8,9,11,12), (2,5,6,7,9,10,11,12),
                         (2,5,7,8,9,10,11,12),
                         (2,3,4,5,6,8,10,12), (2,3,4,5,7,9,10,12),
                         (2,3,5,6,7,9,10,12),
                         (2,3,4,6,7,8,10,12), (2,3,4,6,8,9,10,12),
                         (2,3,5,7,8,9,10,12),
                         (2,4,5,6,7,9,11,12), (2,4,5,6,8,10,11,12),
                         (2,4,6,7,8,10,11,12),
                         (2,4,5,7,8,9,11,12), (2,4,5,7,9,10,11,12),
                         (2,4,6,8,9,10,11,12),
                         (2,4,5,6,7,8,10,12), (2,4,5,6,8,9,10,12),
                         (2,4,6,7,8,9,10,12),
                         (2,3,4,6,7,9,11,12), (2,3,4,6,8,10,11,12),
                         (2,3,5,7,8,10,11,12),                           ###30, 371

                         (3,4,5,6,7,8,9,12),
                         (3,4,5,6,7,10,11,12),
                         (3,4,5,8,9,10,11,12),
                         (3,6,7,8,9,10,11,12),
                         (3,4,5,6,7,9,10,12),
                         (3,4,5,7,8,9,10,12),
                         (3,5,6,7,8,10,11,12),
                         (3,5,6,8,9,10,11,12),
                         (3,5,6,7,8,9,10,12),
                         (3,4,5,7,8,10,11,12),                           ###10, 381
                         ],


             'dod_5'  : [(0,1,2,3,4,5,6,7,10,12), (0,1,2,3,4,5,7,8,10,12), (0,1,2,3,4,5,8,9,10,12),
                         (0,1,2,3,5,6,7,8,10,12), (0,1,2,3,5,6,8,9,10,12),
                         (0,1,2,3,6,7,8,9,10,12),
                         (0,1,3,4,5,6,7,8,10,12), (0,1,3,4,5,6,8,9,10,12),
                         (0,1,3,4,6,7,8,9,10,12),
                         (0,1,4,5,6,7,8,9,10,12),
                         (0,1,2,3,4,5,6,8,11,12), (0,1,2,3,4,5,7,9,11,12), (0,1,2,3,4,5,8,10,11,12),
                         (0,1,2,3,5,6,7,9,11,12), (0,1,2,3,5,6,8,10,11,12),
                         (0,1,2,3,6,7,8,10,11,12),
                         (0,1,3,4,5,6,7,9,11,12), (0,1,3,4,5,6,8,10,11,12),
                         (0,1,3,4,6,7,8,10,11,12),
                         (0,1,4,5,6,7,8,10,11,12),
                         (0,1,2,3,4,6,7,8,11,12), (0,1,2,3,4,6,8,9,11,12), (0,1,2,3,4,6,9,10,11,12),
                         (0,1,2,3,5,7,8,9,11,12), (0,1,2,3,5,7,9,10,11,12),
                         (0,1,2,3,6,8,9,10,11,12),
                         (0,1,3,4,5,7,8,9,11,12), (0,1,3,4,5,7,9,10,11,12),
                         (0,1,3,4,6,8,9,10,11,12),
                         (0,1,4,5,6,8,9,10,11,12),
                         (0,1,2,4,5,6,7,8,11,12), (0,1,2,4,5,6,8,9,11,12), (0,1,2,4,5,6,9,10,11,12),
                         (0,1,2,4,6,7,8,9,11,12), (0,1,2,4,6,7,9,10,11,12),
                         (0,1,2,4,7,8,9,10,11,12),
                         (0,1,3,5,6,7,8,9,11,12), (0,1,3,5,6,7,9,10,11,12),
                         (0,1,3,5,7,8,9,10,11,12),
                         (0,1,4,6,7,8,9,10,11,12),
                         (0,2,3,4,5,6,7,8,11,12), (0,2,3,4,5,6,8,9,11,12), (0,2,3,4,5,6,9,10,11,12),
                         (0,2,3,4,6,7,8,9,11,12), (0,2,3,4,6,7,9,10,11,12),
                         (0,2,3,4,7,8,9,10,11,12),
                         (0,2,4,5,6,7,8,9,11,12), (0,2,4,5,6,7,9,10,11,12),
                         (0,2,4,5,7,8,9,10,11,12),
                         (0,2,5,6,7,8,9,10,11,12),   ### 50, 431


                         (1,2,3,4,5,6,7,8,10,12), (1,2,3,4,5,6,8,9,10,12),
                         (1,2,3,4,6,7,8,9,10,12),
                         (1,2,4,5,6,7,8,9,10,12),
                         (1,2,3,4,5,6,7,9,11,12), (1,2,3,4,5,6,8,10,11,12),
                         (1,2,3,4,6,7,8,10,11,12),
                         (1,2,4,5,6,7,8,10,11,12),
                         (1,2,3,4,5,7,8,9,11,12), (1,2,3,4,5,7,9,10,11,12),
                         (1,2,3,4,6,8,9,10,11,12),
                         (1,2,4,5,6,8,9,10,11,12),
                         (1,2,3,5,6,7,8,9,11,12), (1,2,3,5,6,7,9,10,11,12),
                         (1,2,3,5,7,8,9,10,11,12),
                         (1,2,4,6,7,8,9,10,11,12),
                         (1,3,4,5,6,7,8,9,11,12), (1,3,4,5,6,7,9,10,11,12),
                         (1,3,4,5,7,8,9,10,11,12),
                         (1,3,5,6,7,8,9,10,11,12),  ### 20, 451

                         (2,3,4,5,6,7,8,9,10,12),
                         (2,3,4,5,6,7,8,10,11,12),
                         (2,3,4,5,6,8,9,10,11,12),
                         (2,3,4,6,7,8,9,10,11,12),
                         (2,4,5,6,7,8,9,10,11,12),  ### 5, 456
                         ],

             'dod_6'  : [(0,1,2,3,4,5,6,7,8,9,11,12),
                         (0,1,2,3,4,5,6,7,9,10,11,12),
                         (0,1,2,3,4,5,7,8,9,10,11,12),
                         (0,1,2,3,5,6,7,8,9,10,11,12),  
                         (0,1,3,4,5,6,7,8,9,10,11,12),

                         (1,2,3,4,5,6,7,8,9,10,11,12),   ### 6, 462
                         ],
            } #####


#-------------------||||||||||||
# slices needed to produce sub-set septachords, starting from an octachord

SLICEsept  ={ 'oct_1'  : [(0,7), (1,8)],
              'oct_2'  : [(0,1,2,8), (0,2,3,8), (0,3,4,8), (0,4,5,8), (0,5,6,8), (0,6,7,8)],
              'non_1'  : [(2,9)],
              'non_2'  : [(0,1,3,9), (1,2,3,9), (0,2,4,9), (1,3,4,9), (0,3,5,9), (1,4,5,9),
                          (0,4,6,9), (1,5,6,9), (0,5,7,9), (1,6,7,9), (0,6,8,9), (1,7,8,9)],

              'non_3'  : [(0,1,2,3,4,9), (0,1,2,7,8,9), (0,5,6,7,8,9), (0,2,3,4,5,9), (0,2,3,7,8,9), (0,1,2,4,5,9), (0,1,2,6,7,9), (0,4,5,6,7,9), 
                          (0,4,5,7,8,9), (0,3,4,6,7,9), (0,2,3,6,7,9), (0,2,3,5,6,9), (0,3,4,7,8,9), (0,3,4,5,6,9), (0,1,2,5,6,9)],
              ##### total_new partitions == 84
              'dec_1'  : [(3,10)],
              'dec_2'  : [(0,1,4,10), (1,2,4,10), (2,3,4,10),
                          (0,2,5,10), (1,3,5,10), (2,4,5,10),
                          (0,3,6,10), (1,4,6,10), (2,5,6,10),
                          (0,4,7,10), (1,5,7,10), (2,6,7,10),
                          (0,5,8,10), (1,6,8,10), (2,7,8,10),
                          (0,6,9,10), (1,7,9,10), (2,8,9,10)], ###19

              'dec_3'  : [(0,1,2,3,5,10), (0,1,3,4,5,10),  # 1 1 5
                          (1,2,3,4,5,10),
                          (0,1,2,7,9,10), (0,1,3,8,9,10),  # 1 5 1
                          (1,2,3,8,9,10),
                          (0,5,6,7,9,10), (0,5,7,8,9,10),  # 5 1 1
                          (1,6,7,8,9,10),
                          (0,2,3,4,6,10), (0,2,4,5,6,10),  # 2 1 4
                          (1,3,4,5,6,10),
                          (0,2,3,7,9,10), (0,2,4,8,9,10),  # 2 4 1
                          (1,3,4,8,9,10), 
                          (0,1,2,4,6,10), (0,1,3,5,6,10),  # 1 2 4
                          (1,2,3,5,6,10),
                          (0,1,2,6,8,10), (0,1,3,7,8,10),  # 1 4 2
                          (1,2,3,7,8,10),
                          (0,4,5,6,8,10), (0,4,6,7,8,10),  # 4 1 2
                          (1,5,6,7,8,10),   
                          (0,4,5,7,9,10), (0,4,6,8,9,10),  # 4 2 1
                          (1,5,6,8,9,10),
                          (0,3,4,6,8,10), (0,3,5,7,8,10),  # 3 2 2
                          (1,4,5,7,8,10),
                          (0,2,3,6,8,10), (0,2,4,7,8,10),  # 2 3 2
                          (1,3,4,7,8,10),
                          (0,2,3,5,7,10), (0,2,4,6,7,10),  # 2 2 3
                          (1,3,4,6,7,10),
                          (0,3,4,7,9,10), (0,3,5,8,9,10),  # 3 3 1
                          (1,4,5,8,9,10),
                          (0,3,4,5,7,10), (0,3,5,6,7,10),  # 3 1 3
                          (1,4,5,6,7,10),
                          (0,1,2,5,7,10), (0,1,3,6,7,10),  # 1 3 3  ### 45
                          (1,2,3,6,7,10)],

              'dec_4'  : [(0,1,2,3,4,5,6,10),   # 1 1 1 4
                          (0,1,2,3,4,8,9,10),   # 1 1 4 1
                          (0,1,2,6,7,8,9,10),   # 1 4 1 1
                          (0,4,5,6,7,8,9,10),   # 4 1 1 1
                          (0,1,2,3,4,6,7,10),   # 1 1 2 3
                          (0,1,2,4,5,8,9,10),   # 1 2 3 1
                          (0,2,3,6,7,8,9,10),   # 2 3 1 1
                          (0,3,4,5,6,7,8,10),   # 3 1 1 2
                          (0,1,2,4,5,6,7,10),   # 1 2 1 3
                          (0,2,3,4,5,8,9,10),   # 2 1 3 1
                          (0,1,2,5,6,7,8,10),   # 1 3 1 2
                          (0,3,4,5,6,8,9,10),   # 3 1 2 1
                          (0,2,3,4,5,6,7,10),   # 2 1 1 3
                          (0,1,2,3,4,7,8,10),   # 1 1 3 2
                          (0,1,2,5,6,8,9,10),   # 1 3 2 1
                          (0,3,4,6,7,8,9,10),   # 3 2 1 1
                          (0,1,2,4,5,7,8,10),   # 1 2 2 2
                          (0,2,3,5,6,8,9,10),   # 2 2 2 1
                          (0,2,3,5,6,7,8,10),   # 2 2 1 2
                          (0,2,3,4,5,7,8,10)],  # 2 1 2 2  :: 20, 84  


                         ##### total_new 210
              'und_1'  : [(4,11)],
              'und_2'  : [(0,1,5,11),  (1,2,5,11),  (2,3,5,11), (3,4,5,11),    # 1 6
                          (0,2,6,11),  (1,3,6,11),  (2,4,6,11), (3,5,6,11),    # 2 5
                          (0,3,7,11),  (1,4,7,11),  (2,5,7,11), (3,6,7,11),    # 3 4
                          (0,4,8,11),  (1,5,8,11),  (2,6,8,11), (3,7,8,11),    # 4 3
                          (0,5,9,11),  (1,6,9,11),  (2,7,9,11), (3,8,9,11),    # 5 2
                          (0,6,10,11), (1,7,10,11), (2,8,10,11), (3,9,10,11)], # 6 1         ###25

              'und_3'  : [(0,1,2,3,6,11), (0,1,3,4,6,11), (0,1,4,5,6,11),                # 1 1 5
                          (1,2,3,4,6,11), (1,2,4,5,6,11),
                          (2,3,4,5,6,11),
                          (0,1,2,7,10,11), (0,1,3,8,10,11), (0,1,4,9,10,11),               # 1 5 1
                          (1,2,3,8,10,11), (1,2,4,9,10,11),
                          (2,3,4,9,10,11),
                          (0,5,6,7,10,11), (0,5,7,8,10,11), (0,5,7,8,10,11),            # 5 1 1
                          (1,6,7,8,10,11), (1,6,8,9,10,11),
                          (2,7,8,9,10,11),
                          (0,2,3,4,7,11),  (0,2,4,5,7,11), (0,2,5,6,7,11),         # 2 1 4
                          (1,3,4,5,7,11),  (1,3,5,6,7,11),
                          (2,4,5,6,7,11),
                          (0,2,3,7,10,11), (0,2,4,8,10,11), (0,2,5,9,10,11),         # 2 4 1
                          (1,3,4,8,10,11), (1,3,5,9,10,11),
                          (2,4,5,9,10,11), 
                          (0,1,2,4,7,11),  (0,1,3,5,7,11), (0,1,4,6,7,11),             # 1 2 4
                          (1,2,3,5,7,11),  (1,2,4,6,7,11),
                          (2,3,4,6,7,11),
                          (0,1,2,6,9,11),  (0,1,3,7,9,11), (0,1,4,8,9,11),            # 1 4 2
                          (1,2,3,7,9,11),  (1,2,4,8,9,11),
                          (2,3,4,8,9,11),
                          (0,4,5,6,9,11),  (0,4,6,7,9,11), (0,4,7,8,9,11),           # 4 1 2
                          (1,5,6,7,9,11),  (1,5,7,8,9,11),
                          (2,6,7,8,9,11),   
                          (0,4,5,7,10,11), (0,4,6,8,10,11), (0,4,7,9,10,11),          # 4 2 1
                          (1,5,6,8,10,11), (1,5,7,9,10,11),
                          (2,6,7,9,10,11),

                          (0,3,4,6,9,11),  (0,3,5,7,9,11), (0,3,6,8,9,11),               # 3 2 2
                          (1,4,5,7,9,11),  (1,4,6,8,9,11),
                          (2,5,6,8,9,11),
                          (0,2,3,6,9,11),  (0,2,4,7,9,11), (0,2,5,8,9,11),             # 2 3 2
                          (1,3,4,7,9,11),  (1,3,5,8,9,11),
                          (2,4,5,8,9,11),
                          (0,2,3,5,8,11),  (0,2,4,6,8,11), (0,2,5,7,8,11),             # 2 2 3
                          (1,3,4,6,8,11),  (1,3,5,7,8,11),
                          (2,4,5,7,8,11),

                          (0,3,4,7,10,11), (0,3,5,8,10,11), (0,3,6,9,10,11),         # 3 3 1
                          (1,4,5,8,10,11), (1,4,6,9,10,11),
                          (2,8,6,9,10,11),
                          (0,3,4,5,8,11),  (0,3,5,6,8,11), (0,3,6,7,8,11),            # 3 1 3
                          (1,4,5,6,8,11),  (1,4,6,7,8,11),
                          (2,5,6,7,8,11),
                          (0,1,2,5,8,11),  (0,1,3,6,8,11), (0,1,4,7,8,11),             # 1 3 3; 90, 115
                          (1,2,3,6,8,11),  (1,2,4,7,8,11),
                          (2,3,4,7,8,11)],

              'und_4'  : [(0,1,2,3,4,5,7,11),  (0,1,2,3,5,6,7,11),              # 1 1 1 4
                          (0,1,3,4,5,6,7,11),
                          (1,2,3,4,5,6,7,11),
                          (0,1,2,3,4,8,10,11), (0,1,2,3,5,9,10,11),                   # 1 1 4 1
                          (0,1,3,4,5,9,10,11),
                          (1,2,3,4,5,9,10,11),
                          (0,1,2,6,7,8,10,11), (0,1,2,6,8,9,10,11),                 # 1 4 1 1
                          (0,1,3,7,8,9,10,11),
                          (1,2,3,7,8,9,10,11),
                          (0,4,5,6,7,8,10,11), (0,4,5,6,8,9,10,11),                  # 4 1 1 1
                          (0,4,6,7,8,9,10,11),
                          (1,5,6,7,8,9,10,11),
                          (0,1,2,3,4,6,8,11),  (0,1,2,3,5,7,8,11),                      # 1 1 2 3
                          (0,1,3,4,5,7,8,11),
                          (1,2,3,4,5,7,8,11),
                          (0,1,2,4,5,8,10,11), (0,1,2,4,6,9,10,11),                     # 1 2 3 1
                          (0,1,3,5,6,9,10,11),
                          (1,2,3,5,6,9,10,11),
                          (0,2,3,6,7,8,10,11), (0,2,3,6,8,9,10,11),                    # 2 3 1 1
                          (0,2,4,7,8,9,10,11),
                          (1,3,4,7,8,9,10,11),
                          (0,3,4,5,6,7,9,11),  (0,3,4,5,7,8,9,11),                  # 3 1 1 2
                          (0,3,5,6,7,8,9,11),
                          (1,4,5,6,7,8,9,11),
                          (0,1,2,4,5,6,8,11),  (0,1,2,4,6,7,8,11),             # 1 2 1 3
                          (0,1,3,5,6,7,8,11),
                          (1,2,3,5,6,7,8,11),
                          (0,2,3,4,5,8,10,11), (0,2,3,4,6,9,10,11),            # 2 1 3 1
                          (0,2,4,5,6,9,10,11),
                          (1,3,4,5,6,9,10,11),
                          (0,1,2,5,6,7,9,11),  (0,1,2,5,7,8,9,11),             # 1 3 1 2
                          (0,1,3,6,7,8,9,11),
                          (1,2,3,6,7,8,9,11),
                          (0,3,4,5,6,8,10,11), (0,3,4,5,7,9,10,11),            # 3 1 2 1
                          (0,3,5,6,7,9,10,11),
                          (1,4,5,6,7,9,10,11),
                          (0,2,3,4,5,6,8,11),  (0,2,3,4,6,7,8,11),             # 2 1 1 3
                          (0,2,4,5,6,7,8,11),
                          (1,3,4,5,6,7,8,11),
                          (0,1,2,3,4,7,9,11),  (0,1,2,3,5,8,9,11),        # 1 1 3 2
                          (0,1,3,4,5,8,9,11),
                          (1,2,3,4,5,8,9,11),
                          (0,1,2,5,6,8,10,11), (0,1,2,5,7,9,10,11),        # 1 3 2 1
                          (0,1,3,6,7,9,10,11),
                          (1,2,3,6,7,9,10,11),
                          (0,3,4,6,7,8,10,11), (0,3,4,6,8,9,10,11),    # 3 2 1 1
                          (0,3,5,7,8,9,10,11),
                          (1,4,5,7,8,9,10,11),
                          (0,1,2,4,5,7,9,11),  (0,1,2,4,6,8,9,11),            # 1 2 2 2
                          (0,1,3,5,6,8,9,11),
                          (1,2,3,5,6,8,9,11),
                          (0,2,3,5,6,8,10,11), (0,2,3,5,7,9,10,11),        # 2 2 2 1
                          (0,2,4,6,7,9,10,11),
                          (1,3,4,6,7,9,10,11),
                          (0,2,3,5,6,7,9,11),  (0,2,3,5,7,8,9,11),         # 2 2 1 2
                          (0,2,4,6,7,8,9,11),
                          (1,3,4,6,7,8,9,11),
                          (0,2,3,4,5,7,9,11),  (0,2,3,4,6,8,9,11),         # 2 1 2 2:: x20 = 80, 195
                          (0,2,4,5,6,8,9,11),
                          (1,3,4,5,6,8,9,11)],

              'und_5' :  [(0,1,2,3,4,5,6,7,8,11),     # 1 1 1 1 3
                          (0,1,2,3,4,5,6,9,10,11),    # 1 1 1 3 1
                          (0,1,2,3,4,7,8,9,10,11),    # 1 1 3 1 1
                          (0,1,2,5,6,7,8,9,10,11),    # 1 3 1 1 1
                          (0,3,4,5,6,7,8,9,10,11),    # 3 1 1 1 1
                          (0,1,2,3,4,5,6,8,9,11),     # 1 1 1 2 2
                          (0,1,2,3,4,6,7,9,10,11),    # 1 1 2 2 1
                          (0,1,2,4,5,7,8,9,10,11),    # 1 2 2 1 1
                          (0,2,3,5,6,7,8,9,10,11),    # 2 2 1 1 1
                          (0,2,3,4,5,6,7,8,9,11),     # 2 1 1 1 2
                          (0,1,2,3,4,6,7,8,9,11),     # 1 1 2 1 2
                          (0,1,2,4,5,6,7,9,10,11),    # 1 2 1 2 1
                          (0,2,3,4,5,7,8,9,10,11),    # 2 1 2 1 1
                          (0,1,2,4,5,6,7,8,9,11),     # 1 2 1 1 2
                          (0,2,3,4,5,6,7,9,10,11)],   # 2 1 1 2 1   ::      15, 210


                         ##### total_new 462
              'dod_1'  : [(5,12)],
              'dod_2'  : [(0,1,6,12),  (1,2,6,12),  (2,3,6,12),  (3,4,6,12),  (4,5,6,12),
                          (0,2,7,12),  (1,3,7,12),  (2,4,7,12),  (3,5,7,12),  (4,6,7,12),
                          (0,3,8,12),  (1,4,8,12),  (2,5,8,12),  (3,6,8,12),  (4,7,8,12),
                          (0,4,9,12),  (1,5,9,12),  (2,6,9,12),  (3,7,9,12),  (4,8,9,12),
                          (0,5,10,12), (1,6,10,12), (2,7,10,12), (3,8,10,12), (4,9,10,12),
                          (0,6,11,12), (1,7,11,12), (2,8,11,12), (3,9,11,12), (4,10,11,12)],            ### 31

              'dod_3'  : [(0,1,2,3,7,12), (0,1,3,4,7,12), (0,1,4,5,7,12), (0,1,5,6,7,12),              # 1 1 5
                          (1,2,3,4,7,12), (1,2,4,5,7,12), (1,2,5,6,7,12),
                          (2,3,4,5,7,12), (2,3,5,6,7,12),
                          (3,4,5,6,7,12),
                          (0,1,2,7,11,12), (0,1,3,8,11,12), (0,1,4,9,11,12), (0,1,5,10,11,12),         # 1 5 1
                          (1,2,3,8,11,12), (1,2,4,9,11,12), (1,2,5,10,11,12),
                          (2,3,4,9,11,12), (2,3,5,10,11,12),
                          (3,4,5,10,11,12),
                          (0,5,6,7,11,12), (0,5,7,8,11,12), (0,5,7,8,11,12), (0,5,8,9,11,12),          # 5 1 1
                          (1,6,7,8,11,12), (1,6,8,9,11,12), (1,6,9,10,11,12),
                          (2,7,8,9,11,12), (2,7,9,10,11,12),
                          (3,8,9,10,11,12),
                          (0,2,3,4,8,12),  (0,2,4,5,8,12), (0,2,5,6,8,12), (0,2,6,7,8,12),       # 2 1 4
                          (1,3,4,5,8,12),  (1,3,5,6,8,12), (1,3,6,7,8,12),
                          (2,4,5,6,8,12),  (2,4,6,7,8,12),
                          (3,5,6,7,8,12),
                          (0,2,3,7,11,12), (0,2,4,8,11,12), (0,2,5,9,11,12), (0,2,6,10,11,12),   # 2 4 1
                          (1,3,4,8,11,12), (1,3,5,9,11,12), (1,3,6,10,11,12),
                          (2,4,5,9,11,12), (2,4,6,10,11,12),
                          (3,5,6,10,11,12), 
                          (0,1,2,4,8,12),  (0,1,3,5,8,12), (0,1,4,6,8,12), (0,1,5,7,8,12),       # 1 2 4
                          (1,2,3,5,8,12),  (1,2,4,6,8,12), (1,2,5,7,8,12),
                          (2,3,4,6,8,12),  (2,3,5,7,8,12),
                          (3,4,5,7,8,12),
                          (0,1,2,6,10,12),  (0,1,3,7,10,12), (0,1,4,8,10,12), (0,1,5,9,10,12),        # 1 4 2
                          (1,2,3,7,10,12),  (1,2,4,8,10,12), (1,2,5,9,10,12),
                          (2,3,4,8,10,12),  (2,3,5,9,10,12),
                          (3,4,5,9,10,12),
                          (0,4,5,6,10,12),  (0,4,6,7,10,12), (0,4,7,8,10,12), (0,4,8,9,10,12),        # 4 1 2
                          (1,5,6,7,10,12),  (1,5,7,8,10,12), (1,5,8,9,10,12),
                          (2,6,7,8,10,12),  (2,6,8,9,10,12),
                          (3,7,8,9,10,12),   
                          (0,4,5,7,11,12),  (0,4,6,8,11,12), (0,4,7,9,11,12), (0,4,8,10,11,12),       # 4 2 1
                          (1,5,6,8,11,12),  (1,5,7,9,11,12), (1,5,8,10,11,12),
                          (2,6,7,9,11,12),  (2,6,8,10,11,12),
                          (3,7,8,10,11,12),
                          (0,3,4,6,10,12),  (0,3,5,7,10,12), (0,3,6,8,10,12), (0,3,7,9,10,12),    # 3 2 2
                          (1,4,5,7,10,12),  (1,4,6,8,10,12), (1,4,7,9,10,12),
                          (2,5,6,8,10,12),  (2,5,7,9,10,12),
                          (3,6,7,9,10,12),
                          (0,2,3,6,10,12),  (0,2,4,7,10,12), (0,2,5,8,10,12), (0,2,6,9,10,12),    # 2 3 2
                          (1,3,4,7,10,12),  (1,3,5,8,10,12), (1,3,6,9,10,12),
                          (2,4,5,8,10,12),  (2,4,6,9,10,12),
                          (3,5,6,9,10,12),
                          (0,2,3,5,9,12),   (0,2,4,6,9,12), (0,2,5,7,9,12), (0,2,6,8,9,12),       # 2 2 3
                          (1,3,4,6,9,12),   (1,3,5,7,9,12), (1,3,6,8,9,12),
                          (2,4,5,7,9,12),   (2,4,6,8,9,12),
                          (3,5,6,8,9,12),
                          (0,3,4,7,11,12), (0,3,5,8,11,12), (0,3,6,9,11,12), (0,3,7,10,11,12),       # 3 3 1
                          (1,4,5,8,11,12), (1,4,6,9,11,12), (1,4,7,10,11,12),
                          (2,8,6,9,11,12), (2,8,7,10,11,12),
                          (3,9,7,10,11,12),
                          (0,3,4,5,9,12),  (0,3,5,6,9,12), (0,3,6,7,9,12), (0,3,7,8,9,12),           # 3 1 3
                          (1,4,5,6,9,12),  (1,4,6,7,9,12), (1,4,7,8,9,12),
                          (2,5,6,7,9,12),  (2,5,7,8,9,12),
                          (2,5,7,8,9,12),
                          (0,1,2,5,9,12),  (0,1,3,6,9,12), (0,1,4,7,9,12), (0,1,5,8,9,12),           # 1 3 3  #  15*10 = 150, 181
                          (1,2,3,6,9,12),  (1,2,4,7,9,12), (1,2,5,8,9,12),
                          (2,3,4,7,9,12),  (2,3,5,8,9,12),
                          (3,4,5,8,9,12)],


              'dod_4'  : [(0,1,2,3,4,5,8,12),  (0,1,2,3,5,6,8,12), (0,1,2,3,6,7,8,12),    # 1 1 1 4
                          (0,1,3,4,5,6,8,12),  (0,1,3,4,6,7,8,12),
                          (0,1,4,5,6,7,8,12),
                          (1,2,3,4,5,6,8,12),  (1,2,3,4,6,7,8,12),
                          (1,2,4,5,6,7,8,12),
                          (2,3,4,5,6,7,8,12),
                          (0,1,2,3,4,8,11,12), (0,1,2,3,5,9,11,12), (0,1,2,3,6,10,11,12), # 1 1 4 1
                          (0,1,3,4,5,9,11,12), (0,1,3,4,6,10,11,12),
                          (0,1,4,5,6,10,11,12),
                          (1,2,3,4,5,9,11,12), (1,2,3,4,6,10,11,12),
                          (1,2,4,5,6,10,11,12),
                          (2,3,4,5,6,10,11,12),
                          (0,1,2,6,7,8,11,12), (0,1,2,6,8,9,11,12), (0,1,2,6,9,10,11,12), # 1 4 1 1
                          (0,1,3,7,8,9,11,12), (0,1,3,7,9,10,11,12),
                          (0,1,4,8,9,10,11,12),
                          (1,2,3,7,8,9,11,12), (1,2,3,7,9,10,11,12),
                          (1,2,4,8,9,10,11,12),
                          (2,3,4,8,9,10,11,12),
                          (0,4,5,6,7,8,11,12), (0,4,5,6,8,9,11,12), (0,4,5,6,9,10,11,12), # 4 1 1 1
                          (0,4,6,7,8,9,11,12), (0,4,6,7,9,10,11,12),
                          (0,4,7,8,9,10,11,12),
                          (1,5,6,7,8,9,11,12), (1,5,6,7,9,10,11,12),
                          (1,5,7,8,9,10,11,12),
                          (2,6,7,8,9,10,11,12),
                          (0,1,2,3,4,6,9,12),  (0,1,2,3,5,7,9,12), (0,1,2,3,6,8,9,12),           # 1 1 2 3
                          (0,1,3,4,5,7,9,12), (0,1,3,4,6,8,9,12),
                          (0,1,4,5,6,8,9,12),
                          (1,2,3,4,5,7,9,12), (1,2,3,4,6,8,9,12),
                          (1,2,4,5,6,8,9,12),
                          (2,3,4,5,6,8,9,12),
                          (0,1,2,4,5,8,11,12), (0,1,2,4,6,9,11,12), (0,1,2,4,7,10,11,12),        # 1 2 3 1
                          (0,1,3,5,6,9,11,12), (0,1,3,5,7,10,11,12),
                          (0,1,4,6,7,10,11,12),
                          (1,2,3,5,6,9,11,12), (1,2,3,5,7,10,11,12),
                          (1,2,4,6,7,10,11,12),
                          (2,3,4,6,7,10,11,12),
                          (0,2,3,6,7,8,11,12), (0,2,3,6,8,9,11,12), (0,2,3,6,9,10,11,12),        # 2 3 1 1
                          (0,2,4,7,8,9,11,12), (0,2,4,7,9,10,11,12),
                          (0,2,5,8,9,10,11,12),
                          (1,3,4,7,8,9,11,12), (1,3,4,7,9,10,11,12),
                          (1,3,5,8,9,10,11,12),
                          (2,4,5,8,9,10,11,12),
                          (0,3,4,5,6,7,10,12),  (0,3,4,5,7,8,10,12), (0,3,4,5,8,9,10,12),  # 3 1 1 2
                          (0,3,5,6,7,8,10,12), (0,3,5,6,8,9,10,12),
                          (0,3,6,7,8,9,10,12),
                          (1,4,5,6,7,8,10,12), (1,4,5,6,8,9,10,12),
                          (1,4,6,7,8,9,10,12),
                          (2,5,6,7,8,9,10,12),
                          (0,1,2,4,5,6,9,12),  (0,1,2,4,6,7,9,12), (0,1,2,4,7,8,9,12),     # 1 2 1 3
                          (0,1,3,5,6,7,9,12), (0,1,3,5,7,8,9,12),
                          (0,1,4,6,7,8,9,12),
                          (1,2,3,5,6,7,9,12), (1,2,3,5,7,8,9,12),
                          (1,2,4,6,7,8,9,12),
                          (2,3,4,6,7,8,9,12),
                          (0,2,3,4,5,8,11,12), (0,2,3,4,6,9,11,12), (0,2,3,4,7,10,11,12),  # 2 1 3 1
                          (0,2,4,5,6,9,11,12), (0,2,4,5,7,10,11,12),
                          (0,2,5,6,7,10,11,12),
                          (1,3,4,5,6,9,11,12), (1,3,4,5,7,10,11,12),
                          (1,3,5,6,7,10,11,12),
                          (2,4,5,6,7,10,11,12),
                          (0,1,2,5,6,7,10,12),  (0,1,2,5,7,8,10,12), (0,1,2,5,8,9,10,12),  # 1 3 1 2
                          (0,1,3,6,7,8,10,12), (0,1,3,6,8,9,10,12),
                          (0,1,4,7,8,9,10,12),
                          (1,2,3,6,7,8,10,12), (1,2,3,6,8,9,10,12),
                          (1,2,4,7,8,9,10,12),
                          (2,3,4,7,8,9,10,12),
                          (0,3,4,5,6,8,11,12), (0,3,4,5,7,9,11,12), (0,3,4,5,8,10,11,12), # 3 1 2 1
                          (0,3,5,6,7,9,11,12), (0,3,5,6,8,10,11,12),
                          (0,3,6,7,8,10,11,12),
                          (1,4,5,6,7,9,11,12), (1,4,5,6,8,10,11,12),
                          (1,4,6,7,8,10,11,12),
                          (2,5,6,7,8,10,11,12),
                          (0,2,3,4,5,6,9,12),  (0,2,3,4,6,7,9,12), (0,2,3,4,7,8,9,12),    # 2 1 1 3
                          (0,2,4,5,6,7,9,12), (0,2,4,5,7,8,9,12),
                          (0,2,5,6,7,8,9,12),
                          (1,3,4,5,6,7,9,12), (1,3,4,5,7,8,9,12),
                          (1,3,5,6,7,8,9,12),
                          (2,4,5,6,7,8,9,12),
                          (0,1,2,3,4,7,10,12),  (0,1,2,3,5,8,10,12), (0,1,2,3,6,9,10,12),  # 1 1 3 2
                          (0,1,3,4,5,8,10,12), (0,1,3,4,6,9,10,12),
                          (0,1,4,5,6,9,10,12),
                          (1,2,3,4,5,8,10,12),  (1,2,3,4,6,9,10,12),
                          (1,2,4,5,6,9,10,12),
                          (2,3,4,5,6,9,10,12),
                          (0,1,2,5,6,8,11,12), (0,1,2,5,7,9,11,12), (0,1,2,5,8,10,11,12),  # 1 3 2 1
                          (0,1,3,6,7,9,11,12), (0,1,3,6,8,10,11,12),
                          (0,1,4,7,8,10,11,12),
                          (1,2,3,6,7,9,11,12), (1,2,3,6,8,10,11,12),
                          (1,2,4,7,8,10,11,12),
                          (2,3,4,7,8,10,11,12),
                          (0,3,4,6,7,8,11,12), (0,3,4,6,8,9,11,12), (0,3,4,6,9,10,11,12),  # 3 2 1 1
                          (0,3,5,7,8,9,11,12), (0,3,5,7,9,10,11,12),
                          (0,4,6,7,9,10,11,12),
                          (1,4,5,7,8,9,11,12), (1,4,5,7,9,10,11,12),
                          (1,4,6,8,9,10,11,12),
                          (2,5,6,8,9,10,11,12),
                          (0,1,2,4,5,7,10,12),  (0,1,2,4,6,8,10,12), (0,1,2,4,7,9,10,12),  # 1 2 2 2
                          (0,1,3,5,6,8,10,12), (0,1,3,5,7,9,10,12),
                          (0,1,4,6,7,9,10,12),
                          (1,2,3,5,6,8,10,12), (1,2,3,5,7,9,10,12),
                          (1,2,4,6,7,9,10,12),
                          (2,3,4,6,7,9,10,12),
                          (0,2,3,5,6,8,11,12), (0,2,3,5,7,9,11,12), (0,2,3,5,8,10,11,12),  # 2 2 2 1
                          (0,2,4,6,7,9,11,12), (0,2,4,6,8,10,11,12),
                          (0,2,5,7,8,10,11,12),
                          (1,3,4,6,7,9,11,12), (1,3,4,6,8,10,11,12),
                          (1,3,5,7,8,10,11,12),
                          (2,4,5,7,8,10,11,12),
                          (0,2,3,5,6,7,10,12),  (0,2,3,5,7,8,10,12), (0,2,3,5,8,9,10,12),  # 2 2 1 2
                          (0,2,4,6,7,8,10,12), (0,2,4,6,8,9,10,12),
                          (0,2,5,7,8,9,10,12),
                          (1,3,4,6,7,8,10,12), (1,3,4,6,8,9,10,12),
                          (1,3,5,7,8,9,10,12),
                          (2,4,5,7,8,9,10,12),
                          (0,2,3,4,5,7,10,12),  (0,2,3,4,6,8,10,12), (0,2,3,4,7,9,10,12),  # 2 1 2 2:: 10x20 = 200, 381
                          (0,2,4,5,6,8,10,12),  (0,2,4,5,7,9,10,12),
                          (0,2,5,6,7,9,10,12),
                          (1,3,4,5,6,8,10,12), (1,3,4,5,7,9,10,12),
                          (1,3,5,6,7,9,10,12),
                          (2,4,5,6,7,9,10,12)],

              'dod_5' :  [(0,1,2,3,4,5,6,7,9,12), (0,1,2,3,4,5,7,8,9,12),     # 1 1 1 1 3
                          (0,1,2,3,5,6,7,8,9,12),
                          (0,1,3,4,5,6,7,8,9,12),
                          (1,2,3,4,5,6,7,8,9,12),
                          (0,1,2,3,4,5,6,9,11,12), (0,1,2,3,4,5,7,10,11,12),    # 1 1 1 3 1
                          (0,1,2,3,5,6,7,10,11,12),
                          (0,1,3,4,5,6,7,10,11,12),
                          (1,2,3,4,5,6,7,10,11,12),
                          (0,1,2,3,4,7,8,9,11,12), (0,1,2,3,4,7,9,10,11,12),    # 1 1 3 1 1
                          (0,1,2,3,5,8,9,10,11,12),
                          (0,1,3,4,5,8,9,10,11,12), 
                          (1,2,3,4,5,8,9,10,11,12), 
                          (0,1,2,5,6,7,8,9,11,12), (0,1,2,5,6,7,9,10,11,12),    # 1 3 1 1 1
                          (0,1,2,5,7,8,9,10,11,12),
                          (0,1,3,6,7,8,9,10,11,12),
                          (1,2,3,6,7,8,9,10,11,12),
                          (0,3,4,5,6,7,8,9,11,12), (0,3,4,5,6,7,9,10,11,12),    # 3 1 1 1 1
                          (0,3,4,5,7,8,9,10,11,12),
                          (0,3,5,6,7,8,9,10,11,12),
                          (1,4,5,6,7,8,9,10,11,12),
                          (0,1,2,3,4,5,6,8,10,12), (0,1,2,3,4,5,7,9,10,12),    # 1 1 1 2 2
                          (0,1,2,3,5,6,7,9,10,12),
                          (0,1,3,4,5,6,7,9,10,12),
                          (1,2,3,4,5,6,7,9,10,12),
                          (0,1,2,3,4,6,7,9,11,12), (0,1,2,3,4,6,8,10,11,12),    # 1 1 2 2 1
                          (0,1,2,3,5,7,8,10,11,12),
                          (0,1,3,4,5,7,8,10,11,12),
                          (1,2,3,4,5,7,8,10,11,12),
                          (0,1,2,4,5,7,8,9,11,12), (0,1,2,4,5,7,9,10,11,12),    # 1 2 2 1 1
                          (0,1,2,4,6,8,9,10,11,12),
                          (0,1,3,5,6,8,9,10,11,12),
                          (1,2,3,5,6,8,9,10,11,12),
                          (0,2,3,5,6,7,8,9,11,12), (0,2,3,5,6,7,9,10,11,12),   # 2 2 1 1 1
                          (0,2,3,5,7,8,9,10,11,12),
                          (0,2,4,6,7,8,9,10,11,12),
                          (1,3,4,6,7,8,9,10,11,12),
                          (0,2,3,4,5,6,7,8,10,12), (0,2,3,4,5,6,8,9,10,12),    # 2 1 1 1 2
                          (0,2,3,4,6,7,8,9,10,12),
                          (0,2,4,5,6,7,8,9,10,12),
                          (1,3,4,5,6,7,8,9,10,12),
                          (0,1,2,3,4,6,7,8,10,12),  (0,1,2,3,4,6,8,9,10,12),   # 1 1 2 1 2
                          (0,1,2,3,5,7,8,9,10,12),
                          (0,1,3,4,5,7,8,9,10,12),
                          (1,2,3,4,5,7,8,9,10,12),
                          (0,1,2,4,5,6,7,9,11,12), (0,1,2,4,5,6,8,10,11,12),    # 1 2 1 2 1
                          (0,1,2,4,6,7,8,10,11,12),
                          (0,1,3,5,6,7,8,10,11,12),
                          (1,2,3,5,6,7,8,10,11,12),
                          (0,2,3,4,5,7,8,9,11,12), (0,2,3,4,5,7,9,10,11,12),    # 2 1 2 1 1
                          (0,2,3,4,6,8,9,10,11,12),
                          (0,2,4,5,6,8,9,10,11,12),
                          (1,3,4,5,6,8,9,10,11,12),
                          (0,1,2,4,5,6,7,8,10,12),  (0,1,2,4,5,6,8,9,10,12),    # 1 2 1 1 2
                          (0,1,2,4,6,7,8,9,10,12),
                          (0,1,3,5,6,7,8,9,10,12),
                          (1,2,3,5,6,7,8,9,10,12),
                          (0,2,3,4,5,6,7,9,11,12), (0,2,3,4,5,6,8,10,11,12),
                          (0,2,3,4,6,7,8,10,11,12),
                          (0,2,4,5,6,7,8,10,11,12),
                          (1,3,4,5,6,7,8,10,11,12)],   # 2 1 1 2 1   ::      15*5 == 75, 456

              'dod_6' :  [(0,1,2,3,4,5,6,7,8,9,10,12),    # 1 1 1 1 1 2
                          (0,1,2,3,4,5,6,7,8,10,11,12),   # 1 1 1 1 2 1
                          (0,1,2,3,4,5,6,8,9,10,11,12),   # 1 1 1 2 1 1
                          (0,1,2,3,4,6,7,8,9,10,11,12),   # 1 1 2 1 1 1
                          (0,1,2,4,5,6,7,8,9,10,11,12),   # 1 2 1 1 1 1
                          (0,2,3,4,5,6,7,8,9,10,11,12)]   # 2 1 1 1 1 1    456 + 6 == 462 (correct total)

               } #####

#-------------------||||||||||||
# slices needed to produce sub-set octachords, starting from the nonachord
# in 'give_#' # is the number of units that are being recombined after slicing
SLICEoct  ={ 'non_1'  : [(0,8), (1,9)], # 8           ### if given a nonachord, slice into octachords
             'non_2'  : [(0,1,2,9), (0,2,3,9), (0,3,4,9), (0,4,5,9), (0,5,6,9), (0,6,7,9), (0,7,8,9)], # 1 7 , 2 6, 3 5, 4 4, 5 3, 6 2, 7 1
             ### if given a decachord, slice into octachords
             'dec_1'  : [(2,10)],
             'dec_2'  : [(0,1,3,10),(1,2,3,10),  # 1 7 
                         (0,2,4,10),(1,3,4,10),  # 2 6 
                         (0,3,5,10),(1,4,5,10),  # 3 5 
                         (0,4,6,10),(1,5,6,10),  # 4 4 
                         (0,5,7,10),(1,6,7,10),  # 5 3 
                         (0,6,8,10),(1,7,8,10), # 6 2 
                         (0,7,9,10),(1,8,9,10)], # 7 1 
             'dec_3'  : [(0,1,2,3,4,10),                # 1 1 6
                         (0,1,2,8,9,10),                # 1 6 1
                         (0,6,7,8,9,10),                # 6 1 1
                         (0,1,2,4,5,10),                # 1 2 5
                         (0,1,2,7,8,10),                # 1 5 2
                         (0,2,3,8,9,10),                # 2 5 1
                         (0,2,3,4,5,10),                # 2 1 5 
                         (0,5,6,7,8,10),                # 5 1 2 
                         (0,5,6,8,9,10),                # 5 2 1 
                         (0,4,5,8,9,10),                # 4 3 1 
                         (0,4,5,6,7,10),                # 4 1 3 
                         (0,1,2,5,6,10),                # 1 3 4 
                         (0,1,2,6,7,10),                # 1 4 3
                         (0,3,4,8,9,10),                # 3 4 1
                         (0,3,4,5,6,10),                # 3 1 4
                         (0,3,4,7,8,10),                # 3 3 2
                         (0,3,4,6,7,10),                # 3 2 3
                         (0,2,3,6,7,10),                # 2 3 3
                         (0,2,3,7,8,10),                # 2 4 2
                         (0,4,5,7,8,10),                # 4 2 2
                         (0,2,3,5,6,10)],               # 2 2 4         #total dec 36

             ### if given a undecachord, slice into octachords
             'und_1'  : [(3,11)],
             'und_2'  : [(0,1,4,11),(1,2,4,11),(2,3,4,11),    # 1 7
                         (0,2,5,11),(1,3,5,11),(2,4,5,11),    # 2 6
                         (0,3,6,11),(1,4,6,11),(2,5,6,11),    # 3 5
                         (0,4,7,11),(1,5,7,11),(2,6,7,11),    # 4 4
                         (0,5,8,11),(1,6,8,11),(2,7,8,11),    # 5 3
                         (0,6,9,11),(1,7,9,11),(2,8,9,11),    # 6 2
                         (0,7,10,11),(1,8,10,11),(2,9,10,11)],# 7 1        21+1 = 22

             'und_3'  : [(0,1,2,3,5,11),(0,1,3,4,5,11),    # 1 1 6
                         (1,2,3,4,5,11),
                         (0,1,2,8,10,11),(0,1,3,9,10,11),  # 1 6 1
                         (1,2,3,9,10,11),
                         (0,6,7,8,10,11),(0,6,8,9,10,11),  # 6 1 1
                         (1,7,8,9,10,11),
                         (0,1,2,4,6,11),(0,1,3,5,6,11),      # 1 2 5
                         (1,2,3,5,6,11),
                         (0,1,2,7,9,11),(0,1,3,8,9,11),      # 1 5 2
                         (1,2,3,8,9,11),
                         (0,2,3,8,10,11),(0,2,4,9,10,11),    # 2 5 1
                         (1,3,4,9,10,11),
                         (0,2,3,4,6,11),(0,2,4,5,6,11),      # 2 1 5
                         (1,3,4,5,6,11),
                         (0,5,6,7,9,11),(0,5,7,8,9,11),      # 5 1 2
                         (1,6,7,8,9,11),
                         (0,5,6,8,10,11),(0,5,7,9,10,11),    # 5 2 1
                         (1,6,7,9,10,11),
                         (0,4,5,8,10,11),(0,4,6,9,10,11),        # 4 3 1
                         (1,5,6,9,10,11),
                         (0,4,5,6,8,11),(0,4,6,7,8,11),          # 4 1 3
                         (1,5,6,7,8,11),
                         (0,1,2,5,7,11),(0,1,3,6,7,11),          # 1 3 4
                         (1,2,3,6,7,11),
                         (0,1,2,6,8,11),(0,1,3,7,8,11),          # 1 4 3
                         (1,2,3,7,8,11),
                         (0,3,4,8,10,11),(0,3,5,9,10,11),        # 3 4 1
                         (1,4,5,9,10,11),
                         (0,3,4,5,7,11),(0,3,5,6,7,11),          # 3 1 4
                         (1,4,5,6,7,11),
                         (0,3,4,7,9,11),(0,3,5,8,9,11),      # 3 3 2
                         (1,4,5,8,9,11),
                         (0,3,4,6,8,11),(0,3,5,7,8,11),      # 3 2 3
                         (1,4,5,7,8,11),
                         (0,2,3,6,8,11),(0,2,4,7,8,11),      # 2 3 3
                         (1,3,4,7,8,11),
                         (0,2,3,7,9,11),(0,2,4,8,9,11),          # 2 4 2
                         (1,3,4,8,9,11),
                         (0,4,5,7,9,11),(0,4,6,8,9,11),          # 4 2 2
                         (1,5,6,8,9,11),
                         (0,2,3,5,7,11),(0,2,4,6,7,11),          # 2 2 4
                         (1,3,4,6,7,11)],                                  #21 * 3 = 63, grand total = 85

             'und_4'  : [(0,1,2,3,4,5,6,11),    # 1 1 1 5
                         (0,1,2,3,4,9,10,11),   # 1 1 5 1
                         (0,1,2,7,8,9,10,11),   # 1 5 1 1
                         (0,5,6,7,8,9,10,11),   # 5 1 1 1
                         (0,1,2,3,4,6,7,11),              # 1 1 2 4
                         (0,1,2,3,4,8,9,11),              # 1 1 4 2
                         (0,1,2,4,5,6,7,11),              # 1 2 1 4
                         (0,1,2,4,5,9,10,11),             # 1 2 4 1
                         (0,1,2,6,7,8,9,11),              # 1 4 1 2
                         (0,1,2,6,7,9,10,11),             # 1 4 2 1
                         (0,2,3,4,5,9,10,11),             # 2 1 4 1
                         (0,2,3,4,5,6,7,11),              # 2 1 1 4
                         (0,4,5,7,8,9,10,11),             # 4 2 1 1
                         (0,2,3,7,8,9,10,11),             # 2 4 1 1
                         (0,4,5,6,7,9,10,11),             # 4 1 2 1
                         (0,4,5,6,7,8,9,11),              # 4 1 1 2
                         (0,1,2,3,4,7,8,11),    # 1 1 3 3
                         (0,1,2,5,6,9,10,11),   # 1 3 3 1
                         (0,3,4,7,8,9,10,11),   # 3 3 1 1
                         (0,3,4,5,6,7,8,11),    # 3 1 1 3
                         (0,1,2,5,6,7,8,11),    # 1 3 1 3
                         (0,3,4,5,6,9,10,11),   # 3 1 3 1
                         (0,1,2,4,5,7,8,11),              # 1 2 2 3
                         (0,1,2,4,5,8,9,11),              # 1 2 3 2
                         (0,2,3,5,6,9,10,11),             # 2 2 3 1
                         (0,2,3,5,6,7,8,11),              # 2 2 1 3
                         (0,2,3,6,7,8,9,11),              # 2 3 1 2
                         (0,2,3,6,7,9,10,11),             # 2 3 2 1
                         (0,2,3,4,5,7,8,11),              # 2 1 2 3
                         (0,2,3,4,5,8,9,11),              # 2 1 3 2
                         (0,3,4,5,6,8,9,11),              # 3 1 2 2
                         (0,1,2,5,6,8,9,11),              # 1 3 2 2
                         (0,3,4,6,7,9,10,11),             # 3 2 2 1
                         (0,3,4,6,7,8,9,11),              # 3 2 1 2
                         (0,2,3,5,6,8,9,11)],   # 2 2 2 2                  35, grand total = 120 (correct total 165-45)

             ### if given a dodecachord, slice into octachords
             'dod_1'  : [(4,12)],
             'dod_2'  : [(0,1,5,12),(1,2,5,12),(2,3,5,12),(3,4,5,12),      # 1  7
                         (0,2,6,12),(1,3,6,12),(2,4,6,12),(3,5,6,12),      # 2  6
                         (0,3,7,12),(1,4,7,12),(2,5,7,12),(3,6,7,12),      # 3  5
                         (0,4,8,12),(1,5,8,12),(2,6,8,12),(3,7,8,12),      # 4  4
                         (0,5,9,12),(1,6,9,12),(2,7,9,12),(3,8,9,12),      # 5  3
                         (0,6,10,12),(1,7,10,12),(2,8,10,12),(3,9,10,12),  # 6  2
                         (0,7,11,12),(1,8,11,12),(2,9,11,12),(3,10,11,12)],# 7  1           total 1 + 28 = 29
             'dod_3'  : [(0,1,2,3,6,12),(0,1,3,4,6,12),(0,1,4,5,6,12),             # 1 1 6 
                         (1,2,3,4,6,12),(1,2,4,5,6,12), 
                         (2,3,4,5,6,12), 
                         (0,1,2,8,11,12),(0,1,3,9,11,12),(0,1,4,10,11,12),         # 1 6 1 
                         (1,2,3,9,11,12),(1,2,4,10,11,12),
                         (2,3,4,10,11,12),
                         (0,6,7,8,11,12),(0,6,8,9,11,12),(0,6,9,10,11,12),         # 6 1 1 
                         (1,7,8,9,11,12),(1,7,9,10,11,12),
                         (2,8,9,10,11,12),                                                
                         (0,2,3,4,7,12),(0,2,4,5,7,12),(0,2,5,6,7,12),     # 2 1 5 
                         (1,3,4,5,7,12),(1,3,5,6,7,12),
                         (2,4,5,6,7,12),
                         (0,1,2,7,10,12),(0,1,3,8,10,12),(0,1,4,9,10,12),  # 1 5 2 
                         (1,2,3,8,10,12),(1,2,4,9,10,12),
                         (2,3,4,9,10,12),
                         (0,5,6,8,11,12),(0,5,7,9,11,12),(0,5,8,10,11,12), # 5 2 1 
                         (1,6,7,9,11,12),(1,6,8,10,11,12),
                         (2,7,8,10,11,12),
                         (0,2,3,8,11,12),(0,2,4,9,11,12),(0,2,5,10,11,12), # 2 5 1 
                         (1,3,4,9,11,12),(1,3,5,10,11,12),
                         (2,4,5,10,11,12),
                         (0,1,2,4,7,12),(0,1,3,5,7,12),(0,1,4,6,7,12),     # 1 2 5 
                         (1,2,3,5,7,12),(1,2,4,6,7,12),
                         (2,3,4,6,7,12),
                         (0,5,6,7,10,12),(0,5,7,8,10,12),(0,5,8,9,10,12),  # 5 1 2 
                         (1,6,7,8,10,12),(1,6,8,9,10,12),
                         (2,7,8,9,10,12),
                         (0,4,5,8,11,12),(0,4,6,9,11,12),(0,4,7,10,11,12),        # 4 3 1 
                         (1,5,6,9,11,12),(1,5,7,10,11,12),
                         (2,6,7,10,11,12),
                         (0,4,5,6,9,12),(0,4,6,7,9,12),(0,4,7,8,9,12),            # 4 1 3 
                         (1,5,6,7,9,12),(1,5,7,8,9,12),
                         (2,6,7,8,9,12),
                         (0,3,4,8,11,12),(0,3,5,9,11,12),(0,3,6,10,11,12),        # 3 4 1 
                         (1,4,5,9,11,12),(1,4,6,10,11,12),
                         (2,5,6,10,11,12),
                         (0,3,4,5,8,12),(0,3,5,6,8,12),(0,3,6,7,8,12),            # 3 1 4 
                         (1,4,5,6,8,12),(1,4,6,7,8,12),
                         (2,5,6,7,8,12),
                         (0,1,2,5,8,12),(0,1,3,6,8,12),(0,1,4,7,8,12),            # 1 3 4 
                         (1,2,3,6,8,12),(1,2,4,7,8,12),
                         (2,3,4,7,8,12),
                         (0,1,2,6,9,12),(0,1,3,7,9,12),(0,1,4,8,9,12),            # 1 4 3 
                         (1,2,3,7,9,12),(1,2,4,8,9,12),
                         (2,3,4,8,9,12),
                         (0,3,4,6,9,12),(0,3,5,7,9,12),(0,3,6,8,9,12),     # 3 2 3 
                         (1,4,5,7,9,12),(1,4,6,8,9,12), 
                         (2,5,6,8,9,12), 
                         (0,2,3,6,9,12),(0,2,4,7,9,12),(0,2,5,8,9,12),     # 2 3 3 
                         (1,3,4,7,9,12),(1,3,5,8,9,12),
                         (2,4,5,8,9,12),
                         (0,3,4,7,10,12),(0,3,5,8,10,12),(0,3,6,9,10,12),  # 3 3 2 
                         (1,4,5,8,10,12),(1,4,6,9,10,12),
                         (2,5,6,9,10,12),
                         (0,2,3,5,8,12),(0,2,4,6,8,12),(0,2,5,7,8,12),               # 2 2 4 
                         (1,3,4,6,8,12),(1,3,5,7,8,12),
                         (2,4,5,7,8,12),
                         (0,2,3,7,10,12),(0,2,4,8,10,12),(0,2,5,9,10,12),            # 2 4 2
                         (1,3,4,8,10,12),(1,3,5,9,10,12),
                         (2,4,5,9,10,12), 
                         (0,4,5,7,10,12),(0,4,6,8,10,12),(0,4,7,9,10,12),            # 4 2 2 
                         (1,5,6,8,10,12),(1,5,7,9,10,12),
                         (2,6,7,9,10,12)],                                               # total 21*6 = 126  grand total = 155


             'dod_4'  : [(0,1,2,3,4,5,7,12),(0,1,2,3,5,6,7,12),      # 1 1 1 5
                         (0,1,3,4,5,6,7,12), 
                         (1,2,3,4,5,6,7,12), 
                         (0,1,2,3,4,9,11,12),(0,1,2,3,5,10,11,12),   # 1 1 5 1
                         (0,1,3,4,5,10,11,12),
                         (1,2,3,4,5,10,11,12),
                         (0,1,2,7,8,9,11,12),(0,1,2,7,9,10,11,12),   # 1 5 1 1
                         (0,1,3,8,9,10,11,12),
                         (1,2,3,8,9,10,11,12),
                         (0,5,6,7,8,9,11,12),(0,5,6,7,9,10,11,12),   # 5 1 1 1
                         (0,5,7,8,9,10,11,12),
                         (1,6,7,8,9,10,11,12),

                         (0,1,2,3,4,6,8,12),(0,1,2,3,5,7,8,12),      # 1 1 2 4
                         (0,1,3,4,5,7,8,12),
                         (1,2,3,4,5,7,8,12), 
                         (0,1,2,3,4,8,10,12),(0,1,2,3,5,9,10,12),    # 1 1 4 2
                         (0,1,3,4,5,9,10,12),
                         (1,2,3,4,5,9,10,12),
                         (0,1,2,4,5,6,8,12),(0,1,2,4,6,7,8,12),      # 1 2 1 4
                         (0,1,3,5,6,7,8,12),
                         (1,2,3,5,6,7,8,12),
                         (0,1,2,4,5,9,11,12),(0,1,2,4,6,10,11,12),   # 1 2 4 1
                         (0,1,3,5,6,10,11,12),
                         (1,2,3,5,6,10,11,12),
                         (0,1,2,6,7,8,10,12),(0,1,2,6,8,9,10,12),    # 1 4 1 2
                         (0,1,3,7,8,9,10,12),
                         (1,2,3,7,8,9,10,12),
                         (0,1,2,6,7,9,11,12),(0,1,2,6,8,10,11,12),   # 1 4 2 1
                         (0,1,3,7,8,10,11,12),   
                         (1,2,3,7,8,10,11,12), 
                         (0,2,3,4,5,9,11,12),(0,2,3,4,6,10,11,12),   # 2 1 4 1
                         (0,2,4,5,6,10,11,12),
                         (1,3,4,5,6,10,11,12),
                         (0,2,3,4,5,6,8,12),(0,2,3,4,6,7,8,12),      # 2 1 1 4
                         (0,2,4,5,6,7,8,12),
                         (1,3,4,5,6,7,8,12),
                         (0,4,5,7,8,9,11,12),(0,4,5,7,9,10,11,12),   # 4 2 1 1
                         (0,4,6,8,9,10,11,12),
                         (1,5,6,8,9,10,11,12),
                         (0,2,3,7,8,9,11,12),(0,2,3,7,9,10,11,12),   # 2 4 1 1 
                         (0,2,4,8,9,10,11,12),
                         (1,3,4,8,9,10,11,12),
                         (0,4,5,6,7,9,11,12),(0,4,5,6,8,10,11,12),   # 4 1 2 1
                         (0,4,6,7,8,10,11,12),
                         (1,5,6,7,8,10,11,12),
                         (0,4,5,6,7,8,10,12),(0,4,5,6,8,9,10,12),    # 4 1 1 2
                         (0,4,6,7,8,9,10,12),
                         (1,5,6,7,8,9,10,12),

                         (0,1,2,3,4,7,9,12),(0,1,2,3,5,8,9,12),            # 1 1 3 3
                         (0,1,3,4,5,8,9,12),
                         (1,2,3,4,5,8,9,12),
                         (0,1,2,5,6,9,11,12),(0,1,2,5,7,10,11,12),         # 1 3 3 1
                         (0,1,3,6,7,10,11,12),
                         (1,2,3,6,7,10,11,12),
                         (0,3,4,7,8,9,11,12),(0,3,4,7,9,10,11,12),         # 3 3 1 1
                         (0,3,5,8,9,10,11,12),
                         (1,4,5,8,9,10,11,12),
                         (0,3,4,5,6,7,9,12),(0,3,4,5,7,8,9,12),            # 3 1 1 3
                         (0,3,5,6,7,8,9,12),
                         (1,4,5,6,7,8,9,12),
                         (0,1,2,5,6,7,9,12),(0,1,2,5,7,8,9,12),            # 1 3 1 3
                         (0,1,3,6,7,8,9,12),
                         (1,2,3,6,7,8,9,12),
                         (0,3,4,5,6,9,11,12),(0,3,4,5,7,10,11,12),         # 3 1 3 1
                         (0,3,5,6,7,10,11,12),
                         (1,4,5,6,7,10,11,12),

                         (0,1,2,4,5,7,9,12),(0,1,2,4,6,8,9,12),            # 1 2 2 3
                         (0,1,3,5,6,8,9,12),
                         (1,2,3,5,6,8,9,12),
                         (0,1,2,4,5,8,10,12),(0,1,2,4,6,9,10,12),          # 1 2 3 2 
                         (0,1,3,5,6,9,10,12),
                         (1,2,3,5,6,9,10,12),
                         (0,2,3,5,6,9,11,12),(0,2,3,5,7,10,11,12),         # 2 2 3 1
                         (0,2,4,6,7,10,11,12),
                         (1,3,4,6,7,10,11,12),
                         (0,2,3,5,6,7,9,12),(0,2,3,5,7,8,9,12),            # 2 2 1 3
                         (0,2,4,6,7,8,9,12),
                         (1,3,4,6,7,8,9,12),
                         (0,2,3,6,7,8,10,12),(0,2,3,6,8,9,10,12),          # 2 3 1 2 
                         (0,2,4,7,8,9,10,12),
                         (1,3,4,7,8,9,10,12),
                         (0,2,3,6,7,9,11,12),(0,2,3,6,8,10,11,12),         # 2 3 2 1
                         (0,2,4,7,8,10,11,12),
                         (1,3,4,7,8,10,11,12),
                         (0,2,3,4,5,7,9,12),(0,2,3,4,6,8,9,12),            # 2 1 2 3
                         (0,2,4,5,6,8,9,12),
                         (1,3,4,5,6,8,9,12),
                         (0,2,3,4,5,8,10,12),(0,2,3,4,6,9,10,12),          # 2 1 3 2 
                         (0,2,4,5,6,9,10,12), 
                         (1,3,4,5,6,9,10,12), 
                         (0,3,4,5,6,8,10,12),(0,3,4,5,7,9,10,12),          # 3 1 2 2
                         (0,3,5,6,7,9,10,12),
                         (1,4,5,6,7,9,10,12),
                         (0,1,2,5,6,8,10,12),(0,1,2,5,7,9,10,12),          # 1 3 2 2
                         (0,1,3,6,7,9,10,12),
                         (1,2,3,6,7,9,10,12),
                         (0,3,4,6,7,9,11,12),(0,3,4,6,8,10,11,12),         # 3 2 2 1 
                         (0,3,5,7,8,10,11,12),
                         (1,4,5,7,8,10,11,12),
                         (0,3,4,6,7,8,10,12),(0,3,4,6,8,9,10,12),          # 3 2 1 2
                         (0,3,5,7,8,9,10,12),
                         (1,4,5,7,8,9,10,12),

                         (0,2,3,5,6,8,10,12),(0,2,3,5,7,9,10,12),  # 2 2 2 2
                         (0,2,4,6,7,9,10,12),
                         (1,3,4,6,7,9,10,12)],                                               # 35 * 4 = 140  grand total 295 

             'dod_5'  : [(0,1,2,3,4,5,6,7,8,12),        # 1 1 1 1 4
                         (0,1,2,3,4,5,6,10,11,12),      # 1 1 1 4 1
                         (0,1,2,3,4,8,9,10,11,12),      # 1 1 4 1 1
                         (0,1,2,6,7,8,9,10,11,12),      # 1 4 1 1 1
                         (0,4,5,6,7,8,9,10,11,12),      # 4 1 1 1 1

                         (0,1,2,3,4,5,6,8,9,12),      # 1 1 1 2 3
                         (0,1,2,3,4,6,7,10,11,12),    # 1 1 2 3 1
                         (0,1,2,4,5,8,9,10,11,12),    # 1 2 3 1 1
                         (0,2,3,6,7,8,9,10,11,12),    # 2 3 1 1 1
                         (0,3,4,5,6,7,8,9,10,12),     # 3 1 1 1 2

                         (0,1,2,3,4,6,7,8,9,12),      # 1 1 2 1 3
                         (0,1,2,4,5,6,7,10,11,12),    # 1 2 1 3 1
                         (0,2,3,4,5,8,9,10,11,12),    # 2 1 3 1 1
                         (0,1,2,5,6,7,8,9,10,12),     # 1 3 1 1 2
                         (0,3,4,5,6,7,8,10,11,12),    # 3 1 1 2 1

                         (0,1,2,4,5,6,7,8,9,12),      # 1 2 1 1 3
                         (0,2,3,4,5,6,7,10,11,12),    # 2 1 1 3 1
                         (0,1,2,3,4,7,8,9,10,12),     # 1 1 3 1 2
                         (0,1,2,5,6,7,8,10,11,12),    # 1 3 1 2 1
                         (0,3,4,5,6,8,9,10,11,12),    # 3 1 2 1 1

                         (0,1,2,3,4,5,6,9,10,12),     # 1 1 1 3 2
                         (0,1,2,3,4,7,8,10,11,12),    # 1 1 3 2 1
                         (0,1,2,5,6,8,9,10,11,12),    # 1 3 2 1 1
                         (0,3,4,6,7,8,9,10,11,12),    # 3 2 1 1 1
                         (0,2,3,4,5,6,7,8,9,12),      # 2 1 1 1 3

                         (0,2,3,5,6,8,9,10,11,12),        # 2 2 2 1 1 
                         (0,2,3,5,6,7,8,9,10,12),         # 2 2 1 1 2
                         (0,2,3,4,5,6,7,9,10,12),         # 2 1 1 2 2 
                         (0,1,2,3,4,6,7,9,10,12),         # 1 1 2 2 2 
                         (0,1,2,4,5,7,8,10,11,12),        # 1 2 2 2 1

                         (0,2,3,5,6,7,8,10,11,12),        # 2 2 1 2 1
                         (0,2,3,4,5,7,8,9,10,12),         # 2 1 2 1 2
                         (0,1,2,4,5,6,7,9,10,12),         # 1 2 1 2 2 
                         (0,2,3,4,5,7,8,10,11,12),        # 2 1 2 2 1 
                         (0,1,2,4,5,7,8,9,10,12)]         # 1 2 2 1 2                # 7 * 5 = 35, grand total = 330 (correct total 495-165)
            } 

#-------------------||||||||||||
# slices needed to produce sub-set nonachords, starting from the decachord

SLICEnon = { 'dec_1'  : [(0,9),(1,10)],
             'dec_2'  : [(0,1,2,10),(0,2,3,10),(0,3,4,10),(0,4,5,10),(0,5,6,10),(0,6,7,10),(0,7,8,10),(0,8,9,10)],  # 1 8, 2 7, etc
             ### if given a undecachord, slice into nonachords
             'und_1'  : [(2,11)],
             'und_2'  : [(0,1,3,11),(1,2,3,11),      # 1 8
                         (0,2,4,11),(1,3,4,11),      # 2 7
                         (0,3,5,11),(1,4,5,11),      # 3 6
                         (0,4,6,11),(1,5,6,11),      # 4 5
                         (0,5,7,11),(1,6,7,11),      # 5 4
                         (0,6,8,11),(1,7,8,11),      # 6 3
                         (0,7,9,11),(1,8,9,11),      # 7 2
                         (0,8,10,11),(1,9,10,11)],   # 8 1
             'und_3'  : [(0,1,2,3,4,11),    # 1 1 7
                         (0,1,2,9,10,11),   # 1 7 1
                         (0,7,8,9,10,11),   # 7 1 1
                         (0,1,2,4,5,11),             # 1 2 6
                         (0,1,2,8,9,11),             # 1 6 2
                         (0,2,3,4,5,11),             # 2 1 6
                         (0,2,3,9,10,11),            # 2 6 1
                         (0,6,7,8,9,11),             # 6 1 2
                         (0,6,7,9,10,11),            # 6 2 1
                         (0,1,2,5,6,11),    # 1 3 5
                         (0,1,2,7,8,11),    # 1 5 3
                         (0,3,4,9,10,11),   # 3 5 1
                         (0,3,4,5,6,11),    # 3 1 5
                         (0,5,6,7,8,11),    # 5 1 3
                         (0,5,6,9,10,11),   # 5 3 1
                         (0,1,2,6,7,11),            # 1 4 4
                         (0,4,5,6,7,11),            # 4 1 4
                         (0,4,5,9,10,11),           # 4 4 1
                         (0,2,3,5,6,11),    # 2 2 5
                         (0,2,3,8,9,11),    # 2 5 2
                         (0,5,6,8,9,11),    # 5 2 2
                         (0,2,3,6,7,11),             # 2 3 4
                         (0,2,3,7,8,11),             # 2 4 3
                         (0,3,4,8,9,11),             # 3 4 2
                         (0,3,4,6,7,11),             # 3 2 4
                         (0,4,5,7,8,11),             # 4 2 3
                         (0,4,5,8,9,11),             # 4 3 2
                         (0,3,4,7,8,11)],   # 3 3 3
             ### if given a dodecachord, slice into nonachords
             'dod_1'  : [(3,12)],
             'dod_2'  : [(0,1,4,12),(1,2,4,12),(2,3,4,12),     # 1 8
                         (0,2,5,12),(1,3,5,12),(2,4,5,12),     # 2 7
                         (0,3,6,12),(1,4,6,12),(2,5,6,12),     # 3 6
                         (0,4,7,12),(1,5,7,12),(2,6,7,12),     # 4 5
                         (0,5,8,12),(1,6,8,12),(2,7,8,12),     # 5 4
                         (0,6,9,12),(1,7,9,12),(2,8,9,12),     # 6 3
                         (0,7,10,12),(1,8,10,12),(2,9,10,12),  # 7 2
                         (0,8,11,12),(1,9,11,12),(2,10,11,12)],# 8 1       # 8 * 3 =  24 + 1 = 25

             'dod_3'  : [(0,1,2,3,5,12),(0,1,3,4,5,12),           # 1 1 7
                         (1,2,3,4,5,12),
                         (0,1,2,9,11,12),(0,1,3,10,11,12),        # 1 7 1
                         (1,2,3,10,11,12),
                         (0,7,8,9,11,12),(0,7,9,10,11,12),        # 7 1 1 
                         (1,8,9,10,11,12),
                         (0,1,2,4,6,12),(0,1,3,5,6,12),     # 1 2 6
                         (1,2,3,5,6,12),
                         (0,1,2,8,10,12),(0,1,3,9,10,12),   # 1 6 2
                         (1,2,3,9,10,12),
                         (0,2,3,4,6,12),(0,2,4,5,6,12),     # 2 1 6
                         (1,3,4,5,6,12),
                         (0,2,3,9,11,12),(0,2,4,10,11,12),  # 2 6 1
                         (1,3,4,10,11,12),
                         (0,6,7,8,10,12),(0,6,8,9,10,12),   # 6 1 2
                         (1,7,8,9,10,12),
                         (0,6,7,9,11,12),(0,6,8,10,11,12),  # 6 2 1
                         (1,7,8,10,11,12),
                         (0,1,2,5,7,12),(0,1,3,6,7,12),             # 1 3 5
                         (1,2,3,6,7,12),
                         (0,1,2,7,9,12),(0,1,3,8,9,12),             # 1 5 3
                         (1,2,3,8,9,12),
                         (0,3,4,9,11,12),(0,3,5,10,11,12),          # 3 5 1 
                         (1,4,5,10,11,12),
                         (0,3,4,5,7,12),(0,3,5,6,7,12),             # 3 1 5 
                         (1,4,5,6,7,12),
                         (0,5,6,7,9,12),(0,5,7,8,9,12),             # 5 1 3
                         (1,6,7,8,9,12),
                         (0,5,6,9,11,12),(0,5,7,10,11,12),          # 5 3 1
                         (1,6,7,10,11,12),
                         (0,1,2,6,8,12),(0,1,3,7,8,12),    # 1 4 4
                         (1,2,3,7,8,12),
                         (0,4,5,6,8,12),(0,4,6,7,8,12),    # 4 1 4
                         (1,5,6,7,8,12),
                         (0,4,5,6,8,12),(0,4,6,7,8,12),    # 4 1 4
                         (1,5,6,7,8,12),
                         (0,2,3,5,7,12),(0,2,4,6,7,12),             # 2 2 5
                         (1,3,4,6,7,12),
                         (0,2,3,8,10,12),(0,2,4,9,10,12),           # 2 5 2
                         (1,3,4,9,10,12),
                         (0,5,6,8,10,12),(0,5,7,9,10,12),           # 5 2 2
                         (1,6,7,9,10,12),
                         (0,2,3,6,8,12),(0,2,4,7,8,12),    # 2 3 4
                         (1,3,4,7,8,12),
                         (0,2,3,7,9,12),(0,2,4,8,9,12),    # 2 4 3
                         (1,3,4,8,9,12),
                         (0,3,4,8,10,12),(0,3,5,9,10,12),  # 3 4 2
                         (1,4,5,9,10,12),
                         (0,3,4,6,8,12),(0,3,5,7,8,12),    # 3 2 4
                         (1,4,5,7,8,12),
                         (0,4,5,7,9,12),(0,4,6,8,9,12),    # 4 2 3
                         (1,5,6,8,9,12),
                         (0,4,5,8,10,12),(0,4,6,9,10,12),  # 4 3 2
                         (1,5,6,9,10,12),
                         (0,3,4,7,9,12),(0,3,5,8,9,12),    # 3 3 3          
                         (1,4,5,8,9,12)],                               #28*3=84  grand total 109

             'dod_4'  : [(0,1,2,3,4,5,6,12),    # 1 1 1 6
                         (0,1,2,3,4,10,11,12),  # 1 1 6 1
                         (0,1,2,8,9,10,11,12),  # 1 6 1 1
                         (0,6,7,8,9,10,11,12),  # 6 1 1 1
                         (0,1,2,3,4,6,7,12),               # 1 1 2 5
                         (0,1,2,3,4,9,10,12),              # 1 1 5 2
                         (0,1,2,4,5,10,11,12),             # 1 2 5 1
                         (0,1,2,4,5,6,7,12),               # 1 2 1 5
                         (0,1,2,7,8,9,10,12),              # 1 5 1 2
                         (0,1,2,7,8,10,11,12),             # 1 5 2 1
                         (0,2,3,8,9,10,11,12),             # 2 5 1 1
                         (0,5,6,8,9,10,11,12),             # 5 2 1 1
                         (0,2,3,4,5,10,11,12),             # 2 1 5 1
                         (0,2,3,4,5,6,7,12),               # 2 1 1 5
                         (0,5,6,7,8,9,10,12),              # 5 1 1 2
                         (0,5,6,7,8,10,11,12),             # 5 1 2 1
                         (0,1,2,3,4,7,8,12),    # 1 1 3 4
                         (0,1,2,3,4,8,9,12),    # 1 1 4 3
                         (0,1,2,5,6,10,11,12),  # 1 3 4 1
                         (0,1,2,5,6,7,8,12),    # 1 3 1 4
                         (0,1,2,6,7,8,9,12),    # 1 4 1 3
                         (0,1,2,6,7,10,11,12),  # 1 4 3 1
                         (0,3,4,8,9,10,11,12),  # 3 4 1 1
                         (0,4,5,8,9,10,11,12),  # 4 3 1 1
                         (0,3,4,5,6,10,11,12),  # 3 1 4 1
                         (0,3,4,5,6,7,8,12),    # 3 1 1 4
                         (0,4,5,6,7,8,9,12),    # 4 1 1 3
                         (0,4,5,6,7,10,11,12),  # 4 1 3 1
                         (0,1,2,4,5,7,8,12),               # 1 2 2 4
                         (0,1,2,4,5,9,10,12),              # 1 2 4 2
                         (0,2,3,5,6,10,11,12),             # 2 2 4 1
                         (0,2,3,5,6,7,8,12),               # 2 2 1 4
                         (0,2,3,4,5,7,8,12),               # 2 1 2 4
                         (0,2,3,4,5,9,10,12),              # 2 1 4 2
                         (0,2,3,7,8,9,10,12),              # 2 4 1 2
                         (0,2,3,7,8,10,11,12),             # 2 4 2 1
                         (0,4,5,7,8,9,10,12),              # 4 2 1 2
                         (0,4,5,7,8,10,11,12),             # 4 2 2 1
                         (0,4,5,6,7,9,10,12),              # 4 1 2 2
                         (0,1,2,6,7,9,10,12),              # 1 4 2 2
                         (0,1,2,5,6,9,10,12),   # 1 3 3 2
                         (0,1,2,5,6,8,9,12),    # 1 3 2 3
                         (0,1,2,4,5,8,9,12),    # 1 2 3 3
                         (0,2,3,4,5,8,9,12),    # 2 1 3 3
                         (0,3,4,5,6,9,10,12),   # 3 1 3 2
                         (0,3,4,5,6,8,9,12),    # 3 1 2 3
                         (0,3,4,6,7,8,9,12),    # 3 2 1 3
                         (0,3,4,6,7,10,11,12),  # 3 2 3 1
                         (0,3,4,7,8,10,11,12),  # 3 3 2 1
                         (0,3,4,7,8,9,10,12),   # 3 3 1 2
                         (0,2,3,6,7,10,11,12),  # 2 3 3 1
                         (0,2,3,6,7,8,9,12),    # 2 3 1 3
                         (0,2,3,5,6,8,9,12),               # 2 2 2 3
                         (0,2,3,5,6,9,10,12),              # 2 2 3 2
                         (0,2,3,6,7,9,10,12),              # 2 3 2 2
                         (0,3,4,6,7,9,10,12)]              # 3 2 2 2                # 56, grand total = 165   (correct is 220-55 = 165)

           }

#-------------------||||||||||||
# slices needed to produce sub-set decachords, starting from the unddecachord

SLICEdec = { 'und_1'  : [(0,10),(1,11)],
             'und_2'  : [(0,1,2,11),(0,2,3,11),(0,3,4,11),(0,4,5,11),(0,5,6,11),(0,6,7,11),(0,7,8,11),(0,8,9,11),(0,9,10,11)],  # tot= 11
             ### if given a dodecachord, slice into decachords
             'dod_1'  : [(2,12)],
             'dod_2'  : [(0,1,3,12),(1,2,3,12),    # 1 9
                         (0,2,4,12),(1,3,4,12),    # 2 8
                         (0,3,5,12),(1,4,5,12),    # 3 7
                         (0,4,6,12),(1,5,6,12),    # 4 6
                         (0,5,7,12),(1,6,7,12),    # 5 5
                         (0,6,8,12),(1,7,8,12),    # 6 4
                         (0,7,9,12),(1,8,9,12),    # 7 3
                         (0,8,10,12),(1,9,10,12),  # 8 2
                         (0,9,11,12),(1,10,11,12)],# 9 1                   # 19
             'dod_3'  : [(0,1,2,3,4,12),                  # 1 1 8
                         (0,1,2,10,11,12),                # 1 8 1
                         (0,8,9,10,11,12),                # 8 1 1
                         (0,1,2,4,5,12),        # 1 2 7
                         (0,1,2,9,10,12),       # 1 7 2
                         (0,2,3,4,5,12),        # 2 1 7
                         (0,2,3,10,11,12),      # 2 7 1
                         (0,7,8,9,10,12),       # 7 1 2
                         (0,7,8,10,11,12),      # 7 2 1
                         (0,1,2,5,6,12),                 # 1 3 6
                         (0,1,2,8,9,12),                 # 1 6 3
                         (0,3,4,5,6,12),                 # 3 1 6
                         (0,3,4,10,11,12),               # 3 6 1
                         (0,6,7,10,11,12),               # 6 3 1
                         (0,6,7,8,9,12),                 # 6 1 3
                         (0,1,2,6,7,12),        # 1 4 5
                         (0,1,2,7,8,12),        # 1 5 4
                         (0,4,5,10,11,12),      # 4 5 1
                         (0,4,5,6,7,12),        # 4 1 5
                         (0,5,6,7,8,12),        # 5 1 4
                         (0,5,6,10,11,12),      # 5 4 1
                         (0,2,3,5,6,12),                 # 2 2 6
                         (0,2,3,9,10,12),                # 2 6 2
                         (0,6,7,9,10,12),                # 6 2 2
                         (0,2,3,6,7,12),        # 2 3 5
                         (0,2,3,8,9,12),        # 2 5 3
                         (0,3,4,9,10,12),       # 3 5 2
                         (0,3,4,6,7,12),        # 3 2 5
                         (0,5,6,8,9,12),        # 5 2 3
                         (0,5,6,9,10,12),       # 5 3 2
                         (0,2,3,7,8,12),                 # 2 4 4
                         (0,4,5,9,10,12),                # 4 4 2
                         (0,4,5,7,8,12),                 # 4 2 4
                         (0,3,4,7,8,12),        # 3 3 4
                         (0,3,4,8,9,12),        # 3 4 3
                         (0,4,5,8,9,12)]       # 4 3 3                 # 36, grand total = 55 ( correct 66-11 = 55)
           }

#-------------------||||||||||||
# slices needed to produce sub-set undecachods, starting from the dodechachod

SLICEund = { 'dod_1'  : [(0,11), (1,12)],
             'dod_2'  : [(0,1,2,12),(0,2,3,12),(0,3,4,12),(0,4,5,12),(0,5,6,12),(0,6,7,12),(0,7,8,12),(0,8,9,12),(0,9,10,12),(0,10,11,12)],  # tot= 12
           }

#-------------------||||||||||||

SLICEdod = {} 




#-------------------||||||||||||
        
#        <TnI>                                            <Tn>
#               no. of registers                          w/o inversion
#card    2cv 3cv 4cv 5cv 6cv 7cv 8cv 9cv 10cv 11cv 12cv   3xv 4xv 5xv 6xv 7xv 8xv 9xv 10xv 11xv 12xv
#   1    0                                                                                
#   2    6                                                                                 
#   3    6   12                                           19                               
#   4    6   12  29                                       19  43                          
#   5    6   12  29  38                                   19  43  66                     
#   6    6   12  29  38  50                               19  43  66  80              
#   7    6   12  29  38  50  38                           19  43  66  80  66   
#   8    6   12  29  38  50  38  29                       19  43  66  80  66  43 
#   9    6   12  29  38  50  38  29  12                   19  43  66  80  66  43  19
#  10    6   12  29  38  50  38  29  12  6                19  43  66  80  66  43  19  6 
#  11    6   12  29  38  50  38  29  12  6    1           19  43  66  80  66  43  19  6    1
#  12    6   12  29  38  50  38  29  12  6    1    1      19  43  66  80  66  43  19  6    1    1
#
# 2cv == 2xv, and 10cv == 10xv (all 6 postition vectors)
#
# 19=20, 43=46 66=70, 79=88 nt exluding inv ersion eq

# number of subsets fr a given card, frm forte p27
# pascals triangle
#        subset card
#card    2   3   4   5   6   7   8   9   10  11  12 
#
#   3    3   1                                           
#   4    6   4   1                                      
#   5    10  10  5   1                                         
#   6    15  20  15  6   1                                       
#   7    21  35  35  21  7   1                                
#   8    28  56  70  56  28  8   1                          
#   9    36  84  126 126 84  36  9   1                      
#  10    45  120 210 252 210_120 45  10  1                   
#  11    55  165 330 462 462 330 165 55  11  1     
#  12    66  220 495 792 924 792 495 220 66  12  1   
#
# to find the number of partitions as made in slices above, subtract the desired number 
# from the number directly above it. for example, to find the number of _new_ slices needed
# to cut a decachord into octachords, find column eight, b/c we are cutting into octachords.
# then find row 10, b/c we are given a decachord. the number is 45. subtract the number above 
# (9) from 45 to get 34, the number of new partitions needed in this group
#---------------------------------------------------------------------------||||||||||||
#---------------------------------------------------------------------------||||||||||||


def subsetCounter(mode, chord, setMatrix, vector, sliceGroup, sliceDictKeys=[]):
   if len(sliceDictKeys) == 0: # for samllest card case, i.e, when one entry in vector
      subSet = chord

      ssCard, ssIndex, ssInv = findNormal(subSet, setMatrix)
      if mode == 'cv': # tn/i types
         vector[ssIndex-1] = vector[ssIndex-1] + 1
      elif mode == 'xv': # tn types: must find a vector register before adding value
         reg = TNREF[ssCard, ssIndex, ssInv]
         vector[reg-1] = vector[reg-1] + 1

   # divisionName is the key for each branch in the slice dictionaries above
   for divisionName in sliceDictKeys:
      for sl in sliceGroup[divisionName]:
         if divisionName.find('1') >= 0:
            subSet = chord[sl[0]:sl[1]]      
         elif divisionName.find('2') >= 0:
            subSet = chord[sl[0]:sl[1]] + chord[sl[2]:sl[3]]   
         elif divisionName.find('3') >= 0:
            subSet = chord[sl[0]:sl[1]] + chord[sl[2]:sl[3]] + chord[sl[4]:sl[5]] 
         elif divisionName.find('4') >= 0:
            subSet = chord[sl[0]:sl[1]] + chord[sl[2]:sl[3]] + chord[sl[4]:sl[5]] + chord[sl[6]:sl[7]] 
         elif divisionName.find('5') >= 0:
            subSet = chord[sl[0]:sl[1]] + chord[sl[2]:sl[3]] + chord[sl[4]:sl[5]] + chord[sl[6]:sl[7]] + chord[sl[8]:sl[9]]
         elif divisionName.find('6') >= 0:
            subSet = chord[sl[0]:sl[1]] + chord[sl[2]:sl[3]] + chord[sl[4]:sl[5]] + chord[sl[6]:sl[7]] + chord[sl[8]:sl[9]] + chord[sl[10]:sl[11]]
         
         ssCard, ssIndex, ssInv = findNormal(subSet, setMatrix)
         if mode == 'cv': # tn/i types
            vector[ssIndex-1] = vector[ssIndex-1] + 1
         elif mode == 'xv': # tn types: must find a vector register before adding value
            reg = TNREF[ssCard, ssIndex, ssInv]
            vector[reg-1] = vector[reg-1] + 1

### these functions find subset vectors fr forte elements, employing partitions 
### derived by hand. in the future these partitions should be calculated by machine
### cv used fr sets under TnI. cx fr Tn classification.

def cv3_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 2 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0]

   if card == 3:
      sliceDictKeys = []
   elif card == 4:
      sliceDictKeys = ('tetr_1', 'tetr_2') # why is tetr_3 not here?
   elif card == 5:
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3')
   elif card == 6:
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3')
   elif card == 7 :
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3')
   elif card == 8 :
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 
                       'oct_1', 'oct_2', 'oct_3')
   elif card == 9 :
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 
                       'oct_1', 'oct_2', 'oct_3','non_1', 'non_2', 'non_3')
   elif card == 10 :
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 
                       'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'dec_1', 'dec_2', 'dec_3')
   elif card == 11 :
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 
                       'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'dec_1', 'dec_2', 'dec_3', 'und_1', 'und_2', 'und_3')
   elif card == 12 :
      sliceDictKeys = ('tetr_1', 'tetr_2', 'tetr_3', 'pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 
                       'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'dec_1', 'dec_2', 'dec_3', 'und_1', 'und_2', 'und_3', 'dod_1', 'dod_2', 'dod_3')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEtri, sliceDictKeys)

   sum = 0
   for i in vector:
      sum = sum + i
   return tuple(vector)


def cv4_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 3 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0]

   if card == 4:
      sliceDictKeys = []
   elif card == 5:
      sliceDictKeys = ('pent_1', 'pent_2')
   elif card == 6:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3')
   elif card == 7:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'sept_4')
   elif card == 8:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'sept_4',
                       'oct_1', 'oct_2', 'oct_3', 'oct_4')
   elif card == 9:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'sept_4',
                       'oct_1', 'oct_2', 'oct_3', 'oct_4', 'non_1', 'non_2', 'non_3', 'non_4')
   elif card == 10:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'sept_4',
                       'oct_1', 'oct_2', 'oct_3', 'oct_4', 'non_1', 'non_2', 'non_3', 'non_4', 'dec_1', 'dec_2', 'dec_3', 'dec_4')
   elif card == 11:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'sept_4',
                       'oct_1', 'oct_2', 'oct_3', 'oct_4', 'non_1', 'non_2', 'non_3', 'non_4', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 
                       'und_1', 'und_2', 'und_3', 'und_4')
   elif card == 12:
      sliceDictKeys = ('pent_1', 'pent_2', 'pent_3', 'hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'sept_4',
                       'oct_1', 'oct_2', 'oct_3', 'oct_4', 'non_1', 'non_2', 'non_3', 'non_4', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 
                       'und_1', 'und_2', 'und_3', 'und_4', 'dod_1', 'dod_2', 'dod_3', 'dod_4')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEtetr, sliceDictKeys)

   sum = 0
   for i in vector:
      sum = sum + i
   return tuple(vector)

def cv5_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 4 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0]

   if card == 5:
      sliceDictKeys = []
   elif card == 6:
      sliceDictKeys = ('hex_1', 'hex_2')
   elif card == 7 :
      sliceDictKeys = ('hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3')
   elif card == 8 :
      sliceDictKeys = ('hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'oct_1', 'oct_2', 'oct_3', 'oct_4')
   elif card == 9 :
      sliceDictKeys = ('hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'oct_1', 'oct_2', 'oct_3', 'oct_4',
                       'non_1', 'non_2', 'non_3', 'non_4', 'non_5')
   elif card == 10 :
      sliceDictKeys = ('hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'oct_1', 'oct_2', 'oct_3', 'oct_4',
                       'non_1', 'non_2', 'non_3', 'non_4', 'non_5', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 'dec_5')
   elif card == 11 :
      sliceDictKeys = ('hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'oct_1', 'oct_2', 'oct_3', 'oct_4',
                       'non_1', 'non_2', 'non_3', 'non_4', 'non_5', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 'dec_5', 
                       'und_1', 'und_2', 'und_3', 'und_4', 'und_5')
   elif card == 12 :
      sliceDictKeys = ('hex_1', 'hex_2', 'hex_3', 'sept_1', 'sept_2', 'sept_3', 'oct_1', 'oct_2', 'oct_3', 'oct_4',
                       'non_1', 'non_2', 'non_3', 'non_4', 'non_5', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 'dec_5', 
                       'und_1', 'und_2', 'und_3', 'und_4', 'und_5', 'dod_1', 'dod_2', 'dod_3', 'dod_4', 'dod_5')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEpent, sliceDictKeys)

   sum = 0
   for i in vector:
      sum = sum + i
   return tuple(vector)


def cv6_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 5 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,]

   if card == 6:
      sliceDictKeys = []
   elif card == 7 :
      sliceDictKeys = ('sept_1', 'sept_2')
   elif card == 8 :
      sliceDictKeys = ('sept_1', 'sept_2', 'oct_1', 'oct_2', 'oct_3')
   elif card == 9 :
      sliceDictKeys = ('sept_1', 'sept_2', 'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'non_4')
   elif card == 10 :
      sliceDictKeys = ('sept_1', 'sept_2', 'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'non_4', 
                       'dec_1', 'dec_2', 'dec_3', 'dec_4', 'dec_5')
   elif card == 11 :
      sliceDictKeys = ('sept_1', 'sept_2', 'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'non_4', 
                       'dec_1', 'dec_2', 'dec_3', 'dec_4', 'dec_5', 'und_1', 'und_2', 'und_3', 'und_4', 'und_5', 'und_6')
   elif card == 12 :
      sliceDictKeys = ('sept_1', 'sept_2', 'oct_1', 'oct_2', 'oct_3', 'non_1', 'non_2', 'non_3', 'non_4', 
                       'dec_1', 'dec_2', 'dec_3', 'dec_4', 'dec_5', 'und_1', 'und_2', 'und_3', 'und_4', 'und_5', 'und_6', 
                       'dod_1', 'dod_2', 'dod_3', 'dod_4', 'dod_5', 'dod_6')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEhex, sliceDictKeys)

   sum = 0
   for i in vector:
      sum = sum + i
   return tuple(vector)


def cv7_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 6 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0]

   if card == 7:
      sliceDictKeys = []
   elif card == 8 :
      sliceDictKeys = ('oct_1', 'oct_2')
   elif card == 9 :
      sliceDictKeys = ('oct_1', 'oct_2', 'non_1', 'non_2', 'non_3')
   elif card == 10 :
      sliceDictKeys = ('oct_1', 'oct_2', 'non_1', 'non_2', 'non_3', 'dec_1', 'dec_2', 'dec_3', 'dec_4')
   elif card == 11 :
      sliceDictKeys = ('oct_1', 'oct_2', 'non_1', 'non_2', 'non_3', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 
                       'und_1', 'und_2', 'und_3', 'und_4', 'und_5')
   elif card == 12 :
      sliceDictKeys = ('oct_1', 'oct_2', 'non_1', 'non_2', 'non_3', 'dec_1', 'dec_2', 'dec_3', 'dec_4', 
                       'und_1', 'und_2', 'und_3', 'und_4', 'und_5', 'dod_1', 'dod_2', 'dod_3', 'dod_4', 'dod_5', 'dod_6')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEsept, sliceDictKeys)

   sum = 0
   for i in vector:
      sum = sum + i
   return tuple(vector)


def cv8_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 7 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0]

   if card == 8:
      sliceDictKeys = []
   elif card == 9 :
      sliceDictKeys = ('non_1', 'non_2')
   elif card == 10:
      sliceDictKeys = ('non_1', 'non_2', 'dec_1', 'dec_2', 'dec_3')
   elif card == 11:
      sliceDictKeys = ('non_1', 'non_2', 'dec_1', 'dec_2', 'dec_3', 'und_1', 'und_2', 'und_3', 'und_4')
   elif card == 12:
      sliceDictKeys = ('non_1', 'non_2', 'dec_1', 'dec_2', 'dec_3', 'und_1', 'und_2', 'und_3', 'und_4', 
                       'dod_1', 'dod_2', 'dod_3', 'dod_4', 'dod_5')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEoct, sliceDictKeys)

   return tuple(vector)


def cv9_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 8 or card > 12:
      return "n/a"

   if mode == 'cv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0]
   elif mode == 'xv':
      vector = [0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0]

   if card == 9:
      sliceDictKeys = []
   elif card == 10:
      sliceDictKeys = ('dec_1', 'dec_2')
   elif card == 11:
      sliceDictKeys = ('dec_1', 'dec_2', 'und_1', 'und_2', 'und_3')
   elif card == 12:
      sliceDictKeys = ('dec_1', 'dec_2', 'und_1', 'und_2', 'und_3', 'dod_1', 'dod_2', 'dod_3', 'dod_4')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEnon, sliceDictKeys)

   return tuple(vector)


def cv10_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 9 or card > 12:
      return "n/a"

   vector = [0,0,0,0,0,0] #same for both modes
 
   if card == 10:
      sliceDictKeys = []
   elif card == 11:
      sliceDictKeys = ('und_1', 'und_2')
   elif card == 12:
      sliceDictKeys = ('und_1', 'und_2', 'dod_1', 'dod_2', 'dod_3')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEdec, sliceDictKeys)

   return tuple(vector)


def cv11_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 10 or card > 12:
      return "n/a"

   vector = [0] # same for both modes

   if card == 11:
      sliceDictKeys = []
   elif card == 12:
      sliceDictKeys = ('dod_1', 'dod_2')
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEund, sliceDictKeys)

   return tuple(vector)


def cv12_anal(set_class, setMatrix, mode):                  #sc chord as list of pcs
   chord = list(set_class)
   card = len(chord)
   if card <= 11 or card > 12:
      return "n/a"

   vector = [0] # same for both modes

   if card == 12:
      sliceDictKeys = []
   # create subset partitions, analyze, and score vector
   subsetCounter(mode, chord, setMatrix, vector, SLICEdod, sliceDictKeys)

   return tuple(vector)


#-----------------------------------------------------------------||||||||||||--
#-----------------------------------------------------------------||||||||||||--


# these functions are used to generate SC.DICT; they needed on data in this
# file. kept iff SC.DICT needs to be regerated; no doc entry is supplied, however.

def tn_dir():
   for x in range(1,12):
      index = 1
      #SCDICT stores each cardinality of dictionary
      key_list = SCdata.SCDICT[x].keys()         
      a = []
      for q in range(1,60):                #60 is the maximum number of forte indexs (not_sets)
         for key in key_list:
            if q == key[0] and key[1] == 0:
               a.append(key)
            elif q == key[0]:
               if key[1] == 1:
                  a.append(key)
               if key[1] == -1:
                  a.append(key)
      counter = 0
      length = len(a)
      for element in a:
         if a[counter][1] == -1 and a[counter + 1][1] == 1 and a[counter][0] == a[counter + 1][0]:
            b = a[counter]
            a[counter]     = a[counter + 1]
            a[counter + 1] = b
            counter = counter + 2
         else: counter = counter + 1
         if counter == length -1:
            break

      for tuple in a:
         print "           (%i, %i, %i) : %i,   " % (x, tuple[0], tuple[1] , index)
         index = index + 1
   return


def allCvectorString(card, index, forte, space, mode, inversion='normal'):
   # gets all cv (tn/i) vectors and returns as a string
   dict = '' 
   if inversion == 'inversion':
      set = inverter(forte[card][index][0]) # take inversion
   else:
      set = forte[card][index][0]

   entry = cv3_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #3%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv4_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #4%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv5_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #5%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv6_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #6%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv7_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #7%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv8_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #8%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv9_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #9%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv10_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #10%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv11_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #11%s\n" % (repr(entry).replace(' ',''), mode)
   entry = cv12_anal(set, forte, mode)
   if entry != 'n/a':
      dict = dict + space + "%s, #12%s\n" % (repr(entry).replace(' ',''), mode)
   return dict


# creates SC database as a tuple
def gen_dictTuple(min_card=1, max_card=12):
   space = "                   "
   space2 = "         "
   counter = 1
   for card in range(min_card,(max_card+1)):
      print "\n#+++++++++++++++++\n#cardinality %s" % card
      for index in range(1, len(forte[card])):
         inv = forte[card][index][2][1]  #frm invariance vector
         if index == 1:
            dict = "card_%s ={" % card
         else: dict = space2
         if inv != 0:                           #symmetrical
            dict = dict + "("+string.ljust(repr(index), 2)+", 0) :("
            dict =         dict + "forte[%s][%s][0], " % (card, index) + "#%s\n" % counter   #0
            dict = dict + space + "forte[%s][%s][2], #var\n" % (card, index)                     #1
            dict = dict + space + "forte[%s][%s][1], #icv\n" % (card, index)                     #2
            # adds all vectos as as a string
            dict = dict + allCvectorString(card, index, forte, space, 'cv', 'normal')
            dict = dict + allCvectorString(card, index, forte, space, 'xv', 'normal')

            dict = dict + space + ")," #end
            counter = counter + 1

         else:                                  #has inversion
            dict = dict + "("+ string.ljust(repr(index), 2) +", 1) :("
            dict =         dict + "forte[%s][%s][0], " % (card, index) + "#%s\n" % counter   #0
            dict = dict + space + "forte[%s][%s][2], #var\n" % (card, index)                     #1
            dict = dict + space + "forte[%s][%s][1], #icv\n" % (card, index)                     #2
            # adds all vectos as as a string
            dict = dict + allCvectorString(card, index, forte, space, 'cv', 'normal')
            dict = dict + allCvectorString(card, index, forte, space, 'xv', 'normal')

            dict = dict + space + "),\n" #end
            counter = counter + 1

            inversion = inverter(forte[card][index][0])

            dict = dict + space2 + "(" + string.ljust(repr(index), 2) + ",-1) :("
            dict = dict + "%s, " % string.replace(repr(inversion)," ","")
            dict = dict +                                                    "#%s\n" % counter
            dict = dict + space + "forte[%s][%s][2], #var\n" % (card, index)
            dict = dict + space + "forte[%s][%s][1], #icv\n" % (card, index)
            # adds all vectos as as a string
            dict = dict + allCvectorString(card, index, forte, space, 'cv', 'normal')
            dict = dict + allCvectorString(card, index, forte, space, 'xv', 'inversion')

            dict = dict + space + ")," #end
            counter = counter + 1
         print dict
      print "        ", "}"
   print "\n\n"


#-----------------------------------------------------------------||||||||||||--

import sys
from athenaCL.libATH import dialog

class Print_to_File:
   """ temporarily redirects standard io (print functions) to a file"""
   def __init__(self, last_path_used=""):
      while 1:
         try:
            self.file_path, ok = dialog.promptPutFile("name your csound score:", "ath.sco", last_path_used)
            if ok == 0:
               break
            self.stdout_init = sys.stdout    ### save value of stdout for later
            pathname = self.file_path
            filename = self.file_path
            sys.stdout = open(pathname, 'w')  #/* open std out */
            break
         except IOError:
            dialog.msgOut("error: file is busy!!\n\neither close or choose new name.")
      
   def close_file(self):
      sys.stdout.close() #/* close std out */
      sys.stdout = self.stdout_init       ### return original value to stdout
      filename = self.file_path
      return filename, self.file_path  

class genSC:
   def __init__(self, min_card=1, max_card=12): 
      f = Print_to_File()
      gen_dictTuple(min_card, max_card)
      name, pathname = f.close_file()  #/*returns filename*/
      




#-----------------------------------------------------------------||||||||||||--
#-----------------------------------------------------------------||||||||||||--
# originally part of the file 'scpartition.py'






        
#        <TnI>                                            <Tn>
#               no. of registers                          w/o inversion
#card    2cv 3cv 4cv 5cv 6cv 7cv 8cv 9cv 10cv 11cv 12cv   3xv 4xv 5xv 6xv 7xv 8xv 9xv 10xv 11xv 12xv
#   1    0                                                                                
#   2    6                                                                                 
#   3    6   12                                           19                               
#   4    6   12  29                                       19  43                          
#   5    6   12  29  38                                   19  43  66                     
#   6    6   12  29  38  50                               19  43  66  80              
#   7    6   12  29  38  50  38                           19  43  66  80  66   
#   8    6   12  29  38  50  38  29                       19  43  66  80  66  43 
#   9    6   12  29  38  50  38  29  12                   19  43  66  80  66  43  19
#  10    6   12  29  38  50  38  29  12  6                19  43  66  80  66  43  19  6 
#  11    6   12  29  38  50  38  29  12  6    1           19  43  66  80  66  43  19  6    1
#  12    6   12  29  38  50  38  29  12  6    1    1      19  43  66  80  66  43  19  6    1    1
#
# 2cv == 2xv, and 10cv == 10xv (all 6 postition vectors)
#
# 19=20, 43=46 66=70, 79=88 nt exluding inv ersion eq

# number of subsets fr a given card, frm forte p27
# pascals triangle
#        subset card
#card    2   3   4   5   6   7   8   9   10  11  12 
#
#   3    3   1                                           
#   4    6   4   1                                      
#   5    10  10  5   1                                         
#   6    15  20  15  6   1                                       
#   7    21  35  35  21  7   1                                
#   8    28  56  70  56  28  8   1                          
#   9    36  84  126 126 84  36  9   1                      
#  10    45  120 210 252 210 120 45  10  1                   
#  11    55  165 330 462 462 330 165 55  11  1     
#  12    66  220 495 792 924 792 495 220 66  12  1   
# 


# sum 8, 2-part divisions
# 1 7
# 2 6
# 3 5
# 4 4
# 5 3
# 6 2
# 7 1

# sum 8, 3-part divisions
# 1 1 6
# 1 6 1
# 6 1 1
# 
# 1 2 5
# 1 5 2
# 2 5 1
# 2 1 5
# 5 1 2
# 5 2 1
# 
# 4 3 1
# 4 1 3
# 1 3 4
# 1 4 3
# 3 4 1
# 3 1 4
# 
# 3 3 2
# 3 2 3
# 2 3 3
# 
# 2 4 2
# 4 2 2
# 2 2 4
# 

# sum 8, 4-part divisions
# 
# 1 1 1 5
# 1 1 5 1
# 1 5 1 1
# 5 1 1 1
# 
# 1 1 2 4
# 1 1 4 2
# 1 2 1 4
# 1 2 4 1
# 1 4 1 2
# 1 4 2 1
# 2 1 4 1
# 2 1 1 4
# 4 2 1 1
# 2 4 1 1
# 4 1 2 1
# 4 1 1 2
# 
# 1 1 3 3
# 1 3 3 1
# 3 3 1 1
# 3 1 1 3
# 1 3 1 3
# 3 1 3 1
# 
# 1 2 2 3
# 1 2 3 2
# 2 2 3 1
# 2 2 1 3
# 2 3 1 2
# 2 3 2 1
# 2 1 2 3
# 2 1 3 2
# 3 1 2 2
# 1 3 2 2
# 3 2 2 1
# 3 2 1 2 
# 
# 2 2 2 2
# 

# sum 8, 5-part divisions
# 
# 1 1 1 1 4
# 1 1 1 4 1
# 1 1 4 1 1
# 1 4 1 1 1
# 4 1 1 1 1
# 
#   1 1 1 2 3
#   1 1 2 3 1
#   1 2 3 1 1
#   2 3 1 1 1
#   3 1 1 1 2  #
#   
#   1 1 2 1 3
#   1 2 1 3 1
#   2 1 3 1 1
#   1 3 1 1 2
#   3 1 1 2 1  # 
#   
#   1 2 1 1 3
#   2 1 1 3 1
#   1 1 3 1 2
#   1 3 1 2 1
#   3 1 2 1 1
#   
#   1 1 1 3 2  # 
#   1 1 3 2 1
#   1 3 2 1 1
#   3 2 1 1 1
#   2 1 1 1 3
# 
# 2 2 2 1 1
# 2 2 1 1 2
# 2 1 1 2 2
# 1 1 2 2 2
# 1 2 2 2 1
# 
# 2 2 1 2 1
# 2 1 2 1 2
# 1 2 1 2 2
# 2 1 2 2 1
# 1 2 2 1 2











############################
# non divisions

# sum 9, 3-part divisions
# 
# 1 1 7
# 1 7 1
# 7 1 1
# 
# 1 2 6
# 1 6 2
# 2 1 6
# 2 6 1
# 6 1 2
# 6 2 1
# 
# 1 3 5
# 1 5 3
# 3 5 1
# 3 1 5
# 5 1 3
# 5 3 1
# 
# 1 4 4
# 4 1 4
# 4 4 1
# 
# 2 2 5
# 2 5 2
# 5 2 2
# 
# 2 3 4
# 2 4 3
# 3 4 2
# 3 2 4
# 4 2 3
# 4 3 2
# 
# 3 3 3
# 
# # sum 9, 4-part divisions
# 
# 1 1 1 6
# 1 1 6 1
# 1 6 1 1
# 6 1 1 1
# 
# 1 1 2 5
# 1 1 5 2
# 1 2 5 1
# 1 2 1 5
# 1 5 1 2
# 1 5 2 1
# 2 5 1 1
# 5 2 1 1
# 2 1 5 1
# 2 1 1 5
# 5 1 1 2
# 5 1 2 1
# 
# 1 1 3 4
# 1 1 4 3
# 1 3 4 1
# 1 3 1 4
# 1 4 1 3
# 1 4 3 1
# 3 4 1 1
# 4 3 1 1
# 3 1 4 1
# 3 1 1 4
# 4 1 1 3
# 4 1 3 1
# 
# 1 2 2 4
# 1 2 4 2
# 2 2 4 1
# 2 2 1 4
# 2 1 2 4
# 2 1 4 2
# 2 4 1 2
# 2 4 2 1
# 4 2 1 2
# 4 2 2 1
# 4 1 2 2
# 1 4 2 2
# 
# 1 3 3 2
# 1 3 2 3
# 1 2 3 3
# 2 1 3 3
# 3 1 3 2
# 3 1 2 3
# 3 2 1 3
# 3 2 3 1
# 3 3 2 1
# 3 3 1 2
# 2 3 3 1
# 2 3 1 3
# 
# 2 2 2 3
# 2 2 3 2
# 2 3 2 2
# 3 2 2 2
#  
# 




############################
# dec divisions

# sum 10, 2-part divisions
# 
# 1 9
# 2 8
# 3 7
# 4 6
# 5 5
# 6 4
# 7 3
# 8 2
# 9 1
# 
# # sum 10, 3-part divisions
# 
# 1 1 8
# 1 8 1
# 8 1 1
# 
# 1 2 7
# 1 7 2
# 2 1 7
# 2 7 1
# 7 1 2
# 7 2 1
# 
# 1 3 6
# 1 6 3
# 3 1 6
# 3 6 1
# 6 3 1
# 6 1 3
# 
# 1 4 5
# 1 5 4
# 4 5 1
# 4 1 5
# 5 1 4
# 5 4 1
# 
# 2 2 6
# 2 6 2
# 6 2 2
# 
# 2 3 5
# 2 5 3
# 3 5 2
# 3 2 5
# 5 2 3
# 5 3 2
# 
# 2 4 4
# 4 4 2
# 4 2 4
# 
# 3 3 4
# 3 4 3
# 4 3 3
# 
# 
# 
# 




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.