Squeak Class Documentation category index | class index  
 
FMSound
  category: Sound-Synthesis
  superclass: AbstractSound
  subclasses: FMClarinetSound FMBassoonSound UnloadedSound

No comment. Sorry.

instance methods
  accessing
  duration
duration:
internalizeModulationAndRatio
modulation
modulation:
modulation:multiplier:
modulation:ratio:
multiplier
pitch
pitch:
ratio
ratio:

  initialization
  initialize
setPitch:dur:loudness:
setWavetable:

  sound generation
  mixSampleCount:into:startingAt:leftVol:rightVol:
reset
samplesRemaining
stopAfterMSecs:

  storing
  storeOn:

class methods
  class initialization
  initialize
sineTable

  instruments
  bass1
bassoon1
brass1
brass2
clarinet
clarinet2
default
flute1
flute2
marimba
mellowBrass
oboe1
oboe2
organ1
pluckedElecBass
randomWeird1
randomWeird2

instance methods
  accessing top  
 

duration


 

duration:

Scale my envelopes to the given duration. Subclasses overriding this method should include a resend to super.


 

internalizeModulationAndRatio

Recompute the internal state for the modulation index and frequency ratio relative to the current pitch.


 

modulation

Return the FM modulation index.


 

modulation:

Set the FM modulation index. Typical values range from 0 (no modulation) to 5, although values up to about 10 are sometimes useful.


 

modulation:multiplier:

For backward compatibility. Needed to read old .fmp files.


 

modulation:ratio:

Set the modulation index and carrier to modulation frequency ratio for this sound, and compute the internal state that depends on these parameters.


 

multiplier


 

pitch


 

pitch:

Warning: Since the modulation and ratio are relative to the current pitch, some internal state must be recomputed when the pitch is changed. However, for efficiency during envelope processing, this compuation will not be done until internalizeModulationAndRatio is called.


 

ratio

Return the FM modulation to carrier frequency ratio.


 

ratio:

Set the FM modulation to carrier frequency ratio.


  initialization top  
 

initialize


 

setPitch:dur:loudness:

(FMSound pitch: 'a4' dur: 2.5 loudness: 0.4) play


 

setWavetable:

(AbstractSound lowMajorScaleOn: (FMSound new setWavetable: AA)) play


  sound generation top  
 

mixSampleCount:into:startingAt:leftVol:rightVol:

Play samples from a wave table by stepping a fixed amount through the table on every sample. The table index and increment are scaled to allow fractional increments for greater pitch accuracy.


 

reset

Reset my internal state for a replay. Methods that override this method should do super reset.


 

samplesRemaining

Answer the number of samples remaining until the end of this sound. A sound with an indefinite ending time should answer some large integer such as 1000000.


 

stopAfterMSecs:

Terminate this sound this note after the given number of milliseconds.


  storing top  
 

storeOn:

Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.


class methods
  class initialization top  
 

initialize

Build a sine wave table.


 

sineTable

Answer a SoundBuffer containing one complete cycle of a sine wave.


  instruments top  
 

bass1

FMSound bass1 play


 

bassoon1

FMSound bassoon1 play


 

brass1

FMSound brass1 play


 

brass2

FMSound brass2 play


 

clarinet

FMSound clarinet play


 

clarinet2

FMSound clarinet2 play


 

default

Return a default sound prototype for this class, with envelopes if appropriate. (This is in contrast to new, which returns a raw instance without envelopes.)


 

flute1

FMSound flute1 play


 

flute2

FMSound flute2 play


 

marimba

FMSound marimba play


 

mellowBrass

FMSound mellowBrass play


 

oboe1

FMSound oboe1 play


 

oboe2

FMSound oboe2 play


 

organ1

FMSound organ1 play


 

pluckedElecBass

FMSound pluckedElecBass play


 

randomWeird1

FMSound randomWeird1 play


 

randomWeird2

FMSound randomWeird2 play