Re: Question about Audio Buffer/Timing

Bob Arning <[email protected]> Thu, 22 Feb 2018 13:57:42 -0500
Newsgroups gmane.comp.lang.smalltalk.squeak.squeakland
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============1817629780704738744==
Content-Type: multipart/alternative;
 boundary="------------A52AD1E4340B8907470F9157"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------A52AD1E4340B8907470F9157
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

There do seem to be some platform issues as to whether this will really 
work. Some things you could do:

- check the value of the Preference for #soundQuickStart -- make it true 
if not already

- put some code into the SoundPlayer method to tell you if quickStart is 
being requested and if not honored, why


On 2/22/18 1:22 PM, Jeremy Landry wrote:
> Thanks for the crossover.  I am subscribed, but generally shy away 
> from posting there as it seems out of my league and my main interest 
> is in Etoys since, well, again, leagues and all that.  I know just 
> enough ST to break things, not build them!  :)
>
> So using the code from this message from Bob Arning:
> *Bob Arning*arning315 at 
> comcast.net<mailto:squeak-dev%40lists.squeakfoundation.org?Subject=Re%3A%20%5Bsqueak-dev%5D%20%5Bsqueakland%5D%20Question%20about%20Audio%20Buffer/Timing&In-Reply-To=%3C269cdd30-7c77-6cab-22aa-591eee543b21%40comcast.net%3E>
> /Thu Feb 22 15:49:07 UTC 2018/
>
>   * Previous message:[squeak-dev] [squeakland] Question about Audio
>     Buffer/Timing
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197505.html>
>   * Next message:[squeak-dev] [squeakland] Question about Audio
>     Buffer/Timing
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197509.html>
>   * *Messages sorted by:*[ date ]
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/date.html#197508>[
>     thread ]
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/thread.html#197508>[
>     subject ]
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/subject.html#197508>[
>     author ]
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/author.html#197508>
>
> ------------------------------------------------------------------------
> SoundPlayer class gives a clue:
>
> resumePlaying: aSound quickStart: quickStart
>       "Start playing the given sound without resetting it; it will resume
> playing from where it last stopped. If quickStart is true, then try to
> start playing the given sound immediately."
>
> Just looking at it and taking a guess, it doesn't seem to be *quite* 
> the thing I was looking for.  I was thinking there's a method/class 
> variable with a value that could be changed to affect the system, 
> rather than 'poking in' every thing I want to play when I want to play 
> it individually because the ultimate effect is that Etoys 
> PLAYSOUND:SOUND tile will work as normal and this seems that it would 
> have to be used instead of the tiles...I have no idea if this is 
> possible, but I'll also dig around the class browser in Etoys, maybe 
> I'll stumble into something, but so far, as I noted, I only found the 
> sound-buffer and sample rates, not the imposed delay method that I 
> remember reading about.  I remember the reasoning it was put in was to 
> prevent accidental playing of sounds inside of a single-frame 
> repeat-tile...i.e. a repeat tile with any value other than 1 and 
> inside of it having a playsound:sound tile would overload the speakers 
> and make nasty noises because so many things are playing on top of 
> each other. I actually WANT this.  Based on how sound plays now, you 
> can hear an 'invisible' metronome that makes sure all sounds are 
> separated and equally spaced apart and in the case of repeat tiles, 
> only seems to accept the last sound as valid/playable.
>
> Thanks for the help so far!  I'm not expecting a solution because I 
> don't know if one exists, but my thought is 'if it was done, it can be 
> undone'...and just looking at how to undo it!  :p
>
>
>
> On Thu, Feb 22, 2018 at 9:59 AM, David T. Lewis <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     There is some follow up discussion happening on the squeak-dev
>     list. I don't
>     know if it helps, but you can read the posts here if you are not
>     subscribed to
>     that list:
>
>     http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197508.html
>     <http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197508.html>
>
>     HTH,
>     Dave
>
>     On Thu, Feb 22, 2018 at 10:27:18AM -0500, David T. Lewis wrote:
>     > Hi Jeremy,
>     >
>     > I am copying this to the squeak-dev list in case someone there
>     can offer
>     > some guidance.
>     >
>     > Dave
>     >
>     >
>     > On Wed, Feb 21, 2018 at 02:44:21PM -0800, Jeremy Landry wrote:
>     > > Hi, I made a quick audio sequencer test in Etoys and found
>     that there's a
>     > > hidden 'timer' that limits the responsiveness of new sounds
>     that go into
>     > > the playback buffer (terminology isn't accurate, but hopefully
>     it makes
>     > > sense to people).
>     > >
>     > > I found the sound buffer setting, but was wondering if there's
>     something
>     > > else that limits how fast new sounds get added to the playback
>     stream? I
>     > > read somewhere (old-man-aphasia here) that some code was added
>     to prevent
>     > > overloading the buffer so surely there's a snippet of code I
>     could add to a
>     > > project to reverse this, if it's what is causing the delay?
>     > >
>     > > Thanks for any help finding the solution.
>     >
>     > > _______________________________________________
>     > > squeakland mailing list
>     > > squeakland-bD51WKytQuId/fn+uklp/[email protected]
>     <mailto:squeakland-bD51WKytQuId/fn+uklp/[email protected]>
>     > > http://lists.squeakland.org/mailman/listinfo/squeakland
>     <http://lists.squeakland.org/mailman/listinfo/squeakland>
>     >
>     > _______________________________________________
>     > squeakland mailing list
>     > squeakland-bD51WKytQuId/fn+uklp/[email protected]
>     <mailto:squeakland-bD51WKytQuId/fn+uklp/[email protected]>
>     > http://lists.squeakland.org/mailman/listinfo/squeakland
>     <http://lists.squeakland.org/mailman/listinfo/squeakland>
>
>
>
>
> _______________________________________________
> squeakland mailing list
> squeakland-bD51WKytQuId/fn+uklp/[email protected]
> http://lists.squeakland.org/mailman/listinfo/squeakland


--------------A52AD1E4340B8907470F9157
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font face="Georgia">There do seem to be some platform issues as
        to whether this will really work. Some things you could do:</font></p>
    <p><font face="Georgia">- check the value of the Preference for
        #soundQuickStart -- make it true if not already</font></p>
    <p><font face="Georgia">- put some code into the SoundPlayer method
        to tell you if quickStart is being requested and if not honored,
        why</font><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 2/22/18 1:22 PM, Jeremy Landry
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMYa41=oVaC0fJ4v4K0-SWEUXVe4kwejNqiEnHDJ8GBs_rKHfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org">
      <div dir="ltr">Thanks for the crossover.  I am subscribed, but
        generally shy away from posting there as it seems out of my
        league and my main interest is in Etoys since, well, again,
        leagues and all that.  I know just enough ST to break things,
        not build them!  :)
        <div><br>
        </div>
        <div>So using the code from this message from Bob Arning:</div>
        <div>
          <b style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Bob
            Arning</b><span
            style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span></span><a
href="mailto:squeak-dev%40lists.squeakfoundation.org?Subject=Re%3A%20%5Bsqueak-dev%5D%20%5Bsqueakland%5D%20Question%20about%20Audio%20Buffer/Timing&amp;In-Reply-To=%3C269cdd30-7c77-6cab-22aa-591eee543b21%40comcast.net%3E"
            title="[squeak-dev] [squeakland] Question about Audio
            Buffer/Timing" style="font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"
            moz-do-not-send="true">arning315 at comcast.net<span> </span></a><br
            style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">
          <i style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Thu
            Feb 22 15:49:07 UTC 2018</i><span
            style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"></span>
          <ul style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">
            <li>Previous message:<span> </span><a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197505.html"
                moz-do-not-send="true">[squeak-dev] [squeakland]
                Question about Audio Buffer/Timing</a></li>
            <li>Next message:<span> </span><a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197509.html"
                moz-do-not-send="true">[squeak-dev] [squeakland]
                Question about Audio Buffer/Timing</a></li>
            <li><b>Messages sorted by:</b><span> </span><a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/date.html#197508"
                moz-do-not-send="true">[ date ]</a><span> </span><a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/thread.html#197508"
                moz-do-not-send="true">[ thread ]</a><span> </span><a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/subject.html#197508"
                moz-do-not-send="true">[ subject ]</a><span> </span><a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/author.html#197508"
                moz-do-not-send="true">[ author ]</a></li>
          </ul>
          <hr style="color:rgb(0,0,0);font-family:&quot;Times New
Roman&quot;;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">
          <pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">SoundPlayer class gives a clue:

resumePlaying: aSound quickStart: quickStart
     "Start playing the given sound without resetting it; it will resume 
playing from where it last stopped. If quickStart is true, then try to 
start playing the given sound immediately."
</pre>
          <br class="gmail-Apple-interchange-newline">
          Just looking at it and taking a guess, it doesn't seem to be
          *quite* the thing I was looking for.  I was thinking there's a
          method/class variable with a value that could be changed to
          affect the system, rather than 'poking in' every thing I want
          to play when I want to play it individually because the
          ultimate effect is that Etoys PLAYSOUND:SOUND tile will work
          as normal and this seems that it would have to be used instead
          of the tiles...I have no idea if this is possible, but I'll
          also dig around the class browser in Etoys, maybe I'll stumble
          into something, but so far, as I noted, I only found the
          sound-buffer and sample rates, not the imposed delay method
          that I remember reading about.  I remember the reasoning it
          was put in was to prevent accidental playing of sounds inside
          of a single-frame repeat-tile...i.e. a repeat tile with any
          value other than 1 and inside of it having a playsound:sound
          tile would overload the speakers and make nasty noises because
          so many things are playing on top of each other. I actually
          WANT this.  Based on how sound plays now, you can hear an
          'invisible' metronome that makes sure all sounds are separated
          and equally spaced apart and in the case of repeat tiles, only
          seems to accept the last sound as valid/playable.</div>
        <div><br>
        </div>
        <div>Thanks for the help so far!  I'm not expecting a solution
          because I don't know if one exists, but my thought is 'if it
          was done, it can be undone'...and just looking at how to undo
          it!  :p  </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Feb 22, 2018 at 9:59 AM, David
          T. Lewis <span dir="ltr">&lt;<a
              href="mailto:[email protected]" target="_blank"
              moz-do-not-send="true">[email protected]</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">There is
            some follow up discussion happening on the squeak-dev list.
            I don't<br>
            know if it helps, but you can read the posts here if you are
            not subscribed to<br>
            that list:<br>
            <br>
            <a
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2018-February/197508.html"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.squeakfoundation.<wbr>org/pipermail/squeak-dev/2018-<wbr>February/197508.html</a><br>
            <br>
            HTH,<br>
            Dave<br>
            <div class="HOEnZb">
              <div class="h5"><br>
                On Thu, Feb 22, 2018 at 10:27:18AM -0500, David T. Lewis
                wrote:<br>
                &gt; Hi Jeremy,<br>
                &gt;<br>
                &gt; I am copying this to the squeak-dev list in case
                someone there can offer<br>
                &gt; some guidance.<br>
                &gt;<br>
                &gt; Dave<br>
                &gt;<br>
                &gt;<br>
                &gt; On Wed, Feb 21, 2018 at 02:44:21PM -0800, Jeremy
                Landry wrote:<br>
                &gt; &gt; Hi, I made a quick audio sequencer test in
                Etoys and found that there's a<br>
                &gt; &gt; hidden 'timer' that limits the responsiveness
                of new sounds that go into<br>
                &gt; &gt; the playback buffer (terminology isn't
                accurate, but hopefully it makes<br>
                &gt; &gt; sense to people).<br>
                &gt; &gt;<br>
                &gt; &gt; I found the sound buffer setting, but was
                wondering if there's something<br>
                &gt; &gt; else that limits how fast new sounds get added
                to the playback stream? I<br>
                &gt; &gt; read somewhere (old-man-aphasia here) that
                some code was added to prevent<br>
                &gt; &gt; overloading the buffer so surely there's a
                snippet of code I could add to a<br>
                &gt; &gt; project to reverse this, if it's what is
                causing the delay?<br>
                &gt; &gt;<br>
                &gt; &gt; Thanks for any help finding the solution.<br>
                &gt;<br>
                &gt; &gt; ______________________________<wbr>_________________<br>
                &gt; &gt; squeakland mailing list<br>
                &gt; &gt; <a
                  href="mailto:squeakland-bD51WKytQuId/fn+uklp/[email protected]"
                  moz-do-not-send="true">squeakland-bD51WKytQuId/fn+uklp/uG/[email protected]<wbr>org</a><br>
                &gt; &gt; <a
                  href="http://lists.squeakland.org/mailman/listinfo/squeakland"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">http://lists.squeakland.org/<wbr>mailman/listinfo/squeakland</a><br>
                &gt;<br>
                &gt; ______________________________<wbr>_________________<br>
                &gt; squeakland mailing list<br>
                &gt; <a href="mailto:squeakland-bD51WKytQuId/fn+uklp/[email protected]"
                  moz-do-not-send="true">squeakland-bD51WKytQuId/fn+uklp/uG/[email protected]<wbr>org</a><br>
                &gt; <a
                  href="http://lists.squeakland.org/mailman/listinfo/squeakland"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">http://lists.squeakland.org/<wbr>mailman/listinfo/squeakland</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
squeakland mailing list
<a class="moz-txt-link-abbreviated" href="mailto:squeakland-bD51WKytQuId/fn+uklp/[email protected]">squeakland-bD51WKytQuId/fn+uklp/[email protected]</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakland.org/mailman/listinfo/squeakland">http://lists.squeakland.org/mailman/listinfo/squeakland</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------A52AD1E4340B8907470F9157--

--===============1817629780704738744==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kc3F1ZWFrbGFu
ZCBtYWlsaW5nIGxpc3QKc3F1ZWFrbGFuZEBsaXN0cy5zcXVlYWtsYW5kLm9yZwpodHRwOi8vbGlz
dHMuc3F1ZWFrbGFuZC5vcmcvbWFpbG1hbi9saXN0aW5mby9zcXVlYWtsYW5kCg==

--===============1817629780704738744==--