We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Chording with proMidi library
Page Index Toggle Pages: 1
Chording with proMidi library? (Read 541 times)
Chording with proMidi library?
Jan 10th, 2010, 1:06pm
 
I am having trouble getting the noteOn function of the proMidi Library to return multiple notes when a chord is played.

I have built a sketch using proMidi.

the value of the variable note inside the noteOn(); function is used to define an objects appearance:

void noteOn (Note note, int device, int channel) {
  for (int i=0; i < bubble.length; i++) {
      if (bubble[i].build == false) {
          bubble[i].button = true;
          bubble[i].noteToCheck = note;
          break;
      }
  }
}

The sketch works fine with one exception:

  if a chord is played (multiple notes at once) only one note variable is returned.

this seems to be because of the way the function is defined:

  void noteOn (Note note, int device, int channel) {

it has an Input of a single note rather than an Array of notes, this is peculiar because when the note is sent to the midi output via sendNote(); all played notes are heard:

  midiOut.sendNote(note);

How can I get the noteOn(); function to receive all played notes in a single frame, and/or get my objects to react to all notes played at once?

Can I get the noteOn function to receive an input of an Array of notes?

  void noteOn (Note [] note, int device, int channel) {

Page Index Toggle Pages: 1