Copyright © 2005-2018 MultiMedia Soft

MIDI.VoicesDefaultSet method

Previous pageReturn to chapter overviewNext page



Sets the default maximum number of voices to play at a time for supporting polyphony. The current maximum number can be obtained through the MIDI.VoicesDefaultGet method.


The default number of voices for a loaded MIDI stream can be determined through the MIDI.VoicesGet method or modified through the MIDI.VoicesSet method.


For further details about the use of MIDI protocol see the MIDIMan class section and the How to deal with MIDI protocol tutorial.





[Visual Basic]

Public Function VoicesDefaultSet (

nVoices as Int16

) as enumErrorCodes



public enumErrorCodes VoicesDefaultSet (

Int16 nVoices




public: enumErrorCodes VoicesDefaultSet (

Int16 nVoices










The default maximum number of voices to play at a time; the accepted range of values is from 1 to 256. The higher the number of voices, the higher will be the amount of needed CPU so by reducing the number of voices there will be some CPU saving.



Return value






Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.