Ahh, truly just note patterns and not chords. I have a similar thing in one of my songs and that is a script unique to that song and matches three 2 note patterns. I had a think about making a generic version that would work for me. I think this does 1/7th of your script, so you would need to add 7 scriptlets, but the patterns can be added without editing code, so can be set in variations via widgets so may reduce the number you require. Also It distributes the loops into the notes arriving so the activation is as fast as possible.
const DEFAULT_CHANNEL : Integer = 1
const DEFAULT_NOTE : String = "C-2"
const DEFAULT_VELOCITY : Integer = 127
Var note3 : Parameter AsNoteNames C-2..G8 = DEFAULT_NOTE
note2 : Parameter AsNoteNames C-2..G8 = DEFAULT_NOTE
note1 : Parameter AsNoteNames C-2..G8 = DEFAULT_NOTE
output : Parameter AsNoteNames C-2..G8 = DEFAULT_NOTE
Var noteOut : NoteMessage
count : Integer = 0
match : Integer Array = [0,0,0]
sent : boolean = false
// Handle note On/Off events
On NoteOnEvent(m : NoteMessage)
var i : Integer = 0
If count < Size(match) Then
for i=0; i<Size(match); i=i+1 Do
If match[i] == GetNoteNumber(m) Then
count = count + 1
End
End
End
// Send trigger
If sent == false And count == Size(match) Then
SendNow(noteOut)
sent = true
End
End
On NoteOffEvent(m : NoteMessage)
var i : Integer = 0
If count > 0 Then
for i=0; i<Size(match); i=i+1 Do
If match[i] == GetNoteNumber(m) Then
count = count - 1
End
End
End
If sent == true And count != Size(match)Then
SendNow(WithVelocity(noteOut,0))
sent = false
End
End
// Set up paramters for detector and output
On ParameterValueChanged matching note3
match[2] = NoteNameToNoteNumber(note3)
End
On ParameterValueChanged matching note2
note3 = note2
match[1] = NoteNameToNoteNumber(note2)
End
On ParameterValueChanged matching note1
note2 = note1
match[0] = NoteNameToNoteNumber(note1)
End
On ParameterValueChanged matching output
noteOut = noteOut.WithNoteNumber(NoteNameToNoteNumber(output))
End
Initialization
noteOut = MakeNoteMessageEx(NoteNameToNoteNumber(output),DEFAULT_VELOCITY,DEFAULT_CHANNEL)
End