PolyTone Constructor (int Pitch, int Duration, Tone.VOLUME Volume)

Creates an instance of the PolyTone class with a specified pitch, duration, and volume for each tone in the sequence. Volume is defined by the range in Tone.VOLUME.

Syntax

public PolyTone(
    int Pitch, int Duration, Tone.VOLUME Volume,
    [...0 to N more tones as shown above]
    );	

Parameters

Pitch
The tone's frequency specified in cycles-per-second (Hertz), subject to range limits defined by Tone.PITCH.

Duration
The tone's duration in milliseconds, subject to range limits defined by Tone.DURATION.

Volume
The tone's volume, subject to range limits defined by Tone.VOLUME:
Tone.VOLUME.OFF
Tone.VOLUME.LOW
Tone.VOLUME.NORMAL
Tone.VOLUME.LOUD
Tone.VOLUME.VERY_LOUD
Tone.VOLUME.MUTE
Tone.VOLUME.UNMUTE
Tone.VOLUME.CURRENT_CFG_VOL

For more information, see Range Constants.

Example

As seen in the example below, use the volume value Tone.VOLUME.OFF to generate pauses (rests) between tones.

[C#]
using Honeywell.Mobility.Device.Audio;
PolyTone Ptone1 = new PolyTone( 
300, 100, Tone.VOLUME.NORMAL ,
400, 100, Tone.VOLUME.NORMAL ,
500, 100, Tone.VOLUME.NORMAL ,
600, 75,  Tone.VOLUME.NORMAL ,
0,   175, Tone.VOLUME.OFF    , // Rest (pause) for 175 milliseconds.
500, 75,  Tone.VOLUME.NORMAL ,
600, 400, Tone.VOLUME.NORMAL 
);

More Information

PolyTone Class