Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Possible bug? ArrayIndexOutOfBoundsException when using SoundCipher sendMidi() with minim import.

$
0
0

I'm having an unusual problem with the SoundCipher library on Mac. This question is some combination of asking for help and a bug report. I wasn't sure where to file a bug-report, so I thought I would post here before bothering the creator.

The gist of the problem is in Processing 2.2.1, whenever I use SoundCipher's sendMidi() function while I have imported the minim library, I get an "ArrayIndexOutOfBoundsException". But, by simply commenting out the minim import, sendMidi() works fine. In Processing 1.5.1, SoundCipher's sendMidi() function works regardless of whether minim is imported. I believe there might be some conflict with SoundCipher on macs, in Processing 2.2.1, with the minim library.

I pursued the problem a little further and tested a few different combinations of OS/Processing. In all of these tests I used the "latest" version of SoundCipher I could download from explodingart.com (beta release 10). The list of testing combinations is below:

  1. On mac (OSX 10.9.5), Processing 2.2.1: importing minim causes exception.
  2. On mac (OSX 10.9.5), Processing 2.2.1: NOT importing minim works.
  3. On mac (OSX 10.9.5), Processing 1.5.1: importing minim works.
  4. On mac (OSX 10.9.5), Processing 1.5.1: NOT importing minim works.
  5. On Win 7, Processing 2.2.1 and 1.5.1, SoundCipher sendMidi() works regardless of whether minim is imported.

The code I am using for testing is below. With the running applet window selected, press a key to hear a ridiculously short midi note.:

import arb.soundcipher.*;
import ddf.minim.*; // commenting out this line affects whether sendMidi works.

SoundCipher sc = new SoundCipher(this);

void setup(){}
void draw() {}

void keyPressed() {
  sc.sendMidi(sc.NOTE_ON,0,63,66);
  sc.sendMidi(sc.NOTE_OFF,0,63,0);
}

void stop() {
  // cleanup
  sc.stop();
  super.stop();
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles