Reel Time Tuning Analysis

(By Graeme)
 

 

Customising and Versions

Simple changes

The batch file Polygraph.bat used to launch the program, or the equivalent if using Mac or Linux has several items that can be changed. They are:

440 [3] is pitch shift, To look at a high D whistle or piccolo use 880 here. For High Pitch flute try 450 For Low C flute use 392. Note names on the graph will still be as if fingering a D flute.

5 [4] filtering diff width, if consecutive notes are more than 5 cents different they are rejected.

boxplot [5] type of plot, boxplot or vioplot.  If using vioplot you'll need to add vioplot and sm packages to R.

10  [6] is min number of data points for note to be included in graph (integer).

"0" [7] is the amount of tuning slide shift.  "-5" shows what we'd get if we shortened the tuning slide 5mm.  Quotes are needed only if negative and this is only used if doing a boxplot.  For a vioplot it is h in vioplot which determines the smoothing - around 1.5 looks good.

equal [8] is temperament either equal or justD - if you want other temperaments it's easy to edit the Polygraph.r

So you could edit these values with some different settings then save with a different file name. For example whistle.bat with the value 440 changed to 880


Further customization

To make changes to other than the above you can edit the Polygraph.r file. It's written in such a manner that you don't need to be a computer programmer to figure out how to do most of the changes you might want. For instance if you have a flute with a very flat foot it may not plot correctly because the note is too flat to be picked up. In the Polygraph.r file find this line:

D4 <- (z[z>=61.5 & z<=62.5] - 62) * 100

62.00 is the note D4 (midi note number or semitones above C0).  So currently the script takes everything that is between 50 cents flat of 62.0 and 50 cents sharp of 62.0 ie 61.5 to 62.5, and assigns it to D4.  For a very flat low D (when not looking at C#4) just change the value of 61.5 to something lower eg 61.0.  And you may need to make a similar change for D5 if that note is also very flat.

What if you want a different temperament? All values are measured relative to equal temperament, but justD temperament is already in the script here:

temperament <- c(0,0,0,0,0,0,0,0)
if (args[8] == "justD") {temperament <- c(0,+4,-14,-2,+2,-16,-4,-12)}

This is just saying set all temperament values to 0 (equal temperament). Then if we get justD passed in from the batch file (as argument number 8), set the temperament values to: 0,+4,-14,-2,+2,-16,-4,-12, for D, E, F#, G, A, B, C, C# respectively. So you can easily set your own temperament.

Like with the batch file, you can save different versions of the .r file with different names, then alter the batch file to call the one you want.


Some examples of different versions

Download some examples from:

As an example of how you might change the .r file, Chromatic.r is a version that plots all chromatic notes from G3 to C7 - the lowest note on a fiddle to the top of the 3rd octave of a flute.  You need to create a .bat file to point to this, like Chromatic.bat

In the chromatic version the temperament order is done a little differently - running from C to B eg. for justD we use -4,-12,0,+12,+4,+16,-14,-2,-10,+2,+14,-16.  Otherwise we are just plotting more notes. Again justD and equal temperament are available by editing the batch file, for any other temperaments edit the .r file

For something quite different, those of you who are familiar with programming in "R" might like to look at this version PolyGraph-MSandiford.R whipped up by Martin Sandiford. Martin's version is set up to be used interactively within the R console. The coding is done much better than the one by Graeme which is not surprising as Graeme had never even heard of "R" before knocking this together one evening. However if you're not familiar with programming in "R" you'll find Graeme's version a lot easier to follow than Martin's.


The future of Tartini-R

We are hoping to write a small front end GUI program to make use of it more elegant, but in the meantime actual use is quite simple.


Back to McGee-Flutes Home Page

Last updated, April 17 2009.