-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
executable file
·40 lines (31 loc) · 883 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
import time
from pymouse import PyMouse
import midi
from pprint import pprint
import sys
#pattern = midi.read_midifile('/home/claudio/Downloads/EspanjaPrelude.mid')
# pattern = midi.read_midifile('/home/claudio/Development/python-midi/mary.mid')
# events = []
# for track in pattern:
# for event in track:
# if isinstance(event, midi.events.NoteOnEvent):
# print(type(event))
# events.append(event)
# events.sort()
# pprint(events)
# sys.exit()
mouseButton = 1 # 1 for left 2 for right click
mouse = PyMouse()
screenSize = mouse.screen_size()
scaleFactor = 32
scaledMaxValue = int(screenSize[1] / scaleFactor + 1)
pause = 1
for i in range(0, scaledMaxValue):
currentPosition = mouse.position()
y = i * scaleFactor
x = currentPosition[0]
print(y)
#mouse.move(currentPosition[0], y)
mouse.click(x, y, 2)
time.sleep(pause)