RingTonePlayer

From fmepedia

created by: Michael Habarta


Table of contents



Introduction

RingTonePlayer is a transformer, which uses a Beeper transformer (see below) to play mobile phone ringtones. It reads a RTTTL-formatted textline and prepares each note in a way so it can be used by the Beeper transformer.


What is RTTTL ?

RTTTL stands for "Ring Tone Text Transfer Language", was introduced by Nokia to enable mobile phones to exchange ringtones and is described in detail at http://en.wikipedia.org/wiki/RTTL

An example RTTTL string looks like the following:

elise:d=4,o=5,b=60:p,16e6,16d#6,16e6,16d#6,16e6,16b,16d6,16c6,8a,16p,16c,...

Format Explanation:

Part 1:

  elise ... is the name of the melody

Part 2:

  d=4  ... default note is 1/4
  o=5  ... default octave is 5
  b=60 ... the tempo of the melody is 60 bpm (beats per minute)

Part 3: the notes and pauses

  p ... is pause
  16e6 ... is a 1/16 note of pitch e in octave 6


Beeper

The Beeper transformer is a "conventional" transformer, implemented in C++, which uses the Windows "beep" function to generate a tone via the PC speaker. It is parameterized by frequency (Hz) and duration (milliseconds). It works independent of the installed soundcard; this means that it may not be supported on all FME platforms, and that the Windows Volume controls have no effect on the level of output!


RingTonePlayer

The RingTonePlayer transformer converts RTTTL strings into codes which can be sent to the Beeper transformer.

Below: The RingTonePlayer transformer looks like this:

Yes, this is not a simple transformer. However, it is a great example of how to process a text file containing some form of structured information. In this case it is a set of musical notes, but you'd need to use similar techniques on spatial data held in such a customized text file.


How To

In order to use the Beeper, copy the "Beeper.db" file to the "<FME_HOME>/Transformers" directory and the "Beeper.dll" file to your <FME_HOME> directory.

In order to use RingTonePlayer copy "RingTonePlayer.fmx" to "<FME_HOME>/Transformers" directory or double-click the *.fmx file after it was downloaded to your machine.


Examples

This web page (http://www.2thumbswap.com/members/tones/nokia/tones_nokia_main.html) has a whole bunch of example ringtones. All you need to do is copy the ringtone into a text file and use that as the source in the attached workspace. Make sure the content is all on a single line, and does not wrap onto separate lines (as only the first line of text gets played).

Attached are three examples: Mission Impossible, Hawaii-Five-O and Für Elise (what would Beethoven think?)

Also available is a utility which extracts RTTL from Midi files (http://www.softpedia.com/get/Multimedia/Audio/Audio-Convertors/MID2RTTL.shtml) (of course only 1 channel)


Uses

The Beeper transformer could be useful as an audible warning when data fails a workspace test (for example) and is written to a "bad output" dataset. If more than a simple beep is useful, the RingTonePlayer provides a way to play melodies or "jingles" as some people call it.


Server

Yes, this does work on FME Server, if you copy the transformer files into <FME Server Home>\Server\fme and <FME Server Home>\Server\fme\transformers

Then any user can upload a workspace using this and run it.... the sound will emerge on the computer where FME Server is installed. You can imagine the fun to be had in surprising your FME Server administrator with a blast of music!

Attached Files
filesizedate
Beeper.db1.1 kB11/24/08
Beeper.dll44.0 kB11/24/08
ELISE_part.TXT<1kB11/24/08
H50.txt<1kB11/24/08
MI.txt<1kB11/24/08
RingTonePlayer.fmx198.5 kB11/25/08
beeper1.png21.6 kB11/24/08
rttl_play.fmw216.3 kB11/25/08
User Comments Add a new comment