Going Further

Customize the Built-In RTTTLs

Bring down the source code for the project.

git clone https://github.com/onebeartoe/media-players.git

The built-in selections are updated/modified by editing the BuiltInSongs.java file.  

The path to that file, under the cloned github project, is:

path-to-github-clone/media-players/pi-ezo/src/main/java/org/onebeartoe/media/piezo/ports/rtttl/BuiltInSongs.java

Open and edit this file with your favorite text editor.

The actuall RTTTL data is stored in the elements of the String array variable named songData.

To add RTTTL sequences, place a comma character after the last one, followed by the RTTTL data in double quotes.

So if the RTTTL array data looked like this before adding a sequence:

Download: file
private final String[] songData =
{
"The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6",
"Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6"
};

Then the RTTTL array data would look like this after adding a sequnce:

Download: file
private final String[] songData =
{
"The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6",
"Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6",
"MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d"
};

 Save the changes.

Next, repackage the application for distribution to the Raspberry Pi.  At a command line window, change directories to the directory where the github project was cloned.  Then issue the following command:

mvn package

This will create an executable JAR file, at this location:

path-to-github-clone/media-players/pi-ezo/target/pisoundo-0.0.1-SNAPSHOT-jar-with-dependencies.jar

Copy this updated JAR to the Raspberry Pi, and run as before to see the updated list of built-in RTTTLs.

This guide was first published on Mar 04, 2015. It was last updated on Mar 04, 2015. This page (Going Further) was last updated on Oct 20, 2019.