Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit

ie.ncl.media.music
Class IMelody

java.lang.Object
  extended by ie.ncl.media.music.Melody
      extended by ie.ncl.media.music.IMelody

public class IMelody
extends Melody

IMelody is a standard developed by the Infrared Data Association - Specifications for Ir Mobile Communications (IrMC) - for the purposes of transmitting ring tones to mobile phones.

Note this version of IMelody does not support melody 'repeats'.

The format of the IMelody string should conform to the following BNF specification:-
 

<imelody-object>::= 
 "BEGIN:IMELODY"<cr><line-feed>
"VERSION:"<version><cr><line-feed> 
"FORMAT:"<format><cr><line-feed> 
["NAME:"<characters-not-lf><cr><line-feed>] 
["COMPOSER:"<characters-not-lf><cr><line-feed>] 
["BEAT:"<beat><cr><line-feed>] 
["STYLE:"<style><cr><line-feed>] 
["VOLUME:"<volume><cr><line-feed>] 
["COPYRIGHT:"<copyright><cr><line-feed>] 
"MELODY:"<melody><cr><line-feed> 
"END:IMELODY"<cr><line-feed> 
<version>::="1.2" 
<format>::"CLASS1.0" | "CLASS2.0"
<beat>::="25" | "26" | "27" | ... | "899" | "900" 
<style>::="S0" | "S1" | "S2" 
<volume-modifier>::="V+"|"V-" (changes volume + or  from current volume) 
<volume>::="V0" | "V1" | ... | "V15" |<volume-modifier> 
<basic-note>::="c" | "d" | "e" | "f" | "g" | "a" | "b" 
<ess-note >::="&d" | "&e" | "&g" | "&a" | "&b" (flat notes) 
<iss-note >::="#c" | "#d" | "#f" | "#g" | "#a" (sharp notes) 
<basic-ess-iss- note >::=<basic-note> | <ess-note> | <iss-note> 
<octave-prefix>::="*0" | "*1" |  | "*8" (A=55Hz) | (A=110Hz) |  | (A=14080Hz) 
<duration>::="0" | "1" | "2" | "3" | "4" | "5" 
<duration-specifier>::="." | ":" | ";" 
<rest>::="r" 
<led>::="ledoff" | "ledon" 
<vibe>::="vibeon" | "vibeoff" 
<backlight>::="backon" | "backoff" 
<note>::=[<octave-prefix>]<basic-ess-iss-note><duration>[<duration-specifier>] 
<silence>::=<rest><duration>[<duration-specifier] 
<repeat>::= "("{<silence>|<note>|<led>|<vibe>|<volume>|<backlight>}+
           "@"<repeat-count>[<volume-modifier>]")"
<repeat-count>::="0" | "1" | "2" |  (0 is repeat forever) 
<melody>::={<silence>|<note>|<led>|<vibe>|<repeat>|<volume>|<backlight>}+ 
<characters-not-lf >::= 'Any character in the ASCII character-set except <line-feed>.'
<copyright>::="FREE" | "PROTECTED" 
(C) 2000 Infrared Data Association (IrDA) 
 

Sample IMelody ring tones are (treble-click on name to select all):

BEGIN:IMELODY
 VERSION:1.2
 FORMAT:CLASS1.0
 NAME:AxelF
 MELODY:*3g2#a3.g4r4g4*4c3*3g3f3g2*4d3.*3g4r4g4*4#d3d3*3#a3g3*4d3
 END:IMELODY
BEGIN:IMELODY
 VERSION:1.2
 FORMAT:CLASS1.0
 NAME:Bolero
 MELODY:*4c2c3*3b4*4c4d4c4*3b4a4*4c3c4*3a4*4c2c3*3b4*4c4*3a4g4e4
 END:IMELODY
BEGIN:IMELODY
 VERSION:1.2
 FORMAT:CLASS1.0
 NAME:Entertainer 
 BEAT:140
 STYLE:S1
 VOLUME:V10 
 MELODY:*4d3*4#d3*4e3*5c2*4e3*5c2*4e3*5c1*5c3*5d3*5#d3*5e3*5c3*5d3*5e2*4b3*5d2*5c1r2*4d3*
 4#d3*4e3*5c2*4e3*5c2*4e3*5c1r3*4a3*4g3*4#f3*4a3*5c3*5e2*5d3*5c3*4a3*5d1
 END:IMELODY 
 


Constructor Summary
IMelody()
          Create a blank IMelody.
IMelody(Melody melody)
          Create IMelody from another melody - useful for converting from one melody format (e.g.
IMelody(java.lang.String imelody)
          Create an IMelody given an IMelody formatted string.
 
Method Summary
 void add(java.lang.String name, java.lang.String value)
          Add an extra parameter name and value pair.
 java.lang.String getFormat()
          Get the format of the IMelody.
 java.lang.String getVersion()
          Get the version of the IMelody.
 void setFormat(java.lang.String format)
          Set the format of the IMelody.
 void setVersion(java.lang.String version)
          Set the version of the IMelody.
 java.lang.String toString()
          Get the IMelody string for this melody.
 
Methods inherited from class ie.ncl.media.music.Melody
add, clearNotes, createMIDI, createMIDI, getBeat, getDuration, getLoop, getName, getNotes, getScale, getStyle, getVolume, setBeat, setDuration, setLoop, setName, setScale, setStyle, setVolume
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IMelody

public IMelody()
Create a blank IMelody.


IMelody

public IMelody(Melody melody)
Create IMelody from another melody - useful for converting from one melody format (e.g. RTTTL) to another (e.g. IMelody)


IMelody

public IMelody(java.lang.String imelody)
        throws MelodyException
Create an IMelody given an IMelody formatted string. This must conform to the (BNF) specification above.

Throws:
MelodyException
Method Detail

setFormat

public void setFormat(java.lang.String format)
Set the format of the IMelody. By default this is "CLASS1.0"

See Also:
setFormat(java.lang.String)

getFormat

public java.lang.String getFormat()
Get the format of the IMelody. By default this is "CLASS1.0"

See Also:
setFormat(java.lang.String)

setVersion

public void setVersion(java.lang.String version)
Set the version of the IMelody. By default this is "1.0"

See Also:
getVersion()

getVersion

public java.lang.String getVersion()
Get the version of the IMelody. By default this is "1.0"

See Also:
setVersion(java.lang.String)

add

public void add(java.lang.String name,
                java.lang.String value)
Add an extra parameter name and value pair.


toString

public java.lang.String toString()
Get the IMelody string for this melody.

Overrides:
toString in class java.lang.Object

Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit