[jsyn] how to tell when an envelope is finished?

jsyn at music.columbia.edu jsyn at music.columbia.edu
Fri Apr 22 11:11:22 EDT 2011


so the args look like:
envelope
startFrame
numFrames
time
callback


I'm assuming (hoping) that the type callback is a jsyn interface
implemented by UnitDataQueueCallback and not actually the class
UnitDataQueueCallback itself.  Having the observer be an interface and
not a class type will of course make things much more flexible.

I would *love* it if queueLoop had the same API and delivered  a
callback at the loop seam - after playing the last frame of the
envelope specified.  That way loopers I have driven by this class can
make other changes precisely at the "downbeat".

thoughts?

Side question: If I call queueLoop with synth envelope A and then
queueLoop with synth envelope B will envelope B start right on the
"loop seam" of envelope A?  In not I presume envelope B will never get
started (w/ no other calls)?

thanks so much!

C>T>

On Fri, Apr 22, 2011 at 5:11 AM, jsyn at music.columbia.edu
<jsyn at music.columbia.edu> wrote:
> Sorry. That code was for a unit test. Here is a more appropriate example:
>
>
> // Create an object to be called when the queued data is done.
> UnitDataQueueCallback callback = new UnitDataQueueCallback(){
>    public void finished()
>    {
>        System.out.println("Callback complete.");
>    }
> };
> envelopePlayer.dataQueue.queueData( envelope,
>     0, envelope.length, 0, callback );
>
> Thank you,
> Phil Burk
> ---------------------------------------
> SoftSynth, Audio Research and Development
> http://www.softsynth.com/
> 75 Pleasant Lane, San Rafael, CA, 94901 USA
> Office/Fax: +1-415-453-4320
> Mobile: +1-415-846-4370
> ---------------------------------------
>
> On 4/22/11 7:57 AM, jsyn at music.columbia.edu wrote:
>>
>> I'm seeing this bullet point in the migrating from... to pure-java jsyn
>> doc:
>>
>> * You can request a completion callback when you queue data.
>>
>> Seems like just what the doctor ordered but I can't find it in the
>> EnvelopePlayer class - using Pure Java V16.3 (build 418, 2010-10-01)
>>
>> will this be rolled out soon?
>>
>> thanks!
>>
>> C>T>
>>
>> On Thu, Apr 21, 2011 at 9:21 PM, jsyn at music.columbia.edu
>> <jsyn at music.columbia.edu>  wrote:
>>>
>>> The problem for me is knowing when an envelope is finished so that I
>>> can detect loops using queueLoop()
>>>
>>> Has there been any creative solutions to this by anyone?
>>>
>>> An observer pattern would seem ideal once some transition state is
>>> detected...I remember the old difficulties described by Phil in the
>>> old thread on this.
>>>
>>> Sorry, can't figure out how to get the old thread in here...
>>>
>>> C>T>
>>> _______________________________________________
>>> JSyn mailing list
>>> JSyn at music.columbia.edu
>>> To change digest mode or to make other administrative changes visit:
>>> http://music.columbia.edu/mailman/listinfo/jsyn
>>>
>> _______________________________________________
>> JSyn mailing list
>> JSyn at music.columbia.edu
>> To change digest mode or to make other administrative changes visit:
>> http://music.columbia.edu/mailman/listinfo/jsyn
>>
>>
> _______________________________________________
> JSyn mailing list
> JSyn at music.columbia.edu
> To change digest mode or to make other administrative changes visit:
> http://music.columbia.edu/mailman/listinfo/jsyn
>


More information about the JSyn mailing list