<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Dave,</p>
<p><br>
</p>
<p>I can take a look at it, but I have never really dived into sounds yet - I only polished a few interfaces so far.</p>
<p><br>
</p>
<p>However: Nice extension. I did not read the affected methods before, but the changes look reasonable to me :-)</p>
<p>What is #///? My image does not know it.</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> David T. Lewis <lewis@mail.msen.com><br>
<b>Gesendet:</b> Mittwoch, 11. Dezember 2019 05:08:09<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Cc:</b> Thiede, Christoph<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Sound-dtl.67.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">This commit harvests a fix by St?phane Rollandin, discussed on the<br>
squeak-dev list.<br>
<br>
We are in 5.3 feature freeze now, but it may be reasonable to move<br>
this to trunk because the fix is of high value to the small number<br>
of people who are affected by it.<br>
<br>
@Christoph,<br>
You have a number of other inbox submissions for the Sound package.<br>
If you have the time, would you mind reviewing and commenting on<br>
this one?<br>
<br>
Thanks,<br>
Dave<br>
<br>
<br>
On Wed, Dec 11, 2019 at 03:51:05AM +0000, commits@source.squeak.org wrote:<br>
> David T. Lewis uploaded a new version of Sound to project The Inbox:<br>
> <a href="http://source.squeak.org/inbox/Sound-dtl.67.mcz">http://source.squeak.org/inbox/Sound-dtl.67.mcz</a><br>
> <br>
> ==================== Summary ====================<br>
> <br>
> Name: Sound-dtl.67<br>
> Author: dtl<br>
> Time: 10 December 2019, 10:51:04.985835 pm<br>
> UUID: ca970845-8428-41f9-b83c-f64a6cc732c1<br>
> Ancestors: Sound-eem.66<br>
> <br>
> Sound mixing improvements by St?phane Rollandin (spfa).<br>
> Allow adjusting volume of mixed sounds while playing. <br>
> Original discussion at <a href="http://forum.world.st/Adjusting-the-volume-of-a-sound-as-it-s-playing-td5102562.html">
http://forum.world.st/Adjusting-the-volume-of-a-sound-as-it-s-playing-td5102562.html</a><br>
> Patches posted to squeak-dev at <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2019-December/205440.html">
http://lists.squeakfoundation.org/pipermail/squeak-dev/2019-December/205440.html</a><br>
> <br>
> =============== Diff against Sound-eem.66 ===============<br>
> <br>
> Item was changed:<br>
>   ----- Method: AbstractSound>>loudness (in category 'volume') -----<br>
>   loudness<br>
>        "Answer the current volume setting for this sound."<br>
>   <br>
> +      self hasVolumeEnvelope ifTrue: [^ self volumeEnvelope scale].<br>
> + <br>
> +      ^ scaledVol asFloat / ScaleFactor!<br>
> -      ^ scaledVol asFloat / ScaleFactor asFloat!<br>
> <br>
> Item was changed:<br>
>   ----- Method: MixedSound>>mixSampleCount:into:startingAt:leftVol:rightVol: (in category 'sound generation') -----<br>
>   mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol<br>
>        "Play a number of sounds concurrently. The level of each sound can be set independently for the left and right channels."<br>
>   <br>
>        | snd left right |<br>
>        1 to: sounds size do: [:i |<br>
>                (soundDone at: i) ifFalse: [<br>
>                        snd := sounds at: i.<br>
> +                      left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.<br>
> +                      right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.<br>
> -                      left := (leftVol * (leftVols at: i)) // ScaleFactor.<br>
> -                      right := (rightVol * (rightVols at: i)) // ScaleFactor.<br>
>                        snd samplesRemaining > 0<br>
>                                ifTrue: [<br>
>                                        snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right]<br>
>                                ifFalse: [soundDone at: i put: true]]].<br>
>   !<br>
> <br>
> Item was changed:<br>
>   ----- Method: RepeatingSound>>mixSampleCount:into:startingAt:leftVol:rightVol: (in category 'sound generation') -----<br>
>   mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol<br>
>        "Play a collection of sounds in sequence."<br>
>        "(RepeatingSound new<br>
>                setSound: FMSound majorScale<br>
>                iterations: 2) play"<br>
>   <br>
>        | i count samplesNeeded |<br>
>        iteration <= 0 ifTrue: [^ self].<br>
>        i := startIndex.<br>
>        samplesNeeded := n.<br>
>        [samplesNeeded > 0] whileTrue: [<br>
>                count := sound samplesRemaining min: samplesNeeded.<br>
>                count = 0 ifTrue: [<br>
>                        iterationCount == #forever<br>
>                                ifFalse: [<br>
>                                        iteration := iteration - 1.<br>
>                                        iteration <= 0 ifTrue: [^ self]].  "done"<br>
>                        sound reset.<br>
>                        count := sound samplesRemaining min: samplesNeeded.<br>
>                        count = 0 ifTrue: [^ self]].  "zero length sound"<br>
>                sound mixSampleCount: count<br>
>                        into: aSoundBuffer<br>
>                        startingAt: i<br>
> +                      leftVol: leftVol * scaledVol // ScaleFactor<br>
> +                      rightVol: rightVol * scaledVol // ScaleFactor.<br>
> -                      leftVol: leftVol<br>
> -                      rightVol: rightVol.<br>
>                i := i + count.<br>
>                samplesNeeded := samplesNeeded - count].<br>
>   !<br>
> <br>
> Item was changed:<br>
>   ----- Method: SequentialSound>>mixSampleCount:into:startingAt:leftVol:rightVol: (in category 'sound generation') -----<br>
>   mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol<br>
>        "Play a collection of sounds in sequence."<br>
>        "PluckedSound chromaticScale play"<br>
>   <br>
> +      | finalIndex i snd remaining count leftScaledVol rightScaledVol |<br>
> -      | finalIndex i snd remaining count |<br>
>        currentIndex = 0 ifTrue: [^ self].  "already done"<br>
> + <br>
> +      leftScaledVol := leftVol * scaledVol /// ScaleFactor.<br>
> +      rightScaledVol := rightVol * scaledVol /// ScaleFactor.<br>
> + <br>
>        finalIndex := (startIndex + n) - 1.<br>
>        i := startIndex.<br>
>        [i <= finalIndex] whileTrue: [<br>
>                snd := (sounds at: currentIndex).<br>
>                [(remaining := snd samplesRemaining) <= 0] whileTrue: [<br>
>                        "find next undone sound"<br>
>                        currentIndex < sounds size<br>
>                                ifTrue: [<br>
>                                        currentIndex := currentIndex + 1.<br>
>                                        snd := (sounds at: currentIndex)]<br>
>                                ifFalse: [<br>
>                                        currentIndex := 0.<br>
>                                        ^ self]].  "no more sounds"<br>
>                count := (finalIndex - i) + 1.<br>
>                remaining < count ifTrue: [count := remaining].<br>
> +              snd mixSampleCount: count into: aSoundBuffer startingAt: i <br>
> +                      leftVol: leftScaledVol<br>
> +                      rightVol: rightScaledVol.<br>
> -              snd mixSampleCount: count into: aSoundBuffer startingAt: i leftVol: leftVol rightVol: rightVol.<br>
>                i := i + count].<br>
>   !<br>
> <br>
<br>
> <br>
<br>
</div>
</span></font>
</body>
</html>