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.
Pages: 1 2 
SoundCipher (Read 9362 times)
SoundCipher
Apr 15th, 2009, 8:46am
 
I have started the SoundCipher library, at soundcipher.com It is a music and sound library for Processing and was recently listed on the Processing libraries web page.

At present SoundCipher is in beta release and undergoing regular development and documentation.

This thread can be a location for discussion about the library within the Processing community.
Re: SoundCipher
Reply #1 - Apr 19th, 2009, 2:42pm
 
Hello,

I use your 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  Smiley .
Re: SoundCipher
Reply #2 - May 18th, 2009, 7:41am
 
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.
Re: SoundCipher
Reply #3 - Jun 17th, 2009, 12:31am
 
I like this library but I'm having an issue with  score.addNote( and writing the score to a midi file. It seems it all goes well but then when I try to import the .mid file to Garage Band there are as many instrument tracks as there are notes I've added.

?? Any clues as to this behavior?
Re: SoundCipher
Reply #4 - Jul 22nd, 2009, 3:26pm
 
Hello,

on linux i get the message:

The pakage 'arb' does not exist. You might be missing a library. But, I installed de lib into the folder: "~/sketchbook/libraries/". I need to install a java package?

thks.
Re: SoundCipher
Reply #5 - Sep 18th, 2009, 3:26pm
 
andrewb wrote on May 18th, 2009, 7:41am:
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.


Thank you very much!

Sorry for replying very late ... Indeed, the soundbank in my installation of the JRE was absent ("soundbank-deluxe.gm" in "C:\Program Files\Java\jre1.6.x\lib\audio").

My applet works much better now!
Re: SoundCipher
Reply #6 - Oct 10th, 2009, 7:03pm
 
The following updates to MIDI file handling in SoundCipher have been made to SoundCipher in beta release nine that address issues raised in this thread.

1. MIDI files now consolidate all notes on the one channel into a single track. This means MIDI files now have a maximum of 16 tracks - one per channel.

2. Tempo is saved as part of the MIDI file. The specified SCScore tempo at time of saving is used.

To support these a few SCScore accessor methods and addChord method have been updated or added.
Re: SoundCipher
Reply #7 - Oct 11th, 2009, 10:12pm
 
thank you for improving this excellent library !  Smiley
Re: SoundCipher
Reply #8 - Oct 20th, 2009, 1:14am
 

I downloaded the SoundCipher library tonight and ran the GeneratingBeats demo sketch without any problems. I ran into a problem with the DynamicUpdating sketch though. It is getting an ArrayIndexOutOfBoundsException when executing the score.addCallback() function as shown below.


void setup() {
 noLoop();
 background(250);
 sc.instrument(sc.GUITAR);
 score.tempo(tempo);
 score.addCallbackListener(this);
 score.addCallback(0.5, 1);      <<<<<<< Run Stops Here -
 score.play(-1);
 redraw();
}


Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 0
     at arb.soundcipher.SCScore.addCallback(SCScore.java:446)
     at DynamicUpdating.setup(DynamicUpdating.java:47)
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:619)


Next problem: UsingCallbacks sketch.
When I try running the UsingCallbacks sketch I get an error from the mis-spelling of MSscore, I changed it to MSScore and got past that problem. The next problem is similar to the GeneratingBeats sketch, the score.addCallback function is trowing an ArrayIndexOutOfBoundsException too.

Any ideas why the ArrayIndexOutOfBoundsException in DynamicUpdating and UsingCallbacks but not in GeneratingBeats?
Re: SoundCipher
Reply #9 - Oct 22nd, 2009, 11:28am
 
In response to alf on Jul 22nd:

I also had the same problem on my linux box and resolved it by renaming SoundCipher.jar to soundcipher.jar. Finds the library no problem now!

Just make sure you place the soundcipher folder in -> processing_install_dir/libraries

Cheers!
Re: SoundCipher
Reply #10 - Nov 15th, 2009, 12:07pm
 
Hello

How can i display midi messages, and there hexadecimal values in the console area?


thanks
Re: SoundCipher
Reply #11 - Dec 1st, 2009, 7:49am
 
Has anyone had any luck routing the midi output from SoundCipher's Score object to the IAC Bus (on OS X) when using the play() function?

The playnote() function from the SoundCipher object works fine but score.play() doesn't.  The reason for the question is when writing generative midi scores, the use of the callback function to change the score itself means that the entire process can't be written out to a midi file.

The generative process has to be recorded live via a midi sequencer (Logic in this case)
Re: SoundCipher
Reply #12 - Dec 9th, 2009, 2:18pm
 
Hi Andrew, I'd like to thank you for this library.  It provided a really nice entry point into music, MIDI, etc.
I used it for "Water Music":
 http://processing.org/discourse/yabb2/num_1260396088.html
 http://openprocessing.org/visuals/?visualID=6458
Re: SoundCipher
Reply #13 - Dec 28th, 2009, 10:10am
 
I cannot run the callback tutorials given on the soundcipher page.
when i copy them on the PDE (Processing 1.0.1) i get an error message: arrayindexoutofboundsexception: 0, for the line:
Code:
 score.addCallback(0.5, 1); 


any clue why?
Re: SoundCipher
Reply #14 - Feb 17th, 2010, 6:45am
 
In response to some recent posts in this thread regarding arrayIndexOutOfBounds errors and the halting of playback, beta release 10 of SoundCipher is available. This release addresses some bugs in dynamically updating scores during looped playback, and related issues with errors when playing an empty score or one with only callback events in it. The score.update() method is no longer required to be called after invoking score.empty() and refilling the score with music data.
Pages: 1 2