I am using a variation of the @David-san “!Time Lapse to catch chords by David San.Rackspace”, I am trying to change and/or augment the chords being played. Obviously, I am having a difficult time understanding the role of the NoteTracker and its functions in my Scriptlet. I am trying to release all the notes that have been played and/or held but they are hanging on and I don’t know how to release them. I would appreciate advice on how to correct my problem and also a better understanding of NoteTracker (as I was not able to find a blog on NoteTracker).
So, to be more specific with my question: I modified your original Rackspace Scriplet by Adding “SendNow(WithTranspose(m, -7))” in the NoteEvent callback. … and now I can’t turn the extra notes off? Here is my variation of your Rackspace: !Time Lapse to catch chords by David - MODIFIED By Phil San.rackspace (25.5 KB)
Var
nt : NoteTracker;
notifyChord : Boolean = false;
timelapse : double = TimeSinceStartup();
// adjust this delay if necessary
analysisDelay : double = 10.0;
Initialization
SetTimersRunning(true);
End
Function DS_NoteTracker_GetStringOfNotes(nt : NoteTracker) Returns string
Var
i : Integer;
nt_heldNotes : Integer Array = nt.NoteTracker_GetHeldNotes();
stringOfNotes : string = "";
For i=0; i<nt_heldNotes.Size(); i=i+1 Do
stringOfNotes = stringOfNotes+NoteNumberToNoteName(nt_heldNotes[i])+"("+nt.NoteTracker_GetSpecificNoteOnCount(nt_heldNotes[i])+") - ";
End
result = stringOfNotes;
End
On NoteEvent(m : NoteMessage)
SendNow(m);
nt.NoteTracker_GotNote(m);
Print("Number of different notes played : "+nt.NoteTracker_NoteOnCount() );
Print(nt.DS_NoteTracker_GetStringOfNotes());
Print("");
If nt.NoteTracker_NoteOnCount() >= 3
Then
/************************************************ I added the following line of code and now I can't release the note ************************/
SendNow(WithTranspose(m, -7)) // Also send a transposed note
timelapse = TimeSinceStartup()+analysisDelay;
notifyChord = true;
Else
notifyChord = false;
End
End
On TimerTick(ms : double)
If notifyChord && nt.NoteTracker_NoteOnCount() >= 3 && ms > timelapse
Then
Print("");
Print("*** "+nt.NoteTracker_NoteOnCount()+"-notes chord playing ***");
Print("");
notifyChord = false;
End
End
A NoteTracker is a kind of array where you can keep a track of some notes to remember them.
I understand why you have stuck notes. You don’t have a GPScript issue, but an algorithmic issue. The only advice I can give you in this area is not to get into GPScript whose algorithmic complexity is beyond your control. Try to think more simply about what you would like to do.