Musical Calculator Instructions

Step 1: Creating a File

The musical calculator applet allows you to design your own calculators to process musical elements. Each of your calculators will be stored in a file on your own computer. Since the applet's file chooser always starts with your home directory, and since you probably don't want to clutter up your home directory with XML files, I recommend that you establish a working folder directly under your home directory. A single working directory will suffice for all the applets on this site.

Version 1.0.7 of the musical calculator differs only from the preceding version 1.0.6. in that the SHA-1 64-bit encrypted Java Signing Certificate has been upgraded to 128-bit SHA-2 encryption, as required by the latest browsers.

Initially, the applet should look as in Figure 1.


Figure 1: The applet without a file.

In this exercise, you will create a new calculator named “Musicalc-Try1”. This calculator will transpose a sequence of pitches by an indicated interval. Start by clicking on . Use the file chooser to locate your working directory and create a new XML file named “Musicalc-Try1”. As Figure 2 shows, the initial diagram will display a Document unit with an empty drop-down and a dangling input link.


Figure 2: A new document of unspecified data type, with input yet to be defined.

Step 2: Choosing a Data Type

Use the drop down to select what type of data you want to work with. You cannot create an input to your document until you have made this decision. Three options are offered:

Choosing Pitch alters the document as shown in Figure 3. Notice that there is NO save button. Excepting text fields, changes made within any unit immediately are immediately recorded in the underlying file.


Figure 3: A document of data type Pitch, with input yet to be defined.

Step 3: Creating a Binary Operation

To create an input for the unit, click on the icon. The applet responds with the Select Input for Document illustrated in Figure 4.


Figure 4: The Select Input dialog.

The dialog offers you three unit types:

Transposing a pitch sequence requires two inputs, the original pitch sequence and the transposition interval. Since Binary operations have two inputs, that is the option to choose. Once you have made your choice, the diagram adjusts as shown in Figure 5.


Figure 5: A Document taking input from a Binary operation (addition).

The Document unit is now linked to a Binary input, and the link between the two units now displays a delete-unit icon (). Notice that data-type drop down is greyed out. The new Binary unit has two dangling links ending in add-unit icons (). The Binary also provides a drop-down for selecting which operation to employ. The musical operation of transposition corresponds to the mathematical operation of addition, so ADD is the operation you want.

Step 4: Creating Text Input Fields

This step creates editable text fields for each of the Binary unit's input. To create a field for the first input, click on the upper . A Select Input for Binary Operation dialog will appear. Select the Field unit type, then click on .

Use the same actions to create a second Field unit for the second Binary input. The diagram should now resemble Figure 6.


Figure 6: A Binary unit taking input from two Field units.

Step 5: Data Entry

The original pitch sequence for Musicalc-Try1.xml will be the first 12 pitches of the overtone series built on G1:

G1 G2 D3+2 G3 B3-14 D4+2 F4-31 G4 A4+4 B4-14 C#5-49 D5+2

(These values come from a posting by Jørgen Mortensen.) Copy this text and paste it into the Binary unit's first Field input. The text field is not wide enough to display all these characters, but they can be pasted in nonetheless.

Confirm your data by clicking on . This causes the editor to parse your input and verify that each element is a proper pitch indication. Failure would provoke an error message, but I've already tried out this text.

Complete your data entry by specifying a transposition interval in the Binary unit's second Field input. There is no separate notation for pitch intervals, but pitch indications can also represent intervals if you treat them as displacements from middle C. Thus C4 (middle C itself) indicates the interval of a unison, while F3 indicates a descending perfect fifith. Use this second value as your transposition interval, and remember to click on . The diagram should now resemble Figure 7.


Figure 7: The finished calculator.

Notice that two new icons appeared when you submitted the transposition interval: one in the Document and the other in the Binary unit. Run icons only appear when all units are fully connected and when all Field text parses properly. If you think you're done but no icons are present, you can use the button to locate the reason.

Click on in the Document unit to run the calculator. ( in other units will display intermediate results in the green-bordered field.) The message dialog illustrated in Figure 8 will present the results.


Figure 8: Results from Musicalc-Try1.xml.

© Charles Ames Page created: 2013-08-22 Last updated: 2015-03-12