コード例 #1
0
 def scene_name_changestate(self, scene, sc):
     nm = ""
     nm = scene.name
     if scene.color == 0:
         self.oscServer.sendOSC("/scene", (sc, touchAbleUtils.repr3(nm), 0))
     else:
         self.oscServer.sendOSC("/scene",
                                (sc, touchAbleUtils.repr3(nm), scene.color))
コード例 #2
0
    def get_modulation_targe_parameter_name(self, msg):
    
    
        device = self.get_device_for_message(msg)
        number_of_steps = msg[5]
        new_index = 6+(number_of_steps)*2
        unison_voice_count = msg[new_index]
        target = msg[new_index]

        if device.class_name == 'InstrumentVector':
            wavetable = device
            mod_name = wavetable.get_modulation_target_parameter_name(target)


            play_pos_data = [int(type)]
            play_pos_data.append(int(tid))
            play_pos_data.append(int(did))
            play_pos_data.append(int(number_of_steps))
    
            for index in range(number_of_steps * 2):
                play_pos_data.append(int(indices[index]))
            
            play_pos_data.append(touchAbleUtils.repr3(mod_name))
        
            self.oscServer.sendOSC("/device/wavetable/set_modulation_targe_parameter_name", play_pos_data)
コード例 #3
0
 def clip_gain_str_changed(self, clip, tid, cid):
     try:
         gain_string = clip.gain_display_string
         self.oscServer.sendOSC(
             "/clip/gain_str_changed",
             (tid, cid, touchAbleUtils.repr3(gain_string)))
     except:
         pass
コード例 #4
0
    def drum_pad_changed(self, drum_pad, i, j, number_of_steps, indices):
        #self.oscServer.sendOSC("/NSLOG_REPLACE", str("DRUM PAD CHANGED !!!!!!!11111"))

        drum_pad_tuple = [0, i, j, number_of_steps]
        for index in range(number_of_steps * 2):
            drum_pad_tuple.append(int(indices[index]))
                
        drum_pad_tuple.append(int(drum_pad.note))
        drum_pad_tuple.append(touchAbleUtils.repr3(drum_pad.name))
        drum_pad_tuple.append(int(drum_pad.mute))
        drum_pad_tuple.append(int(drum_pad.solo))
        self.oscServer.sendOSC("/track/device/drumpad", tuple(drum_pad_tuple))
コード例 #5
0
 def param_changestate(self, param, tid, did, pid, type, number_of_steps, indices):
     if type == 1:
         indis = [type, 0, did, pid, param.value, touchAbleUtils.repr3(param.__str__()), number_of_steps]
         for index in range(number_of_steps * 2):
             indis.append(int(indices[index]))
         indis.append(int(param.is_enabled))
         indis.append(int(param.automation_state))
         self.oscServer.sendOSC('/master/device/parameter', (tuple(indis)))
     elif type == 2:
         indis = [type, tid, did, pid, param.value, touchAbleUtils.repr3(param.__str__()), number_of_steps]
         for index in range(number_of_steps * 2):
             indis.append(int(indices[index]))
         indis.append(int(param.is_enabled))
         indis.append(int(param.automation_state))
         self.oscServer.sendOSC('/return/device/parameter', (tuple(indis)))
     else:
         indis = [type, tid, did, pid, param.value, touchAbleUtils.repr3(param.__str__()), number_of_steps]
         for index in range(number_of_steps * 2):
             indis.append(int(indices[index]))
         indis.append(int(param.is_enabled))
         indis.append(int(param.automation_state))
         self.oscServer.sendOSC('/track/device/parameter', (tuple(indis)))
コード例 #6
0
    def trname_changestate(self, tid, track, r=0):
        #trackTotal = len(LiveUtils.getTracks())
        #sceneTotal = len(LiveUtils.getScenes())
        #returnsTotal = len(LiveUtils.getSong().return_tracks)
        #self.oscServer.sendOSC("/set/size", (trackTotal, sceneTotal, returnsTotal))
        if r == 1:
            nm = track.name
            col = 0
            grouptrack = 0
            try:
                col = track.color
            except:
                pass
            #ascnm = (nm.encode('ascii', 'replace'))
            self.oscServer.sendOSC('/return',
                                   (tid, touchAbleUtils.repr3(nm), col))
        else:
            nm = track.name
            col = 0
            is_midi_track = track.has_midi_input

            try:
                col = track.color
            except:
                pass
            if track.is_foldable == 1:
                grouptrack = 1
            else:
                grouptrack = 0
            #ascnm = (nm.encode('ascii', 'replace'))

            live_pointer = ""

            self.oscServer.sendOSC(
                '/track', (tid, touchAbleUtils.repr3(nm), col, grouptrack,
                           int(is_midi_track), live_pointer))
コード例 #7
0
    def update_available_input_routing_types(self, device, track, tid, did, type , number_of_steps, indices):
       
        data = [int(type)]
        data.append(int(tid))
        data.append(int(did))
        data.append(int(number_of_steps))
       
        for index in range(number_of_steps * 2):
            data.append(int(indices[index]))
    
        input_routing_types = device.available_input_routing_types
        length = len(input_routing_types)
        data.append(length)

        for index in range(length):
            input_type = input_routing_types[index]
            data.append(touchAbleUtils.repr3(input_type.display_name))
                       
        self.oscServer.sendOSC("/device/compressor/update_available_input_routing_types", data)
コード例 #8
0
    def update_oscillator_wavetable_categories(self, device, track, tid, did,
                                               type, number_of_steps, indices):

        play_pos_data = [int(type)]
        play_pos_data.append(int(tid))
        play_pos_data.append(int(did))
        play_pos_data.append(int(number_of_steps))

        for index in range(number_of_steps * 2):
            play_pos_data.append(int(indices[index]))

        play_pos_data.append(int(len(device.oscillator_wavetable_categories)))

        for index in range(len(device.oscillator_wavetable_categories)):
            filter_routing = device.oscillator_wavetable_categories[index]
            play_pos_data.append(touchAbleUtils.repr3(filter_routing))

        self.oscServer.sendOSC(
            "/device/wavetable/update_oscillator_wavetable_categories",
            play_pos_data)
コード例 #9
0
    def clip_name(self, clip, tid, cid):
        ascnm = ""
        nm = ""
        play = 0
        audioclip = 0

        if clip.name != None:
            nm = touchAbleUtils.cut_string(clip.name)
            #ascnm = (nm.encode('ascii', 'replace'))
        if clip.is_playing == 1:
            play = 1
        if clip.is_triggered == 1:
            play = 2
        if clip.is_recording == 1:
            if clip.is_playing == 1:
                play = 3
        if clip.is_audio_clip:
            audioclip = 1

        nm = touchAbleUtils.repr3(nm)
        self.oscServer.sendOSC(
            '/clip', (tid, cid, nm, clip.color, play, int(audioclip)))
コード例 #10
0
    def update_wavetable_visible_modulation_target_names(
            self, device, track, tid, did, type, number_of_steps, indices):

        play_pos_data = [int(type)]
        play_pos_data.append(int(tid))
        play_pos_data.append(int(did))
        play_pos_data.append(int(number_of_steps))

        for index in range(number_of_steps * 2):
            play_pos_data.append(int(indices[index]))

        play_pos_data.append(int(len(device.visible_modulation_target_names)))

        for index in range(len(device.visible_modulation_target_names)):
            filter_routing = device.visible_modulation_target_names[index]
            play_pos_data.append(touchAbleUtils.repr3(filter_routing))

        self.oscServer.sendOSC(
            "/device/wavetable/update_wavetable_visible_modulation_target_names",
            play_pos_data)
        self.update_wavetable_modulation_matrix(device, track, tid, did, type,
                                                number_of_steps, indices)
コード例 #11
0
    def update_plugin_presets(self, device, track, tid, did, type,
                              number_of_steps, indices):

        a_version = Live.Application.get_application().get_major_version()
        minor_version = Live.Application.get_application().get_minor_version()

        if a_version < 9 or (a_version == 9 and minor_version < 5):
            return

        data = [int(type)]
        data.append(int(tid))
        data.append(int(did))
        data.append(int(number_of_steps))

        for index in range(number_of_steps * 2):
            data.append(int(indices[index]))

        data.append(int(len(device.presets)))

        for index in range(len(device.presets)):
            preset = device.presets[index]
            data.append(touchAbleUtils.repr3(preset))

        self.oscServer.sendOSC("/device/plugin/update_plugin_presets", data)
コード例 #12
0
    def slot_changestate(self, slot, tid, cid):

        ascnm = ""
        nm = ""
        # Added new clip
        if slot.clip != None:
            self.add_cliplistener(slot.clip, tid, cid)
            play = 0
            audioclip = 0

            if slot.clip.is_audio_clip:
                audioclip = 1
            if slot.clip.name != None:
                nm = touchAbleUtils.cut_string(slot.clip.name)
                #ascnm = (nm.encode('ascii', 'replace'))
            if slot.clip.is_playing == 1:
                play = 1

            if slot.clip.is_triggered == 1:
                play = 2

            if slot.clip.is_recording == 1:
                if slot.clip.is_playing == 1:
                    play = 3
                    if self.touchAble.onetap == 1:
                        if LiveUtils.getSong().clip_trigger_quantization > 0:
                            slot.clip.fire()
                        else:
                            pass
                    else:
                        pass

                else:
                    pass
            else:
                pass
            self.oscServer.sendOSC('/clip/playing_status', (tid, cid, play))
            self.oscServer.sendOSC('/clip',
                                   (tid, cid, touchAbleUtils.repr3(nm),
                                    slot.clip.color, play, int(audioclip)))

            clip = slot.clip

            is_audio_clip = int(clip.is_audio_clip)

            isLooping = int(clip.looping)
            is_audio_clip = int(clip.is_audio_clip)

            warp = 0
            if is_audio_clip == 1:
                warp = int(clip.warping)
            else:
                pass
            loop_start = clip.loop_start
            loop_end = clip.loop_end

            try:
                start = clip.start_marker
                end = clip.end_marker
            except:
                start = clip.loop_start
                end = clip.loop_end

            self.oscServer.sendOSC(
                '/clip/loopstats',
                (tid, cid, isLooping, start, end, loop_start, loop_end,
                 is_audio_clip, int(warp)))

        else:

            self.oscServer.sendOSC('/clip/playing_status', (tid, cid, 0))
            self.stop_changestate(slot, tid, cid)
            if slot.has_stop_button_has_listener != 1:
                cb2 = lambda: self.stop_changestate(slot, tid, cid)
                slot.add_has_stop_button_listener(cb2)
            if self.clisten.has_key(slot.clip) == 1:
                slot.clip.remove_playing_status_listener(
                    self.clisten[slot.clip])

            if self.pplisten.has_key(slot.clip) == 1:
                slot.clip.remove_playing_position_listener(
                    self.pplisten[slot.clip])

            if self.cnlisten.has_key(slot.clip) == 1:
                slot.clip.remove_name_listener(self.cnlisten[slot.clip])

            if self.smlisten.has_key(slot.clip) == 1:
                slot.clip.remove_start_marker_listener(
                    self.smlisten[slot.clip])

            if self.emlisten.has_key(slot.clip) == 1:
                slot.clip.remove_end_marker_listener(self.emlisten[slot.clip])

            if self.lslisten.has_key(slot.clip) == 1:
                slot.clip.remove_loop_start_listener(self.lslisten[slot.clip])

            if self.lelisten.has_key(slot.clip) == 1:
                slot.clip.remove_loop_end_listener(self.lelisten[slot.clip])

            if self.cliplooplisten.has_key(slot.clip) == 1:
                slot.clip.remove_looping_listener(
                    self.cliplooplisten[slot.clip])

            if self.clipwarplisten.has_key(slot.clip) == 1:
                slot.clip.remove_warping_listener(
                    self.clipwarplisten[slot.clip])

            if self.clipwarpmodelisten.has_key(slot.clip) == 1:
                slot.clip.remove_warp_mode_listener(
                    self.clipwarpmodelisten[slot.clip])

            if self.clipmutelisten.has_key(slot.clip) == 1:
                slot.clip.remove_muted_listener(self.clipmutelisten[slot.clip])

            if self.clipgainlisten.has_key(slot.clip) == 1:
                slot.clip.remove_gain_listener(self.clipgainlisten[slot.clip])

            if self.clipcoarselisten.has_key(slot.clip) == 1:
                slot.clip.remove_pitch_coarse_listener(
                    self.clipcoarselisten[slot.clip])

            if self.clipfinelisten.has_key(slot.clip) == 1:
                slot.clip.remove_pitch_fine_listener(
                    self.clipfinelisten[slot.clip])

            if self.fplisten.has_key(
                    slot.clip) == 1 and slot.clip.is_audio_clip:
                slot.clip.remove_file_path_listener(self.fplisten[slot.clip])

            if self.cclisten.has_key(slot.clip) == 1:
                slot.clip.remove_color_listener(self.cclisten[slot.clip])

            if self.noteListeners.has_key(slot.clip) == 1:
                slot.clip.remove_notes_listener(self.noteListeners[slot.clip])