|
|
@@ -373,9 +373,11 @@ class PianoRoll(QGraphicsScene): |
|
|
|
# ------------------------------------------------------------------------- |
|
|
|
# Callbacks |
|
|
|
|
|
|
|
def movePlayHead(self, t): |
|
|
|
total_duration = 1920 * self.time_sig[0] * self.num_measures |
|
|
|
pos = t['bar']*1920*self.time_sig[0] + t['beat']*1920 + t['tick'] |
|
|
|
def movePlayHead(self, transport_info): |
|
|
|
# TODO: need conversion between frames and PPQ |
|
|
|
x = 105. # works for 120bpm |
|
|
|
total_duration = self.time_sig[0] * self.num_measures * x |
|
|
|
pos = transport_info['frame'] / x |
|
|
|
frac = (pos % total_duration) / total_duration |
|
|
|
self.play_head.setPos(QPointF(frac * self.grid_width, 0)) |
|
|
|
|
|
|
@@ -1108,6 +1110,8 @@ class MainWindow(ExternalUI, QWidget): |
|
|
|
if beat != self.fTransportInfo["beat"]: |
|
|
|
print(beat) |
|
|
|
|
|
|
|
old_frame = self.fTransportInfo['frame'] |
|
|
|
|
|
|
|
self.fTransportInfo = { |
|
|
|
"playing": playing, |
|
|
|
"frame": frame, |
|
|
@@ -1119,7 +1123,8 @@ class MainWindow(ExternalUI, QWidget): |
|
|
|
"sigDenom": sigDenom |
|
|
|
} |
|
|
|
|
|
|
|
self.piano.movePlayHead(self.fTransportInfo) |
|
|
|
if old_frame != frame: |
|
|
|
self.piano.movePlayHead(self.fTransportInfo) |
|
|
|
|
|
|
|
|
|
|
|
elif msg == "show": |
|
|
|