Loading ...
Sorry, an error occurred while loading the content.

Event Scheduling and Envelopes

Expand Messages
  • Nick Didkovsky
    Hello JSyn List, Has anyone experimented with scheduling the changing the data of a SynthEnvelope? The public void write(double[] data) is not time stamped,
    Message 1 of 5 , Oct 1, 2002
    • 0 Attachment
      Hello JSyn List,

      Has anyone experimented with scheduling the changing the data of a
      SynthEnvelope? The public void write(double[] data) is not time stamped,
      so using this to change envelopes from event to event won't give the
      expected results.

      So I was thinking of a implementing a class that behaved like an n-stage
      envelope but was really n separate SynthEnvelopes and one
      EnvelopePlayer. If each SynthEnvelope contained a single frame with an
      amplitude of 1.0 and a duration of, say, 0.001 seconds, then one could set
      the rate and amplitude of each, queue them up in sequence starting at time
      t, resulting in event-scheduled envelope contour variation. Each "frame"
      duration could then vary from 0.0005 seconds up to very long durations.

      At the top level, I could imagine this could end up being just:

      double envdata[] = { 0.1, 1.0, 0.5, 0.9, 2.0, 0.0 };

      EventScheduledEnvelope m = new EventScheduledEnvelope(3); // 3 frames

      m.queue(time, envdata); // queue it all
      m.queue(time, envdata, 2, 3); // queue frames 2..4

      Not sure how to neatly do a queueloop, but anyway...

      Thoughts?
      Nick




      Doctor Nerve Home Page, http://www.doctornerve.org
      Interactive Computer Music, http://www.punosmusic.com
      Java Music Specification Language, http://www.algomusic.com

      [Non-text portions of this message have been removed]
    • Phil Burk
      Hello Nick, ... SynthEnvelope? I think there may be an easier way to achieve what you want. You can get arbitrary scheduled linear contours by sending
      Message 2 of 5 , Oct 1, 2002
      • 0 Attachment
        Hello Nick,

        > Has anyone experimented with scheduling the changing the data of a
        SynthEnvelope?

        I think there may be an easier way to achieve what you want. You can get
        arbitrary scheduled linear contours by sending timestamped messages to a
        LinearLag unit:


        http://www.softsynth.com/jsyn/docs/autodocs/com/softsynth/jsyn/LinearLag.htm
        l

        Just set the input and time ports simultaneously using timestamps. For
        example:

        linLag.input( timeInTicks, target );
        linLag.input( timeInTicks, durationInSeconds);

        When the input changes, the lag will ramp from its current level to the
        target level in the given number of seconds. You can create complex
        envelopes by scheduling multiple breakpoints.

        Phil Burk
      • Nick Didkovsky
        This is great Phil, thanks - it s nice to think envelope and see a solution that doesn t use one. Nick ... Doctor Nerve Home Page, http://www.doctornerve.org
        Message 3 of 5 , Oct 1, 2002
        • 0 Attachment
          This is great Phil, thanks - it's nice to think "envelope" and see a
          solution that doesn't use one.
          Nick



          At 11:57 AM 10/1/02 -0700, you wrote:
          >Hello Nick,
          >
          > > Has anyone experimented with scheduling the changing the data of a
          >SynthEnvelope?
          >
          >I think there may be an easier way to achieve what you want. You can get
          >arbitrary scheduled linear contours by sending timestamped messages to a
          >LinearLag unit:
          >
          >
          >http://www.softsynth.com/jsyn/docs/autodocs/com/softsynth/jsyn/LinearLag.htm
          >l
          >
          >Just set the input and time ports simultaneously using timestamps. For
          >example:
          >
          > linLag.input( timeInTicks, target );
          > linLag.input( timeInTicks, durationInSeconds);
          >
          >When the input changes, the lag will ramp from its current level to the
          >target level in the given number of seconds. You can create complex
          >envelopes by scheduling multiple breakpoints.
          >
          >Phil Burk
          >
          >
          >
          >JSyn home at: http://www.softsynth.com/jsyn/
          >List home at: http://groups.yahoo.com/group/jsyn/
          >To unsubscribe, send an email to: jsyn-unsubscribe@yahoogroups.com
          >
          >
          >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


          Doctor Nerve Home Page, http://www.doctornerve.org
          Interactive Computer Music, http://www.punosmusic.com
          Java Music Specification Language, http://www.algomusic.com
        • Bradford Garton
          ... Nick -- I think I do something similar (not 100% sure), but I accomplish it by kicking the problem up a level . I build a SynthCircuit that has an
          Message 4 of 5 , Oct 2, 2002
          • 0 Attachment
            On Tue, 1 Oct 2002, Nick Didkovsky wrote:

            > Has anyone experimented with scheduling the changing the data of a
            > SynthEnvelope? The public void write(double[] data) is not time stamped,
            > so using this to change envelopes from event to event won't give the
            > expected results.

            Nick --

            I think I do something similar (not 100% sure), but I accomplish it by
            kicking the problem 'up a level'. I build a SynthCircuit that has an
            EnvelopePlayer and a really basic envelope. I also define a method
            that will rewrite the envelope data and do an EnvelopePlayer.write(),
            EnvelopePlayer.envelopePort.clear(), and then an
            EnvelopePlayer.envelopePort.queue() of the new envelope data. Then I
            instantiate a 'controller' thread that does Synth.sleepUntilTick()'s
            until I want to alter the envelope -- this controlling thread then hits
            the envelopechange method (or whatever I call it -- I forget) with
            appropriate data passed in. This allows me to queue the successive
            envelope stages at the ticks I want them, and it also leaves it fairly
            open-ended for complex envelope construction. Is this what you were
            after?

            brad
          • Nick Didkovsky
            Thanks Brad, That s the idea - same issue. It s the EnvelopePlayer.write() that is the problem for me, since it cannot be timestamped. But I guess you are
            Message 5 of 5 , Oct 2, 2002
            • 0 Attachment
              Thanks Brad,

              That's the idea - same issue.

              It's the EnvelopePlayer.write() that is the problem for me, since it cannot be
              timestamped. But I guess you are calling clear() and queue() without the
              timestamp argument?

              Nick

              Bradford Garton wrote:

              > On Tue, 1 Oct 2002, Nick Didkovsky wrote:
              >
              > > Has anyone experimented with scheduling the changing the data of a
              > > SynthEnvelope? The public void write(double[] data) is not time stamped,
              > > so using this to change envelopes from event to event won't give the
              > > expected results.
              >
              > Nick --
              >
              > I think I do something similar (not 100% sure), but I accomplish it by
              > kicking the problem 'up a level'. I build a SynthCircuit that has an
              > EnvelopePlayer and a really basic envelope. I also define a method
              > that will rewrite the envelope data and do an EnvelopePlayer.write(),
              > EnvelopePlayer.envelopePort.clear(), and then an
              > EnvelopePlayer.envelopePort.queue() of the new envelope data. Then I
              > instantiate a 'controller' thread that does Synth.sleepUntilTick()'s
              > until I want to alter the envelope -- this controlling thread then hits
              > the envelopechange method (or whatever I call it -- I forget) with
              > appropriate data passed in. This allows me to queue the successive
              > envelope stages at the ticks I want them, and it also leaves it fairly
              > open-ended for complex envelope construction. Is this what you were
              > after?
              >
              > brad
              >
              > JSyn home at: http://www.softsynth.com/jsyn/
              > List home at: http://groups.yahoo.com/group/jsyn/
              > To unsubscribe, send an email to: jsyn-unsubscribe@yahoogroups.com
              >
              >
              > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

              --
              Doctor Nerve Home Page, http://www.doctornerve.org
              Interactive Computer Music, http://www.punosmusic.com
              Java Music Specification Language, http://www.algomusic.com
            Your message has been successfully submitted and would be delivered to recipients shortly.