|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Displaying a trace.Hi JSyn Users,
I'm just starting out with JSyn, (and also with Java), but its so far so good. I got JSyn working from the examples and tutorials without too much of a hassle. Now I need to draw an oscilloscope view of the output signal in a java app. I have noticed the SynthScope which seems to be what I need, but I'm thinking that I would rather want to get the image data directly, and use that together with anything else I may want to add. I.e. to have more control over the display. The WaveTrace and WaveDisplay classes also seem to be handy. 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). If anyone can help me with an example or just point me in the right direction, it will be greatly appreciated. Thanks |
|
|
Re: Displaying a trace.> 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 |
|
|
Re: Displaying a trace. [OT]This is very off-topic, but I love the way Phil always says
Thank You, Phil Burk after he has provided complete, concise, detailed help even for the most vague questions. The irony always makes me laugh. Thank YOU, Phil! best, kevin On Jun 13, 2007, at 3:02 PM, jsyn@... wrote: > >> 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 _______________________________________________ JSyn mailing list JSyn@... To change digest mode or to make other administrative changes visit: http://music.columbia.edu/mailman/listinfo/jsyn |
|
|
Re: Displaying a trace. [OT]Phil,
Thank you for the reply. It is much appreciated. I got the display working and am currently busy trying non-real time processing. I think I may have some questions on how to set it up but I will first try to figure it out and then ask some (hopefully less vague) questions. Kevin, my apologies for posting a vague question; I'm sure it will become easier to be more specific once I've mastered the likes of JSyn, Java and Eclipse (all in one go). I'll try my best! Thanks again. |
|
|
Limited audio device friendly name.Hi Phil,
I am currently enumerating the list of audio devices available, similar to the example TJ_Devices.java using AudioDevice.getName(index). However, the result returned seems to be only 31 characters long (at max). While getting the friendly names is really useful, having them limited makes it only almost useful. What should I do (or do differently) if I want to return the full name? Do you know where the limit exists, because from what I gather in the AudioDevice class, the length of the buffer is actually 256? Could it possibly be hardware/OS related? Any help is appreciated. Thanks, Etienne. |
| Free embeddable forum powered by Nabble | Forum Help |