Renumbering cues

Hej Folks,

What about a renumbering system like the other guys have to do get cues in a numeric order just in one step?

So far I'm good with copy and move but it would be convenient sometimes.

The other guys do that with popups but I think syntax should work as well...

Parents Comment
  • i could also think of a softkey {renumber}


    And it could be used like [Cue] 1 [Thru] {Renumber} 100 {Offset} 10
    -This would renumber All my Cues, starting from 1 till the end.
    -Start the new Cues with 100 and make a Gap of 10 inbetween every following Cue (100,110,120,...)

    Or just use:
    - [Cue] 1 [/] {Renumber}
    - [Cue] 5 [Thru] 19 {Renumber}

Children
  • Using the offset key would seem to be consistent with how you can create numberings ...

    So [Cue] 1 [thru] 10 [Move to] 1 [Offset] 5 

    Changing 1, 2, 3, 4
    To become 1, 5, 10, 15, 20

    Of course, the question would be how you would want point-cues to be renumbered, such that would the point cues remain in place under the main cue, unless explicitly indicated?

  • Getting rid of point cues is the main goal here. Using the offset key seems like a good idea if you want to get rid of the point cues, not using the key would then keep them in place. 

    So [Cue] 1 [thru] 2 [Move to] 1 [Offset] 1 [Enter]

    Changing 1, 1.2, 1.5, 2

    To become 1, 2, 3, 4

    And [Cue] 1 [thru] 2 [Moven to] 10 [Enter]

    Changing 1, 1.2, 1.5, 2

    To become 10, 10.2, 10.5,12

  • The one at the bottom does that:

    import time
    import socket
    
    OSC_IP_ADDRESS = "192.168.1.9"
    OSC_PORT = 8000
    
    
    def send_udp(osc_addr, addr, port, string):
        def pad(data):
            return data + b"\0" * (4 - (len(data) % 4 or 4))
    
        if not osc_addr.startswith("/"):
            osc_addr = "/" + osc_addr
    
        osc_addr = osc_addr.encode() + b"\0"
        string = string.encode() + b"\0"
        tag = ",s".encode()
    
        message = b"".join(map(pad, (osc_addr, tag, string)))
        try:
            sock.sendto(message, (addr, port))
    
        except Exception:
            import traceback
            traceback.print_exc()
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    
    
    def lighting_command(command):
        print(f"Command: {command}")
        send_udp("eos/newcmd", OSC_IP_ADDRESS, OSC_PORT, command)
    
    
    def expand_integer_cues(current_cue_list, new_cue_list, start_cue, end_cue, factor):
        for i in range(start_cue, end_cue):
            lighting_command(f"Cue {current_cue_list} / {i} Copy_To Cue {new_cue_list} / {i*factor} Enter Enter")
            time.sleep(.3) # Give Eos time to keep up
            
            
    def expand_decimal_cues_root_only(current_cue_list, new_cue_list, start_cue, end_cue, root_factor, floating_point_depth=0.1, multiply=False):
        '''Increment the root only, operating adding or multiplying with root_factor.'''
        i = float(start_cue)
        end_cue = float(end_cue)
    
        while i <= end_cue + (floating_point_depth / 10):
            root = int(i)
            decimal = i - root
    
            if multiply:
                boosted_root = root * root_factor
            else:
                boosted_root = root + root_factor
                
            new_cue = boosted_root + decimal
    
            def format_cue(n):
                return str(int(n)) if n == int(n) else str(round(n, 3))
    
            lighting_command(
                f"Cue {current_cue_list} / {format_cue(i)} Copy_To Cue {new_cue_list} / {format_cue(new_cue)} Enter Enter"
            )
    
            time.sleep(0.3)
            i += floating_point_depth
            
            
    def move_cue_block(current_cue_list, new_cue_list, start_cue, end_cue, floating_point_depth=0.1, new_start_root=3):
        """
        Move a block of cues while preserving spacing, root structure, and decimal parts.
        Root is incremented each time the original root increases.
        """
        i = float(start_cue)
        end_cue = float(end_cue)
        epsilon = floating_point_depth / 100
    
        original_root = int(i)
        current_new_root = new_start_root
    
        while round(i - end_cue, 10) <= epsilon:
            this_root = int(i)
            decimal = i - this_root
    
            # If we've moved into a new root in the source cues, increment target root
            if this_root > original_root:
                current_new_root += (this_root - original_root)
                original_root = this_root
    
            new_cue = current_new_root + decimal
    
            def format_cue(n):
                return str(int(n)) if n == int(n) else str(round(n, 3))
    
            lighting_command(
                f"Cue {current_cue_list} / {format_cue(i)} Copy_To Cue {new_cue_list} / {format_cue(new_cue)} Enter Enter"
            )
    
            time.sleep(0.3)
            i += floating_point_depth
            
            
    def collapse_cues_to_whole_numbers(current_cue_list, new_cue_list, start_cue, end_cue, new_start=1.0, step=0.1):
        """Collapse all cues (including point cues) in a range into a clean whole-number sequence.
        Equivalent to: [Cue] x [Thru] y [Move To] z [Offset] 1"""
    
        i = float(start_cue)
        end_cue = float(end_cue)
        epsilon = step / 100
    
        current_number = int(new_start)
    
        while round(i - end_cue, 10) <= epsilon:
            def format_cue(n):
                return str(int(n)) if n == int(n) else str(round(n, 3))
    
            lighting_command(
                f"Cue {current_cue_list} / {format_cue(i)} Copy_To Cue {new_cue_list} / {current_number} Enter Enter"
            )
            time.sleep(0.3)
            i += step
            current_number += 1
    
            
    #expand_integer_cues(1, 2, 1, 100, 10)
    #expand_decimal_cues_root_only(3, 4, 1.1, 2.5, 10, multiply=False)
    #move_cue_block(3, 4, 1.1, 2.5, new_start_root=3)
    collapse_cues_to_whole_numbers(3, 4, 1.1, 2.5, new_start=10)

    But you have all kinds of tools there that fill basically every gap left by Eos that I've seen reported just now. This is a very solvable coding problem, even from the outside.