Thanks guys !
Given that you two come with the same solution must be a proof of truth !
Thanks guys !
I’m trying to parse out why that would work and the mental wall starts @ this command [quote=", post:282, topic:839"]
P I TOSS
what’s the difference between
FLIP? why does toss accomplish @chapelierfou’s idea?
is this restricted to two pattern banks or does it hop between all four?
FLIP inverts everytime (if 1, then 0… if 0, then 1). TOSS acts like a coin toss and returns 0 or 1 randomly.
Toss is launching a coin in the air.
Flip is flipping the coin on the table.
I’d like to populate a pattern with random 1s or 0s, but i also want to specify how many 1s.
Is there a way to do this ?
[quote=“chapelierfou, post:288, topic:839”]
specify how many 1s
[/quote]in what sense?
Sounds like you want some sort of conditional statement to check that there are pauses rather than:
in script 1, set X to how many 0/1’s you want to generate.
Thank you. Unfortunately, tehn, that’s not my goal.
Let’s say i want to generate 8 steps, with always 3 zeros (and thus 5 ones) :
1 0 0 1 0 0 0 1 or 1 1 1 0 0 0 0 0 or 0 1 0 0 1 0 1 0 etc…
The purpose :
i generate 2 random patterns to trigger the 2 inputs of René. I want it random but i want always the same length for the pattern created by René.
Maybe…but then, i still have no idea how to count the pauses, and how to store the ‘pause sequence’. That would mean the use of a pattern for this. So i’m not sure.
I’m a TT noob and this is untested… and it looks overcomplicating… but maybe something like this?
L 0 8 : SCRIPT 2
IF GT Y 0 : X Z
Y SUB Y Z
P I X
L 0 3 : SCRIPT 1
Thanks very much.
I admit i absolutely don’t get your code. But i’ll try on the TT !
ah, i see what you’re after.
a simple method you might try:
- fill the pattern with 0’s
- randomly fill positions with 1’s
you may get repeat randoms of course
set X to number of possible 1’s. 8 is length
L 0 8 : P I 0 L 0 X : P RAND 8 1
That doesn’t guarantee X 1s if the rand in the second loop turns up the same number twice.
yeah, i mentioned that.
You need to shuffle if you want to guarantee that you always have the same number of 1s and 0s.
L 0 99 : P.INS 0 P.RM RAND 8
(you need a newish version of the firmware where
P.RM returns the value removed).
Makes me think : what about a new operator ‘URN’ like urn in max, to output non equal random numbers ?
i guess i don’t have the good version :
‘Move left : P.RM’ is the message TT returns.
another method, use P.INS randomly
x = how many 0’s
y = how many 1’s
X 3 Y 5 P.L 0 L 0 X : P.INS 0 0 L 0 Y : P.INS RAND P.L 1
untested but the idea should work
Many thanks this works. For the sake of rightness, the correct script is :
L 1 X : P.INS 0 0
L 1 Y : P.INS RAND P.L 1