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 7733 times)
Re: Beads: another computer music library
Reply #15 - Jan 21st, 2010, 4:59am
 
Victory (almost) !!!!!!!!

The solution is in createInput and the good news is that sounds can be stored either in the data folder or a folder next to your jar files.

The bad news is it only works with aif (maybe wav) but not mp3. I think beads looks for a duration tags in the mp3 and for some reason can't find it with this solution. any clue?

Quote:
import beads.*;

AudioContext ac;
SamplePlayer player1, player2;
float myLength;

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

  String path = "cheering.aif";

  ac = new AudioContext();

  try{
    Sample sound = new Sample(createInput(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(){
  background(150);
  scrub(player1);
}

void mousePressed(){

}

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


ps: The file permission is still a mystery.  

Re: Beads: another computer music library
Reply #16 - Jan 21st, 2010, 2:47pm
 
Hey TM,

that's good, I was about to say I'd recreated your problem but not solved it. Applet security is quite a faf. Regarding the duration tag, look's like we've still got a bug to do with what to do if there's no duration tag. Most mp3s I use do have this tag, although it's just a tag so might not be correct. If you re-convert the file using some other software you might find it works. I'll make sure this is high on the bug list.

O
Re: Beads: another computer music library
Reply #17 - Jan 22nd, 2010, 1:20am
 
Hi orsjb,

we tried a few softwares to get this duration tag but duration doesn't seems to be a ID3 tag. Although mp3 work perfectly when loading then with the SampleManager. Would it be possible for you to tell me what software you use to create your mp3?

Cheers
Re: Beads: another computer music library
Reply #18 - Jan 22nd, 2010, 7:54pm
 
If the behaviour is different using SampleManager than via AudioFile then something's wrong with that, it's probably not the duration tag. I'll look into it, sorry for that.
Re: Beads: another computer music library
Reply #19 - Jan 29th, 2010, 12:29am
 
Hey TM,

I patched the duration issue. It will appear in the new release of Beads. The cheering applet is here:

http://users.on.net/~eigenbom/tmp/cheering/cheering.html

For now you can use my compiled  processing .jar, which you can grab from:

http://users.on.net/~eigenbom/tmp/cheering/

Regards,
Ben
Re: Beads: another computer music library
Reply #20 - Feb 4th, 2010, 9:37am
 
I thought I knew a lot about music libraries, but this one, IMHO, is unique. Nothing I've ever come across has all of these features. Unfortunately, I feel the market will be fairly limited.
Re: Beads: another computer music library
Reply #21 - Feb 9th, 2010, 1:12pm
 
Limited market, probably but this project looks great though.
Pages: 1 2