def __init__(self, clip_creator = None, skin = None, grid_resolution = None, note_editor_settings = None, *a, **k):
     super(StepSeqComponent, self).__init__(*a, **k)
     raise clip_creator or AssertionError
     if not skin:
         raise AssertionError
         self._grid_resolution = grid_resolution
         note_editor_settings and self.register_component(note_editor_settings)
     self._note_editor, self._loop_selector, self._big_loop_selector, self._drum_group = self.register_components(NoteEditorComponent(settings_mode=note_editor_settings, clip_creator=clip_creator, grid_resolution=self._grid_resolution), LoopSelectorComponent(clip_creator=clip_creator), LoopSelectorComponent(clip_creator=clip_creator, measure_length=2.0), DrumGroupComponent())
     self._paginator = NoteEditorPaginator([self._note_editor])
     self._big_loop_selector.set_enabled(False)
     self._big_loop_selector.set_paginator(self._paginator)
     self._loop_selector.set_paginator(self._paginator)
     self._shift_button = None
     self._delete_button = None
     self._mute_button = None
     self._solo_button = None
     self._note_editor_matrix = None
     self._on_pressed_pads_changed.subject = self._drum_group
     self._on_detail_clip_changed.subject = self.song().view
     self._detail_clip = None
     self._playhead = None
     self._playhead_component = self.register_component(PlayheadComponent(grid_resolution=grid_resolution, paginator=self._paginator, follower=self._loop_selector, notes=chain(*starmap(range, ((92, 100),
      (84, 92),
      (76, 84),
      (68, 76)))), triplet_notes=chain(*starmap(range, ((92, 98),
      (84, 90),
      (76, 82),
      (68, 74))))))
     self._skin = skin
     self._playhead_color = 'NoteEditor.Playhead'
Exemplo n.º 2
0
 def __init__(self, clip_creator = None, parameter_provider = None, grid_resolution = None, note_editor_settings = None, skin = None, instrument_play_layer = None, instrument_sequence_layer = None, layer = None, *a, **k):
     super(MelodicComponent, self).__init__(*a, **k)
     self._matrices = None
     self._grid_resolution = grid_resolution
     self._instrument = self.register_component(InstrumentComponent())
     self._note_editors = self.register_components(*[ NoteEditorComponent(settings_mode=note_editor_settings, clip_creator=clip_creator, grid_resolution=self._grid_resolution, is_enabled=False) for _ in xrange(NUM_NOTE_EDITORS) ])
     self._paginator = NoteEditorPaginator(self._note_editors)
     self._loop_selector = self.register_component(LoopSelectorComponent(clip_creator=clip_creator, paginator=self._paginator, is_enabled=False))
     self._playhead = None
     self._playhead_component = self.register_component(PlayheadComponent(grid_resolution=grid_resolution, paginator=self._paginator, follower=self._loop_selector, is_enabled=False))
     self.add_mode('play', LayerMode(self._instrument, instrument_play_layer))
     self.add_mode('sequence', [LayerMode(self._instrument, instrument_sequence_layer),
      self._loop_selector,
      note_editor_settings,
      LayerMode(self, layer),
      self._playhead_component] + self._note_editors)
     self.selected_mode = 'play'
     scales = self._instrument.scales
     self._on_detail_clip_changed.subject = self.song().view
     self._on_scales_changed.subject = scales
     self._on_scales_preset_changed.subject = scales._presets
     self._on_notes_changed.subject = self._instrument
     self._on_selected_mode_changed.subject = self
     self._on_detail_clip_changed()
     self._update_note_editors()
     self._skin = skin
     self._playhead_color = 'Melodic.Playhead'
     self._update_playhead_color()
 def __init__(self, matrix_raw, num_steps, num_rows, row_width, channels, res_comp, velo_comp=None, targets_comp=None, should_enumerate=False, playhead_offsets=(0, 0), prefer_playing_clip=False, name='Mono_Sequence_Control', *a, **k):
     super(MonoSeqComponent, self).__init__(num_steps, res_comp, targets_comp=targets_comp, prefer_playing_clip=prefer_playing_clip, name=name, *a, **k)
     if prefer_playing_clip:
         targets_comp = None
     notes, t_notes = self._create_playhead_notes(matrix_raw, num_rows, row_width, playhead_offsets, should_enumerate)
     self._playhead_component = self.register_component(PlayheadComponent(res_comp, self._page_component, notes=notes, triplet_notes=t_notes, feedback_channels=channels, targets_comp=targets_comp))
     self._note_lane_components = self.register_components(*[
      NoteLaneComponent(num_steps, row_width, channel=channels[0], enumerate_ids=should_enumerate, resolution_comp=res_comp, page_comp=self._page_component, velo_comp=velo_comp, targets_comp=targets_comp, use_odd_colors=True)])
     return
Exemplo n.º 4
0
 def __init__(self,
              num_steps,
              num_rows,
              row_width,
              channels,
              res_comp,
              invert_rows=True,
              velo_comp=None,
              targets_comp=None,
              prefer_playing_clip=False,
              name='Poly_Sequence_Control',
              *a,
              **k):
     super(PolySeqComponent,
           self).__init__(num_steps,
                          res_comp,
                          targets_comp=targets_comp,
                          prefer_playing_clip=prefer_playing_clip,
                          name=name,
                          *a,
                          **k)
     if prefer_playing_clip:
         targets_comp = None
     self._playhead_component = self.register_component(
         PlayheadComponent(res_comp,
                           self._page_component,
                           feedback_channels=channels,
                           targets_comp=targets_comp))
     self._note_lane_components = self.register_components(*[
         NoteLaneComponent(num_steps,
                           row_width,
                           note=36 + i,
                           channel=channels[i],
                           enumerate_ids=True,
                           resolution_comp=res_comp,
                           page_comp=self._page_component,
                           velo_comp=velo_comp,
                           targets_comp=targets_comp,
                           use_odd_colors=i % 2 == 0)
         for i in xrange(num_rows)
     ])
     self._num_note_lanes = num_rows
     self._invert_rows = bool(invert_rows)
     return