Skip to content

Commit

Permalink
formatting for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
0XDE57 committed Dec 18, 2022
1 parent 8ead4ce commit 7436a68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ def __init__(self, callback):
if not self.midi_in.get_ports():
print('No midi devices found.')
return
else:
print('detected midi devices:')
for x in self.midi_in.get_ports():
print(x)
self.midi_in.set_callback(callback)
self.midi_in.open_port(0) # open first device

print('detected midi devices:')
for ports in self.midi_in.get_ports():
print(ports)

# open first device by default
self.midi_in.set_callback(callback)
self.midi_in.open_port(0)

self.midi_opened = True
2 changes: 1 addition & 1 deletion note.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def get_note(self, freq):
return self.note_letter + str(self.octave)

def to_string(self):
return "{0:4} | {1:10} | {3:4}".format(self.get_note(False), round(self.frequency, 6), self.cents, self.midi_ID)
return "{0:4} | {1:10} | {3:4}".format(self.get_note(False), round(self.frequency, 4), self.cents, self.midi_ID)

0 comments on commit 7436a68

Please sign in to comment.