These 2 small scripts below are not working and generate some compilation problems (seen in the log.txt file in the preferences folder).
Code: Select all
#__init__.py
from BCR2000HPS import BCR2000HPS
def create_instance(c_instance):
""" Creates and returns the BCR2000HPS script """
return BCR2000HPS(c_instance)
Code: Select all
#BCR2000HPS.py
from __future__ import with_statement
import Live
from _Framework.ButtonElement import ButtonElement
from _Framework.ControlSurface import ControlSurface
#from _Framework.MixerComponent import MixerComponent
#from _Framework.SliderElement import SliderElement
from _Framework.TransportComponent import TransportComponent
CHANNEL = 0
NUM_TRACKS = 16
class BCR2000HPS(ControlSurface):
__module__ = __name__
__doc__ = ' BCR2000 hpsounds scripts '
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
with self.component_guard():
self._setup_transport_control()
def _setup_transport_control(self):
is_momentary = True
transport = TransportComponent()
transport.set_play_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 61))
transport.set_stop_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 63))
#transport.set_record_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 81))
#transport.set_nudge_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 86), ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 85))
#transport.set_loop_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 84))
#transport.set_punch_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 82), ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 83))
#transport.set_tempo_control(SliderElement(MIDI_CC_TYPE, CHANNEL, 26), SliderElement(MIDI_CC_TYPE, CHANNEL, 25))
H.