Esempio n. 1
0
 def __init__(self, synth):
     self.hover = Hover(address=0x42, ts=4, reset=17)
     self.device = synth
Esempio n. 2
0
import time
import subprocess
from Hover_library import Hover

hover = Hover(address=0x42, ts=23, reset=24)

try:
    while True:

        # Check if hover is ready to send gesture or touch events
        if (hover.getStatus() == 0):

            # Read i2c data and print the type of gesture or touch event
            event = hover.getEvent()

            if event is not None:
                print event,
                # This line can be commented out if you don't want to see the
                # event in text format
                try:
                    direction = hover.getEventString(event)
                except:
                    print "Invalid input recieved from hover, ignoring."
                    direction = ''

                print direction

                if direction == 'swipe_left':
                    print 'left'
                    subprocess.Popen(['bash', '-c', 'xdotool key --window "$(xdotool search --class --onlyvisible Chromium | head -n 1)" Up'])
                elif direction == 'swipe_right':
Esempio n. 3
0
#the Calebrator's sound card is alsa's default output
#device
fs.start(driver='alsa')

#NOTE: These print statements won't be seen unless a display
#is hooked up to the Calebrator via the HDMI port
print("Started FluidSynth")

#Loading a soundfont for fluidsynth to use
sfid = fs.sfload("guitar.sf2")
#Select the program with the desired soundfont
fs.program_select(0, sfid, 0, 0)

print("Loaded soundfont")

hover = Hover(address=0x42, ts=4, reset=17)

########################################################################
######################### All of the commands ##########################
########################################################################


#Plays an instance of the C note
def playButton1():
    global switch1
    global switch2
    global switch3
    if (switch1 == 1):
        fs.noteon(0, 48, 100)
        print("Button 1 (C4): On")