@@ -261,14 +261,15 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
261
261
"# Tracer le quadrillage principal en bleu clair."
262
262
self .fin_col , self .fin_lin = self .deb_col + self .tot_col , self .deb_lin + self .tot_lin
263
263
self .deb_col0 , self .deb_lin0 = self .deb_col , self .deb_lin
264
- for i in range (67 ):
264
+ for i in range (68 ):
265
265
self .tableau .create_line (self .deb_col , self .deb_lin0 , self .fin_col , self .deb_lin0 ,
266
266
fill = "lightblue" , dash = (1 , 1 ))
267
267
self .tableau .create_line (self .deb_col0 , self .deb_lin , self .deb_col0 , self .fin_lin ,
268
268
fill = "lightblue" , dash = (1 , 1 ))
269
269
self .deb_col0 += self .col
270
270
self .deb_lin0 += self .lin
271
271
272
+ print (lineno (), "di_colon" , di_colon [:6 ])
272
273
if di_colon == ["" ]:
273
274
di_colon = []
274
275
self .colonne_bin = di_colon # Première colonne aux modes binaires uniques. L'index de l'élément = La ligne.
@@ -280,13 +281,13 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
280
281
"# Exécution de la fonction qui sert à alimenter les boutons horizontaux et verticaux."
281
282
if len (di_colon ) == 0 :
282
283
"# self.gammes_arp() # Fonction découvertes binaires selon les gammes."
283
- self .gammes_arp () # Fonction découvertes binaires selon les gammes.
284
+ self .gammes_arp () # Fonction découvertes des gammes binarisées .
284
285
self .borne [1 ] = int ([self .dic_codage [(44 , '102034050607' )][0 ][1 ]][0 ])
285
286
("self borne[1]" , self .borne [1 ], type (self .borne [1 ]), "|" , None , lineno ())
286
287
# self borne[1] 1111111 <class 'int'> | None 281.
287
288
else :
288
289
"# self.gammes_log() # Fonction découvertes des gammes selon les binaires."
289
- self .gammes_log () # Fonction découvertes des gammes selon les binaires .
290
+ self .gammes_log () # Fonction découvertes des gammes binarisées .
290
291
self .borne [1 ] = di_colon [0 ]
291
292
("self borne[1]" , self .borne [1 ], type (self .borne [1 ]), "|" , di_colon [0 ], lineno ())
292
293
# self borne[1] 1000001 <class 'int'> | 1000001 287
@@ -297,12 +298,18 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
297
298
self .mod_type = []
298
299
self .dic_trans = {}
299
300
self .table_bin = self .colonne_bin .copy ()
300
- (lineno (), "colonne_bin" , self .colonne_bin , "\n colonne_gam" , self .colonne_gam )
301
+ (lineno (), "colonne_bin" , self .colonne_bin , "\n colonne_gam" , self .colonne_gam . keys () )
301
302
(lineno (), "Long colonne_bin" , len (self .colonne_bin ), "Long colonne_gam" , len (self .colonne_gam .keys ()))
302
303
303
304
"# Visionner les modes binaires par l'écriture."
304
- (lineno (), " colonne_bin" , self .colonne_bin )
305
+ if self .colonne_bin .count ("" ) == 0 :
306
+ self .colonne_bin .insert (0 , "" )
307
+ self .colonne_bin .insert (0 , "" )
308
+ elif self .colonne_bin .count ("" ) == 1 :
309
+ self .colonne_bin .insert (0 , "" )
310
+ (lineno (), " colonne_bin" , self .colonne_bin [:6 ])
305
311
deb_col1 , deb_lin1 = self .deb_col + 6 , self .deb_lin + 26
312
+ (lineno (), "deb_col1, deb_lin1" , deb_col1 , deb_lin1 )
306
313
for colin in range (len (self .colonne_bin )):
307
314
self .tableau .create_text (deb_col1 , deb_lin1 , text = self .colonne_bin [colin ], font = self .police1 )
308
315
deb_lin1 += self .lin
@@ -339,14 +346,22 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
339
346
340
347
"# Écriture des noms et les degrés des soixante-six gammes."
341
348
# gammes_bin = Les gammes aux modes binaires existants.
349
+ (lineno (), "self.gammes_bin" , self .gammes_bin , " " )
350
+ # 342 self.gammes_bin {'x26-': 'Ok', '*5': 'Ok', '-34': 'Ok', 'o63-': 'Ok', 'o34x': 'Ok', '-25o': 'Ok',
351
+ # '-45x': 'Ok', '-46o': 'Ok', '*6': 'Ok', 'o65-': 'Ok', '+34x': 'Ok', 'x36+': 'Ok', '^3': 'Ok', '^2': 'Ok',
352
+ # '+35x': 'Ok', '+23x': 'Ok', 'o35-': 'Ok', '+45x': 'Ok', 'x46+': 'Ok', '^4': 'Ok', 'o6': 'Ok', '+56': 'Ok',
353
+ # '-56': 'Ok', '-56+': 'Ok', '+25-': 'Ok', '-26+': 'Ok', '+26-': 'Ok', '+26': 'Ok', '+2': 'Ok', '-34x': 'Ok',
354
+ # '+34': 'Ok', 'x3': 'Ok', 'o5': 'Ok', '-35': 'Ok', '+6': 'Ok'}
355
+ (lineno (), "self.colonne_gam" , self .colonne_gam , "" )
356
+ print (lineno (), " *********************************************** " )
342
357
coq2 = 1
343
358
color1 , color2 = "black" , "lavender"
344
359
mul_bin = False # Si la gamme en cours a plusieurs ensembles de degrés.
345
360
col0 , lin0 = self .deb_col + 24 , self .deb_lin + 26
346
361
recaler = True
347
362
for k_col , v_lin in self .colonne_gam .items ():
348
363
col1 , sig = (k_col [0 ] * self .col ) + col0 , 0
349
- # print( "colonne_gam", colonne_gam[k_col], "mul_bin", mul_bin)
364
+ ( lineno (), "colonne_gam" , self . colonne_gam [k_col ], "mul_bin" , mul_bin )
350
365
for val in v_lin :
351
366
if k_col [1 ] == 0 :
352
367
if val in self .gammes_bin .keys ():
@@ -356,8 +371,8 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
356
371
color1 = "black"
357
372
color2 = "lavender"
358
373
lin1 = (k_col [1 ] * self .lin ) + lin0
359
- # print( "___ col1", col1, "lin1", lin1, "v_lin", v_lin)
360
- # print( "*** k_col", k_col[1], "val", type(val), len(val), val)
374
+ ( lineno (), "___ col1" , col1 , "lin1" , lin1 , "v_lin" , v_lin )
375
+ ( lineno (), "*** k_col" , k_col [1 ], "val" , type (val ), len (val ), val )
361
376
if len (val ) > 1 : # Le dictionnaire 'multi' informe sur les multilistes.
362
377
if val in multi .keys () and multi [val ]:
363
378
mul_bin = True # print("val", val, colonne_gam[k_col], "multi", multi[val])
@@ -380,6 +395,7 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
380
395
col3 , lin3 = (col1 - 6 , lin1 - 6 ), (col1 + 6 , lin1 + 6 )
381
396
self .tableau .create_rectangle (col3 , lin3 , fill = "gold" , width = 0 )
382
397
self .tableau .create_text (col1 , lin1 + sig , text = str (val ), font = self .police2 , fill = color1 )
398
+ (lineno (), "col1, lin1 + sig" , col1 , lin1 + sig )
383
399
else : # 'len(v_lin)'. Quand, plusieurs degrés correspondent à un même emplacement.
384
400
ce = len (v_lin )
385
401
col2 , lin2 = (col1 - ce , lin1 - ce ), (col1 + ce , lin1 + ce )
@@ -393,6 +409,7 @@ def __init__(self, di_code=None, di_bine=None, di_indi=None, di_fort=None, di_co
393
409
col3 , lin3 = (col1 - 12 , lin1 - 6 ), (col1 , lin1 + 6 )
394
410
self .tableau .create_rectangle (col3 , lin3 , fill = "gold" , width = 0 )
395
411
self .tableau .create_text (col1 + cran , lin1 , text = ici , font = self .police2 , fill = "maroon" )
412
+ (lineno (), "col1 + cran, lin1" , col1 + cran , lin1 )
396
413
cran += 12
397
414
# print("Ici", ici, "col2, lin2", col2, lin2, val, "v_lin", v_lin,
398
415
# colonne_gam[k_col[0], 0][0])
@@ -440,6 +457,7 @@ def quitter(self, tag):
440
457
self .destroy ()
441
458
elif tag == "clic_image" :
442
459
self .colonne_bin .clear ()
460
+ self .colonne_gam .clear ()
443
461
self .destroy ()
444
462
(lineno (), "Quitter/elif/clic_image borne" , self .borne [1 ], "\t tag" , tag )
445
463
# 436 Quitter/elif/clic_image borne 1111111 tag clic_image
@@ -452,13 +470,15 @@ def gammes_arp(self):
452
470
Concerne l'initialisation des tables par la gamme naturelle exprimée en modulations (binaires et degrés)."""
453
471
("\t " , lineno (), "** Fonction gammes_arp " , "gammes_mode" , "self.gammes_mode" )
454
472
gammes_col = list (self .dic_codage .values ()) # "dic_codage" = Les gammes issues de 'globdicTcoup.txt'
473
+ (lineno (), "gammes_col" , len (gammes_col ))
455
474
"# À chaque ligne, correspond un mode binaire. La ligne zéro, c'est pour les noms des gammes."
456
475
# La ligne peut être donnée par l'index de l'élément de la liste des modes binaires présents.
457
476
colon = 1 # À chaque colonne, correspond une gamme répertoriée. Une gamme a autant de modes que de lignes.
458
477
459
478
"# Initialisation de la colonne binaire par les modulations binaires de la gamme naturelle."
460
479
for gc in gammes_col [43 ]:
461
480
if len (gc ) == 2 :
481
+ self .colonne_bin .append ("" )
462
482
self .colonne_bin .append ("" )
463
483
self .colonne_bin .append (gc [- 1 ])
464
484
ligne = self .colonne_bin .index (gc [- 1 ])
@@ -557,7 +577,8 @@ def gammes_arp(self):
557
577
# print("___ Not col_bin0 gc", gc, gc[-1])
558
578
if nbr_bin > 6 :
559
579
self .gammes_bin [self .colonne_gam [colon , 0 ][0 ]] = 'Ok'
560
- # print("\t \t nbr_bin", nbr_bin, "colonne_gam[colon, 0]", colonne_gam[colon, 0][0])
580
+ (lineno (), "\t \t nbr_bin" , nbr_bin , "colonne_gam[colon, 0]" , self .colonne_gam [colon , 0 ][0 ])
581
+ (lineno (), "self.gammes_bin" , self .gammes_bin [self .colonne_gam [colon , 0 ][0 ]], )
561
582
# print("Colon", colon, "Ligne", ligne, "gc", gc)
562
583
# print("Colon / Ligne", colon, ligne, "colonne_gam", colonne_gam[colon, ligne])
563
584
gammes_col .pop (n_gam ) # Effacement de la gamme traitée, afin de ne pas revenir dessus.
@@ -585,6 +606,7 @@ def gammes_log(self):
585
606
("\t " , lineno (), "** Fonction gammes_log, self.dic_force" , list (self .dic_force )[0 ])
586
607
"# Définir les contenants par quantité des sept premiers binaires cumulatifs."
587
608
gammes_loc = list (self .dic_codage .values ()) # "dic_codage" = Les gammes issues de 'globdicTcoup.txt'
609
+ (lineno (), "gammes_loc" , len (gammes_loc ))
588
610
(lineno (), "gammes_loc[0]" , gammes_loc [0 ], "\n force" , self .dic_force , "\n Clés" , self .dic_force .keys ())
589
611
# 541 gammes_loc[0] [(['o45x', 1], '1000001'), (1, 2, '1000001'), (1, 3, '1000001'),
590
612
# force {'1000001': [((1, '123400000567'), (['o45x', 1], '1000001')), (1, 2, '1000001'),
@@ -620,7 +642,10 @@ def gammes_log(self):
620
642
col_count = colonne_cop .count ("" )
621
643
if col_count == 0 :
622
644
colonne_cop .insert (0 , "" )
623
- (lineno (), " § colonne_cop" , colonne_cop , "long" , len (colonne_cop ), "col_count" , col_count )
645
+ colonne_cop .insert (1 , "" )
646
+ if col_count == 1 :
647
+ colonne_cop .insert (0 , "" )
648
+ (lineno (), " § colonne_cop" , colonne_cop [:6 ], "long" , len (colonne_cop ), "col_count" , col_count )
624
649
# force_cop ['1000001', '1000000', '1000101', '1011000', '1011001', '1000111', '1111000']
625
650
# colonne_cop ['1000001', '1000000', '1000101', '1011000', '1011001', '1000111', '1111000']
626
651
@@ -634,11 +659,11 @@ def gammes_log(self):
634
659
(lineno (), " °°° Réajustement repos_num" , repos_num , "Reste globe_num" , globe_num )
635
660
636
661
"# Tournée de tous les binaires de 'colonne_cop' en évolution. Et, rassembleur 'globe_num'"
637
- for cop in colonne_cop [1 :]:
662
+ for cop in colonne_cop [2 :]:
638
663
liste_gam .clear ()
639
664
force_gam [cop ] = [] # Liste les gammes et contrôle quantitatif.
640
665
cop1 = cop
641
- (lineno (), "colonne_cop" , colonne_cop [1 :], "cop" , cop , type (cop ))
666
+ (lineno (), "colonne_cop" , colonne_cop [2 :], "cop" , cop , type (cop ))
642
667
643
668
"# Lire le rassembleur 'self.dic_force[cop]', pour un mode binaire qui compte les 'globe_num'."
644
669
for fc in self .dic_force [str (cop )]:
@@ -694,7 +719,7 @@ def gammes_log(self):
694
719
ind_loc , halte0 = None , True
695
720
(lineno (), "gn" , gn , "repos_num" , repos_num )
696
721
"# Il peut y avoir quelques degrés avec un binaire, et le reste diatonique avec un autre binaire."
697
- for cc1 in colonne_cop [1 :]: # 'colonne_cop' = Les binaires ou clefs 'self.dic_force'.
722
+ for cc1 in colonne_cop [2 :]: # 'colonne_cop' = Les binaires ou clefs 'self.dic_force'.
698
723
force_g1 = self .dic_force [str (cc1 )] # 'dic_force' = Total, 'force_gam' = Numéros.
699
724
gl_index , fg2 = - 1 , None
700
725
(lineno (), " ****** Tous les modes aux cc1" , cc1 , "\n ♦ force_g1[:3]" , force_g1 )
@@ -765,8 +790,44 @@ def gammes_log(self):
765
790
cc += 1 # Nombre d'accompagnements des binaires dans la liste (en cours). Utile boucle 'while'
766
791
767
792
"# colonne_gam = Clé (colonne, ligne). Valeur (Position zéro = Nom-gamme. Autres = Degrés numériques (1234567)"
768
- (lineno (), "self.colonne_gam" , self .colonne_gam )
769
- # 635 self.colonne_gam {}
793
+ "# Intégrer 'self.gammes_bin' et repérer les gammes aux mêmes binaires (colorations)."
794
+ # 342 self.gammes_bin {'x26-': 'Ok', '*5': 'Ok', '-34': 'Ok', 'o63-': 'Ok', 'o34x': 'Ok', '-25o': 'Ok'...
795
+ dic_keys , tab_lig , k_nbr = {}, [], 1
796
+ for g_key in self .colonne_gam .keys ():
797
+ if g_key [0 ] == k_nbr :
798
+ tab_lig .append (g_key )
799
+ (lineno (), "tab_lig" , tab_lig )
800
+ elif g_key [0 ] == k_nbr + 1 :
801
+ dic_keys [k_nbr ] = tab_lig .copy ()
802
+ tab_lig .clear ()
803
+ k_nbr += 1
804
+ tab_lig .append (g_key )
805
+ (lineno (), "g_key" , g_key , "tab_lig" , tab_lig , "\n dic_keys" , dic_keys )
806
+ (lineno (), "dic_keys" , dic_keys .keys ())
807
+ (lineno (), "gammes_loc" , len (gammes_loc ), len (self .colonne_gam .keys ()))
808
+
809
+ "# "
810
+ key_lig = [] # Enregistre les nouvelles lignes.
811
+ for c_col0 in range (0 , 65 ):
812
+ c_col = c_col0 + 1
813
+ if c_col == 1 :
814
+ for dk in dic_keys [c_col ]:
815
+ key_lig .append (dk [1 ])
816
+ else :
817
+ long_k , lo = len (dic_keys [c_col ]), 0
818
+ for dk in dic_keys [c_col ]:
819
+ if dk [1 ] not in key_lig : # Provient des nouvelles lignes.
820
+ key_lig .append (dk [1 ])
821
+ (lineno (), "If c_col" , c_col , "long_k" , long_k )
822
+ else : # dk[1] in key_lig
823
+ lo += 1
824
+ (lineno (), " If/Else c_col" , c_col , "\t lo" , lo )
825
+ if long_k == lo :
826
+ self .gammes_bin [self .colonne_gam [c_col , 0 ][0 ]] = "Ok"
827
+ (lineno (), "If c_col" , c_col , "long_k" , long_k , "\n dic_keys" , dic_keys [c_col ])
828
+ (lineno (), " **************************************************** " )
829
+ (lineno (), "key_lig" , key_lig , "\n dic_keys" , "dic_keys" )
830
+ (lineno (), "self.gammes_bin" , self .gammes_bin )
770
831
771
832
def clic_image (self , event ):
772
833
"""Cette fonction convertit les modes binaires.
0 commit comments