Trigger with simd

hi,

im here for asking some of your tricks :slight_smile: whats the best approch to manage trigger using simd?

idea for 16 voices for example. start gate4[4] at zero, read input value and use some logic operator (or mask?) to store 1 on a trigger4[4] only if input is 1 and gate is 0. 0 otherwise. than store input array on gate4.

than, “scalar” code iterating each of 16 voices and check any trigger4 item; in case of true, call some functions (i.e. reset).

could work? not sure about the mask. do you have some smarter tricks? maybe some already module on git where i can see the code?

note: of course i mean “evaluate trigger” on a gate input :stuck_out_tongue:

thanks

Why don’t you look at the source for some modules that do it? VCV adsr is an obvious one. Many of mine do this, like sfz player or organ3 or kitchen sink.

1 Like

That’s a suggestion :slight_smile: thanks

1 Like

There are some conditional move instructions that make this super fast.