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 › Beads: another computer music library
Pages: 1 2 
Beads: another computer music library (Read 7734 times)
Beads: another computer music library
Dec 28th, 2008, 4:10am
 
Hello,

I've been working for a while with generative music using Java Sound and have the beginnings of a library that could be a potential Processing library for sound. It's pure Java, for better or for worse. To be honest, I haven't properly explored the existing Processing sound libraries very carefully, but I'm interested to know what kind of demand there is for a detailed generative music library with the following features:

* granular sample player multichannel + varispeed
* FM synthesis
* additive synthesis
* flexible envelopes and events
* realtime and offline analysis (FFT, Onset Detection, Peaks, etc.)
* sample sound bank manager
* full plugability (i.e., connect anything with an output to anything with an input)
* pure Java
* live performance tools (commandline and GUI tools)

Most of this is implemented, but some only very roughly. I've been gigging with it and it's great fun to work with for myself, and very useful for generative music experiments where it's advantageous to have access to everything all in one flexible language (i.e., Java), but would need more cleaning up and documenting and making examples before it could be a proper Processing Library. Nevertheless, I've made a simple download with some demos here:

http://www.olliebown.com/files/software/Beads%20for%20Processing%20BETA.zip

SVN users can also check out the whole project here:

http://www.olliebown.com/svn/beads

Is there any demand for these features? Do they already exist in the other sound libraries?

Merry Christmas.

Re: Beads: another computer music library
Reply #1 - Dec 31st, 2008, 6:29pm
 
I've got some of that stuff going on in Minim, but not all. It sounds like you are providing some higher level building blocks for doing generative work, which I will probably avoid doing too much of because it's somewhat outside the scope of a general audio library (particularly the live performance tools bit).
Re: Beads: another computer music library
Reply #2 - Jan 8th, 2009, 12:22pm
 
Hello,
I downloaded the demos and had a bit of a play, there's a few nice things there. So I decided to poke around in your SVN and reading through the JAVA docs I came across some very interesting sounding modules (I recommend others to take a quick look!).

IMO Processing is definitely in need of some more experimental native sound libraries. I come from a CSound/Capybara background so having access to things like Oscillator banks and Sample analyzers is vital for me.

Anyway, I just wanted to say yes, be sure that there is a demand for these features. I'm still wrapping my head around Processing, so I'm a few months away from being able to put these interesting tools to much use. But hopefully you will keep up the effort and provide us n00bz with some getting started documentation and more example patches!

Thanks for your contribution

David Moss
Re: Beads: another computer music library
Reply #3 - Jan 23rd, 2009, 7:07am
 
My call is yes definitely... I'm going to give it a shot and come back later. cheers.
Re: Beads: another computer music library
Reply #4 - Feb 2nd, 2009, 10:57am
 
Hello,

I only took a brief look at the examples, but it sounds great! I was realy waiting for hi-end flexible sound-synthesis. Can you tell more about the FM-part? Also I was looking for the FFT-offline functionality (to creae thumbs for audio-libraries for a VJ-tool). Keep up the good work!

Thanks, Rien
Re: Beads: another computer music library
Reply #5 - May 15th, 2009, 4:39pm
 
I installed everything and get the same error message every time I run the midi-test:


Exception in thread "Animation Thread" java.lang.ClassCastException: uk.co.mandolane.midi.MMidiTransmitter$Info
     at de.humatic.mmj.spi.CoreMidiProvider.getDevice(CoreMidiProvider.java:122)
     at javax.sound.midi.MidiSystem.getMidiDevice(MidiSystem.java:200)
     at promidi.MidiIO.getDevice(MidiIO.java:202)
     at promidi.MidiIO.getAvailablePorts(MidiIO.java:213)
     at promidi.MidiIO.<init>(MidiIO.java:127)
     at promidi.MidiIO.getInstance(MidiIO.java:148)
     at sketch_may16a.setup(sketch_may16a.java:30)
     at processing.core.PApplet.handleDraw(PApplet.java:1400)
     at processing.core.PApplet.run(PApplet.java:1328)
     at java.lang.Thread.run(Thread.java:613)


What does it mean?
Re: Beads: another computer music library
Reply #6 - May 24th, 2009, 3:30pm
 
the features sound great.
As far as I know, this is the only sound library for Processing that allows to choose the sound card/channel to output to  with selectMixer(int i)
(correct me anyone if I'm wrong on this)

I saw in the TODO list of the SVN that you plan on including MP3 support, that would be awesome
Re: Beads: another computer music library
Reply #7 - May 25th, 2009, 7:45am
 
havent tried it yet but a new soundlib is defnitly welcome in processing
Re: Beads: another computer music library
Reply #8 - Jun 1st, 2009, 7:25pm
 
The Beads project has found its own site now at beadsprocessing.org, where you'll find a rudimentary Processing tutorial and a link to the SVN repository.

And Casey and Ben have kindly linked to it from the Processing site now too. Cheers.

We're expecting to put out a new release by July 2009, including mp3 support and some snazzy Sample management tools. You can see what's afoot via SVN.

alkopop79, your error seems to relate to Mandalone's MIDI tools. Might want check what mandalone stuff you have installed.

Cheers,

Ollie
Re: Beads: another computer music library
Reply #9 - Jun 23rd, 2009, 1:23am
 
Thanks for this
Re: Beads: another computer music library
Reply #10 - Jan 19th, 2010, 1:41am
 
Hi Orsjb,

I've got a question on using a audio file in a applet. Is it possible without signing it? I looked on the Beads google group and people seems to have managed that by using a inputstream with audiofile like that:
Code:

mySample = new Sample(new AudioFile(inputStream));
myPlayer = new SamplePlayer(myAudioContext, mySample);


I've tried it but really can't manage to make that work, I always get a "can't define sample lenght" or null pointer.

Also I though that file permissions were only to protect access to the client machine, normally a applet can access folder/files on the same machine. At least those with the right permissions set.

Your lib seems really good even without that, but that would be a plus. I really like how it works, it's simple, it's quick and feels powerfull. And being able to select outputs/inputs on the soundCard is amazing! Haven't tried it but I love the idea.

Thanks you.
Re: Beads: another computer music library
Reply #11 - Jan 19th, 2010, 2:00am
 
Hi TM,

just off the top of my head (which is not known for accuracy), the signing requirement has to do with accessing data from a domain which is different from the one the applet is from (or is not a subdirectory of the directory the applet is in, or something like that).

I haven't explored this feature for a while. If you're still having trouble I can look further. Please send me the entire error message (and any relevant code), preferably to the Beads list.

Ollie

PS: if you're using Beads in any online work I'd be glad to link to it.
Re: Beads: another computer music library
Reply #12 - Jan 19th, 2010, 3:24am
 
Thank you for your quick answer.

orsjb wrote on Jan 19th, 2010, 2:00am:
Hi TM,

just off the top of my head (which is not known for accuracy), the signing requirement has to do with accessing data from a domain which is different from the one the applet is from (or is not a subdirectory of the directory the applet is in, or something like that).


I know, I don't understand. It doesn't make sense I must be missing something...

I am basically just doing a simple test and before going further I needed to know if that would work online. I am trying to optimize a game I did for HIV and Aids charity and I wanted to swap minim with beads for various reasons. So I can give you a link but it's not really arty or experimental.


UPDATE:
"All applets and any applications invoked with a security manager must be granted explicit permission to access local system resources apart from read access to the directory and its subdirectories where the program is invoked. The Java platform provides permissions to allow various levels of access to different types of local information."

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html

Really don't get it Sad
Re: Beads: another computer music library
Reply #13 - Jan 19th, 2010, 5:08am
 
Hard to tell without example of the code you're calling, the URLs you're using and the error message (classes, line numbers etc.). However, I'll endeavour to do a basic test of this in principle.
Re: Beads: another computer music library
Reply #14 - Jan 19th, 2010, 5:38am
 
Sorry, as the code is really simple and the error is just a simple permission thing I though it wouldn't help.
I've tried locally on my computer, on our server and remote server, setting all permissions to read/write on the applet folder, etc...

ERROR MESSAGE:

Tue Jan 19 13:36:48 GMT 2010 JEP creating applet triggerMP3_9 (http://www.avert.org/applet/)
Exception in thread "Animation Thread" java.security.AccessControlException: access denied (java.io.FilePermission cheering.mp3 read)
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323
)
     at java.security.AccessController.checkPermission(AccessController.java:546)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
     at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
     at java.io.File.length(File.java:846)
     at org.tritonus.share.sampled.file.TAudioFileReader.getAudioFileFormat(TAudioFileRe
ader.java:107)
     at javazoom.spi.mpeg.sampled.file.MpegAudioFileReader.getAudioFileFormat(Unknown Source)
     at javax.sound.sampled.AudioSystem.getAudioFileFormat(AudioSystem.java:1051)
     at beads.AudioFile.<init>(Unknown Source)
     at beads.AudioFile.<init>(Unknown Source)
     at triggerMP3_9.setup(triggerMP3_9.java:35)
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:637)

Quote:
import beads.*;

AudioContext ac;
SamplePlayer player1, player2;
float myLength;

void setup(){
  size(300, 300);

  String path = "cheering.mp3";

  ac = new AudioContext();

  try{
    Sample sound = new Sample(new AudioFile(path));
    myLength = sound.getLength();
    println(myLength);
    player1 = new SamplePlayer(ac, sound);
    player1.setLoopType(SamplePlayer.LoopType.NO_LOOP_FORWARDS );

    Gain g = new Gain(ac, 2, 1);
    g.addInput(player1);
    ac.out.addInput(g);
    ac.start();

  }
  catch(IOException e){
    println(e);
  }
  catch(javax.sound.sampled.UnsupportedAudioFileException e){
    println(e);
  }


}


void draw(){
  scrub(player1);
}

void mousePressed(){

}

void scrub(SamplePlayer sp){
  //sp.reTrigger();
  float p = map(mouseX, 0 ,width, 0, myLength);
  if(sp!=null) sp.setPosition(p);
}


My first test wasn't using audioFile but sampleManager (player = new SamplePlayer(ac, SampleManager.sample(path));) and I was getting the same error message. I've tried every possibilities, in the data folder, full path, in a folder next to the applet , straight next to the applet, url. I also tried to set sampleManager to stream.

If I use a URL (http://www.avert.org/applet/cheering.mp3) I get this error message even when running it in processing:
Code:

AudioFile cannot determine the duration of the file. Is it missing the duration tag?
javax.sound.sampled.UnsupportedAudioFileException: AudioFile cannot determine the duration of the file.


Thanks

ps: tested in Firefox 3.5.7, safari 4, osx 10.6, osx 10.5.8, java plugin 1.6.0_17


Pages: 1 2