From jsyn at music.columbia.edu Tue Jul 10 17:36:29 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Tue Jul 10 17:36:33 2007 Subject: [jsyn] planets Message-ID: <4693FBDD.7080602@nefkom.net> These days I came up with a new Java-JSyn-application - "Planeten" - for audiovisual simulation of elliptic planet movements according to the laws of Newton in a gravitation field. Different modi of graphical representation, multiple access to sounddesign, possibilities for defining and saving individual settings, manual. I want to announce this to the JSyn-list in hope of critical comments about usability and aspects of further improvement. http://www.wolfgang-fulda.de/harmonik/planeten/Planeten.zip best Wolfgang Fulda From jsyn at music.columbia.edu Wed Jul 11 09:11:25 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Wed Jul 11 09:12:49 2007 Subject: [jsyn] Using a SampleQueueOutputStream with variable rate sample reader. Message-ID: <11540060.post@talk.nabble.com> Hi All, Does anyone know whether it is possible to connect a SampleQueueOutputStream to the sample port of a sample reader having a different frame rate? The problem I'm experiencing is that the SampleQueueOutputStream seems to supply samples to the sample reader (SampleReader16V1) at an audio rate of 44100 while the rate on the sample reader is set to 24000. This obviously causes glitches in the resulting audio signal. Is there another way of doing this, apart from handling the correct timing and queueing of samples myself? Or am I totally missing something? Thanks, Etienne. -- View this message in context: http://www.nabble.com/Using-a-SampleQueueOutputStream-with-variable-rate-sample-reader.-tf4061844.html#a11540060 Sent from the music.columbia.edu - JSyn mailing list archive at Nabble.com. From jsyn at music.columbia.edu Wed Jul 11 10:09:06 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Wed Jul 11 10:09:08 2007 Subject: [jsyn] Using a SampleQueueOutputStream with variable rate sample reader. In-Reply-To: <11540060.post@talk.nabble.com> References: <11540060.post@talk.nabble.com> Message-ID: <11541122.post@talk.nabble.com> OK, I found what the problem was: it all still boils down to a timing issue. marmadoc wrote: > > Does anyone know whether it is possible to connect a > SampleQueueOutputStream to the sample port of a sample reader having a > different frame rate? > Yes, this is possible, and it works. However, this brings me to my actual problem. Processing non-real-time is not a problem when all the inputs originate inside the synthEngine, but how should it be handled for example when writing to the said SampleQueueOutputStream from a file. Reading from the file is slower than the possible processing speed, which results in buffer underruns. So my question: Is there a way (and if so, how) to control the speed of the synthEngine while processing in non real-time (or at least to let it wait for slower inputs)? Thanks, Etienne. -- View this message in context: http://www.nabble.com/Using-a-SampleQueueOutputStream-with-variable-rate-sample-reader.-tf4061844.html#a11541122 Sent from the music.columbia.edu - JSyn mailing list archive at Nabble.com. From jsyn at music.columbia.edu Wed Jul 11 10:51:43 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Wed Jul 11 10:51:17 2007 Subject: [jsyn] Using a SampleQueueOutputStream with variable rate sample reader. In-Reply-To: <11541122.post@talk.nabble.com> References: <11540060.post@talk.nabble.com> <11541122.post@talk.nabble.com> Message-ID: <4694EE7F.7070105@softsynth.com> > Reading from the file is slower than the possible processing speed, > which results in buffer underruns. It should not be so slow. Make sure you use a BufferedInputStream or it will be very very slow. > So my question: Is there a way (and if so, how) to control the speed > of the synthEngine while processing in non real-time (or at least to > let it wait for slower inputs)? You can also run the SynthEngine in non real-time by passing Synth.FLAG_NON_REAL_TIME when you start the engine. When you call Synth.sleepUntilTick() then the synth engine will generate audio up to that tick. This works with multiple threads. You should be able to do file I/O and other slow stuff in the middle. 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 --------------------------------------- From jsyn at music.columbia.edu Wed Jul 11 11:34:51 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Wed Jul 11 11:34:54 2007 Subject: [jsyn] Using a SampleQueueOutputStream with variable rate sample reader. In-Reply-To: <4694EE7F.7070105@softsynth.com> References: <11540060.post@talk.nabble.com> <11541122.post@talk.nabble.com> <4694EE7F.7070105@softsynth.com> Message-ID: <11542701.post@talk.nabble.com> music.columbia.edu - JSyn mailing list wrote: > > You can also run the SynthEngine in non real-time by passing > Synth.FLAG_NON_REAL_TIME when you start the engine. When you call > Synth.sleepUntilTick() then the synth engine will generate audio up to > that tick. This works with multiple threads. You should be able to do > file I/O and other slow stuff in the middle. > I do start the engine in NON_REAL_TIME, and use sleepUntilTick(), but what happens if the engine gets to the tick the thread is sleeping until, and the required amount of data has not yet been prepared for queueing? In other words, what happens if I call sleepUntilTick(x), while tick x has already gone past? Won't this result in unpredictable data going through the units? This seems to be the problem I'm experiencing probably because of the time it takes to prepare the data. Thanks again! Etienne. -- View this message in context: http://www.nabble.com/Using-a-SampleQueueOutputStream-with-variable-rate-sample-reader.-tf4061844.html#a11542701 Sent from the music.columbia.edu - JSyn mailing list archive at Nabble.com. From jsyn at music.columbia.edu Wed Jul 11 13:06:19 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Wed Jul 11 13:05:56 2007 Subject: [jsyn] Using a SampleQueueOutputStream with variable rate sample reader. In-Reply-To: <11542701.post@talk.nabble.com> References: <11540060.post@talk.nabble.com> <11541122.post@talk.nabble.com> <4694EE7F.7070105@softsynth.com> <11542701.post@talk.nabble.com> Message-ID: <46950E0B.1020000@softsynth.com> > In other words, what happens if I call sleepUntilTick(x), > while tick x has already gone past? The JSyn clock will not advance until you call sleepUntilTick(x). So just make sure you have all your other data before you call it. That is one reason for the non-real-time mode. 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 --------------------------------------- From jsyn at music.columbia.edu Wed Jul 11 14:15:46 2007 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Wed Jul 11 14:16:02 2007 Subject: [jsyn] Using a SampleQueueOutputStream with variable rate sample reader. In-Reply-To: <46950E0B.1020000@softsynth.com> References: <11540060.post@talk.nabble.com> <11541122.post@talk.nabble.com> <4694EE7F.7070105@softsynth.com> <11542701.post@talk.nabble.com> <46950E0B.1020000@softsynth.com> Message-ID: <11545862.post@talk.nabble.com> music.columbia.edu - JSyn mailing list wrote: > > The JSyn clock will not advance until you call sleepUntilTick(x). So > just make sure you have all your other data before you call it. > Thats, good to know. So, let's look at a multi-threaded app, where the synthContext is created, started and stopped in one location (not really a thread, just a method call e.g. start()), while data input, data output, and other functions are handled by separate threads. Should sleepUntilTick() be called on all threads involved, and not only on the specific data handling thread? What happens if one thread calls sleepUntilTick() while another is not ready to do that yet, or should the control of when to sleep only happen from one thread? Thanks for your time and patience. Etienne. -- View this message in context: http://www.nabble.com/Using-a-SampleQueueOutputStream-with-variable-rate-sample-reader.-tf4061844.html#a11545862 Sent from the music.columbia.edu - JSyn mailing list archive at Nabble.com.