pianeiro Posted March 4, 2019 Share Posted March 4, 2019 Hi guys! I need to play a undefined number of notes when a determined parameter has changed. The note pitches is storaged in a global array, from a if statemend inside a HandleMIDI function. When a determined parameter has changed, i tryed to create another array inside of ParameterChanged function that recieves the Note objects created in a loop from each pitch storage in the global array. But this code not works. Occurs a infinite loop with a lot of messages with NoteOn objects with undefined pitch numbers. For example: var key = [], // ... a lot of code supressed ... function HandleMIDI (e) { if (GetParameter("Learning") == 1) { e instanceof NoteOn ? key.push(e.pitch) : undefined; Trace(key); } // ... a lot of code supressed ... } function ParameterChanged () { if (GetParameter("Playing") == 1) { var voicings = []; for (i = 0; i = key.length; i++) { voicings[i] = new NoteOn(); voicings[i].pitch = key[i]; voicings[i].send(); } } There are a way to: 1. to store pitch notes 2. to create various NoteOn to play from the pitch notes storaged (in 1) 3. to play the notes created (2) That is my question. Thanks for help guys!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.