UnwiredtecDocumentation : RingtoneCreatorJavaPoly

Polyphonic Ringtones

Formats

FormatExtensionMax. Polyphony
MIDI (SP-MIDI).mid, .midi, .rmiunlimited1
Yamaha SMAF MA-1.mmf4
Qualcomm CMX (prior to v3.0).pmd3 or 162
Sagem v2.1.emsunlimited1

1 Individual phone models restrict the capabilities of the format and play only fixed number of simultaneous notes
2 CMX 1.X is limited to 3-voice polyphony and CMX 2.X to 16 voices

Yamaha SMAF MA-2, Yamaha SMAF MA-3, Qualcomm CMX 3.X and 4.X, NTT DoCoMo MFi ringtones are mixed formats ringtones and are not listed here though they have all the features of polyphonic ringtones. To read more on them go here.

Operations


public Ringtone truncateChannels(int channelsCount, int allowedRhythmPolyphony);

Truncate the ringtone leaving only first channelsCount mono channels by priority

public Ringtone truncateChannels(int channelsCount);

Truncate the ringtone leaving only first channelsCount mono channels by priority. Treat rhythm channel as monophonic.

public Ringtone truncateTracks(int polyphony, int[] tracks, int allowedRhythmPolyphony);

Truncate the ringtone leaving only first channelsCount mono channels by priority given by tracks array

public Ringtone truncateTracks(int polyphony, int[] tracks);

Same as truncateTracks(polyphony, tracks, -1);

public Ringtone truncateTracks(int[] tracks);

Same as truncateTracks(-1, tracks, -1);

public Ringtone truncateTracks(int[] tracks, int allowedRhythmPolyphony);

Same as truncateTracks(-1, tracks, allowedRhythmPolyphony);

public int getPolyphonyLevel();

Get the maximal number of notes played simultaneously in the ringtone (ringtone polyphony)

public Ringtone truncatePolyphonyLevel(int polyphony);

Truncate the ringtone so that not more than polyphony notes are played simultaneously

public Ringtone truncateParts(int maxCount);

Truncate the ringtone so that not more than maxCount parts is used

public int getTracksCount();

Get the number of tracks in the ringtone

public int getTrackNotesCount(int track);

Get the number of notes on the given track of the ringtone.
If there's no track with the given number 0 is returned.

public int getInstantPolyphony(int time);

Return the number of simultaneously sounding notes at the given time (in ms).
If time exceeds getDuration() value, return 0.

public Ringtone reducePolyphony(int channelCount, int maxPolyphony, int drumPolyphony);

Reduce number of channels of the ringtone to the given value.

public Ringtone truncateTracks(int maxPolyphony);

Limit the ringtone so that
Pay attention to MIP table if it's present. Otherwise use natural order of tracks.

public Ringtone append(Ringtone appendedRingtone);

Appends ringtone to the end of current

public void substituteInstrument(Instrument oldInstrument, Instrument newInstrument) throws Incorrect Instrument Exception

Substitute all occurences of one instrument with the other.
Note that you can't substitute percussion instrument with the melodic or vice verse.
Only instruments of the same nature can be substituted.

public void substituteInstruments(Map instrumentSubstitution) throws Incorrect Instrument Exception;

Substitute all occurences of the set of instruments with the instruments from the other set.
Note that you can't substitute percussion instrument with the melodic or vice verse.
Only instruments of the same nature can be substituted.

Individual Format Options


Format Format Constant Applicable Options
MIDI
(MIDI 0, MIDI 1, SP-MIDI)
RingtoneConstants.FORMAT_MIDI_0,
RingtoneConstants.FORMAT_MIDI_1,
RingtoneConstants.FORMAT_SPMIDI
RingtoneConstants.OPTION_COMPACT
Make ringtones less in size by omitting unnecessary information

RingtoneConstants.OPTION_START_WITH_TEXT
Shift all text metaevents to the beginning of the track

RingtoneConstants.OPTION_FORBID_SPECIAL_NOTES
Don't include special notes (like vibra or lights)

RingtoneConstants.OPTION_NORMALIZE_VIBRA
Make vibrachannel volume as small as possible to eliminate effects on devices that are not capable of distinguishing vibra

RingtoneConstants.OPTION_INSERT_VIBRATION
Generate vibrachannel and insert it to the ringtone

RingtoneConstants.OPTION_DISALLOW_INSTRUMENT_CHANGES
Forbid changing the instrument in the middle of the channel. Is necessary for Nokia Series 40 devices.
Yamaha SMAF MA-1 RingtoneConstants.FORMAT_SMAF_MA1 RingtoneConstants.OPTION_FORBID_SAVE
Set content read only (not savable)

RingtoneConstants.OPTION_FORBID_TRANSMISSION
Set content not transferrable
RingtoneConstants.OPTION_FORBID_EDIT
Set content not ediatble

RingtoneConstants.OPTION_NO_CRASH_CYMBAL
Replace Crash Cymbal with another instrument (useful for some phone models)
Qualcomm CMX 
(CMX 1.X, CMX 2.X)
RingtoneConstants.FORMAT_CMX +
RingtoneConstants.OPTION_CMX_CMX1X,
RingtoneConstants.FORMAT_CMX +
RingtoneConstants.OPTION_CMX_CMX2X
RingtoneConstants.OPTION_COPYRIGHTED
Set copyright flag for the ringtone to true

RingtoneConstants.OPTION_NO_COPYRIGHT
Set copyright flag for the ringtone to false

RingtoneConstants.OPTION_DOWNLOADED_FROM_NET
Set content origin to downloaded from net

RingtoneConstants.OPTION_MOBILE_ORIGINATED
Set content origin to mobile originated

RingtoneConstants.OPTION_FROM_DESKTOP
Set content origin to desktop
Sagem 2.1 RingtoneConstants.FORMAT_SAGEM_21 No options applicable

See also information on mixed formats