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 › Compilation problem with SoundCipher
Page Index Toggle Pages: 1
Compilation problem with SoundCipher (Read 472 times)
Compilation problem with SoundCipher
Apr 26th, 2009, 5:00pm
 
Hello,

I use the SoundCipher library in a project and i have some trouble when i want to export an application.

When I compile, everything goes well (no error message) and when I run the program, I do not have the sound of notes generated with playNote() . However, when tested in the PDE IDE, it works perfectly.

For code that is simple, I do not excpetionnel, it gives, once cleaned, something like this:

Code:
...
SoundCipher sc;
int cptFrames;
...
setup() {
  sc = new SoundCipher(this);
  ...
}

draw() {
  ...
  cptFrames++;
  if (cptFrames>frameRate/2) {
    sc.playNote(200,30,1.0);
    cptFrames=0;
  }
  ...
}


There are a lot more code in my program but it would be unnecessary in this case because the rest operating normally.

I'm working on windows XP. If you have an idea, cause i don't know where the problem is.

Thanks for any help  Wink .
Re: Compilation problem with SoundCipher
Reply #1 - May 18th, 2009, 7:39am
 
Your code looks mostly fine. Make sure MIDI pitch names are between 1 - 127. You can also use a modulo against the frameCount variable instead of incrementing and resetting as your code does.

For example:

void draw() {
  if (frameCount%12 == 0) {
    sc.playNote(100, 80, 1.0);
  }
}

The Export and Export Application options work fine for me on a Mac with SoundCipher, but you do need to be using the latest Processing version (at least 1.0).

Make sure that the application uses the same version of Java as Processing does. If you have an installation of the JRE on your computer it may not have the soundbank installed and thus there will be no sound output. It is possible for applications and applets to use a different version/install of Java than IDE's such as Processing.

Page Index Toggle Pages: 1