Ejemplo n.º 1
0
    def __init__(self, parent):
        RackUnit.__init__(self, parent, 'delay-unit')

        self.delay_type = CbxParameter(parent=self,
                                       name='delay-type',
                                       cc_nb=53,
                                       parameter_nb=27,
                                       max_value=3)
        self.delay_time_course = ScaleParameter(parent=self,
                                                name='delay-time-course',
                                                cc_nb=55,
                                                parameter_nb=29,
                                                max_value=30)
        self.delay_time_fine = ScaleParameter(parent=self,
                                              name='delay-time-fine',
                                              cc_nb=56,
                                              parameter_nb=30,
                                              min_value=1,
                                              max_value=99)
        self.delay_feedback = ScaleParameter(parent=self,
                                             name='delay-feedback',
                                             cc_nb=57,
                                             parameter_nb=31,
                                             max_value=99)
        self.delay_level = ScaleParameter(parent=self,
                                          name='delay-level',
                                          cc_nb=54,
                                          parameter_nb=28,
                                          max_value=99,
                                          display_percent=True)
        self.delay_on_off_btn = BtnParameter(parent=self,
                                             name='delay',
                                             cc_nb=52,
                                             parameter_nb=26)
Ejemplo n.º 2
0
    def __init__(self, main_window, gtk_builder):
        self.main_window = main_window
        self.gtk_builder = gtk_builder

        self.settings = UtilitySettingsResponse()

        self.prevent_propagation = False

        self.gtk_dlg = self.get_widget('utilities-dlg')
        self.done_btn = self.get_widget('utilities-done-btn')
        self.done_btn.connect('clicked', self.on_done_btn_clicked)

        self.cabinet_emul_switch = self.get_widget('cabinet-emulation-swtch')
        self.cabinet_emul_switch.connect('state_set', self.on_utility_changed)
        self.stereo_switch = self.get_widget('stereo-swtch')
        self.stereo_switch.connect('state_set', self.on_utility_changed)
        self.dry_track_switch = self.get_widget('dry-track-swtch')
        self.dry_track_switch.connect('state_set', self.on_utility_changed)
        self.midi_loopback_switch = self.get_widget('midi-loopback-swtch')
        self.midi_loopback_switch.connect('state_set', self.on_utility_changed)

        # digital level is the only utility parameter
        # to be associated to a CC parameter
        self.digital_level = self.get_widget('digital-level-scale')
        self.digital_level_scale = ScaleParameter(parent=self,
                                                  name='digital-level',
                                                  cc_nb=14,
                                                  max_value=24,
                                                  auto_register=False)
        self.digital_level_scale.init_widget(self.gtk_builder)
        self.digital_level_has_changed = False
Ejemplo n.º 3
0
    def __init__(self, parent):
        RackUnit.__init__(self, parent, 'effect-unit')

        self.effect_type = CbxParameter(parent=self,
                                        name='effect-type',
                                        cc_nb=45,
                                        parameter_nb=20,
                                        max_value=6)
        self.speed = ScaleParameter(parent=self,
                                    name='effect-speed',
                                    cc_nb=47,
                                    parameter_nb=22,
                                    max_value=90)
        self.depth = EffectUnit.DepthDetuneParameter(parent=self,
                                    name='effect-depth',
                                    cc_nb=48,
                                    parameter_nb=23,
                                    max_value=90)
        self.option = ScaleParameter(parent=self,
                                     name='effect-option',
                                     cc_nb=49, # regen
                                     parameter_nb=24,
                                     max_value=90)
        self.mix = ScaleParameter(parent=self,
                                  name='effect-mix',
                                  cc_nb=46, # level
                                  parameter_nb=21,
                                  max_value=90)
        self.on_off_btn = BtnParameter(parent=self,
                                       name='effect',
                                       cc_nb=44, # On/Bypass
                                       parameter_nb=19)

        self.rd_btn_grp = GrpParameter(parent=self, name='effect-rd-btn-grp')
        self.pre_rdbtn = RdBtnParameter(parent=self.rd_btn_grp,
                                        name='effect-pre',
                                        is_active=1,
                                        value=99,
                                        cc_nb=50, # position
                                        parameter_nb=25)
        self.post_rdbtn = RdBtnParameter(parent=self.rd_btn_grp,
                                         name='effect-post',
                                         is_active=0,
                                         value=0,
                                         cc_nb=50, # position
                                         parameter_nb=25)
Ejemplo n.º 4
0
    def __init__(self, parent):
         RackUnit.__init__(self, parent, 'reverb-unit')

         self.reverb_type = CbxParameter(parent=self,
                                         name='reverb-type',
                                         cc_nb=60,
                                         parameter_nb=33,
                                         max_value=12)
         self.reverb_diffusion = ScaleParameter(parent=self,
                                                name='reverb-diffusion',
                                                cc_nb=62,
                                                parameter_nb=35,
                                                max_value=99,
                                                display_percent=True)
         self.reverb_density = ScaleParameter(parent=self,
                                              name='reverb-density',
                                              cc_nb=63,
                                              parameter_nb=36,
                                              max_value=99,
                                              display_percent=True)
         self.reverb_decay = ScaleParameter(parent=self,
                                            name='reverb-decay',
                                            cc_nb=65,
                                            parameter_nb=37,
                                            max_value=9)
         self.reverb_level = ScaleParameter(parent=self,
                                            name='reverb-level',
                                            cc_nb=61,
                                            parameter_nb=34,
                                            max_value=99,
                                            display_percent=True)
         self.reverb_on_off_btn = BtnParameter(parent=self,
                                               name='reverb',
                                               cc_nb=59,
                                               parameter_nb=32)
Ejemplo n.º 5
0
    def __init__(self, parent):
        RackUnit.__init__(self, parent, 'compressor-gate-unit')

        self.compressor_ratio = CbxParameter(parent=self,
                                             name='compressor-ratio',
                                             cc_nb=3,
                                             parameter_nb=2,
                                             max_value=9)
        self.compressor_freq = CbxParameter(parent=self,
                                            name='compressor-freq',
                                            cc_nb=5,
                                            parameter_nb=4,
                                            max_value=19)
        self.compressor_gain = ScaleParameter(parent=self,
                                              name='compressor-gain',
                                              cc_nb=4,
                                              parameter_nb=3,
                                              max_value=30)
        self.compressor_threshold = CompressorGateUnit.ThresholdScaleParameter(
            parent=self,
            name='compressor-threshold',
            cc_nb=2,
            parameter_nb=1,
            max_value=50)
        self.compressor_on_off_btn = BtnParameter(parent=self,
                                                  name='compressor',
                                                  cc_nb=1,
                                                  parameter_nb=0)
        self.gate_threshold = ScaleParameter(parent=self,
                                             name='gate-threshold',
                                             cc_nb=43,
                                             parameter_nb=18,
                                             min_value=1,
                                             max_value=99,
                                             display_percent=True)
        self.gate_attack = ScaleParameter(parent=self,
                                          name='gate-attack',
                                          cc_nb=42,
                                          parameter_nb=17,
                                          max_value=10)
        self.gate_on_off_btn = BtnParameter(parent=self,
                                            name='gate',
                                            cc_nb=41,
                                            parameter_nb=16)
Ejemplo n.º 6
0
    def __init__(self, parent):
        RackUnit.__init__(self, parent, 'amp-unit')

        self.amp_modeling = CbxParameter(parent=self,
                                         name='amp-model',
                                         cc_nb=34,
                                         parameter_nb=9,
                                         max_value=24)
        self.cabinet = CbxParameter(parent=self,
                                    name='cabinet-type',
                                    cc_nb=66,
                                    parameter_nb=15,
                                    max_value=18)
        self.gain = ScaleParameter(parent=self,
                                   name='gain',
                                   cc_nb=35,
                                   parameter_nb=10,
                                   max_value=90,
                                   display_percent=True)
        self.treble = ScaleParameter(parent=self,
                                     name='treble',
                                     cc_nb=39,
                                     parameter_nb=11,
                                     max_value=90,
                                     display_percent=True)
        self.mid = ScaleParameter(parent=self,
                                  name='mid',
                                  cc_nb=38,
                                  parameter_nb=12,
                                  max_value=90,
                                  display_percent=True)
        self.bass = ScaleParameter(parent=self,
                                   name='bass',
                                   cc_nb=37,
                                   parameter_nb=13,
                                   max_value=90,
                                   display_percent=True)
        self.level = ScaleParameter(parent=self,
                                    name='level',
                                    cc_nb=36,
                                    parameter_nb=14,
                                    max_value=90,
                                    display_percent=True)
Ejemplo n.º 7
0
    def __init__(self, parent):
         RackUnit.__init__(self, parent=parent, name='wah-expression-unit')

         self.dwah_expression_type = CbxParameter(parent=self,
                                                  name='wah-expression-type',
                                                  cc_nb=70,
                                                  parameter_nb=40,
                                                  max_value=3)
         self.wha_heel = ScaleParameter(parent=self,
                                        name='wah-heel',
                                        cc_nb=10,
                                        parameter_nb=7,
                                        max_value=127,
                                        display_percent=True)
         self.wha_toe = ScaleParameter(parent=self,
                                       name='wah-toe',
                                       cc_nb=11,
                                       parameter_nb=8,
                                       max_value=127,
                                       display_percent=True)
         self.pedal_forward = ScaleParameter(parent=self,
                                             name='pedal-forward',
                                             cc_nb=71,
                                             parameter_nb=41,
                                             max_value=127,
                                             display_percent=True)
         self.pedal_back = ScaleParameter(parent=self,
                                          name='pedal-back',
                                          cc_nb=72,
                                          parameter_nb=42,
                                          max_value=127,
                                          display_percent=True)
         self.wah_expression_on_off_btn = BtnParameter(parent=self,
                                                       name='wah-expression',
                                                       cc_nb=8,
                                                       parameter_nb=5)
Ejemplo n.º 8
0
class ReverbUnit(RackUnit):
    def __init__(self, parent):
         RackUnit.__init__(self, parent, 'reverb-unit')

         self.reverb_type = CbxParameter(parent=self,
                                         name='reverb-type',
                                         cc_nb=60,
                                         parameter_nb=33,
                                         max_value=12)
         self.reverb_diffusion = ScaleParameter(parent=self,
                                                name='reverb-diffusion',
                                                cc_nb=62,
                                                parameter_nb=35,
                                                max_value=99,
                                                display_percent=True)
         self.reverb_density = ScaleParameter(parent=self,
                                              name='reverb-density',
                                              cc_nb=63,
                                              parameter_nb=36,
                                              max_value=99,
                                              display_percent=True)
         self.reverb_decay = ScaleParameter(parent=self,
                                            name='reverb-decay',
                                            cc_nb=65,
                                            parameter_nb=37,
                                            max_value=9)
         self.reverb_level = ScaleParameter(parent=self,
                                            name='reverb-level',
                                            cc_nb=61,
                                            parameter_nb=34,
                                            max_value=99,
                                            display_percent=True)
         self.reverb_on_off_btn = BtnParameter(parent=self,
                                               name='reverb',
                                               cc_nb=59,
                                               parameter_nb=32)


    def update_conf_from_parameter(self, parameter):
        if parameter == self.reverb_type:
            str_value = parameter.str_value
            sensitivity = True
            if str_value == '2-Spring 7\"' or \
                    str_value == '2-Spring 14\"' or \
                    str_value == '3-Spring 14\"' or \
                    str_value == 'Rattle \'n\' Boing':
                sensitivity = False

            self.reverb_diffusion.set_sensitive(sensitivity)
            self.reverb_density.set_sensitive(sensitivity)
            self.reverb_decay.set_sensitive(sensitivity)
Ejemplo n.º 9
0
 def __init__(self, **kwargs):
     self.origin = 0
     ScaleParameter.__init__(self, **kwargs)
Ejemplo n.º 10
0
class EffectUnit(RackUnit):
    class DepthDetuneParameter(ScaleParameter):
        def __init__(self, **kwargs):
            self.origin = 0
            ScaleParameter.__init__(self, **kwargs)

        def get_str_value(self):
            return '%d'%(self.value - self.origin)


    def __init__(self, parent):
        RackUnit.__init__(self, parent, 'effect-unit')

        self.effect_type = CbxParameter(parent=self,
                                        name='effect-type',
                                        cc_nb=45,
                                        parameter_nb=20,
                                        max_value=6)
        self.speed = ScaleParameter(parent=self,
                                    name='effect-speed',
                                    cc_nb=47,
                                    parameter_nb=22,
                                    max_value=90)
        self.depth = EffectUnit.DepthDetuneParameter(parent=self,
                                    name='effect-depth',
                                    cc_nb=48,
                                    parameter_nb=23,
                                    max_value=90)
        self.option = ScaleParameter(parent=self,
                                     name='effect-option',
                                     cc_nb=49, # regen
                                     parameter_nb=24,
                                     max_value=90)
        self.mix = ScaleParameter(parent=self,
                                  name='effect-mix',
                                  cc_nb=46, # level
                                  parameter_nb=21,
                                  max_value=90)
        self.on_off_btn = BtnParameter(parent=self,
                                       name='effect',
                                       cc_nb=44, # On/Bypass
                                       parameter_nb=19)

        self.rd_btn_grp = GrpParameter(parent=self, name='effect-rd-btn-grp')
        self.pre_rdbtn = RdBtnParameter(parent=self.rd_btn_grp,
                                        name='effect-pre',
                                        is_active=1,
                                        value=99,
                                        cc_nb=50, # position
                                        parameter_nb=25)
        self.post_rdbtn = RdBtnParameter(parent=self.rd_btn_grp,
                                         name='effect-post',
                                         is_active=0,
                                         value=0,
                                         cc_nb=50, # position
                                         parameter_nb=25)


    def update_conf_from_parameter(self, parameter):
        if parameter == self.effect_type:
            str_value = parameter.str_value

            speed_label = 'Speed:'
            speed_max = 99

            depth_label = 'Depth:'
            depth_origin = 0
            depth_max = 99

            option_label = 'PreDelay:'
            option_max = 99
            option_sensitivity = True

            if str_value == 'Chorus':
                option_max = 40
            elif str_value == 'Flanger':
                option_label = 'Regen:'
            elif str_value == 'Tremolo' or str_value == 'Rotary Speaker':
                option_sensitivity = False
            elif str_value == 'Auto Wah':
                speed_max = 2
            elif str_value == 'Pitch / Detune':
                option_sensitivity = False
                speed_label = 'Pitch:'
                speed_max = 48
                depth_label = 'Detune:'
                depth_origin = 30
                depth_max = 60

            self.speed.set_widget_label(speed_label)
            self.speed.set_max(speed_max)

            self.depth.set_widget_label(depth_label)
            self.depth.set_max(depth_max)
            self.depth.origin = depth_origin

            self.option.set_widget_label(option_label)
            self.option.set_sensitive(option_sensitivity)
            self.option.set_max(option_max)
Ejemplo n.º 11
0
class UtilitiesDlg:
    def __init__(self, main_window, gtk_builder):
        self.main_window = main_window
        self.gtk_builder = gtk_builder

        self.settings = UtilitySettingsResponse()

        self.prevent_propagation = False

        self.gtk_dlg = self.get_widget('utilities-dlg')
        self.done_btn = self.get_widget('utilities-done-btn')
        self.done_btn.connect('clicked', self.on_done_btn_clicked)

        self.cabinet_emul_switch = self.get_widget('cabinet-emulation-swtch')
        self.cabinet_emul_switch.connect('state_set', self.on_utility_changed)
        self.stereo_switch = self.get_widget('stereo-swtch')
        self.stereo_switch.connect('state_set', self.on_utility_changed)
        self.dry_track_switch = self.get_widget('dry-track-swtch')
        self.dry_track_switch.connect('state_set', self.on_utility_changed)
        self.midi_loopback_switch = self.get_widget('midi-loopback-swtch')
        self.midi_loopback_switch.connect('state_set', self.on_utility_changed)

        # digital level is the only utility parameter
        # to be associated to a CC parameter
        self.digital_level = self.get_widget('digital-level-scale')
        self.digital_level_scale = ScaleParameter(parent=self,
                                                  name='digital-level',
                                                  cc_nb=14,
                                                  max_value=24,
                                                  auto_register=False)
        self.digital_level_scale.init_widget(self.gtk_builder)
        self.digital_level_has_changed = False

    def get_widget(self, widget_name):
        widget = self.gtk_builder.get_object(widget_name)
        if widget == None:
            self.is_valid = False
            print('Could not find widget %s' % (widget_name))
        return widget

    def get_parameter_cc_bindings(self):
        return self.digital_level_scale.get_parameter_cc_bindings()

    def present(self, widget=None):
        self.gtk_dlg.present()

    def update_conf_from_parameter(self, parameter):
        pass

    def send_parameter_value(self, parameter):
        self.main_window.send_parameter_value(parameter,
                                              program_has_changed=False)

    def set_utilities(self, settings_resp):
        self.settings = settings_resp

        self.prevent_propagation = True
        self.cabinet_emul_switch.set_active(self.settings.global_cabinet)
        self.stereo_switch.set_active(self.settings.stereo_mono)
        self.digital_level_scale.init_value(self.settings.digital_out_level)
        self.dry_track_switch.set_active(self.settings.dry_track)
        self.midi_loopback_switch.set_active(self.settings.midi_merge)
        self.prevent_propagation = False

    def on_done_btn_clicked(self, widget):
        if self.digital_level_has_changed:
            # digital out sends the value to the J-Station using CC events
            # however, it needs to be confirmed in order to persist
            self.main_window.send_settings(self.settings)
            self.digital_level_has_changed = False

        self.gtk_dlg.hide()

    def on_digital_level_changed(self, widget, step, value):
        if not self.prevent_propagation:
            self.digital_level_has_changed = True
            self.settings.digital_out_level = int(value)
        self.digital_level_regular_callback(widget, step, value)

    def on_utility_changed(self, widget, value=None):
        if not self.prevent_propagation:
            if widget == self.cabinet_emul_switch:
                self.settings.global_cabinet = value
            elif widget == self.stereo_switch:
                self.settings.stereo_mono = value
            elif widget == self.dry_track_switch:
                self.settings.dry_track = value
            elif widget == self.midi_loopback_switch:
                self.settings.midi_merge = value

            # a value has changed => update seq event
            self.settings.fill_seq_event()
            self.main_window.send_settings(self.settings)