Пример #1
0
#!/usr/bin/env python3
import socket
import time
from sys import exit, stdout, path
from functools import partial

from demo.composer import Composer
from chordtable.chordtable import Chordtable
from chordtable.misc import format_fudi

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 8888))

chord = Chordtable()
crap_composer = Composer()

while True:
    p, delta = chord.next_step()

    if delta > 0 and not (chord.weights[p] < chord.max_weight):
        continue

    chord = chord.modify((p, delta))
    print(format_fudi(*chord.weights).decode('ascii'))

    for _ in range(0, 3):
        if delta > 0:
            crap_composer.weight(p)
        else:
            crap_composer.lighten(p)
Пример #2
0
#!/usr/bin/env python3

from chordtable.chordtable import Chordtable
import chordtable.misc as misc

from sys import exit

chord = Chordtable()
names = ['c','c#', 'd', 'd#', 'e', 'f', 'f#', 'g', 'g#' ,'a', 'a#' ,'b']

print('<style>td {width: 2em; height: 2em; text-align: center}</style>')
print('<table>')
for i in range(0, 1000):
    chord = chord.modify(chord.next_step())
    print('<tr>')
    for p, w in enumerate(chord.weights):
        color = misc.get_color(chord.max_weight, w)
        print('<td style="background: %s">%s</td>' % (misc.format_color(*color), names[p]))
    print('</tr>')
print('</table>')