Efficient way to pass 0 or 1 on matching range of specific values?
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.
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
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
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
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
yes, just checked and that's exactly what I wanted. can't get it any simpler.
Thanks, 23fx23!
Thanks, 23fx23!
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE
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.
maybe you can use "comma text get string index" with arrays ?
or wait till I make a " find index of value in array"
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
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
that's a bit different, but that would have it's own use.find index of value in array
I'm making a patch inspired by Intellijel Rainmaker. going to be an addon!
here's how it looked before solving this problem:

join Hollyhock Usine Discord server: https://discord.gg/EdJarnE
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
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
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.oli_lab wrote:check the addons and tell me if it's what you're looking for.
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
I think I didn't get what you were after in the first place !x.iso wrote: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.oli_lab wrote:check the addons and tell me if it's what you're looking for.
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.
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
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Who is online
Users browsing this forum: No registered users and 25 guests
