Ejemplo n.º 1
0
def select(widget, data):
    global buttons, current_note, right, total

    string, fret = data
    try:
        buttons[string, fret].grab_focus()
    except KeyError: pass

    guess = note(string, fret)

    play_note(guess)

    total += 1
    if guess==current_note:
        right += 1
        status.set_markup('<span foreground="dark green" size="x-large">RIGHT</span> %d%%' % int(100.0*right/total))
        gobject.timeout_add(1500, new_question)
    else:
        status.set_markup('<span foreground="red" size="x-large">FALSE</span> %d%%' % int(100.0*right/total))
        gobject.timeout_add(400, play)
Ejemplo n.º 2
0
def play(*args):
    global current_note
    play_note(current_note)