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.
Page Index Toggle Pages: 1
Sonia Samples (Read 2202 times)
Sonia Samples
Mar 13th, 2007, 9:07pm
 
I have been using an example of Sonia manipulating sounds. I went to go in and add my own sounds and now it keeps on bring up this error when compiling:

com.softsynth.jsyn.SynthException: JSyn error: Parameter out of range.  -  , 0x0=0, 0x0=0

The sound file is a wav and is 16-bit and it's placed in my data file.

Any ideas why?

Thanks
Re: Sonia Samples
Reply #1 - Dec 7th, 2007, 4:49pm
 
the same
but how to repair?
Re: Sonia Samples
Reply #2 - Dec 7th, 2007, 8:03pm
 
I try on another macbook pro
10.4.11
the same
pr 133 135
Re: Sonia Samples
Reply #3 - Dec 10th, 2007, 1:32pm
 
import processing.core.*;
import fullscreen.*;
import pitaru.sonia_v2_9.*;
import SoniaHelper.*;
//import processing.opengl.*;


/**
* Mirror
* by Daniel Shiffman.  
*
* Each pixel from the video source is drawn as a rectangle with rotation based on brightness.  
*/

import processing.video.*;
FullScreen fs;
float rad;


int spectrumLength=256; // Needs to be power of 2
int bandsteps;
float maxdist,damperval;
SoniaHelper ffthelper;
float pt[];



// Size of each cell in the grid
int cellSize = 5;
// Number of columns and rows in our system
int cols, rows;
// Variable for capture device
Capture video;


void setup() {
 size(640, 480, P3D);
 frameRate(30);
 cols = width / cellSize;
 rows = height / cellSize;
   rectMode(CENTER);
   
   Sonia.start(this);

 LiveInput.start(spectrumLength);
//  LiveInput.useEnvelope(true,1f);
 LiveInput.useEqualizer(true);  

 // SoniaHelper(int _n, int _nbands,boolean doAvg)
 ffthelper=new SoniaHelper(spectrumLength,32,false);
 ffthelper.setMaxLimits(200,2000);
 damperval=0.1f;
 ffthelper.setDamper(damperval);  
 
 pt=new float[spectrumLength*2];
 for(int i=0; i<spectrumLength; i++) {
   pt[i*2]=random(width-50)+25;
   pt[i*2+1]=random(height-50)+25;
 }
 bandsteps=spectrumLength/ffthelper.band.length;
   maxdist=ffthelper.maxMaximum-ffthelper.maxMinimum;

 //colorMode(RGB, 255, 255, 255, 100);

 // Uses the default video input, see the reference if this causes an error
 video = new Capture(this, width, height, 12);
 
   fs = new FullScreen(this);
 
 // enter fullscreen mode
 fs.enter();
 

}


void draw() {
  doSoundInput();

 for(int i=0; i<spectrumLength; i++) {
    //fill(255,0,128, 255*ffthelper.spectrum[i]);
   
    // scale rad according to spectrum value, using
    // cubic interpolation to give organic values.
    rad=2+50*(ffthelper.spectrum[i]*ffthelper.spectrum[i]);
 
 }
 if (video.available()) {
   background(0);
   video.read();
   video.loadPixels();
   
   // Not bothering to clear background

 
   // Begin loop for columns
   for (int i = 0; i < cols; i++) {
     // Begin loop for rows
     for (int j = 0; j < rows; j++) {
     
       // Where are we, pixel-wise?
       int x = i*cellSize;
       int y = j*cellSize;
       int loc = (video.width - x - 1) + y*video.width; // Reversing x to mirror the image
     
       float r = red(video.pixels[loc]);
       float g = green(video.pixels[loc]);
       float b = blue(video.pixels[loc]);
       // Make a new color with an alpha component
       float av = r+g+b;
       //fill(55,random(0,255),random(34,255));
       // Code for drawing a single rect
       // Using translate in order for rotation to work properly
     pushMatrix();
     translate(x,y);
     rotate(av/32.0);
     rect(0+rad,0+rad,av/26.0,av/26.0);
     popMatrix();
     }
   }
 }
}

public void doSoundInput() {
 LiveInput.getSpectrum();
 ffthelper.update(LiveInput.spectrum);
}

Page Index Toggle Pages: 1