Welcome to %s forums

BrainModular Users Forum

Login Register

Efficient way to pass 0 or 1 on matching range of specific values?

I need help on a Patch
Post Reply
User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 16 Dec 2018, 00:19

Here's what I'm trying to do. I have polyphonic patch that receives step index from step sequencer and normally I have Current voice = Current step comparison for sending trigger.
But now I'm thinking of polytrigger, which would add steps to current one (depending on max polytrigger value) or just activate random other triggers beside current step, all that would wrap around current number of steps in sequencer.

So that means I no longer can simply match one value to current voice and be done with it. Can't come up with efficient solution to that. I need a way to match more than one specific number to current voice and return 1 if any of the numbers match, 0 if none match. Maybe a script would do the job, but the numbers will change rapidly, don't know if it's suited for that. Also I'm not competent at coding.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 16 Dec 2018, 03:37

by patch you could define an array with your wanted possible numbers. ie 3-7-8-11 ect, then use an equal math module and compare to input.
ie if input is 7 it will return you an array of 0,1,0,0,0 in ex case. then can use a sum array module out of that. if sum > 0 then that means it matched at least one of the requested numbers

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

Unread post by x.iso » 16 Dec 2018, 04:40

interesting, I've made a subpatch that checks each array's value match and outputs array of 1 and 0, then max value to filter if anything matched. turns out there's no need to do a subpatch?
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

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

Unread post by x.iso » 16 Dec 2018, 04:44

yes, just checked and that's exactly what I wanted. can't get it any simpler.
Thanks, 23fx23!
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 16 Dec 2018, 07:26

cool you're welcome. i could swear we had a 'find value in array' module wich could do it in one module but could not find it,. think it was a script so prob not more efficient.

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

Unread post by oli_lab » 16 Dec 2018, 13:07

maybe you can use "comma text get string index" with arrays ?

or wait till I make a " find index of value in array" ;-)
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

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

Unread post by x.iso » 16 Dec 2018, 18:47

find index of value in array
that's a bit different, but that would have it's own use.

I'm making a patch inspired by Intellijel Rainmaker. going to be an addon!
here's how it looked before solving this problem:
Image
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 » 16 Dec 2018, 19:36

check the addons and tell me if it's what you're looking 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

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

Unread post by x.iso » 18 Dec 2018, 17:59

oli_lab wrote:check the addons and tell me if it's what you're looking for.
I've checked and the only difference with equal module is that you can get amount of matches in one go. might be useful as well, just didn't think of use case yet.
for instance, if just 1 match it's a regular step trigger, if 2 matches, then make it accent step, if more then add fx or something. in that regard can be useful to cut down on 1 extra module per voice.
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 » 19 Dec 2018, 15:07

x.iso wrote:
oli_lab wrote:check the addons and tell me if it's what you're looking for.
I've checked and the only difference with equal module is that you can get amount of matches in one go. might be useful as well, just didn't think of use case yet.
for instance, if just 1 match it's a regular step trigger, if 2 matches, then make it accent step, if more then add fx or something. in that regard can be useful to cut down on 1 extra module per voice.
I think I didn't get what you were after in the first place !
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

Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests