class VoiceManager

# class VoiceManager | Manages internally the voices used by synth devices. More...
Internal Use Only
Definition | `#include <voiceman.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- VoiceManager (int totalvoices)
- ~VoiceManager ()
- int allocateVoice (int chn,int key)
- void deallocateVoice (int id)
- void initSearch (void)
- int search (int chn)
- int search (int chn,int note)
- int channel (int v)
- int note (int v)
- int used (int v)
- void clearLists (void)

## Detailed Description

Manages the voices used by synthesizers.

VoiceManager (int totalvoices) | ### VoiceManager

Cronstructor.

~VoiceManager () | ### ~VoiceManager

Destructor.

int allocateVoice (int chn,int key) | ### allocateVoice

Allocates a voice used in channel `chn`, and playing key `key`

Returns: the voice that should be used.

See also: deallocateVoice

void deallocateVoice (int id) | ### deallocateVoice

Deallocates the voice with ID `id`.

See also: allocateVoice

void initSearch (void) | ### initSearch

initSearch() must be called always before search() to initialize internal variables.

See also: search

int search (int chn) | ### search

Returns -1 if channel chn is not currently used, or a voice using channel `chn` if any.

Calling search repeteadly, will return all the voices using channel `chn`, and a -1 after the last one.

See also: initSearch

int search (int chn,int note) | ### search

This is a convenience function that differs from the above in that it also looks for a specific note (the second parameter)

See also: initSearch

int channel (int v) | ### channel

Returns the channel that voice `v` is using.

int note (int v) | ### note

Returns the note that voice `v` is playing.

int used (int v) | ### used

Returns true or false if the voice `v` is being used or not respectively.

void clearLists (void) | ### clearLists

Clears the lists of used voices.

- Version: 0.9.5 17/01/2000
- Author: Antonio Larrosa Jimenez
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:38:06 2003, using kdoc 2.0a54.