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 › Sonia in new version (0.85 Beta)
Page Index Toggle Pages: 1
Sonia in new version (0.85 Beta) (Read 4247 times)
Sonia in new version (0.85 Beta)
Apr 19th, 2005, 10:52pm
 
Hi,

I'm just new to Proce55ing and could play with Sonia in version 0.69 by putting the needed files in the code subfolder of my sketch. Today I saw the new version of Proce55ing (being 0.85 Beta) and wanted to try it out with Sonia. When I save the needed files like before under the code subfolder and try to export my sketch I get this error:

Semantic Error: No applicable overload for a method with signature "start(sine_test)" was found in type "Sonia". Perhaps you wanted the overloaded version "void start(BApplet $1);" instead?


C:/Documents and Settings/Hoofdgebruiker/Mijn documenten/Processing/sine_test/applet/sine_test.java:5:9:5:13: Semantic Error: Type "BApplet" was not found.


processing.app.RunnerException: Perhaps you wanted the overloaded version "void start(BApplet $1);" instead?

     at processing.app.Compiler.message(Compiler.java:332)

     at processing.app.MessageSiphon.run(MessageSiphon.java:60)

     at java.lang.Thread.run(Unknown Source)


When I just try to run it, it gives me this:

Semantic Error: Type "BApplet" was not found.

It was just this sample that I wanted to play:

http://processing.org/reference/libraries/sonia/Sample_getVolume_.html

Grz, Kris.
Re: Sonia in new version (0.85 Beta)
Reply #1 - Apr 19th, 2005, 11:06pm
 
Unfortunately, Sonia will need to be upgraded like every applet from the alpha versions of Processing. Since it doesn't deal with visual things, it's mostly a search-and-replace thing which shouldn't take very long. But 0085 now supports libraries, which hopefully Amit will take advantage of.

Looking at the Sonia's download/ directory, it looks like there might be a beta version (versions 2.9 and 2.8 beta are up, I don't know if either work). I'd just wait for an official release, though - it shouldn't be too far off.
Re: Sonia in new version (0.85 Beta)
Reply #2 - Apr 19th, 2005, 11:40pm
 
as i understand it, version 2.9 should work with beta.. if it's on his site i'd try that out. if not, casey has just summoned the great pitaru so we'll see what happens when he emerges.
Re: Sonia in new version (0.85 Beta)
Reply #3 - Apr 20th, 2005, 1:47am
 
Hey Guys, I'll be porting Sonia to Beta (85) this evening and post the links. Sorry for lagging behind Smiley

amit
Re: Sonia in new version (0.85 Beta)
Reply #4 - Apr 20th, 2005, 5:25am
 
OK - http://pitaru.com/sonia now has a compatible version for Processing 85.

Hit me with the bugs!

amit
Re: Sonia in new version (0.85 Beta)
Reply #5 - Apr 20th, 2005, 1:08pm
 
I tried out this example (from the archives of Sonia):

import pitaru.sonia_v2_9.*;

void setup(){
  size(512,200);
  Sonia.start(this); // Start Sonia engine.
  LiveInput.start(256); // Start LiveInput and return 256 FFT frequency bands.
}

void loop(){
  background(0,30,0);
  getMeterLevel(); // Show meter-level reading for Left/Right channels.
  getSpectrum(); // Show FFT reading
}

void getSpectrum(){

  strokeWeight(0);
  stroke(0,230,0);
 // populate the spectrum array with FFT values.
  LiveInput.getSpectrum();
  // draw a bar for each of the elements in the spectrum array.
  // Note - the current FFT math is done in Java and is very raw. expect optimized alternative soon.
  for ( int i = 0; i < LiveInput.spectrum.length; i++){
     line(i*2, height, i*2, height - LiveInput.spectrum[i]/10);
  }
}

void getMeterLevel(){
  // get Peak level for each channel (0 -> Left , 1 -> Right)
  // Value Range: float from 0.0 to 1.0
  // Note: use inputMeter.getLevel() to combine both channels (L+R) into one value.
  float meterDataLeft = LiveInput.getLevel(Sonia.LEFT);
  float meterDataRight = LiveInput.getLevel(Sonia.RIGHT);

  // draw a volume-meter for each channel.
  strokeWeight(100);
  stroke(0,100,0);
  float left = meterDataLeft*height;
  float right = meterDataRight*height;
  line(width/2 - 120, height, width/2 - 120 , height - left);
  line(width/2 + 120, height, width/2 + 120, height - right);
}

// Safely close the sound engine upon Browser shutdown.
public void stop(){
   Sonia.stop();
   super.stop();
}
____________________________________________________

And get these errors when I try to run it:

C:/Documents and Settings/rc01200/Application Data/Processing/build/Temporary_187_6044.java:32:51:32:54: Semantic Error: The field "LEFT" in type "pitaru.sonia_v2_9.Sonia" has default access and is not accessible here.


C:/Documents and Settings/rc01200/Application Data/Processing/build/Temporary_187_6044.java:33:52:33:56: Semantic Error: The field "RIGHT" in type "pitaru.sonia_v2_9.Sonia" has default access and is not accessible here.

Grz, Kris.
Re: Sonia in new version (0.85 Beta)
Reply #6 - Apr 20th, 2005, 3:40pm
 
I can export it, and run it, if I replace these 2 lines:

float meterDataLeft = LiveInput.getLevel(Sonia.LEFT);
float meterDataRight = LiveInput.getLevel(Sonia.RIGHT);

by

float meterDataLeft = LiveInput.getLevel(0);
float meterDataRight = LiveInput.getLevel(1);

However, if I run the sample I can only see the background being gray, I get the popup if the micro may be used (JSynth probably) but no spectrum meter or volume meter Cry.

Grz, Kris.
Re: Sonia in new version (0.85 Beta)
Reply #7 - Apr 20th, 2005, 4:56pm
 
I havn't had the chance to update the example code, and they're all written for Processing 68.

So you'll need to make some changes to the code, have it fit the new processing syntax. The only thing i see here is replacing the loop() event with draw()

let me know if it works for you

amit
Re: Sonia in new version (0.85 Beta)
Reply #8 - Apr 21st, 2005, 10:24am
 
I still can't use the Sonia.LEFT and RIGHT options but when I use the 0 and 1 fix I noted earlier I can compile it (using the draw() method instead of the loop() method).

Strange but true, only the left meter works and the right one won't move an inch. Another thing I notice is that the volume meters have a rounded top instead of having a flat top. Very strange because I just copied the above code.

Grz, Kris.
Re: Sonia in new version (0.85 Beta)
Reply #9 - Apr 21st, 2005, 12:29pm
 
The top comes from the strokeCap(SQUARE); being standard ROUND?

Grz, Kris.
Page Index Toggle Pages: 1