Scripting error question
Posted: Tue Oct 28, 2014 6:48 am
Ok I'm trying to get the hang of simple scripting but I don't know what I'm doing wrong.
I'm just trying to get simple volume control first and then work up from there and this is in my log:
---------------------------------------------------------------------------------------
5512 ms. RemoteScriptMessage: (MM1) Initialising...
5513 ms. RemoteScriptError: Traceback (most recent call last):
5513 ms. RemoteScriptError: File "MIDI Remote Scripts\MM1\__init__.py", line 6, in create_instance
5513 ms. RemoteScriptError:
5513 ms. RemoteScriptError: return MM1(c_instance)
5513 ms. RemoteScriptError: File "MIDI Remote Scripts\MM1\MM1.py", line 27, in __init__
5514 ms. RemoteScriptError:
5514 ms. RemoteScriptError: self._setup_mixer_control()
5514 ms. RemoteScriptError: File "MIDI Remote Scripts\MM1\MM1.py", line 32, in _setup_mixer_control
5514 ms. RemoteScriptError:
5514 ms. RemoteScriptError: mixer = MixerComponent(num_tracks, 0, with_eqs=False, with_filters=False) #(num_tracks, num_returns, with_eqs, with_filters)
5514 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\MixerComponent.py", line 35, in __init__
5515 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\CompoundComponent.py", line 16, in __init__
5515 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\Dependency.py", line 123, in wrapper
5515 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\Dependency.py", line 63, in get_dependency_for
5515 ms. RemoteScriptError: _Framework.Dependency
5515 ms. RemoteScriptError: .
5515 ms. RemoteScriptError: DependencyError
5516 ms. RemoteScriptError: :
5516 ms. RemoteScriptError: Required dependency register_component not provided for <_Framework.MixerComponent.MixerComponent object at 0x000000000B1143C8>
5516 ms. RemoteScriptError:
5516 ms. Exception: Script could not be loaded.
----------------------------------------------------------------------------------------------
Cobbled together code follows:
-----------------------------------------------------------
from __future__ import with_statement
import Live # This allows us (and the Framework methods) to use the Live API on occasion
from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller
from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a button a the controller
from _Framework.ChannelStripComponent import * # Class attaching to the mixer of a given track
from _Framework.EncoderElement import EncoderElement
from _Framework.CompoundComponent import CompoundComponent # Base class for classes encompasing other components to form complex components
from _Framework.ControlElement import ControlElement # Base class for all classes representing control elements on a controller
from _Framework.ControlSurface import ControlSurface # Central base class for scripts based on the new Framework
from _Framework.ControlSurfaceComponent import ControlSurfaceComponent # Base class for all classes encapsulating functions in Live
from _Framework.InputControlElement import * # Base class for all classes representing control elements on a controller
from _Framework.MixerComponent import MixerComponent # Class encompassing several channel strips to form a mixer
from _Framework.SessionComponent import SessionComponent # Class encompassing several scene to cover a defined section of Live's session
from _Framework.SliderElement import SliderElement # Class representing a slider on the controller
from _Framework.CompoundComponent import CompoundComponent
CHANNEL = 4
num_tracks = 4
mixer = None
class MM1(ControlSurface):
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
self._setup_mixer_control()
def _setup_mixer_control(self):
is_momentary = True
global mixer # We want to instantiate the global mixer as a MixerComponent object (it was a global "None" type up until now...)
mixer = MixerComponent(num_tracks, 0, with_eqs=False, with_filters=False) #(num_tracks, num_returns, with_eqs, with_filters)
mixer.set_track_offset(0) #Sets start point for mixer strip (offset from left)
self.song().view.selected_track = mixer.channel_strip(0)._track
def _setup_mixer_control(self):
is_momentary = True
num_tracks = 4 #A mixer is one-dimensional; here we define the width in tracks - seven columns,
global mixer #We want to instantiate the global mixer as a MixerComponent object (it was a global "None" type up until now...)
mixer = MixerComponent(num_tracks, 0, with_eqs=False, with_filters=False) #(num_tracks, num_returns, with_eqs, with_filters)
mixer.set_track_offset(0) #Sets start point for mixer strip (offset from left)
self.song().view.selected_track = mixer.channel_strip(0)._track #set the selected strip to the first track, so that we don't, for example, try to assign a button to arm the master track, which would cause an assertion error
#"""set up the mixer buttons"""
#mixer.set_select_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 56),ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 54)) #left, right track select
#mixer.master_strip().set_select_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 94)) #jump to the master track
#mixer.selected_strip().set_mute_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 42)) #sets the mute ("activate") button
#mixer.selected_strip().set_solo_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 44)) #sets the solo button
#mixer.selected_strip().set_arm_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 46)) #sets the record arm button
#"""set up the mixer sliders"""
mixer.selected_strip().set_volume_control(SliderElement(MIDI_CC_TYPE, CHANNEL, 48)) #sets the continuous controller for volume
#"""note that we have split the mixer functions across two scripts, in order to have two session highlight boxes (one red, one yellow), so there are a few things which we are not doing here..."""
----------------------------------------------------------------------------------------------------
I'm just trying to get simple volume control first and then work up from there and this is in my log:
---------------------------------------------------------------------------------------
5512 ms. RemoteScriptMessage: (MM1) Initialising...
5513 ms. RemoteScriptError: Traceback (most recent call last):
5513 ms. RemoteScriptError: File "MIDI Remote Scripts\MM1\__init__.py", line 6, in create_instance
5513 ms. RemoteScriptError:
5513 ms. RemoteScriptError: return MM1(c_instance)
5513 ms. RemoteScriptError: File "MIDI Remote Scripts\MM1\MM1.py", line 27, in __init__
5514 ms. RemoteScriptError:
5514 ms. RemoteScriptError: self._setup_mixer_control()
5514 ms. RemoteScriptError: File "MIDI Remote Scripts\MM1\MM1.py", line 32, in _setup_mixer_control
5514 ms. RemoteScriptError:
5514 ms. RemoteScriptError: mixer = MixerComponent(num_tracks, 0, with_eqs=False, with_filters=False) #(num_tracks, num_returns, with_eqs, with_filters)
5514 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\MixerComponent.py", line 35, in __init__
5515 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\CompoundComponent.py", line 16, in __init__
5515 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\Dependency.py", line 123, in wrapper
5515 ms. RemoteScriptError: File "c:\Jenkins\live\Binary\Core_Release_64_static\midi-remote-scripts\_Framework\Dependency.py", line 63, in get_dependency_for
5515 ms. RemoteScriptError: _Framework.Dependency
5515 ms. RemoteScriptError: .
5515 ms. RemoteScriptError: DependencyError
5516 ms. RemoteScriptError: :
5516 ms. RemoteScriptError: Required dependency register_component not provided for <_Framework.MixerComponent.MixerComponent object at 0x000000000B1143C8>
5516 ms. RemoteScriptError:
5516 ms. Exception: Script could not be loaded.
----------------------------------------------------------------------------------------------
Cobbled together code follows:
-----------------------------------------------------------
from __future__ import with_statement
import Live # This allows us (and the Framework methods) to use the Live API on occasion
from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller
from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a button a the controller
from _Framework.ChannelStripComponent import * # Class attaching to the mixer of a given track
from _Framework.EncoderElement import EncoderElement
from _Framework.CompoundComponent import CompoundComponent # Base class for classes encompasing other components to form complex components
from _Framework.ControlElement import ControlElement # Base class for all classes representing control elements on a controller
from _Framework.ControlSurface import ControlSurface # Central base class for scripts based on the new Framework
from _Framework.ControlSurfaceComponent import ControlSurfaceComponent # Base class for all classes encapsulating functions in Live
from _Framework.InputControlElement import * # Base class for all classes representing control elements on a controller
from _Framework.MixerComponent import MixerComponent # Class encompassing several channel strips to form a mixer
from _Framework.SessionComponent import SessionComponent # Class encompassing several scene to cover a defined section of Live's session
from _Framework.SliderElement import SliderElement # Class representing a slider on the controller
from _Framework.CompoundComponent import CompoundComponent
CHANNEL = 4
num_tracks = 4
mixer = None
class MM1(ControlSurface):
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
self._setup_mixer_control()
def _setup_mixer_control(self):
is_momentary = True
global mixer # We want to instantiate the global mixer as a MixerComponent object (it was a global "None" type up until now...)
mixer = MixerComponent(num_tracks, 0, with_eqs=False, with_filters=False) #(num_tracks, num_returns, with_eqs, with_filters)
mixer.set_track_offset(0) #Sets start point for mixer strip (offset from left)
self.song().view.selected_track = mixer.channel_strip(0)._track
def _setup_mixer_control(self):
is_momentary = True
num_tracks = 4 #A mixer is one-dimensional; here we define the width in tracks - seven columns,
global mixer #We want to instantiate the global mixer as a MixerComponent object (it was a global "None" type up until now...)
mixer = MixerComponent(num_tracks, 0, with_eqs=False, with_filters=False) #(num_tracks, num_returns, with_eqs, with_filters)
mixer.set_track_offset(0) #Sets start point for mixer strip (offset from left)
self.song().view.selected_track = mixer.channel_strip(0)._track #set the selected strip to the first track, so that we don't, for example, try to assign a button to arm the master track, which would cause an assertion error
#"""set up the mixer buttons"""
#mixer.set_select_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 56),ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 54)) #left, right track select
#mixer.master_strip().set_select_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 94)) #jump to the master track
#mixer.selected_strip().set_mute_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 42)) #sets the mute ("activate") button
#mixer.selected_strip().set_solo_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 44)) #sets the solo button
#mixer.selected_strip().set_arm_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 46)) #sets the record arm button
#"""set up the mixer sliders"""
mixer.selected_strip().set_volume_control(SliderElement(MIDI_CC_TYPE, CHANNEL, 48)) #sets the continuous controller for volume
#"""note that we have split the mixer functions across two scripts, in order to have two session highlight boxes (one red, one yellow), so there are a few things which we are not doing here..."""
----------------------------------------------------------------------------------------------------