# coding: utf-8

import cmd

class PianetteCmd(cmd.Cmd):
    prompt = 'pianette: '

    def __init__(self, piano_state, psx_controller_state):
        super().__init__()
        self.piano_state = piano_state
        self.psx_controller_state = psx_controller_state

    def do_play_note(self, note):
        self.piano_state.raise_note(note)

    def do_EOF(self, line):
        return True

    def postloop(self):
        print()

@@ -20,16 +20,42 @@
 port cmd
+%0Aimport random%0Aimport time
 %0A%0Aclass 
@@ -363,16 +363,223 @@
 (note)%0A%0A
+    def do_play_chord(self, notes_string):%0A        notes = notes_string.split(',')%0A        for note in notes:%0A            self.piano_state.raise_note(note)%0A            time.sleep(random.randint(0,10)/1000)%0A%0A
     def 

introduce play_chord command