Skip to content

Commit

Permalink
minor bug fixes for drumrack detection
Browse files Browse the repository at this point in the history
  • Loading branch information
hdavid committed Jun 19, 2014
1 parent e719413 commit 07e3cd0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions InstrumentControllerComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from _Framework.SubjectSlot import subject_slot
from _Framework.ButtonElement import ButtonElement
from _Framework.Util import find_if
from itertools import imap
from TrackControllerComponent import TrackControllerComponent
from ScaleComponent import * # noqa
from StepSequencerComponent import StepSequencerComponent
Expand Down Expand Up @@ -309,7 +310,7 @@ def _get_drumrack_device(self):
if(track.devices != None and len(track.devices) > 0):
#device = track.devices[0]
device = self.find_drum_group_device(track)
if(device.can_have_drum_pads and device.has_drum_pads):
if(device != None and device.can_have_drum_pads and device.has_drum_pads):
self._drum_group_device = device
else:
self._drum_group_device = None
Expand All @@ -324,7 +325,7 @@ def find_drum_group_device(self, track):
if device.can_have_drum_pads:
return device
elif device.can_have_chains:
return find_if(bool, imap(find_drum_group_device, device.chains))
return find_if(bool, imap(self.find_drum_group_device, device.chains))
else:
return None

Expand Down
5 changes: 3 additions & 2 deletions StepSequencerComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from _Framework.CompoundComponent import CompoundComponent
from _Framework.ButtonElement import ButtonElement
from _Framework.Util import find_if
from itertools import imap
from NoteEditorComponent import NoteEditorComponent
from ScaleComponent import * # noqa
from TrackControllerComponent import TrackControllerComponent
Expand Down Expand Up @@ -1141,7 +1142,7 @@ def _update_drum_group_device(self):
if(track.devices != None and len(track.devices) > 0):
#device = track.devices[0]
device = self.find_drum_group_device(track)
if(device.can_have_drum_pads and device.has_drum_pads):
if(device!= None and device.can_have_drum_pads and device.has_drum_pads):
self._drum_group_device = device
else:
self._drum_group_device = None
Expand All @@ -1161,7 +1162,7 @@ def find_drum_group_device(self, track):
if device.can_have_drum_pads:
return device
elif device.can_have_chains:
return find_if(bool, imap(find_drum_group_device, device.chains))
return find_if(bool, imap(self.find_drum_group_device, device.chains))
else:
return None

Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ <h3>Drum Step Sequencer Mode</h3>
A summary of functions assigned to the buttons is shown in the table below. hover your mouse above a button to get detailed descriptions.
</p>
<p>
StepSeq by default works in combined mode. pressing the scene 2 button toggles between combined mode and multi note mode. Multinote mode works in similarly to the the previous step in launchpad85, while combined mode offers mode close to the way Push StepSeq behaves.
StepSeq by default works in combined mode. pressing the 4th scene button toggles between combined mode and multi note mode. Multinote mode works in similarly to the the previous step in launchpad85, while combined mode offers mode close to the way Push StepSeq behaves.
</p>

<h5>Combined Mode</h5>
Expand Down

0 comments on commit 07e3cd0

Please sign in to comment.