Welcome to %s forums

BrainModular Users Forum

Login Register

Array --> Delete Duplicates?

I need help on a Patch
Post Reply
lytz1
Member
Posts: 123
Contact:

Unread post by lytz1 » 09 Jan 2019, 17:13

Hey all,

is it possible to delete a duplicate in an array?

(i.e. 16, 35, 35,48 to 16, 35, 48)

Couldn't solve this, any ideas?



Thanks,

tL.

User avatar
oli_lab
Member
Posts: 1263
Location: Brittany, France
Contact:

Unread post by oli_lab » 09 Jan 2019, 17:28

can be done with a script
or
a user module

what do you want to use it for ?
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

lytz1
Member
Posts: 123
Contact:

Unread post by lytz1 » 09 Jan 2019, 21:04

I need it to delete duplicate numbers that get queued to an array which indices
shouldn't receive the same number more than once. So that every index has a unique number.

Because a semi random setup is feeding the matrix, duplicate numbers happen which leads to subpar output. That's why I am asking.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 09 Jan 2019, 21:15

maybe rather than processing the array you can check if incoming value is in array , and let it pass to be queued only if its not.
ie use A=B, to check if incoming value A match array (B). use a sum array, if sum>0 then that mean the value is already in array, so can ie stop the floa before the queue.

lytz1
Member
Posts: 123
Contact:

Unread post by lytz1 » 10 Jan 2019, 12:47

This is a good idea, thanks.

Oli: Wouldn't this idea be even more flexible with your "array Value Match" module?

EDIT: Yes, works very good with that module! Stops flow to queue if incoming number is any of the numbers
already present in array.

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 10 Jan 2019, 16:04

There's also Oli_lab's module Random bag in add-ons, which can help with that kind of 'random-no-repeat' stream.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
oli_lab
Member
Posts: 1263
Location: Brittany, France
Contact:

Unread post by oli_lab » 12 Jan 2019, 02:46

try the random bag V2 user module from the oli_lab addon

it shuffle a suite of numbers at random with no duplicate.
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

lytz1
Member
Posts: 123
Contact:

Unread post by lytz1 » 13 Jan 2019, 15:43

Thanks Oli. Very cool stuff.

User avatar
oli_lab
Member
Posts: 1263
Location: Brittany, France
Contact:

Unread post by oli_lab » 14 Jan 2019, 22:40

Hi !
I did this module.

http://www.sensomusic.org/forums/uploads.php?file=Oli_Lab_arrayNoDuplicate.zip

before I start the mac mini, it's win64 only...

with few fun options :
mode :
on change = when a new array is received, each value is tested against the values already present inside the memory
button = when a button is receivedon the "enter" input, each value is tested against the values already present inside the memory

max size : set the max size of the output array, if this value is less than the size of the output array, the array is truncated.

enjoy !
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

lytz1
Member
Posts: 123
Contact:

Unread post by lytz1 » 14 Jan 2019, 23:33

Awesome, thanks a lot! This is USEFUL... ;)

Windows is fine with me now. I have Mac and Windows running, working in windows the most lately.
HH3 just runs far better here.


Best,
tL.

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests