class Haematite::VoiceCollection
- Haematite::VoiceCollection
- Reference
- Object
Overview
A set of Voice
instances used for synthesis. The Synthesizer
class uses
this rather than creating voices directly during synthesis.
Defined in:
haematite/voice.crConstructors
-
.new(synth : Synthesizer, maxActiveVoiceCount : Int32)
Creates a new
VoiceCollection
instance.
Instance Method Summary
-
#activeVoiceCount : Int32
The number of active voices.
-
#clear
Clears all voices.
-
#eachActive(&)
Loops through all of the currently active voices, yielding each one to the block.
-
#process : Nil
"Runs" all voices.
-
#requestNew(region : InstrumentRegion, channel : Int32) : Voice | Nil
Requests a new
Voice
instance for the given instrument on the given channel.
Constructor Detail
def self.new(synth : Synthesizer, maxActiveVoiceCount : Int32)
#
Creates a new VoiceCollection
instance.
Instance Method Detail
def eachActive(&)
#
Loops through all of the currently active voices, yielding each one to the block.
Requests a new Voice
instance for the given instrument on the given
channel. If the VoiceCollection
has not yet reached the maximum
polyphony, this returns a new Voice
instance. Otherwise, this returns
nil
.