[squeak-dev] The Inbox: Sound-dtl.68.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Thu Dec 12 12:22:29 UTC 2019


Hi Dave,

+1 for 5.3

Best,
Marcel
Am 12.12.2019 13:20:46 schrieb commits at source.squeak.org <commits at source.squeak.org>:
David T. Lewis uploaded a new version of Sound to project The Inbox:
http://source.squeak.org/inbox/Sound-dtl.68.mcz

==================== Summary ====================

Name: Sound-dtl.68
Author: dtl
Time: 12 December 2019, 7:20:38.226903 am
UUID: c7b5a141-2b1b-4d24-ab88-0a96dd78600b
Ancestors: Sound-dtl.67

Resolve unimplemented calls in the previous update.
Discussion on squeak-dev http://lists.squeakfoundation.org/pipermail/squeak-dev/2019-December/205515.html

=============== Diff against Sound-dtl.67 ===============

Item was changed:
----- Method: AbstractSound>>loudness (in category 'volume') -----
loudness
"Answer the current volume setting for this sound."

+ ^ envelopes detect: [:e | e isKindOf: VolumeEnvelope]
+ ifFound: [ :envelope | envelope scale ]
+ ifNone: [scaledVol asFloat / FloatScaleFactor]
+ !
- self hasVolumeEnvelope ifTrue: [^ self volumeEnvelope scale].
-
- ^ scaledVol asFloat / ScaleFactor!

Item was changed:
----- Method: SequentialSound>>mixSampleCount:into:startingAt:leftVol:rightVol: (in category 'sound generation') -----
mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol
"Play a collection of sounds in sequence."
"PluckedSound chromaticScale play"

| finalIndex i snd remaining count leftScaledVol rightScaledVol |
currentIndex = 0 ifTrue: [^ self]. "already done"

+ leftScaledVol := leftVol * scaledVol / ScaleFactor asFloat.
+ rightScaledVol := rightVol * scaledVol / ScaleFactor asFloat.
- leftScaledVol := leftVol * scaledVol /// ScaleFactor.
- rightScaledVol := rightVol * scaledVol /// ScaleFactor.

finalIndex := (startIndex + n) - 1.
i := startIndex.
[i
snd := (sounds at: currentIndex).
[(remaining := snd samplesRemaining)
"find next undone sound"
currentIndex
ifTrue: [
currentIndex := currentIndex + 1.
snd := (sounds at: currentIndex)]
ifFalse: [
currentIndex := 0.
^ self]]. "no more sounds"
count := (finalIndex - i) + 1.
remaining
snd mixSampleCount: count into: aSoundBuffer startingAt: i
leftVol: leftScaledVol
rightVol: rightScaledVol.
i := i + count].
!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191212/47a30b7b/attachment.html>


More information about the Squeak-dev mailing list