[jsyn] SynthSample

jsyn at music.columbia.edu jsyn at music.columbia.edu
Sat Jun 19 14:52:07 EDT 2004

Hello Amir,

>  I have some questions regarding SynthSampl,
> 1)  is it circular in nature, mean does it work like a
> buffer if we connect it to LineIn(microphone).
> 2) if no how we can make it happen???? any suggestions

A SynthSample can be used like a circular buffer. You can record into a
sample by queuing it to the sample port of a SampleWriter_16F1.

    // fill a sample once
    sampleWriter.samplePort.queue( sample );

    // fill a sample continuously like a circular buffer
    sampleWriter.samplePort.queueLoop( sample );

You can use a SampleQueueInputStream to read data continuously from a
microphone into Java.

> 3) when we do read() it gives us some -ve and + values
> what they represents because when there is a sound
> they range from -300 to +700 i dont understand why is
> it.

Internally, JSyn uses floating point numbers that range from -1.0 to +1.0.
But samples are often stored as 16 bit short values which can range
from -32768 to 32767.

Phil Burk
Mobileer, Music Software for Embedded Products, http://www.mobileer.com/
SoftSynth, Audio Research and Development, http://www.softsynth.com/
75 Pleasant Lane, San Rafael, CA, 94901 USA,   Phone/FAX: 1-415-453-4320
This communication may contain commercial content and is intended to comply
all applicable laws governing email communications. To stop receiving
messages from us, simply reply to this message indicating that preference.

More information about the JSyn mailing list