Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def drawShape(eventType, channel, data1, data2):
- global window, shape1, shape2, shape3, shape4, shape5, shape6
- # iicon position is random
- x = randint(0, getScreenWidth()) # x may be anywhere on display
- y = randint(0, getScreenHeight()) # y may be anywhere on display
- colors = ["Red", "Orange", "Yellow", "Green", "Blue", "Purple", "Pink", "White", "Teal"]
- colorIdx = (data1 / 2) % len(colors)
- color = colors[colorIdx]
- shapeLists = [shape1, shape2, shape3, shape4, shape5, shape6]
- shapeListIdx = (data1 / 3) % len(shapeLists)
- shapeList = shapeLists[shapeListIdx]
- shape = shapeList[color]
- icon = Icon(shape,x,y)
- window.add(icon)
- # play note
- Play.noteOn(data1, data2)
- # establish a connection to an input MIDI device
- midiIn = MidiIn("Unknown Vendor Oxygen 25")
- # register a callback function to process incoming MIDI events
- midiIn.onNoteOn(drawShape)
Add Comment
Please, Sign In to add comment