1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
| #!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
# Programme: Binaire Gamme. Version 1.0
"""Fichier texte gammes binaires."""
"""Autorité d'origine manuscrite."""
# Les signatures altéractives
noms = ['0', '-2', '+2', '^2', '-3', '-23', '-34x', '+34', '+23x',
'-34', 'x3', '°3', '+34x', '°34x', '^3', '-4', '-24',
'^4', '°4', '-5', '-25', '-25+', '+25-', '-35', '-35+',
'+45x', '+25x', '°35-', '+35x', '-45+', '-45', 'x5',
'x45+', '-25°', '-35°', '-45°', '°45-', '°5', '°35+',
'*5', '°35x', '-45x', '°45x', '-6', '+6', '-26', '-26+',
'+26-', '+26', '-36', '-36+', '-56', '-56+', '+56', 'x46+',
'-26°', '-46+', '-46°', 'x36+', '-56°', '°46-', '°36+',
'*6', '°46+', '°6', 'x26-']
# Les intervalles proportionnels
gammes = [[1, 1, 0, 1, 1, 1, 0], [0, 2, 0, 1, 1, 1, 0], [2, 0, 0, 1, 1, 1, 0], [4, 0, 0, 0, 0, 1, 0],
[1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [1, 0, 3, 0, 0, 1, 0], [1, 2, 1, 0, 0, 1, 0],
[2, 2, 0, 0, 0, 1, 0], [0, 0, 1, 2, 1, 1, 0], [1, 3, 0, 0, 0, 1, 0], [0, 0, 2, 1, 1, 1, 0],
[1, 2, 2, 0, 0, 0, 0], [0, 0, 4, 0, 0, 1, 0], [1, 4, 0, 0, 0, 0, 0], [1, 0, 0, 2, 1, 1, 0],
[0, 1, 0, 2, 1, 1, 0], [1, 1,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0, 0, 2, 0]]
"""Transposition Intervalle Binaire"""
perso_bin = []
perso_nom = []
votre_nom = []
votre_bin = []
votre_new = []
dia = [0]
tom = -1
for gamme in gammes:
transe = [1]
tim = 0
tom += 1
for gam in gamme: # Transposition Gamme
tim += 1
if gam == 0 and tim < 12:
transe.append(1)
else:
retour = gam
while retour > 0:
transe.append(0)
tim += 1
retour -= 1
if tim < 12:
transe.append(1)
trans_bin = ''.join(str(t) for t in transe)
perso_bin.append(trans_bin)
perso_nom.append(noms[tom])
def formation(b_):
"""Code transition:
La formation (b_) en comparaison perso (renversement inclu)
La solution perso compte la superposition intervalle zéro
Zéro = 5: Ainsi, à notes superposées"""
new = 0
for gym in perso_bin: # Transcodage perso
nom = perso_bin.index(gym)
f = t = -1
z = c = 0
zoe = []
while True:
f += 1
t += 1
# b_ = votre_bin
if gym[f] == '0' and b_[t] == '0':
z += 1
if f > 10:
zoe.append(z)
f = -1
z = 0
t += 1
c += 1
if t > 10:
t = 0
if t > 10:
t = -1
if c > 11:
break
if max(zoe) == 5: # Noms connus ignorés
if perso_nom[nom] not in votre_nom:
votre_nom.append(perso_nom[nom])
votre_bin.append(b_)
# print('EST', perso_nom[nom])
else:
dia[0] += 1
new = 1
break
if new == 0:
votre_new.append(b_)
# print('NEW', b_)
with open('gammesbinaires.txt', 'r') as gambin:
suite = list(gambin)
for st in suite:
suit = st[:12]
formation(suit)
# print('perso_bin', perso_bin, '\nLONG', len(perso_bin))
print('DIATONIQUES OMISES', dia[0])
print('\nvotre_nom', votre_nom, '\nLONG', len(votre_nom))
print('\nvotre_new', votre_new, '\nLONG', len(votre_new)) |