[jsyn] LineIn in the Beta...

jsyn at music.columbia.edu jsyn at music.columbia.edu
Wed Apr 13 17:51:33 EDT 2011


Hi Phil,

I'm trying to get a simple LineIn example working with the beta, but I'm 
getting errors. Here's the code:


+++++++
//JSynInput.java

import com.jsyn.engine.SynthesisEngine;
import com.jsyn.unitgen.LineIn;


public class JSynInput {

     SynthesisEngine synth;
     LineIn lineIn;

     JSynInput()
     {
         System.out.println("starting JSyn...");

         synth = new SynthesisEngine();
         synth.start();

         lineIn = new LineIn();

         synth.add(lineIn);

         lineIn.start();
     }

     public static void main(String[] args)
     {

         System.out.println("JSynInput test...");

         JSynInput j = new JSynInput();
     }
}


+++++++

Here's the result:

dyn-128-59-117-126:JSynInputTest douglas$ javac -cp ./jsyn.jar 
JSynInput.java
dyn-128-59-117-126:JSynInputTest douglas$ java -cp ./:./jsyn.jar JSynInput
JSynInput test...
starting JSyn...
---- Pure Java JSyn www.softsynth.com - rate = 44100, RT, V16.3 (build 
418, 2010-10-01)
Output buffer size = 5292 bytes.
Output Latency in msec = 30.0
Synth thread old priority = 5
Synth thread new priority = 7
Exception in thread "Thread-4" java.lang.ArrayIndexOutOfBoundsException: 0
	at 
com.jsyn.engine.SynthesisEngine$InterleavingBuffer.getChannelBuffer(SynthesisEngine.java:209)
	at com.jsyn.engine.SynthesisEngine.getInputBuffer(SynthesisEngine.java:466)
	at com.jsyn.unitgen.LineIn.generate(LineIn.java:24)
	at com.jsyn.unitgen.UnitGenerator.pullData(UnitGenerator.java:188)
	at 
com.jsyn.engine.SynthesisEngine.synthesizeBuffer(SynthesisEngine.java:447)
	at 
com.jsyn.engine.SynthesisEngine.generateNextBlock(SynthesisEngine.java:377)
	at com.jsyn.engine.SynthesisEngine.run(SynthesisEngine.java:341)
	at java.lang.Thread.run(Thread.java:680)


-- 
............................................... http://artbots.org
.....douglas.....irving........................ http://dorkbot.org
.......................... http://music.columbia.edu/cmc/music-dsp
...........repetto............. http://music.columbia.edu/organism
............................... http://music.columbia.edu/~douglas



More information about the JSyn mailing list