Teletype: "Too many parameters" message?

I want to toggle between 2 different pattern length (4 and 8).

This works:
X EZ X P.L ADD 4 MUL 4 X

This doesn’t:
P.L ADD 4 MUL 4 X EZ X
…as it gives the “too many parameter message”.

Any hint as to what exactly triggers this message (as the syntax itself seems to adhere to TT’s expectations as far as I understood these).

Try

P.L ADD 4 MUL 4 EZ X

The leading X in X EZ X will assign the output of EZ X to X, you don’t need to assign it to X in the second case, instead you want it used as the second argument to the MUL

Thanks, but the reason why I use
X EZ X
is that this command toggles X between 1 and 0 on each call.

If I use
EZ X
as you proposed, X is always 1 (or always 0, depending on the initial value of X).

I think the issue is you can’t assign a new value to a variable mid-way through a command. Only the left-most word can have it’s value assigned.

I think you can achieve your goal by having one line flip the value of X, then the second line apply that new value of X to P.L. Something like:

X EZ X
P.L ADD 4 MUL 4 X

To further clarify why this is the case, in your command above you’re finding the result of EZ X to either a value of 1 or 0, then reading the current X value (the opposite). To teletype, this looks like MUL 4 X !X and MUL can only multiply 2 numbers together. Variables are always ‘read-only’ unless in the left-most position in a command. Thus, if you want to change the value of a parameter it needs to be at the beginning of a line.

I haven’t had a chance to use it yet, but I do believe you can use the special FLIP command which will change it’s state on each recall, instead of using the X EZ X command above. Note that you can only use it once per preset if you want predictable results.

1 Like

X EZ X is a complete command, you can’t add it to another line-- just use your first try.

the reason it reports “too many commands” is that MUL is getting 3 params:

4
X
EZ X (returns one value)

this is due to how the command is processed-- i might suggest thinking right to left with complicated lines.

i might point out also that i made a special variable for this situation in v1.1: FLIP which changes state on each read.

so use P.L ADD 4 MUL 4 FLIP and you’re done

1 Like