surge-synthesizer / shortcircuit-xt

Will be a sampler when its done!
GNU General Public License v3.0
256 stars 30 forks source link

Group trigger options explained #780

Open mkruselj opened 8 months ago

mkruselj commented 8 months ago

Conditions that we have and their associated parameters are:

We get a maximum of 4 rules which we can chain via boolean operators: OR, AND, NOT (this is also in order of their precedence). AND is the default operator of a rule. Last rule obviously doesn't have a boolean operator.

1 RR set means we can have multiple sets of groups separately robining. For example: RR set 1 could have 5 groups in it, RR set 2 could have 7 other groups in it. One group cannot participate in more than one RR set, this makes no sense logically. This also means that all three RR condition types can only be used ONCE per group's 4 rules, and they are mutually exclusive.

baconpaul commented 5 months ago

Link to #453

mkruselj commented 3 months ago

trigger conditions

Additional: if you disable a trigger, other controls in the row should go away.

baconpaul commented 1 month ago

Some questions

Keyswitch (Latch): ARG1 specifies key, ARG2 becomes a Learn button. Pressing this key activates this group, as long as another keyswitch isn't pressed. There is only one set of latching keyswitches for the whole instrument.

Here 'instrument' means 'part' right?

Keyswitch (Momentary): Same as above but momentary - activates group only while this key is held. Note: keyswitches are supposed to be silent and not trigger any voices - they decide if the NEXT played key will play the relevant groups!

In both cases what happens if there is a zone mapped to the key which is pressed, and that zone is not in the group with the trigger. Does that zone sound?

MIDI CC: This is a submenu in Condition menu with all 128 CCs listed in it ( Pitch Bend: Same as MIDI CC but with pitch bend instead.

Presumably events on the channel of the part. If the part is in omni mode on any channel. Yes?

Program Change: Pretty simple, activates the group if incoming Program Change message is between and including ARG1 and ARG2.

bank or program?

Round Robin Cycle: ARG1 is RR set, ARG2 is ordinal number (1 to whatever we decide should be the max). RR set means we can have multiple sets of groups separately robining. For example: RR set 1 could have 5 groups alternating, RR set 2 could have 7 different groups alternating. This rule should not be used more than once in the 4 trigger option set of a group, since it makes no sense to have one group in multiple RR sets simultaneously. Multiple groups can be set to the same RR set and the same ordinal number, they would stack in this case.

This is inter-group round robin? And is it dependent on key. So that is fi you have to groups RR spanning the same key range you do G1 G2 G1 G2

How many sets does an instrument need?

Note Duration: Similar to Speed, except it takes the duration of the last played key instead and based on it activates the group on currently played note.

Last played key in the group or last played key anywhere? Keys currently held don't participate?

Legato: ARG1 is legato interval (-24 to 24 should be sufficient), ARG2 is hidden. If the interval between last and currently played keys equals ARG1, activate the group.

Same. What is the set of keys which can be "last played"? With note duration it seems last released. With legato I think its probably last initiated but we need to be clearer.

mkruselj commented 1 month ago

Here 'instrument' means 'part' right?

Yep, and in every other instance mentioned.

In both cases what happens if there is a zone mapped to the key which is pressed, and that zone is not in the group with the trigger. Does that zone sound?

Keyswitches, while assigned per group, are sort of a global thing in a patch. So no zones should be sounding when you hit a keyswitch.

Presumably events on the channel of the part. If the part is in omni mode on any channel. Yes?

Precisely!

bank or program?

Bank Select is CC #0/32 so that is covered by the CC condition. Otherwise I don't get the question... MIDI program change message gets received. It can be 0-127 as we know. If the received value is between ARG1 and ARG2 the group is enabled for playback on subsequent events (receiving a PC message does NOT trigger a note). So there'd have to be some sort of cache here to know what's the last received value, that gets evaluated at note ons.

This is inter-group round robin? And is it dependent on key. So that is fi you have to groups RR spanning the same key range you do G1 G2 G1 G2

Correct, this is RR between groups. It doesn't care about zones being mapped or not, it just cycles between the groups within a specified set on every new keypress.

How many sets does an instrument need?

I think we're good with 16 for starters!

Last played key in the group or last played key anywhere? Keys currently held don't participate?

Last played key arriving at the part (so, depends on the MIDI channel setting). This gets overruled by per-group MIDI channel override - in the case of this override being set then only keys arriving from that channel or channels gets evaluated.

Do you mean keys held as you change the group trigger type? Not fully clear on that question sorry.

Same. What is the set of keys which can be "last played"? With note duration it seems last released. With legato I think its probably last initiated but we need to be clearer.

As far as MIDI input, same as the previous answer. I need to ponder on this one in legato mode.

baconpaul commented 1 month ago

To clarify my question

  1. Yes for PC I meant 'you just use the 0xC_ message you don't have a 128x128 selection of ranges and read the bank'.
  2. As to 'last played' I meant 'is a played key a key which is released or pressed'. What do you mean by 'played' in a midi stream.

I had forgotten there were per group midi channel restrictions in omni mode!

baconpaul commented 1 month ago

Correct, this is RR between groups. It doesn't care about zones being mapped or not, it just cycles between the groups within a specified set on every new keypress.

"It doesn't care about zones being mapped or not".

Imagine I have 3 groups in a RR each of which spans notes 60 to 72. Fine.

If I press note 48 it doesn't advance the RR. That is, the group has to meet the midi hit test to advance the RR right?

baconpaul commented 1 month ago

Keyswitches, while assigned per group, are sort of a global thing in a patch. So no zones should be sounding when you hit a keyswitch.

If a user maps a zone over a key switch is that an error we display to the end user or do we just silently not play that zone when you hit that key.

If a user has a zone mapped and then later adds it as a keyswitch, is that an error we display to the end user.

If a keyswitch is mapped can you drag a zone over it in the editor?

What's the actual user experience when they set this up to have a zone-which-doesn't-play

At least we should show the keys in the virtual keyboard in the map in line accent_2b or something when key switched though.

mkruselj commented 1 month ago

To clarify my question

  1. As to 'last played' I meant 'is a played key a key which is released or pressed'. What do you mean by 'played' in a midi stream.

In case of Speed condition we measure the durartion between the latest received note on and the one before it. In case of Duration condition we measure the duration between note off and note on (for each key separately ofc). In both cases these events need to pass the MIDI hit test.

If I press note 48 it doesn't advance the RR. That is, the group has to meet the midi hit test to advance the RR right?

Historical precedent is at least from what I just tested in both Kontakt and Falcon is that they chose to not care about the MIDI hit test. So, any note on received over a valid MIDI channel that the group listens to will advance (or randomize, or shuffle) the RR counter. This is fine because this makes it almost a probability generator, some notes may sound, some not. It can be used intentionally this way.

If a user maps a zone over a key switch is that an error we display to the end user or do we just silently not play that zone when you hit that key. If a user has a zone mapped and then later adds it as a keyswitch, is that an error we display to the end user.

This is not an error that should be displayed to the user. We just silently don't play that zone.

And yes we should totally show the keyswitches on the VKB. Maybe we should later offer custom colors for keyswitches, and a way to name the keys and expose that to host (especially great for multiple articulation stuff and drumkits). This is a separate issue tho.