class Haematite::VoiceCollection

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(synth : Synthesizer, maxActiveVoiceCount : Int32) #

Creates a new VoiceCollection instance.


Instance Method Detail

def activeVoiceCount : Int32 #

The number of active voices.


def clear #

Clears all voices.


def eachActive(&) #

Loops through all of the currently active voices, yielding each one to the block.


def process : Nil #

"Runs" all voices.


def requestNew(region : InstrumentRegion, channel : Int32) : Voice | Nil #

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.