You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I took the example code and added led on / off to it - lp.LedCtrlXY(buts[0], buts[1],50, 0, 0), and only the first button turns on - even though I get all the events, am I doing something wrong? Thanksss!!!
Weird it works on linux but not on mac
#!/usr/bin/env python## Quick button test.# Works with these Launchpads: Mk1, Mk2, Mini Mk3, S/Mini, Pro, Pro Mk3# And these: Midi Figther 64# ## FMMT666(ASkr) 7/2013..8/2020# www.askrprojects.net#importsysimporttimeimportrandomtry:
importlaunchpad_pyaslaunchpadexceptImportError:
try:
importlaunchpadexceptImportError:
sys.exit("error loading launchpad.py")
defmain():
mode=Noneiflaunchpad.LaunchpadPro().Check( 0 ):
lp=launchpad.LaunchpadPro()
iflp.Open( 0 ):
print("Launchpad Pro")
mode="Pro"eliflaunchpad.LaunchpadProMk3().Check( 0 ):
lp=launchpad.LaunchpadProMk3()
iflp.Open( 0 ):
print("Launchpad Pro Mk3")
mode="ProMk3"eliflaunchpad.LaunchpadMiniMk3().Check( 1 ):
lp=launchpad.LaunchpadMiniMk3()
iflp.Open( 1 ):
print("Launchpad Mini Mk3")
mode="MiniMk3"eliflaunchpad.LaunchpadLPX().Check( 1 ):
lp=launchpad.LaunchpadLPX()
iflp.Open( 1 ):
print("Launchpad X")
mode="LPX"eliflaunchpad.LaunchpadMk2().Check( 0 ):
lp=launchpad.LaunchpadMk2()
iflp.Open( 0 ):
print("Launchpad Mk2")
mode="Mk2"# elif launchpad.LaunchControlXL().Check( 0 ):# lp = launchpad.LaunchControlXL()# if lp.Open( 0 ):# print("Launch Control XL")# mode = "XL"# elif launchpad.LaunchKeyMini().Check( 0 ):# lp = launchpad.LaunchKeyMini()# if lp.Open( 0 ):# print("LaunchKey (Mini)")# mode = "LKM"eliflaunchpad.Dicer().Check( 0 ):
lp=launchpad.Dicer()
iflp.Open( 0 ):
print("Dicer")
mode="Dcr"eliflaunchpad.MidiFighter64().Check( 0 ):
lp=launchpad.MidiFighter64()
iflp.Open( 0 ):
print("Midi Fighter 64")
mode="F64"eliflaunchpad.Launchpad().Check( 0 ):
lp=launchpad.Launchpad()
iflp.Open( 0 ):
print("Launchpad Mk1/S/Mini")
mode="Mk1"ifmodeisNone:
print("Did not find any Launchpads, meh...")
returnprint("QUIT: Push a single button for longer than 3s and release it.")
#lp.LedSetMode(0)lastBut= (-99,-99)
tStart=time.time()
lp.Reset()
lp.ButtonFlush()
whileTrue:
ifmode=='Pro'ormode=='ProMk3':
buts=lp.ButtonStateXY( mode='pro')
else:
buts=lp.ButtonStateXY()
ifbuts!= []:
print( buts[0], buts[1], buts[2] )
lp.LedCtrlXY(buts[0], buts[1],50, 0, 0)
# quit?ifbuts[2] >0:
lastBut= ( buts[0], buts[1] )
tStart=time.time()
else:
iflastBut== ( buts[0], buts[1] ) and (time.time() -tStart) >2:
breakprint("bye ...")
lp.Reset() # turn all LEDs offlp.Close() # close the Launchpad (will quit with an error due to a PyGame bug)if__name__=='__main__':
main()
The text was updated successfully, but these errors were encountered:
I took the example code and added led on / off to it - lp.LedCtrlXY(buts[0], buts[1],50, 0, 0), and only the first button turns on - even though I get all the events, am I doing something wrong? Thanksss!!!
Weird it works on linux but not on mac
The text was updated successfully, but these errors were encountered: