« Return to Thread: Displaying a trace.

Re: Displaying a trace.

by music.columbia.edu - JSyn mailing list :: Rate this Message:

Reply to Author | View in Thread


> As I'm relatively new to java and JSyn I'm searching for examples of
> how to get the image data from a signal to display on a java
> component (e.g. JPanel).

First you need to capture audio data. Queue a SynthSample to a
SampleWriter_16F1 to record a buffer full of audio. Then read() the data
as shorts from the sample.

If you are using Swing then make a subclass of JComponent and override
the paint() method to draw the data. Convert the audio data to x and y
values and then call:

   g.drawLine( previousX, previousY, x, y );

Thank you,
Phil Burk
---------------------------------------
SoftSynth, Audio Research and Development
http://www.softsynth.com/
75 Pleasant Lane, San Rafael, CA, 94901 USA
Phone/FAX: 1-415-453-4320
---------------------------------------
_______________________________________________
JSyn mailing list
JSyn@...
To change digest mode or to make other administrative changes visit:
http://music.columbia.edu/mailman/listinfo/jsyn

 « Return to Thread: Displaying a trace.