The Trunk: Sound-nice.8.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Sound-nice.8.mcz

commits-2
Nicolas Cellier uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-nice.8.mcz

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

Name: Sound-nice.8
Author: nice
Time: 20 October 2009, 12:16:40 pm
UUID: 479a4219-da06-c14a-908b-409ad8627af5
Ancestors: Sound-ar.7

use #fasterKeys

=============== Diff against Sound-ar.7 ===============

Item was changed:
  Object subclass: #SoundRecorder
  instanceVariableNames: 'stereo samplingRate recordLevel recordedBuffers recordedSound recordProcess bufferAvailableSema paused meteringBuffer meterLevel soundPlaying currentBuffer nextIndex codec desiredSampleRate'
+ classVariableNames: 'CanRecordWhilePlaying RecorderActive'
- classVariableNames: 'RecorderActive CanRecordWhilePlaying'
  poolDictionaries: ''
  category: 'Sound-Synthesis'!

Item was changed:
  AbstractSound subclass: #SampledSound
  instanceVariableNames: 'initialCount count samples originalSamplingRate samplesSize scaledIndex indexHighBits scaledIncrement'
+ classVariableNames: 'CoffeeCupClink DefaultSampleTable IncrementFractionBits IncrementScaleFactor NominalSamplePitch ScaledIndexOverflow SoundLibrary'
- classVariableNames: 'SoundLibrary NominalSamplePitch DefaultSampleTable ScaledIndexOverflow IncrementScaleFactor IncrementFractionBits CoffeeCupClink'
  poolDictionaries: ''
  category: 'Sound-Synthesis'!

Item was changed:
  ----- Method: PianoRollScoreMorph>>mouseMove: (in category 'event handling') -----
  mouseMove: evt
 
  | noteMorphs chordRect sound |
  soundsPlaying ifNil: [^ self].
  self autoScrollForX: evt cursorPoint x.
 
  "Play all notes at the cursor time"
  noteMorphs := self notesInRect: ((evt cursorPoint extent: 1@0) expandBy: 0@self height).
  chordRect := (self innerBounds withLeft: evt cursorPoint x) withWidth: 1.
  soundsPlayingMorph delete.
  soundsPlayingMorph := Morph newBounds: chordRect color: Color green.
  self addMorphBack: soundsPlayingMorph.
 
  noteMorphs do:
  [:m |  "Add any new sounds"
  (soundsPlaying includesKey: m)
  ifFalse: [sound := m soundOfDuration: 999.0.
  soundsPlaying at: m put: sound.
  SoundPlayer resumePlaying: sound quickStart: false]].
+ soundsPlaying fasterKeys do:
- soundsPlaying keys do:
  [:m |  "Remove any sounds no longer in selection."
  (noteMorphs includes: m)
  ifFalse: [(soundsPlaying at: m) stopGracefully.
  soundsPlaying removeKey: m]].
 
  !

Item was changed:
  AbstractSound subclass: #LoopedSampledSound
  instanceVariableNames: 'initialCount count releaseCount sampleCountForRelease leftSamples rightSamples originalSamplingRate perceivedPitch gain firstSample lastSample loopEnd scaledLoopLength scaledIndex scaledIndexIncr'
+ classVariableNames: 'FloatLoopIndexScaleFactor LoopIndexFractionMask LoopIndexScaleFactor'
- classVariableNames: 'LoopIndexFractionMask LoopIndexScaleFactor FloatLoopIndexScaleFactor'
  poolDictionaries: ''
  category: 'Sound-Synthesis'!
 
  !LoopedSampledSound commentStamp: '<historical>' prior: 0!
  I respresent a sequence of sound samples, often used to record a single note played by a real instrument. I can be pitch-shifted up or down, and can include a looped portion to allow a sound to be sustained indefinitely.
  !

Item was changed:
  ----- Method: AbstractSound class>>updateFMSounds (in category 'sound library') -----
  updateFMSounds
  "AbstractSound updateFMSounds"
 
+ Sounds fasterKeys do: [:k |
- Sounds keys do: [:k |
  ((Sounds at: k) isKindOf: FMSound) ifTrue: [
  Sounds removeKey: k ifAbsent: []]].
 
  (FMSound class organization listAtCategoryNamed: #instruments) do:
  [:sel | Sounds at: sel asString put: (FMSound perform: sel)].
  !

Item was changed:
  Object subclass: #SoundPlayer
  instanceVariableNames: ''
+ classVariableNames: 'ActiveSounds Buffer BufferIndex BufferMSecs LastBuffer PlayerProcess PlayerSemaphore ReadyForBuffer ReverbState SamplingRate SoundJustStarted SoundSupported Stereo UseReadySemaphore UseReverb'
- classVariableNames: 'UseReverb BufferIndex Buffer SoundSupported ActiveSounds BufferMSecs SoundJustStarted SamplingRate Stereo ReverbState UseReadySemaphore PlayerSemaphore PlayerProcess LastBuffer ReadyForBuffer'
  poolDictionaries: ''
  category: 'Sound-Synthesis'!

Item was changed:
  ----- Method: AbstractSound class>>unloadSampledTimbres (in category 'sound library-file in/out') -----
  unloadSampledTimbres
  "This can be done to unload those bulky sampled timbres to shrink the image. The unloaded sounds are replaced by a well-known 'unloaded sound' object to enable the unloaded sounds to be detected when the process is reversed."
  "AbstractSound unloadSampledTimbres"
 
+ Sounds fasterKeys do: [:soundName |
- Sounds keys copy do: [:soundName |
  (((Sounds at: soundName) isKindOf: SampledInstrument) or:
  [(Sounds at: soundName) isKindOf: LoopedSampledSound]) ifTrue: [
  Sounds at: soundName put: self unloadedSound]].
  self updateScorePlayers.
  Smalltalk garbageCollect.
  !

Item was changed:
  ----- Method: SampledSound class>>soundNames (in category 'sound library') -----
  soundNames
  "Answer a list of sound names for the sounds stored in the sound library."
  "| s |
  SampledSound soundNames asSortedCollection do: [:n |
  n asParagraph display.
  s := SampledSound soundNamed: n.
  s ifNotNil: [s playAndWaitUntilDone]]"
 
+ ^ SoundLibrary fasterKeys
- ^ SoundLibrary keys asArray
  !

Item was changed:
  ----- Method: AbstractSound class>>soundNames (in category 'sound library') -----
  soundNames
 
+ ^ Sounds fasterKeys sort
- ^ Sounds keys asSortedCollection asArray
  !

Item was changed:
  Object subclass: #AbstractSound
  instanceVariableNames: 'envelopes mSecsSinceStart samplesUntilNextControl scaledVol scaledVolIncr scaledVolLimit'
+ classVariableNames: 'FloatScaleFactor MaxScaledValue PitchesForBottomOctave ScaleFactor Sounds TopOfBottomOctave UnloadedSnd'
- classVariableNames: 'UnloadedSnd PitchesForBottomOctave ScaleFactor MaxScaledValue TopOfBottomOctave Sounds FloatScaleFactor'
  poolDictionaries: ''
  category: 'Sound-Synthesis'!