Does that actually work? Even if it does, I’m not sure I like the idea of using the get/set functionality to give OPs variable arity. No other OP works like that.

I’d be happier with:

INIT.SCRIPT 1                   | clear script 1
INIT.SCRIPT.ALL                 | clear all scripts
INIT.P 2                        | clear pattern 2
INIT.P.ALL                      | clear all pattern data
2 Likes

we could also follow the ansible format where 0 means all

2 Likes

i like this, but won’t work for patterns unfortunately…

1 Like

Sure, it could.

Well, there’s my new word for the day. I agree that this is a departure from TT syntax, and have no problem with .ALL.

2 Likes

INIT.TR is not clearing all my triggers, I get the message “Not enough params.”

So I have to clear them individually with INIT.TR.1 etc

If I’m reading everything right, I think:
L 1 4: INIT.TR I
should do it in one fell swoop, but I have the grid beta on my TT

I get that it should, but INIT.TR throws the message “Not enough params.”

Also tried: “L 1 4: INIT.TR” but it too gives the above message.

You need to specify which trigger you are addressing:
INIT.TR 1 (the “1” is your missing param)
same when you are making a Loop:
L 1 4: INIT.TR I (where the “I” is the variable that is changing while loop executes, so on first loop, I = 1, then I=2 etc.)
Does that make sense?

1 Like

included line breaks in my post above to make the code a bit clearer

1 Like

It makes sense, but as I look above to Sliderule’s earlier post about the command I read this that it should be clearing all triggers.

I can’t find the result of this discussion so I must have gone with my best assumptions as to which axes were most useful. I recall someone arguing that if you could do something with a loop, then the omnibus version was redundant. I know I was trying to keep operator count down in this feature.

TL;DR: broadest scope as described above does not necessarily represent current or final implementation.

Yay, found what I was looking for in the code:

INIT.TR.ALL will clear all triggers

4 Likes

Re: INIT.P x

I only know of Patter 0 - 3 and yet I can execute INIT.P 5 and not get an error. Are there other patterns possible beyond the four?

Teletype does not produce an error for an out-of-bounds parameter (yet). Try:

CV 1000 V 5

No error.

So, no, there are no patterns beyond 3. If we want to know what actually happens in out-of-bounds circumstances, we have to look at the code.

static void op_INIT_P_get(const void *NOTUSED(data), scene_state_t *ss,
                          exec_state_t *NOTUSED(es), command_state_t *cs) {
    int16_t v = cs_pop(cs);
    if (v >= 0 && v < 4) ss_pattern_init(ss, v);
}

Here we can see that nothing happens when the parameter is out-of-bounds.

2 Likes

I understand INIT.P to clear Pattern Data, so what is INIT.DATA clearing and in the code where the line reads

static void op_INIT_DATA_get

Does that “_get” necessarily imply there is a variable value following the op, such as INIT.DATA x

The _get portion is an implementation custom and does not define that there is an argument. If you want to know how many arguments an operator takes, you have to look for instances of:

cs_pop(cs)

This is how an operator acquires an argument. INIT.DATA does not call this, so it has no argument!

So what does INIT.DATA clear?

It calls this function:

void ss_variables_init(scene_state_t *ss) {
    const scene_variables_t default_variables = {
        // variables that haven't been explicitly initialised, will be set to 0
        // TODO: verify no missing
        .a = 1,
        .b = 2,
        .c = 3,
        .cv_slew = { 1, 1, 1, 1 },
        .d = 4,
        .drunk_min = 0,
        .drunk_max = 255,
        .m = 1000,
        .m_act = 1,
        .o_inc = 1,
        .o_min = 0,
        .o_max = 63,
        .o_wrap = 1,
        .q_n = 1,
        .r_min = 0,
        .r_max = 16383,
        .time_act = 1,
        .tr_pol = { 1, 1, 1, 1 },
        .tr_time = { 100, 100, 100, 100 },
        .in_range = { 0, 16383 },
        .param_range = { 0, 16383 },
    };

    memcpy(&ss->variables, &default_variables, sizeof(default_variables));
    ss_update_param_scale(ss);
    ss_update_in_scale(ss);
}

It basically sets all the variables to start-up state.

There are other variables in scene_variables_t and they are zeroed by this function. You can see all the variables affected by looking at the definition of this type in src/state.h

1 Like

potential visual bug, can anyone verify on other releases? I’m on 2.3 beta B537759

when in the tracker view, running INIT.P x in a scene from a hotkey doesn’t visually clear the pattern. pushing new data will clear it, as will tabbing away and back. not a crazy deal breaker, but I like hanging in tracker when I’m doing grid ops stuff.

the fix is in, will be included in the next 2.3 beta.

2 Likes