I have a midi controller that sends out several midi note on messages to indicate mode. Eg.
- nn 0 is mode 0
- nn 11 is mode 1
- nn 14 is mode 2
- nn 24 is mode 3
and then it cycles round again.
The thing is it never sends any note off messages for these mode changes.
I used this expression in an STGC to get the mode:
| mode |
mode := EventVariable new initialValue: 0.
((!KeyNumber eq: 0) \/
(!KeyNumber eq: 11) \/
(!KeyNumber eq: 14) \/
(!KeyNumber eq: 24)) true: (
mode <~ (!KeyNumber into: #({0 @ 0} {11 @ 1} {14 @ 2} {24 @ 3}))
) false: (
mode
)
but it only works the first time each mode is entered. I guess because it doesn't get a note off message that note never retriggers. How can I create a !Mode event value that will change with these midi messages?