Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/google/light-my-piano
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirke committed Jan 19, 2016
2 parents 93c1e71 + c0e623a commit ecfd607
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions piano_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import pickle
import sys
import time

import keyboard
import midi
Expand Down Expand Up @@ -132,6 +133,8 @@ def MainLoop(self):
self.piano_display.SetKeyText(38 + 12, 20, u"\u266a")

self.piano_display.Refresh()
if self.piano_input_obj.user_input.empty():
time.sleep(0.1) # Avoid hogging the CPU when idle.
while not self.piano_input_obj.user_input.empty():
user_cmd = self.piano_input_obj.user_input.get()
if user_cmd[1] > 0:
Expand Down
8 changes: 4 additions & 4 deletions piano_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def noteToScreenInterval(note, waterfall, wide):
class PianoOutput(object):
LOWEST_NOTE = 36
HIGHEST_NOTE = 96
CANVAS_WIDTH = 1100 # changed by constructor
KEYBOARD_HEIGHT = 200
WHITE_NOTES = (0,2,4,5,7,9,11)
CANVAS_HEIGHT = KEYBOARD_HEIGHT + 300

def __init__(self):
self.tk_root = tk.Tk()
self.CANVAS_WIDTH = self.tk_root.winfo_screenwidth()
self.tk_root.attributes("-fullscreen", True)
self.CANVAS_WIDTH = self.tk_root.winfo_screenwidth()
self.CANVAS_HEIGHT = self.tk_root.winfo_screenheight()
self.KEYBOARD_HEIGHT = int(self.CANVAS_HEIGHT * 0.22)
self.CANVAS_HEIGHT = self.KEYBOARD_HEIGHT + 300

self.canvas = tk.Canvas(self.tk_root,
width=self.CANVAS_WIDTH,
Expand Down

0 comments on commit ecfd607

Please sign in to comment.