Skip to content

Commit 1f01505

Browse files
authored
Corrections nécessaires
1 parent 9dcf4fc commit 1f01505

File tree

3 files changed

+48
-42
lines changed

3 files changed

+48
-42
lines changed

READnotes.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Se corrige avec l'amélioration du code.
2323
À la ligne 889 du module `gammes_audio.py` l'instruction `if titre1 == 'Gammes':` est arbitraire. <br>
2424
En effet, les modes terminaux binaires pouvant recevoir cette analyse, n'y sont pas traités.
2525

26+
**Solution :** <br>
27+
L'arrangement a été produit grâce à la création, d'une nouvelle liste située à `if titre1 == 'Binomes':`.
28+
2629

2730
## Problématique liée aux mêmes modes binaires
2831
Le dictionnaire 'self.dic_multiples' ne distingue pas les différents rassemblements.
@@ -46,13 +49,10 @@ Le rectangle toute hauteur, "celui qui signale le niveau de lecture sonore", ne
4649
A changé l'identification du rectangle, par un indice équivalant ici : `ind_gam = liste_gam.index(k2)` <br>
4750

4851

49-
50-
51-
52-
5352
## Constitution des paramètres.
54-
Interfaçage des sonorités (volume, tempo,)
55-
Interfaçage des méthodes (lire une seule gamme, en ordre des degrés ou des niveaux Htz,)
53+
Interfaçage des sonorités (volume, tempo, audio ou pas)
54+
Paramétrer les fréquences aux positions réelles, quand (ligne//8 = Octave)
55+
- Il y a soixante-trois lignes liées aux modes binaires et huit octaves pan['A2'...'A9']
5656

5757
## Contrôler la lecture sonore.
5858
En ajoutant des boutons[marche, arrêt, pause,]

gammes_audio.py

+40-34
Original file line numberDiff line numberDiff line change
@@ -730,26 +730,26 @@ def audio_gam(gammic, pulsif, selon, mode, lecture):
730730
"Audibilité de A0 : ('E0', 20.60172230705437) Htz à A10 : ('#D10', 19912.12695821318) Htz.")
731731
"# Il faut déterminer où commence l'octave un et où finit l'octave six. L'octave va de DO à DO."
732732
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.
734734
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
737739
panel, pan, stop = False, [], False
738740
for khz in colis2.keys():
739741
if clef_min[1] == khz[1]:
740742
panel = True
741743
else:
742744
val = int(khz[1:])
743-
if val >= int(clef_max[1]):
745+
if val >= int(clef_max[1:]):
744746
stop = True
745747
if panel:
746748
pan.append(khz)
747749
if stop:
748750
break
749-
(lino(), " khz", int(khz[1]), "colis2.keys()", len(colis2.keys()))
750-
# 746 khz 1 colis2.keys() 12
751751
(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']
753753

754754
"# Création d'une liste contenant les octaves audibles issues du dictionnaire des fréquences."
755755
liste_htz = [] # La liste des fréquences notées du dictionnaire, sur une seule ligne.
@@ -787,7 +787,7 @@ def invitation(inf, sup):
787787
if il < sl:
788788
a0 = "(il<sl) :"
789789
"# 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'].
791791
# 719 Lignes. Plages_lig {2: [2-13], 14: [14-25], 26: [26-37], 38: [38-49], 50: [50-73],
792792
# 62: [62-73], 74: [74-85], 86:[86-97]}
793793
# tables_lig [2, 14, 26, 38, 50, 62, 74, 86]
@@ -798,65 +798,70 @@ def invitation(inf, sup):
798798
if ind_in < ind_sn:
799799
if sl - il < 8: # Teste la différence entre les lignes sup et inf, à vérifier.
800800
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)
802802
else:
803803
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)
805805
elif ind_in > ind_sn:
806806
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)
808808
elif sa == gamme_la[0]: # La note est 'LA'.
809809
if sl//8 + 1 < len(pan):
810810
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)
812812
else:
813813
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)
815815
elif io > so: # La ligne 'sup' est super, l'octave est infer.
816816
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)
818818
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)
820820

821821
"# Les lignes 'inf' et 'sup' sont égales."
822822
if il == sl:
823823
b0 = "(il=sl) :"
824824
if sa == gamme_la[0]:
825825
ind_pan = pan.index(sup[1])
826826
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)
828828
elif io > so:
829829
if ind_in < ind_sn:
830830
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)
832832
elif ind_in > ind_sn:
833833
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)
836841
elif io == so:
837842
if ind_in < ind_sn:
838843
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)
840845
elif ind_in > ind_sn:
841846
ind_pan = pan.index(inf[1])
842847
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)
844849
elif io < so: # Les lignes 'inf et sup' sont égales.
845850
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)
847852
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)
849854

850855
"# La ligne 'inf' est supérieure."
851856
if il > sl:
852857
c0 = "(il>sl) :"
853858
ind_pan = sl//8
854859
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)
856861

857862
"# Utilisé pour une recherche des anomalies."
858863
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)
860865
# 794 Invitation ['C', 'A2', 2] ['D', 'A2', 3]
861866
return inf, sup
862867

@@ -872,7 +877,7 @@ def invitation(inf, sup):
872877
"# Trouver à quelle plage se trouve la ligne."
873878
if ligne in plages_lig[lig_o]:
874879
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']
876881
pass_lig = [note, cran, ligne]
877882
(lino(), "pass_lig", pass_lig)
878883
# 876 pass_lig ['C', 'A2', 2]
@@ -895,7 +900,7 @@ def invitation(inf, sup):
895900
tot_nom = [vn for vn in liste_gen if vn[1] == 0]
896901
bin_nom = [colis1[2][bn][0] for bn in tot_nom]
897902
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)
899904
if len(dic_lig1.keys()) > 1: # Le dictionnaire a plusieurs clefs.
900905
if len(dic_lig1[nom]) == 1: # La clef du nom n'a qu'un seul degré, ici.
901906
("# Cette partie permet l'analyse des passages entre les gammes."
@@ -904,25 +909,25 @@ def invitation(inf, sup):
904909
inf0, sup0 = dic_lig1[tab_nom[ind_nom - 1]][-1], dic_lig1[nom]
905910
elif titre1 == 'Binomes':
906911
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)
908913
retour_invite = invitation(inf0, sup0)
909914
(lino(), nom, "Retour", retour_invite)
910915
# 813 -5 Retour (['B', 'A3', 8], ['C', 'A3', 9])
911916
(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)
913918
if len(dic_lig1[nom]) > 1:
914919
(lino(), "dic_lig1", dic_lig1[nom])
915920
("# Informations des valeurs du dictionnaire (Note. Octave. Ligne)."
916921
"Des derniers et avant-derniers degrés de la liste des valeurs du dictionnaire.")
917922
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)
919924
# 771 inf ['C', 'A2', 2] sup ['D', 'A3', 3]
920925
"# Espace des comparaisons et des corrections."
921926
retour_invite = invitation(inf0, sup0)
922927
(lino(), nom, "Retour", retour_invite)
923928
# 821 0 Retour (['C', 'A2', 2], ['D', 'A2', 3])
924929
(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)
926931
("# Le dictionnaire 'dic_lig1' comporte les bonnes gammes."
927932
"Dont les définitions sup et inf ont été appliquées.")
928933
if len(dic_lig1[nom]) == 7:
@@ -966,11 +971,12 @@ def invitation(inf, sup):
966971
note_o = note
967972
(lino(), "Fonction HERTZ", "signe_o", signe_o, "ind_car", ind_car, "note_o", note_o)
968973
# 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)
970975
"# Aller à la rencontre de l'indice de la note dans la liste des génériques (htz)."
971976
for car in range(ind_cran, ind_cran+13): # La valeur 'ind_cran' est son numéro d'octave.
972977
(lino(), "*HERTZ* liste_htz[car]", liste_htz[car], "car", car, "nom", nom)
973978
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])
974980
car += ind_car # La variable 'car' est l'indice dans la liste des génériques.
975981
(lino(), "*HERTZ* liste_htz[car]", liste_htz[car], note[-1], "note", note, "car", car)
976982
(lino(), "len(liste_htz)", len(liste_htz), "ind_car", ind_car)
@@ -1002,7 +1008,7 @@ def invitation(inf, sup):
10021008
"En fin de ce traitement, est mis en évidence l'ordre de lecture des degrés diatoniques.")
10031009
(lino(), "liste_htz", liste_htz, len(liste_htz)/12)
10041010
# 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']
10061012
# tables_lig [2, 14, 26, 38, 50, 62, 74, 86]
10071013

10081014

@@ -1027,7 +1033,7 @@ def ordonnance(donne1, don2):
10271033
tab_new.append(dld)
10281034
rng_dld += 1
10291035
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])
10311037
elif donne1 == "Hertz":
10321038
("L'ordonnance va agir sur l'ordre croissant des fréquences,"
10331039
"elle n'est pas traitée ici, puisque seuls les degrés désordonnés y figurent."

songammes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ def sine_tone(frequency, duration, sample_rate=18000):
13831383
if len(str(bb)) == 7:
13841384
ind_bin = colis1[3].index(bb) + 4 # Liste des lignes 'self.tab_lig', 'fill="lightblue"'.
13851385
self.tab_ind.append(ind_bin)
1386-
print(lineno(), "ind_gam", ind_gam, "ind_bin", bb, ind_bin, "k2", k2, "v2", v2)
1386+
(lineno(), "ind_gam", ind_gam, "ind_bin", bb, ind_bin, "k2", k2, "v2", v2)
13871387
(lineno(), "tab_ind.1", self.tab_ind)
13881388
(lineno(), "ind_gam", ind_gam, "k2", k2, "v2", v2)
13891389
# 1376 ind_gam 0 k2 0 v2 [['C2', 65.41], ['D2', 73.42], ['E2', 82.41],
@@ -1479,7 +1479,7 @@ def sine_tone(frequency, duration, sample_rate=18000):
14791479
self.tableau.tag_bind(stt, "<Button-1>", self.on_click)
14801480
break
14811481

1482-
# sine_tone(freq[1], 0.05)
1482+
sine_tone(freq[1], 0.05)
14831483
# break de vérification.
14841484

14851485
self.tableau.itemconfig(self.tab_rec[ind_gam], fill="")

0 commit comments

Comments
 (0)