SetVoiceAccent

Syntax

int SetVoiceAccent(nVoice,nTempo,nVolume,nMode,nPitch)

This function places an accent (tempo, volume, mode, and pitch) in the voice queue specified by the nVoice parameter. The new accent replaces the previous accent and remains in effect until another accent is queued. An accent is not counted as a note.

An error occurs if there is insufficient room in the queue; the SetVoiceAccent function always leaves space for a single sync mark in the queue. If nVoice is out of range, the SetVoiceAccent function is ignored.

Parameter Type/Description  

nVoice int Specifies a voice queue. The first voice queue is numbered 1.  
nTempo int Specifies the number of quarter notes played per minute. It can be any value from 32 to 255. The default is 120.  
nVolume int Specifies the volume level. It can be any value from 0 (lowest volume) to 255 (highest).  
nMode int Specifies how the notes are to be played. It can be any one of the following values:  
  Value Meaning
  S_LEGATO Note is held for the full duration and blended with the beginning of the next note.
  S_NORMAL Note is held for the full duration, coming to a full stop before the next note starts.
  S_STACCATO Note is held for only part of the duration, creating a pronounced stop between it and the next note.
nPitch int Specifies the pitch of the notes to be played. It can be any value from 0 to 83. The pitch value is added to the note value, using modulo 84 arithmetic.  

Return Value

The return value specifies the result of the function. It is zero if the function is successful. If an error occurs, the return value is one of the following values:

Value Meaning  

S_SERDMD Invalid mode  
S_SERDTP Invalid tempo  
S_SERDVL Invalid volume  
S_SERQFUL Queue full