Skip to content

Commit

Permalink
fixed overflow issue with Control/XL template set
Browse files Browse the repository at this point in the history
  • Loading branch information
FMMT666 committed Apr 19, 2020
1 parent 87847af commit 3077302
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions launchpad_py/launchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ class LaunchControlXL( LaunchpadBase ):
#-- Uses search string "Control XL", by default.
#-------------------------------------------------------------------------------------
# Overrides "LaunchpadBase" method
def Open( self, number = 0, name = "Control XL", template = 0 ):
def Open( self, number = 0, name = "Control XL", template = 1 ):

# The user template number adds to the MIDI commands.
# Make sure that the Control XL is set to the corresponding mode by
Expand Down Expand Up @@ -1639,7 +1639,7 @@ def Check( self, number = 0, name = "Control XL" ):
#-- 1..8 selects the user and 9..16 the factory setups.
#-------------------------------------------------------------------------------------
def TemplateSet( self, templateNum ):
if templateNum < 0 or templateNum > 15:
if templateNum < 1 or templateNum > 16:
return
else:
self.midi.RawWriteSysEx( [ 0, 32, 41, 2, 17, 119, templateNum-1 ] )
Expand Down Expand Up @@ -1836,7 +1836,7 @@ class LaunchControl( LaunchControlXL ):
#-- Uses search string "Control MIDI", by default.
#-------------------------------------------------------------------------------------
# Overrides "LaunchControlXL" method
def Open( self, number = 0, name = "Control MIDI", template = 0 ):
def Open( self, number = 0, name = "Control MIDI", template = 1 ):

# The user template number adds to the MIDI commands.
# Make sure that the Control is set to the corresponding mode by
Expand Down Expand Up @@ -1868,7 +1868,7 @@ def Check( self, number = 0, name = "Control MIDI" ):
#-- 1..8 selects the user and 9..16 the factory setups.
#-------------------------------------------------------------------------------------
def TemplateSet( self, templateNum ):
if templateNum < 0 or templateNum > 15:
if templateNum < 1 or templateNum > 16:
return
else:
self.midi.RawWriteSysEx( [ 0, 32, 41, 2, 10, 119, templateNum-1 ] )
Expand Down

0 comments on commit 3077302

Please sign in to comment.