[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] Using value from array to select elements in another array
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: [sc-users] Using value from array to select elements in another array
- From: xiaoping lyu <xiaoping.lyu@xxxxxxxxx>
- Date: Mon, 31 Dec 2012 06:54:04 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=EZFfQt/cLz0QqqxaPR9xRGKLrLWs3aVKWU9++ARXtRQ=; b=RCIFyMY57VtueubYBmGJzoSCjKib0zAZMgSJWl5r5hj+XJquPzQVWqstJqjZ8NwAaE cwCBa/uXezHmLmIDVUPJuGSZyEs+atxAshlkF9/JWU3XArlZxDE76zOzGLQoiDD/lOVg eRalZNutYdg8Q1lOpEHgBp+ZpbFTPw28DpcqZ7Fcz6W4ATwOK0GiV+Gl6aV63diZK6by zOtLBzXjfOx9n8dNmIl9DDT0VrDGiQ0Ddzl8qqY+Q0+i6rOzQw8dKPzUy+SPTrS3Qp+j 8sbrpReLD8y0DDSmlgJZXjMqefqJFL64V8yGmXBy/HEM6pq69oHfjeHgKluDpzKVTexf 6Tpw==
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
Hi dear list , I have 2 arrays, both with numbers. I need to select
randomly items from the first array but using the values in the second
array for making the selection, for example lets say i have array A
and B, I need to select randomy a value from array A using array B
in this way: :
A = [14, 2, 9, 1, 11, 8, 12, 4, 4]
| |
B = [1, 2, 3, 1, 2, 4, 1, 3, 4]
Select one random value in A that has 3 in B.
It should select 9 or 4 because both has 3 in the same position in B.
Which is the best approach for doing this in sc3?
any idea would be appreciated.
thanks
Xiao
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/