@@ -730,26 +730,26 @@ def audio_gam(gammic, pulsif, selon, mode, lecture):
730
730
"Audibilité de A0 : ('E0', 20.60172230705437) Htz à A10 : ('#D10', 19912.12695821318) Htz." )
731
731
"# Il faut déterminer où commence l'octave un et où finit l'octave six. L'octave va de DO à DO."
732
732
octave_5 , clef_oct = 440 , 5 # Cette fréquence correspond à la clé de l'octave A5.
733
- oct_min , oct_max = clef_oct - 3 , clef_oct + 4 # Calculer les octaves utiles par rapport à A5.
733
+ oct_min , oct_max = clef_oct - 3 , clef_oct + 5 # Calculer les octaves utiles par rapport à A5.
734
734
clef_min , clef_max = "A" + str (oct_min ), "A" + str (oct_max ) # Définir les clefs utiles.
735
- (lino (), "Octaves min et max" , oct_min , oct_max )
736
- # 730 Octaves min et max 2 9
735
+ (lino (), "Octaves min et max" , oct_min , oct_max , "\n colis2.keys()" , colis2 .keys ())
736
+ (lino (), "Clefs min et max" , clef_min , clef_max )
737
+ # 735 Octaves min et max 2 10
738
+ # 736 Clefs min et max A2 A10
737
739
panel , pan , stop = False , [], False
738
740
for khz in colis2 .keys ():
739
741
if clef_min [1 ] == khz [1 ]:
740
742
panel = True
741
743
else :
742
744
val = int (khz [1 :])
743
- if val >= int (clef_max [1 ]):
745
+ if val >= int (clef_max [1 : ]):
744
746
stop = True
745
747
if panel :
746
748
pan .append (khz )
747
749
if stop :
748
750
break
749
- (lino (), " khz" , int (khz [1 ]), "colis2.keys()" , len (colis2 .keys ()))
750
- # 746 khz 1 colis2.keys() 12
751
751
(lino (), "Octaves. Pan" , pan )
752
- # 748 Octaves. Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9']
752
+ # 752 Octaves. Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10 ']
753
753
754
754
"# Création d'une liste contenant les octaves audibles issues du dictionnaire des fréquences."
755
755
liste_htz = [] # La liste des fréquences notées du dictionnaire, sur une seule ligne.
@@ -787,7 +787,7 @@ def invitation(inf, sup):
787
787
if il < sl :
788
788
a0 = "(il<sl) :"
789
789
"# La différence entre les lignes reste dans l'octave. Chaque clé est un 'LA'."
790
- # Octaves. Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9'].
790
+ # Octaves. Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10' ].
791
791
# 719 Lignes. Plages_lig {2: [2-13], 14: [14-25], 26: [26-37], 38: [38-49], 50: [50-73],
792
792
# 62: [62-73], 74: [74-85], 86:[86-97]}
793
793
# tables_lig [2, 14, 26, 38, 50, 62, 74, 86]
@@ -798,65 +798,70 @@ def invitation(inf, sup):
798
798
if ind_in < ind_sn :
799
799
if sl - il < 8 : # Teste la différence entre les lignes sup et inf, à vérifier.
800
800
sup [1 ] = inf [1 ] # Garder le cran de l'octave 'sup'.
801
- print (lino (), nom_lgf , a0 , "(io<=so, != 'A') \t " , inf , sup , note , "gamme_la" , gamme_la )
801
+ (lino (), nom_lgf , a0 , "(io<=so, != 'A') \t " , inf , sup , note , "gamme_la" , gamme_la )
802
802
else :
803
803
sup [1 ] = pan [sl // 8 ] # Garder le cran de l'octave 'sup'.
804
- print (lino (), nom_lgf , a0 , "(io<=so, != 'A') \t " , inf , sup , note , "gamme_la" , gamme_la )
804
+ (lino (), nom_lgf , a0 , "(io<=so, != 'A') \t " , inf , sup , note , "gamme_la" , gamme_la )
805
805
elif ind_in > ind_sn :
806
806
sup [1 ] = pan [ind_lig + 1 ] # Augmenter d'un cran l'octave 'sup'.
807
- print (lino (), nom_lgf , a0 , "(io<=so, != 'A') \t " , inf , sup , note , "gamme_la" , gamme_la )
807
+ (lino (), nom_lgf , a0 , "(io<=so, != 'A') \t " , inf , sup , note , "gamme_la" , gamme_la )
808
808
elif sa == gamme_la [0 ]: # La note est 'LA'.
809
809
if sl // 8 + 1 < len (pan ):
810
810
sup [1 ] = pan [sl // 8 + 1 ] # Augmenter d'un cran l'octave 'sup'.
811
- print (lino (), nom_lgf , a0 , "(io<=so, 'A', sl8<) \t " , inf , sup , note )
811
+ (lino (), nom_lgf , a0 , "(io<=so, 'A', sl8<) \t " , inf , sup , note )
812
812
else :
813
813
sup [1 ] = pan [sl // 8 ] # Augmenter d'un cran l'octave 'sup'.
814
- print (lino (), nom_lgf , a0 , "(io<=so, 'A', sl8>) \t " , inf , sup , note )
814
+ (lino (), nom_lgf , a0 , "(io<=so, 'A', sl8>) \t " , inf , sup , note )
815
815
elif io > so : # La ligne 'sup' est super, l'octave est infer.
816
816
sup [1 ] = pan [ind_lig + 1 ] # Augmenter d'un cran l'octave 'sup'.
817
- print (lino (), nom_lgf , a0 , "(io>so) \t " , inf , sup , note )
817
+ (lino (), nom_lgf , a0 , "(io>so) \t " , inf , sup , note )
818
818
else :
819
- print (lino (), nom_lgf , a0 , "(Else) \t \t \t " , inf , sup , note )
819
+ (lino (), nom_lgf , a0 , "(Else) \t \t \t " , inf , sup , note )
820
820
821
821
"# Les lignes 'inf' et 'sup' sont égales."
822
822
if il == sl :
823
823
b0 = "(il=sl) :"
824
824
if sa == gamme_la [0 ]:
825
825
ind_pan = pan .index (sup [1 ])
826
826
sup [1 ] = pan [ind_pan + 1 ] # Augmenter d'un cran l'octave 'sup'.
827
- print (lino (), nom_lgf , b0 , "(A) \t \t \t " , inf , sup , note )
827
+ (lino (), nom_lgf , b0 , "(A) \t \t \t " , inf , sup , note )
828
828
elif io > so :
829
829
if ind_in < ind_sn :
830
830
sup [1 ] = inf [1 ] # Garder le cran de l'octave 'sup'.
831
- print (lino (), nom_lgf , b0 , "(io>so,ii<is) \t \t \t " , inf , sup , note )
831
+ (lino (), nom_lgf , b0 , "(io>so,ii<is) \t \t \t " , inf , sup , note )
832
832
elif ind_in > ind_sn :
833
833
ind_pan = pan .index (inf [1 ])
834
- sup [1 ] = pan [ind_pan + 1 ] # Augmenter d'un cran l'octave 'sup'.
835
- print (lino (), nom_lgf , b0 , "(io>so,ii>is) \t \t \t " , inf , sup , note )
834
+ if ind_pan + 1 < len (pan ):
835
+ sup [1 ] = pan [ind_pan + 1 ] # Augmenter d'un cran l'octave 'sup'.
836
+ (lino (), nom_lgf , b0 , "(io>so,ii>is) \t \t \t " , inf , sup , note )
837
+ else :
838
+ ind_pan = pan .index (inf [1 ])
839
+ sup [1 ] = pan [ind_pan ] # Augmenter d'un cran l'octave 'sup'.
840
+ (lino (), nom_lgf , b0 , "(io>so,ii>is) \t \t \t " , inf , sup , note )
836
841
elif io == so :
837
842
if ind_in < ind_sn :
838
843
sup [1 ] = inf [1 ] # Garder le cran de l'octave 'sup'.
839
- print (lino (), nom_lgf , b0 , "(io=so,ii<is) \t \t \t " , inf , sup , note )
844
+ (lino (), nom_lgf , b0 , "(io=so,ii<is) \t \t \t " , inf , sup , note )
840
845
elif ind_in > ind_sn :
841
846
ind_pan = pan .index (inf [1 ])
842
847
sup [1 ] = pan [ind_pan + 1 ] # Augmenter d'un cran l'octave 'sup'.
843
- print (lino (), nom_lgf , b0 , "(io=so,ii>is) \t \t \t " , inf , sup , note )
848
+ (lino (), nom_lgf , b0 , "(io=so,ii>is) \t \t \t " , inf , sup , note )
844
849
elif io < so : # Les lignes 'inf et sup' sont égales.
845
850
sup [1 ] = inf [1 ] # Garder le cran de l'octave 'inf'.
846
- print (lino (), nom_lgf , b0 , "(io<so) \t \t \t " , inf , sup , note )
851
+ (lino (), nom_lgf , b0 , "(io<so) \t \t \t " , inf , sup , note )
847
852
else :
848
- print (lino (), nom_lgf , b0 , "(Else) \t \t \t " , inf , sup , note )
853
+ (lino (), nom_lgf , b0 , "(Else) \t \t \t " , inf , sup , note )
849
854
850
855
"# La ligne 'inf' est supérieure."
851
856
if il > sl :
852
857
c0 = "(il>sl) :"
853
858
ind_pan = sl // 8
854
859
sup [1 ] = pan [ind_pan ] # Régler le cran d'octave 'sup'.
855
- print (lino (), nom_lgf , c0 , " \t \t \t \t " , inf , sup , note )
860
+ (lino (), nom_lgf , c0 , " \t \t \t \t " , inf , sup , note )
856
861
857
862
"# Utilisé pour une recherche des anomalies."
858
863
if nom_lgf in liste_gam_anormales : # ["-26o", "*6", "o6", "-36"]
859
- print (lino (), nom_lgf , "Invitation" , inf , sup )
864
+ (lino (), nom_lgf , "Invitation" , inf , sup )
860
865
# 794 Invitation ['C', 'A2', 2] ['D', 'A2', 3]
861
866
return inf , sup
862
867
@@ -872,7 +877,7 @@ def invitation(inf, sup):
872
877
"# Trouver à quelle plage se trouve la ligne."
873
878
if ligne in plages_lig [lig_o ]:
874
879
ind_lig = list (plages_lig .keys ()).index (lig_o ) # tables_lig [2, 14, 26, 38, 50, 62, 74, 86]
875
- cran = pan [ind_lig ] # Pan = ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9']
880
+ cran = pan [ind_lig ] # Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10 ']
876
881
pass_lig = [note , cran , ligne ]
877
882
(lino (), "pass_lig" , pass_lig )
878
883
# 876 pass_lig ['C', 'A2', 2]
@@ -895,7 +900,7 @@ def invitation(inf, sup):
895
900
tot_nom = [vn for vn in liste_gen if vn [1 ] == 0 ]
896
901
bin_nom = [colis1 [2 ][bn ][0 ] for bn in tot_nom ]
897
902
ind_nom = bin_nom .index (nom )
898
- print (lino (), "tot_nom" , tot_nom , "bin_nom" , bin_nom )
903
+ (lino (), "tot_nom" , tot_nom , "bin_nom" , bin_nom )
899
904
if len (dic_lig1 .keys ()) > 1 : # Le dictionnaire a plusieurs clefs.
900
905
if len (dic_lig1 [nom ]) == 1 : # La clef du nom n'a qu'un seul degré, ici.
901
906
("# Cette partie permet l'analyse des passages entre les gammes."
@@ -904,25 +909,25 @@ def invitation(inf, sup):
904
909
inf0 , sup0 = dic_lig1 [tab_nom [ind_nom - 1 ]][- 1 ], dic_lig1 [nom ]
905
910
elif titre1 == 'Binomes' :
906
911
inf0 , sup0 = dic_lig1 [bin_nom [ind_nom - 1 ]][- 1 ], dic_lig1 [nom ]
907
- print (lino (), "Avant" , "inf0" , inf0 , "sup0" , sup0 )
912
+ (lino (), "Avant" , "inf0" , inf0 , "sup0" , sup0 )
908
913
retour_invite = invitation (inf0 , sup0 )
909
914
(lino (), nom , "Retour" , retour_invite )
910
915
# 813 -5 Retour (['B', 'A3', 8], ['C', 'A3', 9])
911
916
(lino (), nom , " dic_lig1" , dic_lig1 [nom ][- 1 ])
912
- print (lino (), "Après" , "inf0" , inf0 , "sup0" , sup0 )
917
+ (lino (), "Après" , "inf0" , inf0 , "sup0" , sup0 )
913
918
if len (dic_lig1 [nom ]) > 1 :
914
919
(lino (), "dic_lig1" , dic_lig1 [nom ])
915
920
("# Informations des valeurs du dictionnaire (Note. Octave. Ligne)."
916
921
"Des derniers et avant-derniers degrés de la liste des valeurs du dictionnaire." )
917
922
inf0 , sup0 = dic_lig1 [nom ][- 2 ], dic_lig1 [nom ][- 1 ]
918
- print (lino (), "Avant" , "inf0" , inf0 , "sup0" , sup0 )
923
+ (lino (), "Avant" , "inf0" , inf0 , "sup0" , sup0 )
919
924
# 771 inf ['C', 'A2', 2] sup ['D', 'A3', 3]
920
925
"# Espace des comparaisons et des corrections."
921
926
retour_invite = invitation (inf0 , sup0 )
922
927
(lino (), nom , "Retour" , retour_invite )
923
928
# 821 0 Retour (['C', 'A2', 2], ['D', 'A2', 3])
924
929
(lino (), nom , " dic_lig1" , dic_lig1 [nom ][- 1 ])
925
- print (lino (), "Après" , "inf0" , inf0 , "sup0" , sup0 )
930
+ (lino (), "Après" , "inf0" , inf0 , "sup0" , sup0 )
926
931
("# Le dictionnaire 'dic_lig1' comporte les bonnes gammes."
927
932
"Dont les définitions sup et inf ont été appliquées." )
928
933
if len (dic_lig1 [nom ]) == 7 :
@@ -966,11 +971,12 @@ def invitation(inf, sup):
966
971
note_o = note
967
972
(lino (), "Fonction HERTZ" , "signe_o" , signe_o , "ind_car" , ind_car , "note_o" , note_o )
968
973
# 768 Fonction HERTZ signe_o + ind_car 1 note_o A.
969
- print (lino (), nom , " ____________________________ ind_cran" , ind_cran )
974
+ (lino (), nom , " ____________________________ ind_cran" , ind_cran )
970
975
"# Aller à la rencontre de l'indice de la note dans la liste des génériques (htz)."
971
976
for car in range (ind_cran , ind_cran + 13 ): # La valeur 'ind_cran' est son numéro d'octave.
972
977
(lino (), "*HERTZ* liste_htz[car]" , liste_htz [car ], "car" , car , "nom" , nom )
973
978
if liste_htz [car ][0 ][0 ] == note [- 1 ]:
979
+ (lino (), "*HERTZ* car" , car , "ind_car" , ind_car , "nom" , nom , len (liste_htz ), liste_htz [- 1 ])
974
980
car += ind_car # La variable 'car' est l'indice dans la liste des génériques.
975
981
(lino (), "*HERTZ* liste_htz[car]" , liste_htz [car ], note [- 1 ], "note" , note , "car" , car )
976
982
(lino (), "len(liste_htz)" , len (liste_htz ), "ind_car" , ind_car )
@@ -1002,7 +1008,7 @@ def invitation(inf, sup):
1002
1008
"En fin de ce traitement, est mis en évidence l'ordre de lecture des degrés diatoniques." )
1003
1009
(lino (), "liste_htz" , liste_htz , len (liste_htz )/ 12 )
1004
1010
# 731 liste_htz [('A2', 55.0), ('2', 58.27047018976124), ('B2', 61.735412657015516), ('C2', 65.40... )] 7
1005
- # 747 Octaves. Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9']
1011
+ # 747 Octaves. Pan ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10' ]
1006
1012
# tables_lig [2, 14, 26, 38, 50, 62, 74, 86]
1007
1013
1008
1014
@@ -1027,7 +1033,7 @@ def ordonnance(donne1, don2):
1027
1033
tab_new .append (dld )
1028
1034
rng_dld += 1
1029
1035
dic_lgf [don2 ] = tab_new
1030
- print (lino (), "Diatone" , donne1 , don2 , "cop1" , cop1 , cop2 , "\n " , dic_lgf [don2 ])
1036
+ (lino (), "Diatone" , donne1 , don2 , "cop1" , cop1 , cop2 , "\n " , dic_lgf [don2 ])
1031
1037
elif donne1 == "Hertz" :
1032
1038
("L'ordonnance va agir sur l'ordre croissant des fréquences,"
1033
1039
"elle n'est pas traitée ici, puisque seuls les degrés désordonnés y figurent."
0 commit comments